Skip to content

Block Event Inconsistency - Block->BlockBehavior #79

@severedskullz

Description

@severedskullz

For some reason, it seems the ItemStack was left off of the parameter list of BlockBehavior's OnPlaced

Block.cs
public virtual void OnBlockPlaced(IWorldAccessor world, BlockPos blockPos, ItemStack byItemStack = null)

BlockBehavior.cs
public virtual void OnBlockPlaced(IWorldAccessor world, BlockPos blockPos, ref EnumHandling handling)

The only way to get access to this item stack (Primarily to look at the ItemStack's attributes) is through the BlockEntity when it spawns:
world.BlockAccessor.SpawnBlockEntity(EntityClass, blockPos, byItemStack);

For standalone Block classes, this is not possible because there is no BlockEntity associated with a plain Block class.

Please add the ItemStack to follow the actual Block's method signature when invoking the BlockBehavior so that implmentations that need access to the item stack can correctly access it without needing to have a dummy BlockEntity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions