aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-08-07 20:44:39 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-08-07 20:44:39 +1000
commit71b99388a66e7b55b2998439f3e32dffd3ce7651 (patch)
tree0415b5091edd8bc4ec9b7afd6f065f5c139af2bc /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage
parent8f724ee98f334717842c665a02509ecd27576469 (diff)
downloadGT5-Unofficial-71b99388a66e7b55b2998439f3e32dffd3ce7651.tar.gz
GT5-Unofficial-71b99388a66e7b55b2998439f3e32dffd3ce7651.tar.bz2
GT5-Unofficial-71b99388a66e7b55b2998439f3e32dffd3ce7651.zip
$ Fixed Shelving.
$ Fixed minor RTG error.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java374
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java205
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java40
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java64
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java64
5 files changed, 400 insertions, 347 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java
index ca5cf4af98..9960b0e4e8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java
@@ -1,178 +1,212 @@
-package gregtechmod.common.tileentities.storage;
+package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
-import gregtechmod.api.enums.GT_Items;
-import gregtechmod.api.enums.OrePrefixes;
-import gregtechmod.api.interfaces.IGregTechTileEntity;
-import gregtechmod.api.metatileentity.MetaTileEntity;
-import gregtechmod.api.util.GT_Utility;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
-public class GT_MetaTileEntity_Shelf
- extends MetaTileEntity
+public class GT4Entity_Shelf
+extends MetaTileEntity
{
- public byte mType = 0;
-
- public GT_MetaTileEntity_Shelf(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_Shelf() {}
-
- public boolean isSimpleMachine()
- {
- return true;
- }
-
- public int getInvSize()
- {
- return 1;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer)
- {
- return true;
- }
-
- public boolean ownerControl()
- {
- return false;
- }
-
- public boolean isEnetOutput()
- {
- return false;
- }
-
- public boolean isEnetInput()
- {
- return false;
- }
-
- public boolean isOutputFacing(byte aSide)
- {
- return false;
- }
-
- public boolean isInputFacing(byte aSide)
- {
- return false;
- }
-
- public void onRightclick(EntityPlayer aPlayer)
- {
- ItemStack tStack = aPlayer.field_71071_by.func_70301_a(aPlayer.field_71071_by.field_70461_c);
- if (tStack == null)
- {
- if ((this.mInventory[0] != null) && (this.mInventory[0].field_77994_a > 0))
- {
- aPlayer.field_71071_by.func_70299_a(aPlayer.field_71071_by.field_70461_c, this.mInventory[0]);
- getBaseMetaTileEntity().func_70299_a(0, null);
- this.mType = 0;
- }
- }
- else if (this.mInventory[0] == null) {
- if (OrePrefixes.paper.contains(tStack))
- {
- aPlayer.field_71071_by.func_70299_a(aPlayer.field_71071_by.field_70461_c, null);
- getBaseMetaTileEntity().func_70299_a(0, tStack);
- this.mType = 1;
- }
- else if (OrePrefixes.book.contains(tStack))
- {
- aPlayer.field_71071_by.func_70299_a(aPlayer.field_71071_by.field_70461_c, null);
- getBaseMetaTileEntity().func_70299_a(0, tStack);
- this.mType = 2;
- }
- else if ((GT_Items.IC2_Food_Can_Filled.isStackEqual(tStack, true, true)) || (GT_Items.IC2_Food_Can_Spoiled.isStackEqual(tStack, true, true)) || (GT_Items.IC2_Food_Can_Empty.isStackEqual(tStack, false, true)))
- {
- aPlayer.field_71071_by.func_70299_a(aPlayer.field_71071_by.field_70461_c, null);
- getBaseMetaTileEntity().func_70299_a(0, tStack);
- this.mType = 3;
- }
- }
- }
-
- public void onLeftclick(EntityPlayer aPlayer)
- {
- if ((this.mInventory[0] != null) && (this.mInventory[0].field_77994_a > 0))
- {
- ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] });
- if (!aPlayer.func_70093_af()) {
- tOutput.field_77994_a = 1;
- }
- getBaseMetaTileEntity().func_70298_a(0, tOutput.field_77994_a);
- EntityItem tEntity = new EntityItem(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, tOutput);
- tEntity.field_70159_w = 0.0D;
- tEntity.field_70181_x = 0.0D;
- tEntity.field_70179_y = 0.0D;
- getBaseMetaTileEntity().getWorld().func_72838_d(tEntity);
- if (this.mInventory[0] == null) {
- this.mType = 0;
- }
- }
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Shelf();
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- aNBT.func_74768_a("mType", this.mType);
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- this.mType = ((byte)aNBT.func_74762_e("mType"));
- }
-
- public void onValueUpdate(byte aValue)
- {
- this.mType = aValue;
- }
-
- public byte getUpdateData()
- {
- return this.mType;
- }
-
- public boolean allowCoverOnSide(byte aSide, int aCoverID)
- {
- return aSide != getBaseMetaTileEntity().getFrontFacing();
- }
-
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return 208 + this.mType;
- }
- return 10;
- }
-
- public String getDescription()
- {
- return "Decorative Item Storage";
- }
-
- public boolean allowPullStack(int aIndex, byte aSide, ItemStack aStack)
- {
- return false;
- }
-
- public boolean allowPutStack(int aIndex, byte aSide, ItemStack aStack)
- {
- return false;
- }
+ public byte mType = 0;
+
+ public GT4Entity_Shelf(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, 1);
+ }
+
+ public GT4Entity_Shelf(String aName)
+ {
+ super(aName, 1);
+ }
+
+ @Override
+ public boolean isSimpleMachine()
+ {
+ return true;
+ }
+
+ public int getInvSize()
+ {
+ return 1;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean ownerControl()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetInput()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide)
+ {
+ return false;
+ }
+
+ public void onRightclick(EntityPlayer aPlayer)
+ {
+ ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem);
+ if (tStack == null)
+ {
+ if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0))
+ {
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, this.mInventory[0]);
+ getBaseMetaTileEntity().setInventorySlotContents(0, null);
+ this.mType = 0;
+ }
+ }
+ else if (this.mInventory[0] == null) {
+ if (OrePrefixes.paper.contains(tStack))
+ {
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null);
+ getBaseMetaTileEntity().setInventorySlotContents(0, tStack);
+ this.mType = 1;
+ }
+ else if (OrePrefixes.book.contains(tStack))
+ {
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null);
+ getBaseMetaTileEntity().setInventorySlotContents(0, tStack);
+ this.mType = 2;
+ }
+ else if ((ItemList.IC2_Food_Can_Filled.isStackEqual(tStack, true, true)) || (ItemList.IC2_Food_Can_Spoiled.isStackEqual(tStack, true, true)) || (ItemList.IC2_Food_Can_Empty.isStackEqual(tStack, false, true)))
+ {
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null);
+ getBaseMetaTileEntity().setInventorySlotContents(0, tStack);
+ this.mType = 3;
+ }
+ }
+ }
+
+ public void onLeftclick(EntityPlayer aPlayer)
+ {
+ if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0))
+ {
+ ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] });
+ if (!aPlayer.isSneaking()) {
+ tOutput.stackSize = 1;
+ }
+ getBaseMetaTileEntity().decrStackSize(0, tOutput.stackSize);
+ EntityItem tEntity = new EntityItem(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, tOutput);
+ tEntity.motionX = 0.0D;
+ tEntity.motionY = 0.0D;
+ tEntity.motionZ = 0.0D;
+ getBaseMetaTileEntity().getWorld().spawnEntityInWorld(tEntity);
+ if (this.mInventory[0] == null) {
+ this.mType = 0;
+ }
+ }
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT4Entity_Shelf(this.mName);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ aNBT.setInteger("mType", this.mType);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ this.mType = ((byte)aNBT.getInteger("mType"));
+ }
+
+ @Override
+ public void onValueUpdate(byte aValue)
+ {
+ this.mType = aValue;
+ }
+
+ @Override
+ public byte getUpdateData()
+ {
+ return this.mType;
+ }
+
+ public boolean allowCoverOnSide(byte aSide, int aCoverID)
+ {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return 208 + this.mType;
+ }
+ return 10;
+ }
+
+ @Override
+ public String[] getDescription()
+ {
+ return new String[]{
+ "Decorative Item Storage",
+ CORE.GT_Tooltip
+ };
+ }
+
+
+
+ @Override
+ public byte getTileEntityBaseType() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity p0, int p1, byte p2, ItemStack p3) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity p0, int p1, byte p2, ItemStack p3) {
+ return false;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity p0, byte p1, byte p2, byte p3, boolean p4, boolean p5) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java
index 63a18f854d..91300a2d22 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java
@@ -1,108 +1,115 @@
-package gregtechmod.common.tileentities.storage;
+package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gregtechmod.api.interfaces.IGregTechTileEntity;
-import gregtechmod.api.metatileentity.MetaTileEntity;
-import gregtechmod.api.util.GT_Utility;
-import net.minecraft.client.renderer.texture.IconRegister;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.util.Icon;
-import net.minecraft.world.World;
+import net.minecraft.util.IIcon;
-public class GT_MetaTileEntity_Shelf_Compartment
- extends GT_MetaTileEntity_Shelf
+public class GT4Entity_Shelf_Compartment
+extends GT4Entity_Shelf
{
- public static Icon[] sIconList = new Icon['?'];
-
- public GT_MetaTileEntity_Shelf_Compartment(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_Shelf_Compartment() {}
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Shelf_Compartment();
- }
-
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
- {
- if (aSide == 0) {
- return 32;
- }
- if (aSide == 1) {
- return 29;
- }
- return 40;
- }
-
- public boolean allowCoverOnSide(byte aSide, int aCoverID)
- {
- return aSide != getBaseMetaTileEntity().getFrontFacing();
- }
-
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ)
- {
- if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
- this.mType = ((byte)((this.mType + 1) % 16));
- }
- }
-
- public Icon getTextureIcon(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
- {
- return aSide == aFacing ? sIconList[this.mType] : null;
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IconRegister aBlockIconRegister)
- {
- for (int i = 0; i < 32; i++) {
- sIconList[i] = aBlockIconRegister.func_94245_a("gregtech_addon:tile.Compartment/" + i);
- }
- }
-
- public void onLeftclick(EntityPlayer aPlayer)
- {
- if ((this.mInventory[0] != null) && (this.mInventory[0].field_77994_a > 0))
- {
- ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] });
- if (!aPlayer.func_70093_af()) {
- tOutput.field_77994_a = 1;
- }
- getBaseMetaTileEntity().func_70298_a(0, tOutput.field_77994_a);
- EntityItem tEntity = new EntityItem(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, tOutput);
- tEntity.field_70159_w = 0.0D;
- tEntity.field_70181_x = 0.0D;
- tEntity.field_70179_y = 0.0D;
- getBaseMetaTileEntity().getWorld().func_72838_d(tEntity);
- }
- }
-
- public void onRightclick(EntityPlayer aPlayer)
- {
- ItemStack tStack = aPlayer.field_71071_by.func_70301_a(aPlayer.field_71071_by.field_70461_c);
- if (tStack == null)
- {
- if ((this.mInventory[0] != null) && (this.mInventory[0].field_77994_a > 0))
- {
- aPlayer.field_71071_by.func_70299_a(aPlayer.field_71071_by.field_70461_c, this.mInventory[0]);
- getBaseMetaTileEntity().func_70299_a(0, null);
- }
- }
- else if (this.mInventory[0] == null)
- {
- aPlayer.field_71071_by.func_70299_a(aPlayer.field_71071_by.field_70461_c, null);
- getBaseMetaTileEntity().func_70299_a(0, tStack);
- }
- }
-
- public boolean allowPullStack(int aIndex, byte aSide, ItemStack aStack)
- {
- return aIndex == 0;
- }
+ public static IIcon[] sIconList = new IIcon['?'];
+
+ public GT4Entity_Shelf_Compartment(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT4Entity_Shelf_Compartment(String mName) {
+ super(mName);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT4Entity_Shelf_Compartment(this.mName);
+ }
+
+ @Override
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == 0) {
+ return 32;
+ }
+ if (aSide == 1) {
+ return 29;
+ }
+ return 40;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, int aCoverID)
+ {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ)
+ {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
+ this.mType = ((byte)((this.mType + 1) % 16));
+ }
+ }
+
+ public IIcon getTextureIcon(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
+ {
+ return aSide == aFacing ? sIconList[this.mType] : null;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aBlockIconRegister)
+ {
+ for (int i = 0; i < 32; i++) {
+ sIconList[i] = aBlockIconRegister.registerIcon("gregtech_addon:tile.Compartment/" + i);
+ }
+ }
+
+ @Override
+ public void onLeftclick(EntityPlayer aPlayer)
+ {
+ if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0))
+ {
+ ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] });
+ if (!aPlayer.isSneaking()) {
+ tOutput.stackSize = 1;
+ }
+ getBaseMetaTileEntity().decrStackSize(0, tOutput.stackSize);
+ EntityItem tEntity = new EntityItem(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, tOutput);
+ tEntity.motionX = 0.0D;
+ tEntity.motionY = 0.0D;
+ tEntity.motionZ = 0.0D;
+ getBaseMetaTileEntity().getWorld().spawnEntityInWorld(tEntity);
+ }
+ }
+
+ @Override
+ public void onRightclick(EntityPlayer aPlayer)
+ {
+ ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem);
+ if (tStack == null)
+ {
+ if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0))
+ {
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, this.mInventory[0]);
+ getBaseMetaTileEntity().setInventorySlotContents(0, null);
+ }
+ }
+ else if (this.mInventory[0] == null)
+ {
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null);
+ getBaseMetaTileEntity().setInventorySlotContents(0, tStack);
+ }
+ }
+
+ public boolean allowPullStack(int aIndex, byte aSide, ItemStack aStack)
+ {
+ return aIndex == 0;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java
index 6514022338..034b48e3f2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java
@@ -1,27 +1,30 @@
-package gregtechmod.common.tileentities.storage;
+package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
-import gregtechmod.api.interfaces.IGregTechTileEntity;
-import gregtechmod.api.metatileentity.MetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-public class GT_MetaTileEntity_Shelf_Desk
- extends GT_MetaTileEntity_Shelf
+public class GT4Entity_Shelf_Desk
+ extends GT4Entity_Shelf
{
- public GT_MetaTileEntity_Shelf_Desk(int aID, String aName, String aNameRegional)
+ public GT4Entity_Shelf_Desk(int aID, String aName, String aNameRegional)
{
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_Shelf_Desk() {}
+ public GT4Entity_Shelf_Desk(String mName) {
+ super(mName);
+ }
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ @Override
+public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
{
- return new GT_MetaTileEntity_Shelf_Desk();
+ return new GT4Entity_Shelf_Desk(this.mName);
}
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
+ @Override
+public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
{
if (aSide == aFacing) {
return 222;
@@ -35,22 +38,23 @@ public class GT_MetaTileEntity_Shelf_Desk
return 40;
}
- public void onRightclick(EntityPlayer aPlayer)
+ @Override
+public void onRightclick(EntityPlayer aPlayer)
{
- ItemStack tStack = aPlayer.field_71071_by.func_70301_a(aPlayer.field_71071_by.field_70461_c);
+ ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem);
if (tStack == null)
{
- if ((this.mInventory[0] != null) && (this.mInventory[0].field_77994_a > 0))
+ if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0))
{
- aPlayer.field_71071_by.func_70299_a(aPlayer.field_71071_by.field_70461_c, this.mInventory[0]);
- getBaseMetaTileEntity().func_70299_a(0, null);
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, this.mInventory[0]);
+ getBaseMetaTileEntity().setInventorySlotContents(0, null);
this.mType = 0;
}
}
else if (this.mInventory[0] == null)
{
- aPlayer.field_71071_by.func_70299_a(aPlayer.field_71071_by.field_70461_c, null);
- getBaseMetaTileEntity().func_70299_a(0, tStack);
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null);
+ getBaseMetaTileEntity().setInventorySlotContents(0, tStack);
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java
index f888325b09..048b318e7a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java
@@ -1,34 +1,38 @@
-package gregtechmod.common.tileentities.storage;
+package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
-import gregtechmod.api.interfaces.IGregTechTileEntity;
-import gregtechmod.api.metatileentity.MetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
-public class GT_MetaTileEntity_Shelf_FileCabinet
- extends GT_MetaTileEntity_Shelf
+public class GT4Entity_Shelf_FileCabinet
+extends GT4Entity_Shelf
{
- public GT_MetaTileEntity_Shelf_FileCabinet(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_Shelf_FileCabinet() {}
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Shelf_FileCabinet();
- }
-
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return 223;
- }
- if (aSide == 0) {
- return 32;
- }
- if (aSide == 1) {
- return 29;
- }
- return 40;
- }
+ public GT4Entity_Shelf_FileCabinet(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT4Entity_Shelf_FileCabinet(String mName) {
+ super(mName);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT4Entity_Shelf_FileCabinet(this.mName);
+ }
+
+ @Override
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return 223;
+ }
+ if (aSide == 0) {
+ return 32;
+ }
+ if (aSide == 1) {
+ return 29;
+ }
+ return 40;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java
index bad2dc72dd..8b54128af4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java
@@ -1,34 +1,38 @@
-package gregtechmod.common.tileentities.storage;
+package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
-import gregtechmod.api.interfaces.IGregTechTileEntity;
-import gregtechmod.api.metatileentity.MetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
-public class GT_MetaTileEntity_Shelf_Iron
- extends GT_MetaTileEntity_Shelf
+public class GT4Entity_Shelf_Iron
+extends GT4Entity_Shelf
{
- public GT_MetaTileEntity_Shelf_Iron(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_Shelf_Iron() {}
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Shelf_Iron();
- }
-
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return 216 + this.mType;
- }
- if (aSide == 0) {
- return 32;
- }
- if (aSide == 1) {
- return 29;
- }
- return 40;
- }
+ public GT4Entity_Shelf_Iron(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT4Entity_Shelf_Iron(String mName) {
+ super(mName);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT4Entity_Shelf_Iron(this.mName);
+ }
+
+ @Override
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return 216 + this.mType;
+ }
+ if (aSide == 0) {
+ return 32;
+ }
+ if (aSide == 1) {
+ return 29;
+ }
+ return 40;
+ }
}