mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 11:24:11 +01:00
Add inventory and slot types for new containers. Fixes BUKKIT-2741
By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
parent
64a7434f5a
commit
7399bc6c11
3 changed files with 22 additions and 0 deletions
|
@ -109,6 +109,12 @@ public class CraftContainer extends Container {
|
|||
case BREWING:
|
||||
typeID = 5;
|
||||
break;
|
||||
case BEACON:
|
||||
typeID = 7;
|
||||
break;
|
||||
case ANVIL:
|
||||
typeID = 8;
|
||||
break;
|
||||
default:
|
||||
typeID = 0;
|
||||
break;
|
||||
|
|
|
@ -4,12 +4,14 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import net.minecraft.server.ContainerAnvilInventory;
|
||||
import net.minecraft.server.ContainerEnchantTableInventory;
|
||||
import net.minecraft.server.IInventory;
|
||||
import net.minecraft.server.InventoryCrafting;
|
||||
import net.minecraft.server.InventoryEnderChest;
|
||||
import net.minecraft.server.InventoryMerchant;
|
||||
import net.minecraft.server.PlayerInventory;
|
||||
import net.minecraft.server.TileEntityBeacon;
|
||||
import net.minecraft.server.TileEntityBrewingStand;
|
||||
import net.minecraft.server.TileEntityDispenser;
|
||||
import net.minecraft.server.TileEntityFurnace;
|
||||
|
@ -416,6 +418,10 @@ public class CraftInventory implements Inventory {
|
|||
return InventoryType.ENDER_CHEST;
|
||||
} else if (inventory instanceof InventoryMerchant) {
|
||||
return InventoryType.MERCHANT;
|
||||
} else if (inventory instanceof TileEntityBeacon) {
|
||||
return InventoryType.BEACON;
|
||||
} else if (inventory instanceof ContainerAnvilInventory) {
|
||||
return InventoryType.ANVIL;
|
||||
} else {
|
||||
return InventoryType.CHEST;
|
||||
}
|
||||
|
|
|
@ -109,6 +109,16 @@ public class CraftInventoryView extends InventoryView {
|
|||
type = SlotType.CRAFTING;
|
||||
}
|
||||
break;
|
||||
case BEACON:
|
||||
type = SlotType.CRAFTING;
|
||||
break;
|
||||
case ANVIL:
|
||||
if (slot == 2) {
|
||||
type = SlotType.RESULT;
|
||||
} else {
|
||||
type = SlotType.CRAFTING;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Nothing to do, it's a CONTAINER slot
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue