SPIGOT-6570: Missing InventoryType: COMPOSTER

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-06-17 08:29:15 +10:00
parent b9782609ca
commit 4b86eeff64
2 changed files with 20 additions and 5 deletions

View file

@ -86,7 +86,7 @@
return iblockdata;
} else {
int j = i + 1;
@@ -322,7 +349,8 @@
@@ -322,10 +349,11 @@
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
int i = (Integer) iblockdata.get(BlockComposter.LEVEL);
@ -95,7 +95,11 @@
+ return (IWorldInventory) (i == 8 ? new BlockComposter.ContainerOutput(iblockdata, generatoraccess, blockposition, new ItemStack(Items.BONE_MEAL)) : (i < 7 ? new BlockComposter.ContainerInput(iblockdata, generatoraccess, blockposition) : new BlockComposter.ContainerEmpty(generatoraccess, blockposition)));
}
private static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
- private static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
+ public static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
private final IBlockData state;
private final GeneratorAccess level;
@@ -337,6 +365,7 @@
this.state = iblockdata;
this.level = generatoraccess;
@ -104,7 +108,7 @@
}
@Override
@@ -361,8 +390,15 @@
@@ -361,12 +390,19 @@
@Override
public void update() {
@ -122,6 +126,11 @@
}
}
- private static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
+ public static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
private final IBlockData state;
private final GeneratorAccess level;
@@ -375,6 +411,7 @@
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
@ -130,9 +139,12 @@
this.state = iblockdata;
this.level = generatoraccess;
this.pos = blockposition;
@@ -417,8 +454,9 @@
@@ -415,10 +452,11 @@
}
}
private static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
- private static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
+ public static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
- public ContainerEmpty() {
+ public ContainerEmpty(GeneratorAccess generatoraccess, BlockPosition blockposition) { // CraftBukkit

View file

@ -8,6 +8,7 @@ import net.minecraft.world.entity.player.PlayerInventory;
import net.minecraft.world.inventory.InventoryCrafting;
import net.minecraft.world.inventory.InventoryEnderChest;
import net.minecraft.world.inventory.InventoryMerchant;
import net.minecraft.world.level.block.BlockComposter;
import net.minecraft.world.level.block.entity.IHopper;
import net.minecraft.world.level.block.entity.TileEntityBarrel;
import net.minecraft.world.level.block.entity.TileEntityBlastFurnace;
@ -496,6 +497,8 @@ public class CraftInventory implements Inventory {
return InventoryType.GRINDSTONE;
} else if (this instanceof CraftInventoryStonecutter) {
return InventoryType.STONECUTTER;
} else if (inventory instanceof BlockComposter.ContainerEmpty || inventory instanceof BlockComposter.ContainerInput || inventory instanceof BlockComposter.ContainerOutput) {
return InventoryType.COMPOSTER;
} else {
return InventoryType.CHEST;
}