mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:06:11 +03:00
54 lines
2.3 KiB
Diff
54 lines
2.3 KiB
Diff
--- ../src-base/minecraft/net/minecraft/inventory/ContainerPlayer.java
|
|
+++ ../src-work/minecraft/net/minecraft/inventory/ContainerPlayer.java
|
|
@@ -10,6 +10,11 @@
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
+//CraftBukkit start
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting;
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
|
+// CraftBukkit end
|
|
+
|
|
public class ContainerPlayer extends Container
|
|
{
|
|
private static final EntityEquipmentSlot[] VALID_EQUIPMENT_SLOTS = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
|
|
@@ -17,10 +22,20 @@
|
|
public IInventory craftResult = new InventoryCraftResult();
|
|
public boolean isLocalWorld;
|
|
private final EntityPlayer thePlayer;
|
|
+ // CraftBukkit start
|
|
+ private CraftInventoryView bukkitEntity = null;
|
|
+ private InventoryPlayer player;
|
|
+ // CraftBukkit end
|
|
|
|
public ContainerPlayer(final InventoryPlayer playerInventory, boolean localWorld, EntityPlayer player)
|
|
{
|
|
this.isLocalWorld = localWorld;
|
|
+ // CraftBukkit start
|
|
+ this.craftResult = new InventoryCraftResult(); // CraftBukkit - moved to before InventoryCrafting construction
|
|
+ this.craftMatrix = new InventoryCrafting(this, 2, 2, playerInventory.player); // CraftBukkit - pass player
|
|
+ this.craftMatrix.resultInventory = this.craftResult; // CraftBukkit - let InventoryCrafting know about its result slot
|
|
+ this.player = playerInventory; // CraftBukkit - save player
|
|
+ // CraftBukkit end
|
|
this.thePlayer = player;
|
|
this.addSlotToContainer(new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 154, 28));
|
|
|
|
@@ -211,4 +226,17 @@
|
|
{
|
|
return slotIn.inventory != this.craftResult && super.canMergeSlot(stack, slotIn);
|
|
}
|
|
+
|
|
+ // CraftBukkit start
|
|
+ @Override
|
|
+ public CraftInventoryView getBukkitView() {
|
|
+ if (bukkitEntity != null) {
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+
|
|
+ CraftInventoryCrafting inventory = new CraftInventoryCrafting(this.craftMatrix, this.craftResult);
|
|
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
}
|