mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
SPIGOT-3110: SHULKER_BOX InventoryType
By: md_5 <git@md-5.net>
This commit is contained in:
parent
5e2981ee0f
commit
f6f4501444
2 changed files with 10 additions and 0 deletions
paper-server/src/main/java/org/bukkit/craftbukkit
|
@ -250,6 +250,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||||
openCustomInventory(inventory, player, "minecraft:anvil");
|
openCustomInventory(inventory, player, "minecraft:anvil");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SHULKER_BOX:
|
||||||
|
if (iinventory instanceof TileEntityShulkerBox) {
|
||||||
|
getHandle().openTileEntity((TileEntityShulkerBox) iinventory);
|
||||||
|
} else {
|
||||||
|
openCustomInventory(inventory, player, "minecraft:shulker_box");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case CREATIVE:
|
case CREATIVE:
|
||||||
case CRAFTING:
|
case CRAFTING:
|
||||||
throw new IllegalArgumentException("Can't open a " + type + " inventory!");
|
throw new IllegalArgumentException("Can't open a " + type + " inventory!");
|
||||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.server.TileEntityBrewingStand;
|
||||||
import net.minecraft.server.TileEntityDispenser;
|
import net.minecraft.server.TileEntityDispenser;
|
||||||
import net.minecraft.server.TileEntityDropper;
|
import net.minecraft.server.TileEntityDropper;
|
||||||
import net.minecraft.server.TileEntityFurnace;
|
import net.minecraft.server.TileEntityFurnace;
|
||||||
|
import net.minecraft.server.TileEntityShulkerBox;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
@ -462,6 +463,8 @@ public class CraftInventory implements Inventory {
|
||||||
return InventoryType.ANVIL;
|
return InventoryType.ANVIL;
|
||||||
} else if (inventory instanceof IHopper) {
|
} else if (inventory instanceof IHopper) {
|
||||||
return InventoryType.HOPPER;
|
return InventoryType.HOPPER;
|
||||||
|
} else if (inventory instanceof TileEntityShulkerBox) {
|
||||||
|
return InventoryType.SHULKER_BOX;
|
||||||
} else {
|
} else {
|
||||||
return InventoryType.CHEST;
|
return InventoryType.CHEST;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue