diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common')
19 files changed, 1311 insertions, 1110 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index 430ae44d64..ef013fa3a2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -1,16 +1,11 @@ package gtPlusPlus.xmod.gregtech.common; -import static gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow.mOverflowCache; - import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Timer; -import java.util.TimerTask; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @@ -29,7 +24,6 @@ import gregtech.api.util.Recipe_GT; import gregtech.common.GT_Proxy; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.ObjMap; import gtPlusPlus.api.objects.minecraft.FormattedTooltipString; import gtPlusPlus.core.handler.AchievementHandler; import gtPlusPlus.core.lib.CORE; @@ -117,7 +111,6 @@ public class Meta_GT_Proxy { } public static void init() { - scheduleCoverMapCleaner(); setValidHeatingCoilMetas(); PollutionUtils.setPollutionFluids(); fixIC2FluidNames(); @@ -435,47 +428,6 @@ public class Meta_GT_Proxy { } } - - public static void scheduleCoverMapCleaner(){ - TimerTask repeatedTask = new TimerTask() { - public void run() { - cleanupOverFlowCoverCache(); - } - }; - Timer timer = new Timer("CoverCleanupManager"); - long delay = 120000L; - long period = 300000L; - timer.scheduleAtFixedRate(repeatedTask, delay, period); - } - - public static int cleanupOverFlowCoverCache() { - ObjMap<String, ?> cache = mOverflowCache; - int aRemoved = 0; - long aCurrentTime = System.currentTimeMillis()/1000; - for (Object o : cache.values()) { - if (o != null && o instanceof HashMap) { - @SuppressWarnings("unchecked") - HashMap<String, Object> m = (HashMap<String, Object>) o; - if (m != null) { - String s = (String) m.get("aCoverKey"); - if (m.containsKey("aLastUpdatedTime")) { - long mapTime = (long) m.get("mLastUpdatedTime"); - if ((aCurrentTime-(mapTime/1000) > 30)){ - mOverflowCache.remove(s); - aRemoved++; - } - } - else { - mOverflowCache.remove(s); - aRemoved++; - } - } - } - } - return aRemoved; - } - - static GT_Proxy[] mProxies = new GT_Proxy[2]; /** diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java index 814ed589f0..74e269e932 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java @@ -238,44 +238,51 @@ public class StaticFields59 { return null; } - public static int getHeatingCapacityForCoil(Block aBlock, int aMeta) { + + + public static int getTierForCoil(Block aBlock, int aMeta) { if (aBlock == GregTech_API.sBlockCasings1 && (aMeta >= 12 && aMeta <= 14)) { - return getHeatingCapacityForCoilTier(aMeta == 12 ? 1 : aMeta == 13 ? 2 : 3); + return aMeta == 12 ? 1 : aMeta == 13 ? 2 : 3; } else if (aBlock == getBlockCasings5() && (aMeta >= 0 && aMeta <= 8)) { - return getHeatingCapacityForCoilTier(aMeta); + return aMeta; } return 0; } + public static int getHeatingCapacityForCoil(Block aBlock, int aMeta) { + int aTier = getTierForCoil(aBlock, aMeta); + return aTier > 0 ? getHeatingCapacityForCoilTier(aTier) : 0; + } + public static int getHeatingCapacityForCoilTier(int aCoilTier) { int mHeatingCapacity = 0; switch (aCoilTier) { - case 0: + case 1: mHeatingCapacity = 1800; break; - case 1: + case 2: mHeatingCapacity = 2700; break; - case 2: + case 3: mHeatingCapacity = 3600; break; - case 3: + case 4: mHeatingCapacity = 4500; break; - case 4: + case 5: mHeatingCapacity = 5400; break; - case 5: + case 6: mHeatingCapacity = 7200; break; - case 6: + case 7: mHeatingCapacity = 9000; break; - case 7: + case 8: mHeatingCapacity = 9900; break; - case 8: + case 9: mHeatingCapacity = 10800; break; default: @@ -285,7 +292,6 @@ public class StaticFields59 { if (CORE.GTNH && aCoilTier <= 6) { mHeatingCapacity += 1; } - return mHeatingCapacity; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java index b220dd74e8..1c1f9c20f9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java @@ -1,13 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.covers; -import java.util.HashMap; - import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.ObjMap; +import gtPlusPlus.core.util.minecraft.LangUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; @@ -15,123 +11,90 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; public class GTPP_Cover_Overflow extends GT_CoverBehavior { + + public final int mTransferRate; + public final int mInitialTransferRate; public final int mMaxTransferRate; - - public static final ObjMap<String, HashMap<String, Object>> mOverflowCache = new ObjMap<String, HashMap<String, Object>>(10000, 0.5f); public GTPP_Cover_Overflow(int aTransferRate) { - this.mMaxTransferRate = aTransferRate*1000; + this.mTransferRate = aTransferRate * 1000 / 10; + this.mInitialTransferRate = aTransferRate; + this.mMaxTransferRate = aTransferRate * 1000; } public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { - - HashMap<String, Object> aCoverData = getCover(aSide, aCoverID, aCoverVariable, aTileEntity); - //Do things - - if (aCoverData != null) { - if (aCoverData.containsKey("aCoverVariable")) - return (int) aCoverData.get("aCoverVariable"); - } - - - if (aCoverVariable % 6 > 1 && aTileEntity instanceof IMachineProgress - && ((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { + if (aCoverVariable == 0) { return aCoverVariable; - } else { - if (aTileEntity instanceof IFluidHandler) { - IFluidHandler tTank2 = aTileEntity.getITankContainerAtSide(aSide); - if (tTank2 != null) { - IFluidHandler tTank1 = (IFluidHandler) aTileEntity; - FluidStack tLiquid; - if (aCoverVariable % 2 == 0) { - tLiquid = tTank1.drain(ForgeDirection.getOrientation(aSide), this.mMaxTransferRate, false); - if (tLiquid != null) { - tLiquid = tLiquid.copy(); - tLiquid.amount = tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid, - false); - if (tLiquid.amount > 0) { - if ((aCoverVariable % 2 == 0 || aSide != 1) && (aCoverVariable % 2 != 0 || aSide != 0) - && aTileEntity.getUniversalEnergyCapacity() >= (long) Math.min(1, - tLiquid.amount / 10)) { - if (aTileEntity.isUniversalEnergyStored((long) Math.min(1, tLiquid.amount / 10))) { - aTileEntity.decreaseStoredEnergyUnits((long) Math.min(1, tLiquid.amount / 10), - true); - tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain( - ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true); - } - } else { - tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), - tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), - true); - } - } - } - } else { - tLiquid = tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), this.mMaxTransferRate, - false); - if (tLiquid != null) { - tLiquid = tLiquid.copy(); - tLiquid.amount = tTank1.fill(ForgeDirection.getOrientation(aSide), tLiquid, false); - if (tLiquid.amount > 0) { - if ((aCoverVariable % 2 == 0 || aSide != 1) && (aCoverVariable % 2 != 0 || aSide != 0) - && aTileEntity.getUniversalEnergyCapacity() >= (long) Math.min(1, - tLiquid.amount / 10)) { - if (aTileEntity.isUniversalEnergyStored((long) Math.min(1, tLiquid.amount / 10))) { - aTileEntity.decreaseStoredEnergyUnits((long) Math.min(1, tLiquid.amount / 10), - true); - tTank1.fill(ForgeDirection.getOrientation(aSide), - tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), - tLiquid.amount, true), - true); - } - } else { - tTank1.fill(ForgeDirection.getOrientation(aSide), - tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), - tLiquid.amount, true), - true); - } + } + if ((aTileEntity instanceof IFluidHandler)) { + //Logger.INFO("Trying to Void via Overflow."); + IFluidHandler tTank1; + ForgeDirection directionFrom; + directionFrom = ForgeDirection.UNKNOWN; + tTank1 = (IFluidHandler) aTileEntity; + if (tTank1 != null) { + //Logger.INFO("Found Self. "+aSide); + //FluidStack aTankStack = tTank1.drain(ForgeDirection.UNKNOWN, 1, false); + FluidStack aTankStack = tTank1.getTankInfo(directionFrom)[0].fluid; + if (aTankStack != null) { + //Logger.INFO("Found Fluid inside self - "+aTankStack.getLocalizedName()+", overflow point set at "+aCoverVariable+"L and we have "+aTankStack.amount+"L inside."); + if (aTankStack.amount > aCoverVariable) { + int aAmountToDrain = aTankStack.amount - aCoverVariable; + //Logger.INFO("There is "+aAmountToDrain+" more fluid in the tank than we would like."); + if (aAmountToDrain > 0) { + FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aAmountToDrain), true); + if (tLiquid != null) { + //Logger.INFO("Drained "+aAmountToDrain+"L."); } } } } + else { + //Logger.INFO("Could not simulate drain on self."); + } } - - return aCoverVariable; } + return aCoverVariable; } public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - - - if ((double) aX > 0.375D && (double) aX < 0.625D || aSide <= 3 || (double) aY > 0.375D && (double) aY < 0.625D - || (double) aZ <= 0.375D || (double) aZ >= 0.625D) { - HashMap<String, Object> aCoverData = getCover(aSide, aCoverID, aCoverVariable, aTileEntity); - float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); - switch ((byte) ((byte) ((int) (tCoords[0] * 2.0F)) + 2 * (byte) ((int) (tCoords[1] * 2.0F)))) { - case 0 : - aCoverVariable -= 1000; - break; - case 1 : - aCoverVariable += 1000; - break; - case 2 : - aCoverVariable -= 32000; - break; - case 3 : - aCoverVariable += 32000; - } - aCoverData.remove("aCoverVariable"); - aCoverData.put("aCoverVariable", aCoverVariable); - updateCoverMap(aCoverData); - + if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { + aCoverVariable += aPlayer.isSneaking() ? 4096 : 1024; + } else { + aCoverVariable -= aPlayer.isSneaking() ? 4096 : 1024; } - GT_Utility.sendChatToPlayer(aPlayer, "Overflow Limit: " + aCoverVariable); - + if (aCoverVariable > mMaxTransferRate) { + aCoverVariable = mInitialTransferRate; + } + if (aCoverVariable <= 0) { + aCoverVariable = mInitialTransferRate; + } + GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L")); return aCoverVariable; } + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { + boolean aShift = aPlayer.isSneaking(); + int aAmount = aShift ? 128 : 8; + if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { + aCoverVariable += aAmount; + } else { + aCoverVariable -= aAmount; + } + if (aCoverVariable > mMaxTransferRate) { + aCoverVariable = mInitialTransferRate; + } + if (aCoverVariable <= 0) { + aCoverVariable = mInitialTransferRate; + } + GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L")); + aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); + return true; + } + public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } @@ -157,17 +120,11 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { } public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return aCoverVariable > 1 && aTileEntity instanceof IMachineProgress - && ((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4 - ? false - : aCoverVariable >= 6 || aCoverVariable % 2 != 0; + return false; } public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return aCoverVariable > 1 && aTileEntity instanceof IMachineProgress - && ((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4 - ? false - : aCoverVariable >= 6 || aCoverVariable % 2 == 0; + return true; } public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { @@ -175,39 +132,6 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { } public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return 1; - } - - public HashMap<String, Object> getCover(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity){ - //Map this cover - String aTileDataKey = "|"+aTileEntity.getXCoord()+"|"+aTileEntity.getYCoord()+"|"+aTileEntity.getZCoord()+"|"+aTileEntity.getWorld().provider.dimensionId+"|"+aSide+"|"; - HashMap<String, Object> aTileData; - long aCurrentTime = System.currentTimeMillis(); - if (mOverflowCache.get(aTileDataKey) != null) { - aTileData = mOverflowCache.get(aTileDataKey); - aTileData.remove("aLastUpdatedTime"); - aTileData.put("aLastUpdateTime", aCurrentTime); - //Logger.INFO("Found Existing Cover in Cache."); - } - else { - aTileData = new HashMap<String, Object>(); - aTileData.put("aCoverKey", aTileDataKey); - aTileData.put("aSide", aSide); - aTileData.put("aCoverID", aCoverID); - aTileData.put("aCoverVariable", aCoverVariable); - aTileData.put("aLastUpdateTime", aCurrentTime); - mOverflowCache.put(aTileDataKey, aTileData); - Logger.INFO("Adding new Cover to Cache. Storing under key: "+aTileDataKey); - } - return aTileData; - } - - public void updateCoverMap(HashMap<String, Object> aCoverData) { - String mAccessKey = (String) aCoverData.get("aCoverKey"); - if (mOverflowCache.get(mAccessKey) != null) { - mOverflowCache.remove(mAccessKey); - } - mOverflowCache.put(mAccessKey, aCoverData); - return; + return 5; } -}
\ No newline at end of file +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow2.java deleted file mode 100644 index 8a378cf6ad..0000000000 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow2.java +++ /dev/null @@ -1,131 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.covers; - -import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.minecraft.LangUtils; -import gtPlusPlus.core.util.sys.KeyboardUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; - -public class GTPP_Cover_Overflow2 extends GT_CoverBehavior { - - public final int mTransferRate; - public final int mInitialTransferRate; - public final int mMaxTransferRate; - - public GTPP_Cover_Overflow2(int aTransferRate) { - this.mTransferRate = aTransferRate * 1000 / 10; - this.mInitialTransferRate = aTransferRate; - this.mMaxTransferRate = aTransferRate * 1000; - } - - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - long aTimer) { - if (aCoverVariable == 0) { - return aCoverVariable; - } - if ((aTileEntity instanceof IFluidHandler)) { - IFluidHandler tTank1; - ForgeDirection directionFrom; - directionFrom = ForgeDirection.UNKNOWN; - if (aCoverVariable > 0) { - tTank1 = (IFluidHandler) aTileEntity; - } else { - tTank1 = aTileEntity.getITankContainerAtSide(aSide); - } - if (tTank1 != null) { - FluidStack aTankStack = tTank1.drain(ForgeDirection.UNKNOWN, 0, false); - if (aTankStack != null) { - if (aTankStack.amount > aCoverVariable) { - int aAmountToDrain = aTankStack.amount - aCoverVariable; - if (aAmountToDrain > 0) { - FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aAmountToDrain), false); - } - } - } - } - } - return aCoverVariable; - } - - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable += aPlayer.isSneaking() ? 4096 : 1024; - } else { - aCoverVariable -= aPlayer.isSneaking() ? 4096 : 1024; - } - if (aCoverVariable > mMaxTransferRate) { - aCoverVariable = mInitialTransferRate; - } - if (aCoverVariable <= 0) { - aCoverVariable = mInitialTransferRate; - } - GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L/5T")); - return aCoverVariable; - } - - public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - boolean aShift = aPlayer.isSneaking(); - int aAmount = aShift ? 128 : 8; - if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable += aAmount; - } else { - aCoverVariable -= aAmount; - } - if (aCoverVariable > mMaxTransferRate) { - aCoverVariable = mInitialTransferRate; - } - if (aCoverVariable <= 0) { - aCoverVariable = mInitialTransferRate; - } - GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L/5T")); - aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); - return true; - } - - public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return true; - } - - public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return true; - } - - public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return false; - } - - public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return true; - } - - public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return 5; - } -} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 97621203cd..5d4cf5ea94 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -2,20 +2,26 @@ package gtPlusPlus.xmod.gregtech.common.items; import static gtPlusPlus.core.util.Utils.getTcAspectStack; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemStack; - import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; +import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.*; -import gregtech.api.util.*; +import gregtech.api.objects.GT_MultiTexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.ItemData; +import gregtech.api.objects.MaterialStack; +import gregtech.api.util.GT_FoodStat; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.Recipe_GT; import gregtech.common.covers.GT_Cover_Arm; import gregtech.common.covers.GT_Cover_Conveyor; import gregtech.common.covers.GT_Cover_Pump; import gregtech.common.items.behaviors.Behaviour_DataOrb; import gregtech.common.items.behaviors.Behaviour_DataStick; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.handler.OldCircuitHandler; import gtPlusPlus.core.lib.CORE; @@ -29,8 +35,9 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_X32; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow; -import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow2; import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemStack; public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { @@ -263,12 +270,12 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { GregtechItemList.Cover_Overflow_EV.set(this.addItem(75, "Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_IV.set(this.addItem(76, "Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(8)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(64)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(512)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(4096)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(32768)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(262144)); + GregTech_API.registerCover(GregtechItemList.Cover_Overflow_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(8)); + GregTech_API.registerCover(GregtechItemList.Cover_Overflow_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(64)); + GregTech_API.registerCover(GregtechItemList.Cover_Overflow_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(512)); + GregTech_API.registerCover(GregtechItemList.Cover_Overflow_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(4096)); + GregTech_API.registerCover(GregtechItemList.Cover_Overflow_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(32768)); + GregTech_API.registerCover(GregtechItemList.Cover_Overflow_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(262144)); //Fusion Reactor MK4 Singularity GregtechItemList.Compressed_Fusion_Reactor.set(this.addItem(100, "Hypervisor Matrix (Fusion)", "A memory unit containing an RI (Restricted Intelligence)")); @@ -339,7 +346,23 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { } } GregtechItemList.Laser_Lens_WoodsGlass.set(this.addItem(140, "Wood's Glass Lens", "Allows UV & IF to pass through, blocks visible light spectrums")); - + + int aStartID = 141; + GregtechItemList[] aTransParts = new GregtechItemList[] { + GregtechItemList.TransmissionComponent_ULV, + GregtechItemList.TransmissionComponent_LV, + GregtechItemList.TransmissionComponent_MV, + GregtechItemList.TransmissionComponent_HV, + GregtechItemList.TransmissionComponent_EV, + GregtechItemList.TransmissionComponent_IV, + GregtechItemList.TransmissionComponent_LuV, + GregtechItemList.TransmissionComponent_ZPM, + GregtechItemList.TransmissionComponent_UV, + GregtechItemList.TransmissionComponent_MAX, + }; + for (int aIndex=0;aIndex<10;aIndex++){ + aTransParts[aIndex].set(this.addItem(aStartID++, "Transmission Component ("+GT_Values.VN[aIndex]+")", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, aIndex), getTcAspectStack(TC_Aspects.MACHINA, aIndex), getTcAspectStack(TC_Aspects.MAGNETO, aIndex)})); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java index a063d334bf..422a29c34e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java @@ -1,6 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.items.behaviours; -import java.util.ArrayList; import java.util.List; import codechicken.lib.math.MathHelper; @@ -63,7 +62,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) { if (aPlayer.isSneaking()) { Logger.INFO("Changing Mode"); - boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod"); + boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode"); Logger.INFO("Is currently in Fireball mode? "+aCurrentMode); boolean aNewMode = Utils.invertBoolean(aCurrentMode); Logger.INFO("Is now set to Fireball mode? "+aNewMode); @@ -72,7 +71,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { PlayerUtils.messagePlayer(aPlayer, "Current Mode: "+EnumChatFormatting.RED+(aNewMode ? "Projectile" : "Fire Starter")); } else { - boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod"); + boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode"); if (aCurrentMode) { //Shoot Lightning Attack aWorld.playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); @@ -112,16 +111,16 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) { if (aPlayer.isSneaking()) { Logger.INFO("Changing Mode"); - boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod"); + boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode"); Logger.INFO("Is currently in Fireball mode? "+aCurrentMode); boolean aNewM |
