SPIGOT-4961: Cannot open various inventories

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-05-20 19:46:20 +10:00
parent cd9d8451fd
commit 82335a22f1
3 changed files with 24 additions and 13 deletions

View File

@@ -468,12 +468,19 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
case STONECUTTER:
openCustomInventory(inventory, player, Containers.STONECUTTER);
break;
case LOOM:
openCustomInventory(inventory, player, Containers.LOOM);
break;
case CARTOGRAPHY:
openCustomInventory(inventory, player, Containers.CARTOGRAPHY);
break;
case GRINDSTONE:
openCustomInventory(inventory, player, Containers.GRINDSTONE);
break;
case CREATIVE:
case CRAFTING:
case MERCHANT:
case LOOM:
case CARTOGRAPHY:
case GRINDSTONE:
default:
throw new IllegalArgumentException("Can't open a " + type + " inventory!");
}
if (getHandle().activeContainer == formerContainer) {

View File

@@ -16,6 +16,7 @@ import net.minecraft.server.TileEntityBrewingStand;
import net.minecraft.server.TileEntityDispenser;
import net.minecraft.server.TileEntityDropper;
import net.minecraft.server.TileEntityFurnace;
import net.minecraft.server.TileEntityLectern;
import net.minecraft.server.TileEntityShulkerBox;
import net.minecraft.server.TileEntitySmoker;
import org.apache.commons.lang.Validate;
@@ -479,7 +480,7 @@ public class CraftInventory implements Inventory {
return InventoryType.SHULKER_BOX;
} else if (inventory instanceof TileEntityBarrel) {
return InventoryType.BARREL;
} else if (this instanceof CraftInventoryLectern) {
} else if (inventory instanceof TileEntityLectern.LecternInventory) {
return InventoryType.LECTERN;
} else if (this instanceof CraftInventoryLoom) {
return InventoryType.LOOM;