Jump to content

Recommended Posts

Posted

I don't understand this at all. As far as I can tell I'm using the same technique as vanilla tile entity blocks, but I get the following error whenever I break the block:

Cannot get property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[north, south, west, east]} as it does not exist in BlockState{block=minecraft:air, properties=[]}

And then nothing happens.

Block breaking code:

@Override
    public void breakBlock(World w, BlockPos pos, IBlockState state)
    {
        TileEntityFireplace tef = (TileEntityFireplace) w.getTileEntity(pos);
        if (tef.getConnected())
        {
            TileEntityFireplace.removeLocation(w, pos);
        }
        w.removeTileEntity(pos);
    }

This code worked in 1.7.10 but not in 1.8. What do I need to change?

Thank you for reading.

Posted

1. Why are you storing facing in TE?

2. Post full code and full log (where is it logging this error)?

1.7.10 is no longer supported by forge, you are on your own.

Posted

Figured it out:

The problem was to do with the blocks - I thought it was a TE thing because the error happened during a TE method. When breakBlock is called, the block in question has already been set to air. However the previous block is in the state parameter, so instead of using world.getBlockState(pos) (as I did in the removeLocation method), I should have used state.

 

Thanks anyway!

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.