Skip to content

Double TrappedChest not recognized #223

@mikeboers

Description

@mikeboers

I'm writing a plugin with a focus on hoppers and chests, and it seems to me that the normal chest code does not seem to work appropriately for trapped chests.

This (heavily reduced) example always prints out "Chest is of size 27" for double trapped chests, but 54 for normal ones:

TileEntity target = hopperBlock.getWorld().getBlockAt(x, y, z).getTileEntity();

if (target instanceof Chest) {
    Chest chest = (Chest)target;
    Canary.log.info(String.format("Chest is of size %s", chest.getSize()));
}

Trying to explicitly grab the double chest (via getDoubleChest) sometimes throws an exception. I don't have a record of it, so I'll post it if I come across it again.

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