mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-25 14:34:22 +00:00
some more fixes from 1.6.x
This commit is contained in:
1 parent
9fce66a827
commit
689aeba09b
11 files changed
+176
-32
No files matched your search
@@ -16,14 +16,13 @@ public class ArmorExtendedContainer extends ActiveContainer
|
||||
invPlayer = inventoryplayer;
|
||||
this.armor = armor;
|
||||
|
||||
this.addSlotToContainer(new Slot(armor, 0, 80, 17));
|
||||
this.addSlotToContainer(new Slot(armor, 1, 80, 35));
|
||||
this.addSlotToContainer(new Slot(armor, 2, 116, 17));
|
||||
this.addSlotToContainer(new Slot(armor, 3, 116, 35));
|
||||
this.addSlotToContainer(new Slot(armor, 4, 152, 17));
|
||||
this.addSlotToContainer(new Slot(armor, 5, 152, 35));
|
||||
this.addSlotToContainer(new Slot(armor, 6, 152, 53));
|
||||
|
||||
this.addSlotToContainer(new SlotUnused(armor, 0, 80, 17));
|
||||
this.addSlotToContainer(new SlotUnused(armor, 1, 80, 35));
|
||||
this.addSlotToContainer(new SlotKnapsack(armor, 2, 116, 17));
|
||||
this.addSlotToContainer(new SlotUnused(armor, 3, 116, 35));
|
||||
this.addSlotToContainer(new SlotUnused(armor, 4, 152, 17));
|
||||
this.addSlotToContainer(new SlotUnused(armor, 5, 152, 35));
|
||||
this.addSlotToContainer(new SlotCanister(armor, 6, 152, 53));
|
||||
/* Player inventory */
|
||||
for (int playerArmor = 0; playerArmor < 4; ++playerArmor)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -44,7 +45,12 @@ public class SlotArmorCopy extends Slot
|
||||
public boolean isItemValid (ItemStack par1ItemStack)
|
||||
{
|
||||
Item item = (par1ItemStack == null ? null : par1ItemStack.getItem());
|
||||
return item != null;// && item.isValidArmor(par1ItemStack, armorType, parent.thePlayer);
|
||||
boolean isValidArmor = false;
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
isValidArmor = (((ItemArmor) item).armorType == armorType);
|
||||
}
|
||||
return item != null && (isValidArmor || (item instanceof ItemBlock && armorType == 0));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package tconstruct.inventory;
|
||||
|
||||
import tconstruct.items.armor.HeartCanister;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class SlotCanister extends Slot
|
||||
{
|
||||
public SlotCanister(IInventory par2IInventory, int par3, int par4, int par5)
|
||||
{
|
||||
super(par2IInventory, par3, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
|
||||
* of armor slots)
|
||||
*/
|
||||
public int getSlotStackLimit ()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
|
||||
*/
|
||||
public boolean isItemValid (ItemStack par1ItemStack)
|
||||
{
|
||||
Item item = (par1ItemStack == null ? null : par1ItemStack.getItem());
|
||||
return item != null && (item instanceof HeartCanister);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package tconstruct.inventory;
|
||||
|
||||
import tconstruct.items.armor.Knapsack;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class SlotKnapsack extends Slot
|
||||
{
|
||||
public SlotKnapsack(IInventory par2IInventory, int par3, int par4, int par5)
|
||||
{
|
||||
super(par2IInventory, par3, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
|
||||
* of armor slots)
|
||||
*/
|
||||
public int getSlotStackLimit ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
|
||||
*/
|
||||
public boolean isItemValid (ItemStack par1ItemStack)
|
||||
{
|
||||
Item item = (par1ItemStack == null ? null : par1ItemStack.getItem());
|
||||
return item != null && (item instanceof Knapsack);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package tconstruct.inventory;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class SlotUnused extends Slot
|
||||
{
|
||||
public SlotUnused(IInventory par2IInventory, int par3, int par4, int par5)
|
||||
{
|
||||
super(par2IInventory, par3, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
|
||||
* of armor slots)
|
||||
*/
|
||||
public int getSlotStackLimit ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
|
||||
*/
|
||||
public boolean isItemValid (ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user