|
26 | 26 | return ActionResultType.func_233537_a_(p_225533_2_.field_72995_K); |
27 | 27 | } else { |
28 | 28 | return ActionResultType.PASS; |
29 | | -@@ -204,29 +_,49 @@ |
| 29 | +@@ -204,29 +_,53 @@ |
30 | 30 | } |
31 | 31 |
|
32 | 32 | public static BlockState func_235486_a_(BlockState p_235486_0_, ServerWorld p_235486_1_, ItemStack p_235486_2_, BlockPos p_235486_3_) { |
|
43 | 43 | + // CraftBukkit start |
44 | 44 | + double rand = world.func_201674_k().nextDouble(); |
45 | 45 | + BlockState blockstate = attemptCompost(state, DummyGeneratorAccess.INSTANCE, pos, stack, rand); |
46 | | -+ if (state == blockstate || org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, blockstate).isCancelled()) { |
| 46 | ++ if (state == blockstate || (entity == null || org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, blockstate).isCancelled())) { |
47 | 47 | + return state; |
48 | 48 | + } |
49 | 49 | + blockstate = attemptCompost(state, (IWorld) world, pos, stack, rand); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 |
|
60 | | -- public static BlockState func_235489_d_(BlockState p_235489_0_, World p_235489_1_, BlockPos p_235489_2_) { |
| 60 | + public static BlockState func_235489_d_(BlockState p_235489_0_, World p_235489_1_, BlockPos p_235489_2_) { |
61 | 61 | - if (!p_235489_1_.field_72995_K) { |
| 62 | ++ return empty(p_235489_0_, p_235489_1_, p_235489_2_, null); |
| 63 | ++ } |
| 64 | ++ |
62 | 65 | + // CraftBukkit start |
63 | 66 | + public static BlockState empty(BlockState state, World world, BlockPos pos, Entity entity) { |
64 | 67 | + if (entity != null) { |
|
120 | 123 | } |
121 | 124 |
|
122 | 125 | return blockstate; |
123 | | -@@ -282,13 +_,15 @@ |
| 126 | +@@ -282,13 +_,19 @@ |
124 | 127 | if (i == 8) { |
125 | 128 | return new ComposterBlock.FullInventory(p_219966_1_, p_219966_2_, p_219966_3_, new ItemStack(Items.field_196106_bc)); |
126 | 129 | } else { |
|
132 | 135 |
|
133 | 136 | static class EmptyInventory extends Inventory implements ISidedInventory { |
134 | 137 | - public EmptyInventory() { |
| 138 | +- super(0); |
| 139 | ++ public EmptyInventory() { // CraftBukkit |
| 140 | ++ super(0); |
| 141 | ++ } |
| 142 | ++ |
135 | 143 | + public EmptyInventory(IWorld world, BlockPos blockPos) { // CraftBukkit |
136 | | - super(0); |
| 144 | ++ super(0); |
137 | 145 | + this.bukkitOwner = new CraftBlockInventoryHolder(world, blockPos, this); // CraftBukkit |
138 | 146 | } |
139 | 147 |
|
|
0 commit comments