Search in sources :

Example 61 with BlockEntity

use of net.minecraft.block.entity.BlockEntity in project CopperEquipment by Redy1aye.

the class Dryer method onStateReplaced.

@Override
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
    if (state.getBlock() != newState.getBlock()) {
        BlockEntity blockEntity = world.getBlockEntity(pos);
        if (blockEntity instanceof DryerBlockEntity) {
            ItemScatterer.spawn(world, pos, (DryerBlockEntity) blockEntity);
            world.updateComparators(pos, this);
        }
        super.onStateReplaced(state, world, pos, newState, moved);
    }
}
Also used : BlockEntity(net.minecraft.block.entity.BlockEntity)

Aggregations

BlockEntity (net.minecraft.block.entity.BlockEntity)61 BlockPos (net.minecraft.util.math.BlockPos)26 BlockState (net.minecraft.block.BlockState)19 BlockHitResult (net.minecraft.util.hit.BlockHitResult)13 ItemStack (net.minecraft.item.ItemStack)10 ChestBlockEntity (net.minecraft.block.entity.ChestBlockEntity)8 Vec3d (net.minecraft.util.math.Vec3d)8 World (net.minecraft.world.World)7 Block (net.minecraft.block.Block)6 Inject (org.spongepowered.asm.mixin.injection.Inject)6 MatrixStack (net.minecraft.client.util.math.MatrixStack)5 FluidState (net.minecraft.fluid.FluidState)5 Random (java.util.Random)4 AbstractFurnaceBlockEntity (net.minecraft.block.entity.AbstractFurnaceBlockEntity)4 CommandBlockBlockEntity (net.minecraft.block.entity.CommandBlockBlockEntity)4 BlockRenderManager (net.minecraft.client.render.block.BlockRenderManager)4 ChunkRendererRegion (net.minecraft.client.render.chunk.ChunkRendererRegion)4 Inventory (net.minecraft.inventory.Inventory)4 NbtCompound (net.minecraft.nbt.NbtCompound)4 ServerWorld (net.minecraft.server.world.ServerWorld)4