aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/level/block/ComposterBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/level/block/ComposterBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/level/block/ComposterBlock.java.patch489
1 files changed, 489 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/level/block/ComposterBlock.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/ComposterBlock.java.patch
new file mode 100644
index 0000000000..a2cf07f89a
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/ComposterBlock.java.patch
@@ -0,0 +1,489 @@
+--- a/net/minecraft/world/level/block/ComposterBlock.java
++++ b/net/minecraft/world/level/block/ComposterBlock.java
+@@ -13,7 +13,7 @@
+ import net.minecraft.sounds.SoundSource;
+ import net.minecraft.stats.Stats;
+ import net.minecraft.util.RandomSource;
+-import net.minecraft.world.InteractionHand;
++import net.minecraft.world.EnumHand;
+ import net.minecraft.world.InteractionResult;
+ import net.minecraft.world.SimpleContainer;
+ import net.minecraft.world.WorldlyContainer;
+@@ -24,22 +24,26 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.Items;
+ import net.minecraft.world.level.BlockGetter;
+-import net.minecraft.world.level.ItemLike;
++import net.minecraft.world.level.IMaterial;
+ import net.minecraft.world.level.Level;
+ import net.minecraft.world.level.LevelAccessor;
+ import net.minecraft.world.level.block.state.BlockBehaviour;
+-import net.minecraft.world.level.block.state.BlockState;
++import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.block.state.StateDefinition;
+ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
+ import net.minecraft.world.level.block.state.properties.IntegerProperty;
+ import net.minecraft.world.level.gameevent.GameEvent;
+-import net.minecraft.world.level.pathfinder.PathComputationType;
++import net.minecraft.world.level.pathfinder.PathMode;
+ import net.minecraft.world.phys.BlockHitResult;
+ import net.minecraft.world.phys.Vec3;
+ import net.minecraft.world.phys.shapes.BooleanOp;
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.Shapes;
+ import net.minecraft.world.phys.shapes.VoxelShape;
++// CraftBukkit start
++import org.bukkit.craftbukkit.inventory.CraftBlockInventoryHolder;
++import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
++// CraftBukkit end
+
+ public class ComposterBlock extends Block implements WorldlyContainerHolder {
+
+@@ -48,7 +52,7 @@
+ public static final int MIN_LEVEL = 0;
+ public static final int MAX_LEVEL = 7;
+ public static final IntegerProperty LEVEL = BlockStateProperties.LEVEL_COMPOSTER;
+- public static final Object2FloatMap<ItemLike> COMPOSTABLES = new Object2FloatOpenHashMap();
++ public static final Object2FloatMap<IMaterial> COMPOSTABLES = new Object2FloatOpenHashMap();
+ private static final int AABB_SIDE_THICKNESS = 2;
+ private static final VoxelShape OUTER_SHAPE = Shapes.block();
+ private static final VoxelShape[] SHAPES = (VoxelShape[]) Util.make(new VoxelShape[9], (avoxelshape) -> {
+@@ -60,7 +64,6 @@
+ });
+
+ @Override
+- @Override
+ public MapCodec<ComposterBlock> codec() {
+ return ComposterBlock.CODEC;
+ }
+@@ -176,20 +179,20 @@
+ add(1.0F, Items.PUMPKIN_PIE);
+ }
+
+- private static void add(float f, ItemLike itemlike) {
+- ComposterBlock.COMPOSTABLES.put(itemlike.asItem(), f);
++ private static void add(float chance, IMaterial item) {
++ ComposterBlock.COMPOSTABLES.put(item.asItem(), chance);
+ }
+
+- public ComposterBlock(BlockBehaviour.Properties blockbehaviour_properties) {
+- super(blockbehaviour_properties);
+- this.registerDefaultState((BlockState) ((BlockState) this.stateDefinition.any()).setValue(ComposterBlock.LEVEL, 0));
++ public ComposterBlock(BlockBehaviour.Properties properties) {
++ super(properties);
++ this.registerDefaultState((IBlockData) ((IBlockData) this.stateDefinition.any()).setValue(ComposterBlock.LEVEL, 0));
+ }
+
+- public static void handleFill(Level level, BlockPos blockpos, boolean flag) {
+- BlockState blockstate = level.getBlockState(blockpos);
++ public static void handleFill(Level level, BlockPos pos, boolean success) {
++ IBlockData iblockdata = level.getBlockState(pos);
+
+- level.playLocalSound(blockpos, flag ? SoundEvents.COMPOSTER_FILL_SUCCESS : SoundEvents.COMPOSTER_FILL, SoundSource.BLOCKS, 1.0F, 1.0F, false);
+- double d0 = blockstate.getShape(level, blockpos).max(Direction.Axis.Y, 0.5D, 0.5D) + 0.03125D;
++ level.playLocalSound(pos, success ? SoundEvents.COMPOSTER_FILL_SUCCESS : SoundEvents.COMPOSTER_FILL, SoundSource.BLOCKS, 1.0F, 1.0F, false);
++ double d0 = iblockdata.getShape(level, pos).max(Direction.Axis.Y, 0.5D, 0.5D) + 0.03125D;
+ double d1 = 0.13124999403953552D;
+ double d2 = 0.737500011920929D;
+ RandomSource randomsource = level.getRandom();
+@@ -199,49 +202,44 @@
+ double d4 = randomsource.nextGaussian() * 0.02D;
+ double d5 = randomsource.nextGaussian() * 0.02D;
+
+- level.addParticle(ParticleTypes.COMPOSTER, (double) blockpos.getX() + 0.13124999403953552D + 0.737500011920929D * (double) randomsource.nextFloat(), (double) blockpos.getY() + d0 + (double) randomsource.nextFloat() * (1.0D - d0), (double) blockpos.getZ() + 0.13124999403953552D + 0.737500011920929D * (double) randomsource.nextFloat(), d3, d4, d5);
++ level.addParticle(ParticleTypes.COMPOSTER, (double) pos.getX() + 0.13124999403953552D + 0.737500011920929D * (double) randomsource.nextFloat(), (double) pos.getY() + d0 + (double) randomsource.nextFloat() * (1.0D - d0), (double) pos.getZ() + 0.13124999403953552D + 0.737500011920929D * (double) randomsource.nextFloat(), d3, d4, d5);
+ }
+
+ }
+
+ @Override
+- @Override
+- public VoxelShape getShape(BlockState blockstate, BlockGetter blockgetter, BlockPos blockpos, CollisionContext collisioncontext) {
+- return ComposterBlock.SHAPES[(Integer) blockstate.getValue(ComposterBlock.LEVEL)];
++ public VoxelShape getShape(IBlockData state, BlockGetter level, BlockPos pos, CollisionContext context) {
++ return ComposterBlock.SHAPES[(Integer) state.getValue(ComposterBlock.LEVEL)];
+ }
+
+ @Override
+- @Override
+- public VoxelShape getInteractionShape(BlockState blockstate, BlockGetter blockgetter, BlockPos blockpos) {
++ public VoxelShape getInteractionShape(IBlockData state, BlockGetter level, BlockPos pos) {
+ return ComposterBlock.OUTER_SHAPE;
+ }
+
+ @Override
+- @Override
+- public VoxelShape getCollisionShape(BlockState blockstate, BlockGetter blockgetter, BlockPos blockpos, CollisionContext collisioncontext) {
++ public VoxelShape getCollisionShape(IBlockData state, BlockGetter level, BlockPos pos, CollisionContext context) {
+ return ComposterBlock.SHAPES[0];
+ }
+
+ @Override
+- @Override
+- public void onPlace(BlockState blockstate, Level level, BlockPos blockpos, BlockState blockstate1, boolean flag) {
+- if ((Integer) blockstate.getValue(ComposterBlock.LEVEL) == 7) {
+- level.scheduleTick(blockpos, blockstate.getBlock(), 20);
++ public void onPlace(IBlockData state, Level level, BlockPos pos, IBlockData oldState, boolean isMoving) {
++ if ((Integer) state.getValue(ComposterBlock.LEVEL) == 7) {
++ level.scheduleTick(pos, state.getBlock(), 20);
+ }
+
+ }
+
+ @Override
+- @Override
+- public InteractionResult use(BlockState blockstate, Level level, BlockPos blockpos, Player player, InteractionHand interactionhand, BlockHitResult blockhitresult) {
+- int i = (Integer) blockstate.getValue(ComposterBlock.LEVEL);
+- ItemStack itemstack = player.getItemInHand(interactionhand);
++ public InteractionResult use(IBlockData state, Level level, BlockPos pos, Player player, EnumHand hand, BlockHitResult hit) {
++ int i = (Integer) state.getValue(ComposterBlock.LEVEL);
++ ItemStack itemstack = player.getItemInHand(hand);
+
+ if (i < 8 && ComposterBlock.COMPOSTABLES.containsKey(itemstack.getItem())) {
+ if (i < 7 && !level.isClientSide) {
+- BlockState blockstate1 = addItem(player, blockstate, level, blockpos, itemstack);
++ IBlockData iblockdata1 = addItem(player, state, level, pos, itemstack);
+
+- level.levelEvent(1500, blockpos, blockstate != blockstate1 ? 1 : 0);
++ level.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0);
+ player.awardStat(Stats.ITEM_USED.get(itemstack.getItem()));
+ if (!player.getAbilities().instabuild) {
+ itemstack.shrink(1);
+@@ -250,232 +248,245 @@
+
+ return InteractionResult.sidedSuccess(level.isClientSide);
+ } else if (i == 8) {
+- extractProduce(player, blockstate, level, blockpos);
++ extractProduce(player, state, level, pos);
+ return InteractionResult.sidedSuccess(level.isClientSide);
+ } else {
+ return InteractionResult.PASS;
+ }
+ }
+
+- public static BlockState insertItem(Entity entity, BlockState blockstate, ServerLevel serverlevel, ItemStack itemstack, BlockPos blockpos) {
+- int i = (Integer) blockstate.getValue(ComposterBlock.LEVEL);
++ public static IBlockData insertItem(Entity entity, IBlockData state, ServerLevel level, ItemStack stack, BlockPos pos) {
++ int i = (Integer) state.getValue(ComposterBlock.LEVEL);
+
+- if (i < 7 && ComposterBlock.COMPOSTABLES.containsKey(itemstack.getItem())) {
+- BlockState blockstate1 = addItem(entity, blockstate, serverlevel, blockpos, itemstack);
++ if (i < 7 && ComposterBlock.COMPOSTABLES.containsKey(stack.getItem())) {
++ // CraftBukkit start
++ double rand = level.getRandom().nextDouble();
++ IBlockData iblockdata1 = addItem(entity, state, DummyGeneratorAccess.INSTANCE, pos, stack, rand);
++ if (state == iblockdata1 || !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, iblockdata1)) {
++ return state;
++ }
++ iblockdata1 = addItem(entity, state, level, pos, stack, rand);
++ // CraftBukkit end
+
+- itemstack.shrink(1);
+- return blockstate1;
++ stack.shrink(1);
++ return iblockdata1;
+ } else {
+- return blockstate;
++ return state;
+ }
+ }
+
+- public static BlockState extractProduce(Entity entity, BlockState blockstate, Level level, BlockPos blockpos) {
++ public static IBlockData extractProduce(Entity entity, IBlockData state, Level level, BlockPos pos) {
++ // CraftBukkit start
++ if (entity != null && !(entity instanceof Player)) {
++ IBlockData iblockdata1 = empty(entity, state, DummyGeneratorAccess.INSTANCE, pos);
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, iblockdata1)) {
++ return state;
++ }
++ }
++ // CraftBukkit end
+ if (!level.isClientSide) {
+- Vec3 vec3 = Vec3.atLowerCornerWithOffset(blockpos, 0.5D, 1.01D, 0.5D).offsetRandom(level.random, 0.7F);
+- ItemEntity itementity = new ItemEntity(level, vec3.x(), vec3.y(), vec3.z(), new ItemStack(Items.BONE_MEAL));
++ Vec3 vec3d = Vec3.atLowerCornerWithOffset(pos, 0.5D, 1.01D, 0.5D).offsetRandom(level.random, 0.7F);
++ ItemEntity entityitem = new ItemEntity(level, vec3d.x(), vec3d.y(), vec3d.z(), new ItemStack(Items.BONE_MEAL));
+
+- itementity.setDefaultPickUpDelay();
+- level.addFreshEntity(itementity);
++ entityitem.setDefaultPickUpDelay();
++ level.addFreshEntity(entityitem);
+ }
+
+- BlockState blockstate1 = empty(entity, blockstate, level, blockpos);
++ IBlockData iblockdata1 = empty(entity, state, level, pos);
+
+- level.playSound((Player) null, blockpos, SoundEvents.COMPOSTER_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
+- return blockstate1;
++ level.playSound((Player) null, pos, SoundEvents.COMPOSTER_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
++ return iblockdata1;
+ }
+
+- static BlockState empty(@Nullable Entity entity, BlockState blockstate, LevelAccessor levelaccessor, BlockPos blockpos) {
+- BlockState blockstate1 = (BlockState) blockstate.setValue(ComposterBlock.LEVEL, 0);
++ static IBlockData empty(@Nullable Entity entity, IBlockData state, LevelAccessor level, BlockPos pos) {
++ IBlockData iblockdata1 = (IBlockData) state.setValue(ComposterBlock.LEVEL, 0);
+
+- levelaccessor.setBlock(blockpos, blockstate1, 3);
+- levelaccessor.gameEvent(GameEvent.BLOCK_CHANGE, blockpos, GameEvent.Context.of(entity, blockstate1));
+- return blockstate1;
++ level.setBlock(pos, iblockdata1, 3);
++ level.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(entity, iblockdata1));
++ return iblockdata1;
+ }
+
+- static BlockState addItem(@Nullable Entity entity, BlockState blockstate, LevelAccessor levelaccessor, BlockPos blockpos, ItemStack itemstack) {
+- int i = (Integer) blockstate.getValue(ComposterBlock.LEVEL);
++ static IBlockData addItem(@Nullable Entity entity, IBlockData state, LevelAccessor level, BlockPos pos, ItemStack stack) {
++ // CraftBukkit start
++ return addItem(entity, state, level, pos, stack, level.getRandom().nextDouble());
++ }
++
++ static IBlockData addItem(@Nullable Entity entity, IBlockData iblockdata, LevelAccessor generatoraccess, BlockPos blockposition, ItemStack itemstack, double rand) {
++ // CraftBukkit end
++ int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL);
+ float f = ComposterBlock.COMPOSTABLES.getFloat(itemstack.getItem());
+
+- if ((i != 0 || f <= 0.0F) && levelaccessor.getRandom().nextDouble() >= (double) f) {
+- return blockstate;
++ if ((i != 0 || f <= 0.0F) && rand >= (double) f) {
++ return iblockdata;
+ } else {
+ int j = i + 1;
+- BlockState blockstate1 = (BlockState) blockstate.setValue(ComposterBlock.LEVEL, j);
++ IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(ComposterBlock.LEVEL, j);
+
+- levelaccessor.setBlock(blockpos, blockstate1, 3);
+- levelaccessor.gameEvent(GameEvent.BLOCK_CHANGE, blockpos, GameEvent.Context.of(entity, blockstate1));
++ generatoraccess.setBlock(blockposition, iblockdata1, 3);
++ generatoraccess.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entity, iblockdata1));
+ if (j == 7) {
+- levelaccessor.scheduleTick(blockpos, blockstate.getBlock(), 20);
++ generatoraccess.scheduleTick(blockposition, iblockdata.getBlock(), 20);
+ }
+
+- return blockstate1;
++ return iblockdata1;
+ }
+ }
+
+ @Override
+- @Override
+- public void tick(BlockState blockstate, ServerLevel serverlevel, BlockPos blockpos, RandomSource randomsource) {
+- if ((Integer) blockstate.getValue(ComposterBlock.LEVEL) == 7) {
+- serverlevel.setBlock(blockpos, (BlockState) blockstate.cycle(ComposterBlock.LEVEL), 3);
+- serverlevel.playSound((Player) null, blockpos, SoundEvents.COMPOSTER_READY, SoundSource.BLOCKS, 1.0F, 1.0F);
++ public void tick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) {
++ if ((Integer) state.getValue(ComposterBlock.LEVEL) == 7) {
++ level.setBlock(pos, (IBlockData) state.cycle(ComposterBlock.LEVEL), 3);
++ level.playSound((Player) null, pos, SoundEvents.COMPOSTER_READY, SoundSource.BLOCKS, 1.0F, 1.0F);
+ }
+
+ }
+
+ @Override
+- @Override
+- public boolean hasAnalogOutputSignal(BlockState blockstate) {
++ public boolean hasAnalogOutputSignal(IBlockData state) {
+ return true;
+ }
+
+ @Override
+- @Override
+- public int getAnalogOutputSignal(BlockState blockstate, Level level, BlockPos blockpos) {
+- return (Integer) blockstate.getValue(ComposterBlock.LEVEL);
++ public int getAnalogOutputSignal(IBlockData blockState, Level level, BlockPos pos) {
++ return (Integer) blockState.getValue(ComposterBlock.LEVEL);
+ }
+
+ @Override
+- @Override
+- protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> statedefinition_builder) {
+- statedefinition_builder.add(ComposterBlock.LEVEL);
++ protected void createBlockStateDefinition(StateDefinition.Builder<Block, IBlockData> builder) {
++ builder.add(ComposterBlock.LEVEL);
+ }
+
+ @Override
+- @Override
+- public boolean isPathfindable(BlockState blockstate, BlockGetter blockgetter, BlockPos blockpos, PathComputationType pathcomputationtype) {
++ public boolean isPathfindable(IBlockData state, BlockGetter level, BlockPos pos, PathMode type) {
+ return false;
+ }
+
+ @Override
+- @Override
+- public WorldlyContainer getContainer(BlockState blockstate, LevelAccessor levelaccessor, BlockPos blockpos) {
+- int i = (Integer) blockstate.getValue(ComposterBlock.LEVEL);
++ public WorldlyContainer getContainer(IBlockData state, LevelAccessor level, BlockPos pos) {
++ int i = (Integer) state.getValue(ComposterBlock.LEVEL);
+
+- return (WorldlyContainer) (i == 8 ? new ComposterBlock.OutputContainer(blockstate, levelaccessor, blockpos, new ItemStack(Items.BONE_MEAL)) : (i < 7 ? new ComposterBlock.InputContainer(blockstate, levelaccessor, blockpos) : new ComposterBlock.EmptyContainer()));
++ // CraftBukkit - empty generatoraccess, blockposition
++ return (WorldlyContainer) (i == 8 ? new ComposterBlock.OutputContainer(state, level, pos, new ItemStack(Items.BONE_MEAL)) : (i < 7 ? new ComposterBlock.InputContainer(state, level, pos) : new ComposterBlock.EmptyContainer(level, pos)));
+ }
+
+- private static class OutputContainer extends SimpleContainer implements WorldlyContainer {
++ public static class OutputContainer extends SimpleContainer implements WorldlyContainer {
+
+- private final BlockState state;
++ private final IBlockData state;
+ private final LevelAccessor level;
+ private final BlockPos pos;
+ private boolean changed;
+
+- public OutputContainer(BlockState blockstate, LevelAccessor levelaccessor, BlockPos blockpos, ItemStack itemstack) {
+- super(itemstack);
+- this.state = blockstate;
+- this.level = levelaccessor;
+- this.pos = blockpos;
++ public OutputContainer(IBlockData state, LevelAccessor level, BlockPos pos, ItemStack stack) {
++ super(stack);
++ this.state = state;
++ this.level = level;
++ this.pos = pos;
++ this.bukkitOwner = new CraftBlockInventoryHolder(level, pos, this); // CraftBukkit
+ }
+
+ @Override
+- @Override
+ public int getMaxStackSize() {
+ return 1;
+ }
+
+ @Override
+- @Override
+- public int[] getSlotsForFace(Direction direction) {
+- return direction == Direction.DOWN ? new int[]{0} : new int[0];
++ public int[] getSlotsForFace(Direction side) {
++ return side == Direction.DOWN ? new int[]{0} : new int[0];
+ }
+
+ @Override
+- @Override
+- public boolean canPlaceItemThroughFace(int i, ItemStack itemstack, @Nullable Direction direction) {
++ public boolean canPlaceItemThroughFace(int index, ItemStack itemStack, @Nullable Direction direction) {
+ return false;
+ }
+
+ @Override
+- @Override
+- public boolean canTakeItemThroughFace(int i, ItemStack itemstack, Direction direction) {
+- return !this.changed && direction == Direction.DOWN && itemstack.is(Items.BONE_MEAL);
++ public boolean canTakeItemThroughFace(int index, ItemStack stack, Direction direction) {
++ return !this.changed && direction == Direction.DOWN && stack.is(Items.BONE_MEAL);
+ }
+
+ @Override
+- @Override
+ public void setChanged() {
++ // CraftBukkit start - allow putting items back (eg cancelled InventoryMoveItemEvent)
++ if (this.isEmpty()) {
+ ComposterBlock.empty((Entity) null, this.state, this.level, this.pos);
+ this.changed = true;
++ } else {
++ this.level.setBlock(this.pos, this.state, 3);
++ this.changed = false;
++ }
++ // CraftBukkit end
+ }
+ }
+
+- private static class InputContainer extends SimpleContainer implements WorldlyContainer {
++ public static class InputContainer extends SimpleContainer implements WorldlyContainer {
+
+- private final BlockState state;
++ private final IBlockData state;
+ private final LevelAccessor level;
+ private final BlockPos pos;
+ private boolean changed;
+
+- public InputContainer(BlockState blockstate, LevelAccessor levelaccessor, BlockPos blockpos) {
++ public InputContainer(IBlockData state, LevelAccessor level, BlockPos pos) {
+ super(1);
+- this.state = blockstate;
+- this.level = levelaccessor;
+- this.pos = blockpos;
++ this.bukkitOwner = new CraftBlockInventoryHolder(level, pos, this); // CraftBukkit
++ this.state = state;
++ this.level = level;
++ this.pos = pos;
+ }
+
+ @Override
+- @Override
+ public int getMaxStackSize() {
+ return 1;
+ }
+
+ @Override
+- @Override
+- public int[] getSlotsForFace(Direction direction) {
+- return direction == Direction.UP ? new int[]{0} : new int[0];
++ public int[] getSlotsForFace(Direction side) {
++ return side == Direction.UP ? new int[]{0} : new int[0];
+ }
+
+ @Override
+- @Override
+- public boolean canPlaceItemThroughFace(int i, ItemStack itemstack, @Nullable Direction direction) {
+- return !this.changed && direction == Direction.UP && ComposterBlock.COMPOSTABLES.containsKey(itemstack.getItem());
++ public boolean canPlaceItemThroughFace(int index, ItemStack itemStack, @Nullable Direction direction) {
++ return !this.changed && direction == Direction.UP && ComposterBlock.COMPOSTABLES.containsKey(itemStack.getItem());
+ }
+
+ @Override
+- @Override
+- public boolean canTakeItemThroughFace(int i, ItemStack itemstack, Direction direction) {
++ public boolean canTakeItemThroughFace(int index, ItemStack stack, Direction direction) {
+ return false;
+ }
+
+ @Override
+- @Override
+ public void setChanged() {
+ ItemStack itemstack = this.getItem(0);
+
+ if (!itemstack.isEmpty()) {
+ this.changed = true;
+- BlockState blockstate = ComposterBlock.addItem((Entity) null, this.state, this.level, this.pos, itemstack);
++ IBlockData iblockdata = ComposterBlock.addItem((Entity) null, this.state, this.level, this.pos, itemstack);
+
+- this.level.levelEvent(1500, this.pos, blockstate != this.state ? 1 : 0);
++ this.level.levelEvent(1500, this.pos, iblockdata != this.state ? 1 : 0);
+ this.removeItemNoUpdate(0);
+ }
+
+ }
+ }
+
+- private static class EmptyContainer extends SimpleContainer implements WorldlyContainer {
++ public static class EmptyContainer extends SimpleContainer implements WorldlyContainer {
+
+- public EmptyContainer() {
++ public EmptyContainer(LevelAccessor generatoraccess, BlockPos blockposition) { // CraftBukkit
+ super(0);
++ this.bukkitOwner = new CraftBlockInventoryHolder(generatoraccess, blockposition, this); // CraftBukkit
+ }
+
+ @Override
+- @Override
+- public int[] getSlotsForFace(Direction direction) {
++ public int[] getSlotsForFace(Direction side) {
+ return new int[0];
+ }
+
+ @Override
+- @Override
+- public boolean canPlaceItemThroughFace(int i, ItemStack itemstack, @Nullable Direction direction) {
++ public boolean canPlaceItemThroughFace(int index, ItemStack itemStack, @Nullable Direction direction) {
+ return false;
+ }
+
+ @Override
+- @Override
+- public boolean canTakeItemThroughFace(int i, ItemStack itemstack, Direction direction) {
++ public boolean canTakeItemThroughFace(int index, ItemStack stack, Direction direction) {
+ return false;
+ }
+ }