Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Add inventory and slot types for new containers. Fixes BUKKIT-2741
Dieser Commit ist enthalten in:
Ursprung
347fd3cb6e
Commit
87a1cd3d43
@ -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
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren