13
0
geforkt von Mirrors/Paper

SPIGOT-5047: Correct slot types for 1.14 inventories

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2019-06-13 21:25:58 +10:00
Ursprung aa6ffe2455
Commit 1399237b6b
2 geänderte Dateien mit 23 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -54,7 +54,7 @@ public enum InventoryType {
*/ */
ENCHANTING(2,"Enchanting"), ENCHANTING(2,"Enchanting"),
/** /**
* A brewing stand inventory, with one FUEL slot and three CRAFTING slots. * A brewing stand inventory, with one FUEL slot and four CRAFTING slots.
*/ */
BREWING(5,"Brewing"), BREWING(5,"Brewing"),
/** /**
@ -70,7 +70,7 @@ public enum InventoryType {
*/ */
CREATIVE(9,"Creative", false), CREATIVE(9,"Creative", false),
/** /**
* The merchant inventory, with 2 TRADE-IN slots, and 1 RESULT slot. * The merchant inventory, with 2 CRAFTING slots, and 1 RESULT slot.
*/ */
MERCHANT(3,"Villager", false), MERCHANT(3,"Villager", false),
/** /**
@ -111,19 +111,19 @@ public enum InventoryType {
*/ */
SMOKER(3, "Smoker"), SMOKER(3, "Smoker"),
/** /**
* Loom inventory, with 3 INPUT slots, and 1 RESULT slot. * Loom inventory, with 3 CRAFTING slots, and 1 RESULT slot.
*/ */
LOOM(4, "Loom"), LOOM(4, "Loom"),
/** /**
* Cartography inventory with 2 INPUT slots, and 1 RESULT slot. * Cartography inventory with 2 CRAFTING slots, and 1 RESULT slot.
*/ */
CARTOGRAPHY(3, "Cartography Table"), CARTOGRAPHY(3, "Cartography Table"),
/** /**
* Grindstone inventory with 2 INPUT slots, and 1 RESULT slot. * Grindstone inventory with 2 CRAFTING slots, and 1 RESULT slot.
*/ */
GRINDSTONE(3, "Repair & Disenchant"), GRINDSTONE(3, "Repair & Disenchant"),
/** /**
* Stonecutter inventory with 1 INPUT slot, and 1 RESULT slot. * Stonecutter inventory with 1 CRAFTING slot, and 1 RESULT slot.
*/ */
STONECUTTER(2, "Stonecutter") STONECUTTER(2, "Stonecutter")
; ;
@ -167,9 +167,7 @@ public enum InventoryType {
*/ */
RESULT, RESULT,
/** /**
* A slot in the crafting matrix, or the input slot in a furnace * A slot in the crafting matrix, or an 'input' slot.
* inventory, the potion slot in the brewing stand, or the enchanting
* slot.
*/ */
CRAFTING, CRAFTING,
/** /**

Datei anzeigen

@ -329,7 +329,9 @@ public abstract class InventoryView {
InventoryType.SlotType type = InventoryType.SlotType.CONTAINER; InventoryType.SlotType type = InventoryType.SlotType.CONTAINER;
if (slot >= 0 && slot < this.getTopInventory().getSize()) { if (slot >= 0 && slot < this.getTopInventory().getSize()) {
switch(this.getType()) { switch(this.getType()) {
case BLAST_FURNACE:
case FURNACE: case FURNACE:
case SMOKER:
if (slot == 2) { if (slot == 2) {
type = InventoryType.SlotType.RESULT; type = InventoryType.SlotType.RESULT;
} else if(slot == 1) { } else if(slot == 1) {
@ -356,6 +358,12 @@ public abstract class InventoryView {
type = InventoryType.SlotType.CRAFTING; type = InventoryType.SlotType.CRAFTING;
} }
break; break;
case BEACON:
type = InventoryType.SlotType.CRAFTING;
break;
case ANVIL:
case CARTOGRAPHY:
case GRINDSTONE:
case MERCHANT: case MERCHANT:
if (slot == 2) { if (slot == 2) {
type = InventoryType.SlotType.RESULT; type = InventoryType.SlotType.RESULT;
@ -363,11 +371,15 @@ public abstract class InventoryView {
type = InventoryType.SlotType.CRAFTING; type = InventoryType.SlotType.CRAFTING;
} }
break; break;
case BEACON: case STONECUTTER:
if (slot == 1) {
type = InventoryType.SlotType.RESULT;
} else {
type = InventoryType.SlotType.CRAFTING; type = InventoryType.SlotType.CRAFTING;
}
break; break;
case ANVIL: case LOOM:
if (slot == 2) { if (slot == 3) {
type = InventoryType.SlotType.RESULT; type = InventoryType.SlotType.RESULT;
} else { } else {
type = InventoryType.SlotType.CRAFTING; type = InventoryType.SlotType.CRAFTING;