diff options
108 files changed, 1768 insertions, 731 deletions
diff --git a/.gitignore b/.gitignore index 27501edac3..f427f51f8c 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ local.properties .idea/ .idea_modules/ +classes/ /out/ gradle/wrapper/gradle-wrapper.properties @@ -22,3 +22,18 @@ Please report any issues you to find the issue tracker on this repository. Inclu ## Contribution Please do! However, please take a note of current issues and what is currently being worked on. + +## Addons + +[Gregtech++](https://forum.industrial-craft.net/thread/13325-gt5u-1-7-10-gregtech-add-s-many-new-machines-multiblocks-general-xmod-compat-wit/)Misc GT additions.<br /> +[GTTweaker](https://forum.industrial-craft.net/thread/11353-gt-5-09-minetweaker-3-10-addon-addon-version-1-6-1-adding-custom-recipes-for-all/)Minetweaker Addon for GregTech.<br /> +[Tinkers Gregworks](https://github.com/Vexatos/TinkersGregworks) Tinkers Construct Tools made with GT materials.<br /> +[GalacticGreg](https://forum.industrial-craft.net/thread/11039-gregtech-addon-addon-galacticgreg-1-9-gregtech-oregen-on-galacticraft-planets/) GregTech Worldgen on Galacticraft Planets (Directly integrated into GT5.09.23+)<br /> +[TecTech](https://github.com/Technus/TecTech)<br /> + +## Modpacks + +[Beyond Reality](https://www.atlauncher.com/pack/BeyondReality)<br /> +[Infitech 2](https://forum.feed-the-beast.com/threads/1-7-10-listed-infitech-2-modpack-v3-2-21-hqm-gregtech-balanced-hard-mode-modpack.50185/)<br /> +[GT New Horizons](https://www.technicpack.net/modpack/mcnewhorizons.677387)<br /> +[Идеальная Индустриальная Сборка / Ideal Industrial Assembly](http://sapientmail.wixsite.com/minecraft)<br />
\ No newline at end of file diff --git a/build.properties b/build.properties index f4dcfcfaaf..39279f1d74 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.7.10 forge.version=10.13.4.1566-1.7.10 -gt.version=5.09.30pre1 +gt.version=5.09.30 ae2.version=rv2-beta-33 applecore.version=1.7.10-1.2.1+107.59407 diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index ec240af840..e558ff06a5 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -254,6 +254,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mExplosionItemDrop = tMainConfig.get("general", "ExplosionItemDrops", false).getBoolean(false);
gregtechproxy.mAddGTRecipesToIC2Machines = tMainConfig.get("general", "AddGTRecipesToIC2Machines", true).getBoolean(true);
gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid");
+ gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true).getBoolean(true);
gregtechproxy.mLowGravProcessing = Loader.isModLoaded(GT_Values.MOD_ID_GC_CORE) && tMainConfig.get("general", "LowGravProcessing", true).getBoolean(true);
Calendar now = Calendar.getInstance();
gregtechproxy.mAprilFool = GregTech_API.sSpecialFile.get(ConfigCategories.general, "AprilFool", now.get(Calendar.MONTH) == Calendar.APRIL && now.get(Calendar.DAY_OF_MONTH) == 1);
@@ -266,6 +267,7 @@ public class GT_Mod implements IGT_Mod { GregTech_API.mRFtoEU = GregTech_API.sOPStuff.get(ConfigCategories.general, "100RFtoEU", 20);
GregTech_API.mRFExplosions = GregTech_API.sOPStuff.get(ConfigCategories.general, "RFExplosions", false);
GregTech_API.meIOLoaded = Loader.isModLoaded("EnderIO");
+ gregtechproxy.mForceFreeFace = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "forceFreeFace",false);
GregTech_API.mUseOnlyGoodSolderingMaterials = GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "useonlygoodsolderingmaterials", GregTech_API.mUseOnlyGoodSolderingMaterials);
@@ -519,6 +521,11 @@ public class GT_Mod implements IGT_Mod { } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
new GT_Bees();
+
+ //Disable Low Grav regardless of config if Cleanroom is disabled.
+ if (!gregtechproxy.mEnableCleanroom){
+ gregtechproxy.mLowGravProcessing = false;
+ }
gregtechproxy.onLoad();
if (gregtechproxy.mSortToTheEnd) {
diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index c8b71ff469..cc545c1ca1 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -648,7 +648,7 @@ public enum ItemList implements IItemContainer { Circuit_Wafer_HPIC, Circuit_Chip_HPIC, Circuit_Wafer_NanoCPU, Circuit_Chip_NanoCPU, Circuit_Wafer_QuantumCPU, Circuit_Chip_QuantumCPU, Circuit_Chip_CrystalCPU, Circuit_Chip_CrystalSoC, Circuit_Chip_NeuroCPU, Circuit_Chip_Stemcell, Circuit_Processor, Circuit_Computer, Circuit_Nanoprocessor, Circuit_Nanocomputer, Circuit_Elitenanocomputer, Circuit_Quantumprocessor, Circuit_Quantumcomputer, Circuit_Masterquantumcomputer, - Circuit_Quantummainframe, Circuit_Crystalprocessor, Circuit_Crystalcomputer, Circuit_Crystalmainframe, Circuit_Neuroprocessor, Circuit_Wetwarecomputer, Circuit_Wetwaresupercomputer, Circuit_Wetwaremainframe, Circuit_Parts_RawCrystalChip, + Circuit_Quantummainframe, Circuit_Crystalprocessor, Circuit_Crystalcomputer, Circuit_Ultimatecrystalcomputer, Circuit_Crystalmainframe, Circuit_Neuroprocessor, Circuit_Wetwarecomputer, Circuit_Wetwaresupercomputer, Circuit_Wetwaremainframe, Circuit_Parts_RawCrystalChip, Machine_LV_CircuitAssembler, Machine_MV_CircuitAssembler, Machine_HV_CircuitAssembler, Machine_EV_CircuitAssembler, Machine_IV_CircuitAssembler, Machine_LuV_CircuitAssembler, Machine_ZPM_CircuitAssembler, Machine_UV_CircuitAssembler, Circuit_Integrated_Good, Machine_IV_LightningRod, Machine_HV_LightningRod, Machine_EV_LightningRod; public static final ItemList[] diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index 379858cb0c..07b6cfb84d 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -15,7 +15,7 @@ import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; public class Textures { public enum BlockIcons implements IIconContainer, Runnable { VOID // The Empty Texture - , RENDERING_ERROR, PIPE_RESTRICTOR, INSULATION_FULL, INSULATION_TINY, INSULATION_SMALL, INSULATION_MEDIUM, INSULATION_LARGE, INSULATION_HUGE, CFOAM_FRESH, + , RENDERING_ERROR, PIPE_RESTRICTOR, INSULATION_FULL, INSULATION_TINY, INSULATION_SMALL, INSULATION_MEDIUM, INSULATION_MEDIUM_PLUS, INSULATION_LARGE, INSULATION_HUGE, CFOAM_FRESH, CFOAM_HARDENED, SOLARPANEL, SOLARPANEL_8V, SOLARPANEL_LV, SOLARPANEL_MV, SOLARPANEL_HV, SOLARPANEL_EV, SOLARPANEL_IV, SOLARPANEL_LuV, SOLARPANEL_ZPM, SOLARPANEL_UV, VENT_NORMAL, VENT_ADVANCED, COVER_WOOD_PLATE, ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, AUTOMATION_FILTER, AUTOMATION_TYPEFILTER, AUTOMATION_CHESTBUFFER, AUTOMATION_SUPERBUFFER, AUTOMATION_REGULATOR, CONCRETE_LIGHT_STONE, CONCRETE_LIGHT_COBBLE, CONCRETE_LIGHT_COBBLE_MOSSY, diff --git a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java index c2fa1ab8ad..14d2db52dd 100644 --- a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java @@ -3,6 +3,7 @@ package gregtech.api.gui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_LanguageManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; @@ -182,4 +183,8 @@ public class GT_ContainerMetaTile_Machine extends GT_Container { public boolean canInteractWith(EntityPlayer player) { return mTileEntity.isUseableByPlayer(player); } + + public String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java index 189e5d25f1..6dcb605567 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java @@ -1,6 +1,7 @@ package gregtech.api.gui; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; @@ -31,42 +32,46 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin if (mContainer != null) { if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 1) != 0) - fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255); + fontRendererObj.drawString(trans("132","Pipe is loose."), 10, 16, 16448255); if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 2) != 0) - fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255); + fontRendererObj.drawString(trans("133","Screws are missing."), 10, 24, 16448255); if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 4) != 0) - fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255); + fontRendererObj.drawString(trans("134","Something is stuck."), 10, 32, 16448255); if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 8) != 0) - fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255); + fontRendererObj.drawString(trans("135","Platings are dented."), 10, 40, 16448255); if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 16) != 0) - fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255); + fontRendererObj.drawString(trans("136","Circuitry burned out."), 10, 48, 16448255); if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 32) != 0) - fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255); + fontRendererObj.drawString(trans("137","That doesn't belong there."), 10, 56, 16448255); if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 64) != 0) - fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255); + fontRendererObj.drawString(trans("138","Incomplete Structure."), 10, 64, 16448255); if (((GT_Container_MultiMachine) mContainer).mDisplayErrorCode == 0) { if (((GT_Container_MultiMachine) mContainer).mActive == 0) { - fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255); - fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255); - fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255); + fontRendererObj.drawString(trans("139","Hit with Soft Hammer"), 10, 16, 16448255); + fontRendererObj.drawString(trans("140","to (re-)start the Machine"), 10, 24, 16448255); + fontRendererObj.drawString(trans("141","if it doesn't start."), 10, 32, 16448255); } else { - fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255); + fontRendererObj.drawString(trans("142","Running perfectly."), 10, 16, 16448255); } int id = mContainer.mTileEntity.getMetaTileID(); if(id == 1157 || id == 1158){ ItemStack tItem = mContainer.mTileEntity.getMetaTileEntity().getStackInSlot(1); if(tItem==null || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L))){ - fontRendererObj.drawString("Missing Mining Pipe", 10,((GT_Container_MultiMachine) mContainer).mActive == 0 ? 40 : 24, 16448255); + fontRendererObj.drawString(trans("143","Missing Mining Pipe"), 10,((GT_Container_MultiMachine) mContainer).mActive == 0 ? 40 : 24, 16448255); } }else if(id == 1131 || id == 1151 || id == 1152 || id == 1153){ ItemStack tItem = mContainer.mTileEntity.getMetaTileEntity().getStackInSlot(1); if(tItem==null || !(tItem.getItem()==GT_MetaGenerated_Tool_01.INSTANCE&&tItem.getItemDamage()>=170&&tItem.getItemDamage()<=177)){ - fontRendererObj.drawString("Missing Turbine Rotor", 10, ((GT_Container_MultiMachine) mContainer).mActive == 0 ? 40 : 24, 16448255); + fontRendererObj.drawString(trans("144","Missing Turbine Rotor"), 10, ((GT_Container_MultiMachine) mContainer).mActive == 0 ? 40 : 24, 16448255); } } } } + } + + public String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); } @Override diff --git a/src/main/java/gregtech/api/interfaces/IToolStats.java b/src/main/java/gregtech/api/interfaces/IToolStats.java index 3c03bb8563..70aaeb206b 100644 --- a/src/main/java/gregtech/api/interfaces/IToolStats.java +++ b/src/main/java/gregtech/api/interfaces/IToolStats.java @@ -8,6 +8,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; +import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; import java.util.List; @@ -156,4 +157,6 @@ public interface IToolStats { public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack); public short[] getRGBa(boolean aIsToolHead, ItemStack aStack); + + public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, int aX, int aY, int aZ); }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 64c5072c39..356c407985 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -379,6 +379,8 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand public void onColorChangeClient(byte aColor); public int getLightOpacity(); + + public boolean allowGeneralRedstoneOutput(); public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider); @@ -390,4 +392,8 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * The onCreated Function of the Item Class redirects here */ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer); + + public boolean hasAlternativeModeText(); + + public String getAlternativeModeText(); }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index b62ed4500b..63020684c0 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -1,8 +1,10 @@ package gregtech.api.interfaces.tileentity; import cofh.api.energy.IEnergyReceiver; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; import ic2.api.energy.tile.IEnergySink; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; @@ -85,6 +87,8 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd GT_Utility.sendSoundToPlayers(tWorld, GregTech_API.sSoundList.get(209), 1.0F, -1, tX, tY, tZ); tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) + if(GT_Mod.gregtechproxy.mPollution) + GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX,tZ), 100000); tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); } } diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java index baa5d23b4c..0b12df13c4 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java @@ -1,6 +1,7 @@ package gregtech.api.items; import buildcraft.api.tools.IToolWrench; +import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -42,6 +43,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.IShearable; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.world.BlockEvent; import java.util.ArrayList; @@ -208,12 +210,20 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements /** * Called by the Block Harvesting Event within the GT_Proxy */ + @Mod.EventHandler public void onHarvestBlockEvent(ArrayList<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { IToolStats tStats = getToolStats(aStack); if (isItemStackUsable(aStack) && getDigSpeed(aStack, aBlock, aMetaData) > 0.0F) doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion()); } + @Mod.EventHandler + public float onBlockBreakSpeedEvent(float aDefault, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, PlayerEvent.BreakSpeed aEvent) + { + IToolStats tStats = getToolStats(aStack); + return tStats == null ? aDefault : tStats.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, aPlayer.worldObj, aX, aY, aZ); + } + @Override public boolean onBlockStartBreak(ItemStack aStack, int aX, int aY, int aZ, EntityPlayer aPlayer) { diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 01ca8c0f7b..336c9234fc 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -807,7 +807,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { if (mWorks) disableWorking(); else enableWorking(); - GT_Utility.sendChatToPlayer(aPlayer, "Machine Processing: " + (isAllowedToWork() ? "Enabled" : "Disabled")); + GT_Utility.sendChatToPlayer(aPlayer, trans("090","Machine Processing: ") + (isAllowedToWork() ? trans("088","Enabled") : trans("087","Disabled"))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord); } return true; @@ -816,7 +816,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) { if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mStrongRedstone ^= (1 << tSide); - GT_Utility.sendChatToPlayer(aPlayer, "Redstone Output at Side " + tSide + " set to: " + ((mStrongRedstone & (1 << tSide)) != 0 ? "Strong" : "Weak")); + GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak"))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord); } return true; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 4aa49a954c..fc46874480 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -65,7 +65,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE private long mTickTimer = 0, oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE; private String mOwnerName = ""; private NBTTagCompound mRecipeStuff = new NBTTagCompound(); - + private static final Field ENTITY_ITEM_HEALTH_FIELD; static { @@ -167,8 +167,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } else { if (aID <= 0) mID = (short) aNBT.getInteger("mID"); else mID = aID; - mStoredSteam = aNBT.getInteger("mStoredSteam"); - mStoredEnergy = aNBT.getInteger("mStoredEnergy"); + mStoredSteam = aNBT.getLong("mStoredSteam"); + mStoredEnergy = aNBT.getLong("mStoredEnergy"); mColor = aNBT.getByte("mColor"); mLightValue = aNBT.getByte("mLightValue"); mWorkData = aNBT.getByte("mWorkData"); @@ -1146,7 +1146,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } } } - GT_Pollution.addPollution(getWorld(), new ChunkPosition(getXCoord(), getYCoord(), getZCoord()), 100000); + + GT_Pollution.addPollution(this, 100000); mMetaTileEntity.doExplosion(aAmount); } } @@ -1238,7 +1239,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { mInputDisabled = !mInputDisabled; if (mInputDisabled) mOutputDisabled = !mOutputDisabled; - GT_Utility.sendChatToPlayer(aPlayer, "Auto-Input: " + (mInputDisabled ? "Disabled" : "Enabled") + " Auto-Output: " + (mOutputDisabled ? "Disabled" : "Enabled")); + GT_Utility.sendChatToPlayer(aPlayer, trans("086","Auto-Input: ") + (mInputDisabled ? trans("087","Disabled") : trans("088","Enabled") + trans("089"," Auto-Output: ") + (mOutputDisabled ? trans("087","Disabled") : trans("088","Enabled")))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord); } return true; @@ -1247,8 +1248,11 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { if (mWorks) disableWorking(); - else enableWorking(); - GT_Utility.sendChatToPlayer(aPlayer, "Machine Processing: " + (isAllowedToWork() ? "Enabled" : "Disabled")); + else enableWorking();{ + String tChat = trans("090","Machine Processing: ") + (isAllowedToWork() ? trans("088","Enabled") : trans("087","Disabled")); + if(getMetaTileEntity() !=null && getMetaTileEntity().hasAlternativeModeText()) + tChat = getMetaTileEntity().getAlternativeModeText(); + GT_Utility.sendChatToPlayer(aPlayer, tChat);} GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord); } return true; @@ -1258,7 +1262,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mStrongRedstone ^= (1 << tSide); - GT_Utility.sendChatToPlayer(aPlayer, "Redstone Output at Side " + tSide + " set to: " + ((mStrongRedstone & (1 << tSide)) != 0 ? "Strong" : "Weak")); + GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak"))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord); } return true; @@ -1413,7 +1417,12 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE @Override public byte getOutputRedstoneSignal(byte aSide) { - return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : 0; + return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : getGeneralRS(aSide); + } + + public byte getGeneralRS(byte aSide){ + if(mMetaTileEntity==null)return 0; + return mMetaTileEntity.allowGeneralRedstoneOutput() ? mSidedRedstone[aSide] : 0; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java index 02f18ecaec..66d1ade42d 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java @@ -3,6 +3,7 @@ package gregtech.api.metatileentity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.net.GT_Packet_Block_Event; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -437,4 +438,8 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public void markDirty() {/* Do not do the super Function */} + + public String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index b34483c31b..f0d70255a7 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -2,6 +2,7 @@ package gregtech.api.metatileentity; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -9,6 +10,7 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.IIconRegister; @@ -644,8 +646,9 @@ public abstract class MetaPipeEntity implements IMetaTileEntity { int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord(); World tWorld = getBaseMetaTileEntity().getWorld(); tWorld.setBlock(tX, tY, tZ, Blocks.air); - if (GregTech_API.sMachineExplosions) + if (GregTech_API.sMachineExplosions) { tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); + } } @Override @@ -673,4 +676,19 @@ public abstract class MetaPipeEntity implements IMetaTileEntity { public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { // } + + @Override + public boolean allowGeneralRedstoneOutput() { + return false; + } + + @Override + public boolean hasAlternativeModeText() { + return false; + } + + @Override + public String getAlternativeModeText() { + return ""; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 662dc59d80..884ceac8ba 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -863,4 +863,23 @@ public abstract class MetaTileEntity implements IMetaTileEntity { public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { // } + + @Override + public boolean allowGeneralRedstoneOutput(){ + return false; + } + + public String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); + } + + @Override + public boolean hasAlternativeModeText(){ + return false; + } + + @Override + public String getAlternativeModeText(){ + return ""; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index fdb3c0da8b..c8a3d1e591 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -11,12 +11,14 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable; import gregtech.api.interfaces.tileentity.IColoredTileEntity; +import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IEnergyConnected; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; import ic2.api.energy.tile.IEnergySink; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -80,13 +82,17 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )}; if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.37F) + if (tThickNess < 0.124F) + return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + if (tThickNess < 0.374F)//0.375 x1 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; - if (tThickNess < 0.49F) + if (tThickNess < 0.499F)//0.500 x2 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; - if (tThickNess < 0.74F) + if (tThickNess < 0.624F)//0.625 x4 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; - if (tThickNess < 0.99F) + if (tThickNess < 0.749F)//0.750 x8 + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + if (tThickNess < 0.874F)//0.825 x12 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; } @@ -101,8 +107,30 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); - return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D); + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override @@ -251,7 +279,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile } } } - } + }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate(); } @Override @@ -275,6 +303,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public float getThickNess() { + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F; return mThickNess; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java index effff677d7..9131f21f8f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Dyes; import gregtech.api.enums.ItemList; @@ -16,6 +17,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -74,13 +76,15 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.37F) + if (tThickNess < 0.124F) + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; + if (tThickNess < 0.374F)//0.375 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.49F) + if (tThickNess < 0.499F)//0.500 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.74F) + if (tThickNess < 0.749F)//0.750 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.99F) + if (tThickNess < 0.874F)//0.825 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; } @@ -143,7 +147,30 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D); + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override @@ -269,7 +296,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { } oLastReceivedFrom = mLastReceivedFrom; - } + }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate(); } @Override @@ -386,6 +413,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public float getThickNess() { + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F; return mThickNess; } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java index e08ae2fb1a..cf405b3639 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -10,6 +11,7 @@ import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -17,6 +19,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import java.util.concurrent.ConcurrentHashMap; @@ -72,13 +77,15 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE if (mIsRestrictive) { if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.37F) + if (tThickNess < 0.124F) + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; + if (tThickNess < 0.374F)//0.375 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; - if (tThickNess < 0.49F) + if (tThickNess < 0.499F)//0.500 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; - if (tThickNess < 0.74F) + if (tThickNess < 0.749F)//0.750 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; - if (tThickNess < 0.99F) + if (tThickNess < 0.874F)//0.825 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; } @@ -86,13 +93,15 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE } if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.37F) + if (tThickNess < 0.124F) + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; + if (tThickNess < 0.374F)//0.375 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.49F) + if (tThickNess < 0.499F)//0.500 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.74F) + if (tThickNess < 0.749F)//0.750 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.99F) + if (tThickNess < 0.874F)//0.825 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; } @@ -217,7 +226,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE if (isInventoryEmpty()) mLastReceivedFrom = 6; oLastReceivedFrom = mLastReceivedFrom; - } + }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate(); } @Override @@ -306,6 +315,36 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public float getThickNess() { + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F; return mThickNess; } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); + + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index 76b2e9aaf5..73d3c19a6b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -203,8 +203,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) { long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), - 10 * getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(),10 * getPollution()); mFluid.amount -= tFluidAmountToUse * tConsumed; } } @@ -216,8 +215,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), - 10 * getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(),10 * getPollution()); } } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index fc4ecfeea9..9114780b2f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -346,7 +346,17 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - aBaseMetaTileEntity.openGUI(aPlayer); + if(!GT_Mod.gregtechproxy.mForceFreeFace) { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + for(byte i=0;i < 6; i++){ + if(aBaseMetaTileEntity.getAirAtSide(i)){ + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + } + GT_Utility.sendChatToPlayer(aPlayer,"No free Side!"); return true; } @@ -701,7 +711,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) { mAllowInputFromOutputSide = !mAllowInputFromOutputSide; - GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? "Input from Output Side allowed" : "Input from Output Side forbidden"); + GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? trans("095","Input from Output Side allowed") : trans("096","Input from Output Side forbidden")); } } @@ -741,11 +751,33 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B * @return see constants above */ public int checkRecipe() { + return checkRecipe(false); + } + + public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId){ + return //TODO check or get a better solution + DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit") || + DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space") || + DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids") || + DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS") || + DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation"); + } + + + /** + * + * @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method... + * @return + */ + public int checkRecipe(boolean skipOC){ GT_Recipe_Map tMap = getRecipeList(); if (tMap == null) return DID_NOT_FIND_RECIPE; GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; - if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && !(DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().endsWith("Orbit")||DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().endsWith("Space"))) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && + !isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId)) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; if (!canOutput(tRecipe)) { mOutputBlocked++; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java index abbf5b7ee5..3fcef913aa 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -212,9 +212,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM mTargetStackSize = (byte) ((mTargetStackSize + (aPlayer.isSneaking()? -1 : 1)) % 65); if(mTargetStackSize <0){mTargetStackSize = 64;} if (mTargetStackSize == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Do not regulate Item Stack Size"); + GT_Utility.sendChatToPlayer(aPlayer, trans("098","Do not regulate Item Stack Size")); } else { - GT_Utility.sendChatToPlayer(aPlayer, "Regulate Item Stack Size to: " + mTargetStackSize); + GT_Utility.sendChatToPlayer(aPlayer, trans("099","Regulate Item Stack Size to: " + mTargetStackSize)); } } } @@ -256,4 +256,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aSide != aBaseMetaTileEntity.getBackFacing(); } + + @Override + public boolean allowGeneralRedstoneOutput(){ + return true; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index dde8d7cf4f..1209b9c582 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -1,14 +1,18 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { @@ -69,7 +73,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public boolean polluteEnvironment() { if (getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing())) { - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), calculatePollutionReduction(10000)); + GT_Pollution.addPollution(getBaseMetaTileEntity(), calculatePollutionReduction(10000)); return true; } return false; @@ -88,4 +92,57 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if(aBaseMetaTileEntity.isClientSide() && this.getBaseMetaTileEntity().isActive()) + pollutionParticles(this.getBaseMetaTileEntity().getWorld(),"largesmoke"); + } + + private static XSTR floatGen=new XSTR(); + + public void pollutionParticles(World aWorld,String name){ + boolean chk1,chk2,chk3; + float ran1=floatGen.nextFloat(),ran2=0,ran3=0; + chk1=ran1*100<calculatePollutionReduction(100); + if(GT_Pollution.getPollution(getBaseMetaTileEntity())>= GT_Mod.gregtechproxy.mPollutionSmogLimit){ + ran2=floatGen.nextFloat(); + ran3=floatGen.nextFloat(); + chk2=ran2*100<calculatePollutionReduction(100); + chk3=ran3*100<calculatePollutionReduction(100); + if(!(chk1||chk2||chk3))return; + }else{ + if(!chk1)return; + chk2=chk3=false; + } + + IGregTechTileEntity aMuffler=this.getBaseMetaTileEntity(); + ForgeDirection aDir=ForgeDirection.getOrientation(aMuffler.getFrontFacing()); + float xPos=aDir.offsetX*0.76F+aMuffler.getXCoord()+0.25F; + float yPos=aDir.offsetY*0.76F+aMuffler.getYCoord()+0.25F; + float zPos=aDir.offsetZ*0.76F+aMuffler.getZCoord()+0.25F; + + float ySpd=aDir.offsetY*0.1F+0.2F+0.1F*floatGen.nextFloat(); + float xSpd; + float zSpd; + + if(aDir.offsetY==-1){ + float temp=floatGen.nextFloat()*2*(float)Math.PI; + xSpd=(float)Math.sin(temp)*0.1F; + zSpd=(float)Math.cos(temp)*0.1F; + }else{ + xSpd=aDir.offsetX*(0.1F+0.2F*floatGen.nextFloat()); + zSpd=aDir.offsetZ*(0.1F+0.2F*floatGen.nextFloat()); + } + + if(chk1) + aWorld.spawnParticle(name, xPos + ran1*0.5F, yPos + floatGen.nextFloat()*0.5F, zPos + floatGen.nextFloat()*0.5F, xSpd, ySpd, zSpd); + + if(chk2) + aWorld.spawnParticle(name, xPos + ran2*0.5F, yPos + floatGen.nextFloat()*0.5F, zPos + floatGen.nextFloat()*0.5F, xSpd, ySpd, zSpd); + + if(chk3) + aWorld.spawnParticle(name, xPos + ran3*0.5F, yPos + floatGen.nextFloat()*0.5F, zPos + floatGen.nextFloat()*0.5F, xSpd, ySpd, zSpd); + } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java index 8221290459..843cb319b6 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java @@ -5,6 +5,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -155,31 +156,35 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch { mMode = (byte) ((mMode + 1) % 8); switch (mMode) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Liquids, Steam and Items"); + GT_Utility.sendChatToPlayer(aPlayer, trans("108","Outputs Liquids, Steam and Items")); break; case 1: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam and Items"); + GT_Utility.sendChatToPlayer(aPlayer, trans("109","Outputs Steam and Items")); break; case 2: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam and Liquids"); + GT_Utility.sendChatToPlayer(aPlayer, trans("110","Outputs Steam and Liquids")); break; case 3: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam"); + GT_Utility.sendChatToPlayer(aPlayer, trans("111","Outputs Steam")); break; case 4: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Liquids and Items"); + GT_Utility.sendChatToPlayer(aPlayer, trans("112","Outputs Liquids and Items")); break; case 5: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs only Items"); + GT_Utility.sendChatToPlayer(aPlayer, trans("113","Outputs only Items")); break; case 6: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs only Liquids"); + GT_Utility.sendChatToPlayer(aPlayer, trans("114","Outputs only Liquids")); break; case 7: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs nothing"); + GT_Utility.sendChatToPlayer(aPlayer, trans("115","Outputs nothing")); break; } } + + public String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); + } public boolean outputsSteam() { return mMode < 4; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 5e06b743d1..963aa2926d 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -16,6 +16,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; import gregtech.common.items.GT_MetaGenerated_Tool_01; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -490,6 +491,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { } public void explodeMultiblock() { + GT_Pollution.addPollution(getBaseMetaTileEntity(), 300000); mInventory[1] = null; for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java index 9320c6d8b4..83497797ea 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java @@ -205,5 +205,15 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; + } + + @Override + public boolean hasAlternativeModeText(){ + return true; + } + + @Override + public String getAlternativeModeText(){ + return (getBaseMetaTileEntity().isAllowedToWork() ? trans("145","Step Down, In: ") : trans("146","Step Up, In"))+maxEUInput()+trans("148","V@")+maxAmperesIn()+trans("147","Amp, Out: ")+maxEUOutput()+"V@"+maxAmperesOut()+trans("149","Amp"); } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/net/GT_Packet_Pollution.java b/src/main/java/gregtech/api/net/GT_Packet_Pollution.java new file mode 100644 index 0000000000..e403cae4e9 --- /dev/null +++ b/src/main/java/gregtech/api/net/GT_Packet_Pollution.java @@ -0,0 +1,43 @@ +package gregtech.api.net; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; + +import gregtech.common.GT_Pollution; +import net.minecraft.world.IBlockAccess; + +public class GT_Packet_Pollution extends GT_Packet { + private int mPollution; + + public GT_Packet_Pollution() { + super(true); + } + + public GT_Packet_Pollution(int aPollution) { + super(false); + mPollution = aPollution; + } + + @Override + public byte[] encode() { + ByteArrayDataOutput tOut = ByteStreams.newDataOutput(4); + tOut.writeInt(mPollution); + return tOut.toByteArray(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput aData) { + return new GT_Packet_Pollution(aData.readInt()); + } + + @Override + public void process(IBlockAccess aWorld) { + GT_Pollution.mPlayerPollution = mPollution; + } + + @Override + public byte getPacketID() { + return 4; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_Cover_Default.java b/src/main/java/gregtech/api/objects/GT_Cover_Default.java index bf3bc84497..fa6d3bcc26 100644 --- a/src/main/java/gregtech/api/objects/GT_Cover_Default.java +++ b/src/main/java/gregtech/api/objects/GT_Cover_Default.java @@ -22,7 +22,7 @@ public class GT_Cover_Default extends GT_CoverBehavior { @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = ((aCoverVariable + 1) & 15); - GT_Utility.sendChatToPlayer(aPlayer, ((aCoverVariable & 1) != 0 ? "Redstone " : "") + ((aCoverVariable & 2) != 0 ? "Energy " : "") + ((aCoverVariable & 4) != 0 ? "Fluids " : "") + ((aCoverVariable & 8) != 0 ? "Items " : "")); + GT_Utility.sendChatToPlayer(aPlayer, ((aCoverVariable & 1) != 0 ? trans("128", "Redstone ") : "") + ((aCoverVariable & 2) != 0 ? trans("129", "Energy ") : "") + ((aCoverVariable & 4) != 0 ? trans("130", "Fluids ") : "") + ((aCoverVariable & 8) != 0 ? trans("131", "Items ") : "")); return aCoverVariable; } diff --git a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java b/src/main/java/gregtech/api/objects/GT_UO_Dimension.java index ffad72868c..657e9353c6 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java +++ b/src/main/java/gregtech/api/objects/GT_UO_Dimension.java @@ -18,7 +18,7 @@ public class GT_UO_Dimension { private int maxChance; public String Dimension = "null"; - public GT_UO_Dimension(ConfigCategory aConfigCategory) { + public GT_UO_Dimension(ConfigCategory aConfigCategory) {//TODO CONFIGURE fFluids = HashBiMap.create(); if (aConfigCategory.containsKey("Dimension")) { @@ -35,18 +35,14 @@ public class GT_UO_Dimension { } public GT_UO_Fluid getRandomFluid (Random aRandom) { - int random = aRandom.nextInt(3); - random = aRandom.nextInt(1000); - int step = 0; + int random = aRandom.nextInt(1000); for (BiMap.Entry<String, GT_UO_Fluid> fl : fFluids.entrySet()) { int chance = fl.getValue().Chance*1000/maxChance; if (random<=chance) return fl.getValue(); //System.out.println("GT UO "+fl.getValue().Registry+" Chance:"+chance+" Random:"+random); random-=chance; } - return null; - } } diff --git a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java index 89340132be..ce3bdc51cb 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java +++ b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java @@ -2,9 +2,9 @@ package gregtech.api.objects; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; - import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Log; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; @@ -48,15 +48,16 @@ public class GT_UO_DimensionList { fConfig.get(Category, "MaxAmount", aMaxAmount).getInt(aMaxAmount); fConfig.get(Category, "Chance", aChance).getInt(aChance); fConfig.get(Category, "DecreasePerOperationAmount", aDecreasePerOperationAmount).getInt(aDecreasePerOperationAmount); + //IT IS IN BUCKETS!!! } public void SetDafultValues() { - SetConfigValues("Overworld", "0", "gas_natural_gas", "gas_natural_gas", 0, 625, 20, 5); - SetConfigValues("Overworld", "0", "liquid_light_oil", "liquid_light_oil", 0, 625, 20, 5); + SetConfigValues("Overworld", "0", "gas_natural_gas", "gas_natural_gas", 0, 625, 20, 7); + SetConfigValues("Overworld", "0", "liquid_light_oil", "liquid_light_oil", 0, 625, 20, 6); SetConfigValues("Overworld", "0", "liquid_medium_oil", "liquid_medium_oil", 0, 625, 20, 5); - SetConfigValues("Overworld", "0", "liquid_heavy_oil", "liquid_heavy_oil", 0, 625, 20, 5); + SetConfigValues("Overworld", "0", "liquid_heavy_oil", "liquid_heavy_oil", 0, 625, 20, 4); SetConfigValues("Overworld", "0", "oil", "oil", 0, 625, 20, 5); - SetConfigValues("Moon", "Moon", "helium-3", "helium-3", 0, 375, 100, 5); + SetConfigValues("Moon", "Moon", "helium-3", "helium-3", 24, 128, 100, 1); } public void getConfig(Configuration aConfig, String aCategory) { @@ -65,7 +66,7 @@ public class GT_UO_DimensionList { if (!fConfig.hasCategory(fCategory)) SetDafultValues(); - fConfig.setCategoryComment(fCategory, "Config Undeground Fluids (Delete this Category for regenerate)"); + fConfig.setCategoryComment(fCategory, "Config Underground Fluids (Delete this Category for regenerate)"); fConfig.setCategoryComment(fCategory+".Default", "Set Default Generating (Use this Category for Default settings)"); fConfig.setCategoryComment(fCategory+".Overworld", "Set Overworld Generating"); fConfig.setCategoryComment(fCategory+".Moon", "Set Moon Generating"); diff --git a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java index c2d9b70bd2..5eea9c323f 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java +++ b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java @@ -9,6 +9,10 @@ import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; +import java.util.Random; + +import static gregtech.common.GT_UndergroundOil.DIVIDER; + public class GT_UO_Fluid { public String Registry = "null"; public int MaxAmount = 0; @@ -19,27 +23,27 @@ public class GT_UO_Fluid { public GT_UO_Fluid(ConfigCategory aConfigCategory) { if (aConfigCategory.containsKey("Registry")) { - aConfigCategory.get("Registry").comment = "Fluid registry"; + aConfigCategory.get("Registry").comment = "Fluid registry name"; Registry = aConfigCategory.get("Registry").getString(); } if (aConfigCategory.containsKey("MaxAmount")) { - aConfigCategory.get("MaxAmount").comment = "Max amount generation (per operation Amount)"; + aConfigCategory.get("MaxAmount").comment = "Max amount generation (per operation, sets the VeinData) 80000 MAX"; MaxAmount = aConfigCategory.get("MaxAmount").getInt(0); } if (aConfigCategory.containsKey("MinAmount")) { - aConfigCategory.get("MinAmount").comment = "Max amount generation (per operation Amount)"; + aConfigCategory.get("MinAmount").comment = "Min amount generation (per operation, sets the VeinData) 0 MIN"; MinAmount = aConfigCategory.get("MinAmount").getInt(0); } if (aConfigCategory.containsKey("Chance")) { - aConfigCategory.get("Chance").comment = "Chance generating"; + aConfigCategory.get("Chance").comment = "Chance generating (weighted chance!, there will be a fluid in chunk always!)"; Chance = aConfigCategory.get("Chance").getInt(0); } if (aConfigCategory.containsKey("DecreasePerOperationAmount")) { - aConfigCategory.get("DecreasePerOperationAmount").comment = "Decrease per operation Amount (X/5000L per operation)"; + aConfigCategory.get("DecreasePerOperationAmount").comment = "Decrease per operation (actual fluid gained works like (Litre)VeinData/5000)"; DecreasePerOperationAmount = aConfigCategory.get("DecreasePerOperationAmount").getInt(5); } //System.out.println("GT UO "+aConfigCategory.getName()+" Fluid:"+Registry+" Max:"+MaxAmount+" Min:"+MinAmount+" Chance:"+Chance); @@ -53,11 +57,10 @@ public class GT_UO_Fluid { } } - public int getRandomAmount(Random aRandom){ - int r1 = (int)Math.round(Math.pow((MaxAmount-MinAmount)*500000.d, 0.2)); - int r2 = (int)Math.floor(Math.pow(MinAmount*500000.d, 0.2)); - double amount = aRandom.nextInt(r1)+r2+aRandom.nextDouble(); - return (int) (Math.pow(amount, 5) / 100); + public int getRandomAmount(Random aRandom){//generates some random ass number that correlates to extraction speeds + int div = (int)Math.floor(Math.pow((MaxAmount-MinAmount)*100.d*DIVIDER, 0.2d)); + int min = (int)Math.floor(Math.pow(MinAmount*100.d*DIVIDER, 0.2d)); + double amount = min+aRandom.nextInt(div)+aRandom.nextDouble(); + return (int) (Math.pow(amount, 5) / 100);//reverses the computation above } - }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_CoverBehavior.java b/src/main/java/gregtech/api/util/GT_CoverBehavior.java index f3ba021ad1..a540601dd1 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehavior.java +++ b/src/main/java/gregtech/api/util/GT_CoverBehavior.java @@ -215,4 +215,8 @@ public abstract class GT_CoverBehavior { public void placeCover(byte aSide, ItemStack aCover, ICoverable aTileEntity) { aTileEntity.setCoverIDAtSide(aSide, GT_Utility.stackToInt(aCover)); } + + public String trans(String aNr, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aNr, aEnglish, false); + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java index 561d47edf7..e697bbc4ad 100644 --- a/src/main/java/gregtech/api/util/GT_LanguageManager.java +++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java @@ -104,4 +104,219 @@ public class GT_LanguageManager { } return aStack.getUnlocalizedName() + ".name"; } + + public static void writePlaceholderStrings(){ + addStringLocalization("Interaction_DESCRIPTION_Index_001", "Puts out into adjacent Slot #"); + addStringLocalization("Interaction_DESCRIPTION_Index_002", "Grabs in for own Slot #"); + addStringLocalization("Interaction_DESCRIPTION_Index_003", "Normal"); + addStringLocalization("Interaction_DESCRIPTION_Index_004", "Inverted"); + addStringLocalization("Interaction_DESCRIPTION_Index_005", "No Work at all"); + addStringLocalization("Interaction_DESCRIPTION_Index_006", "Export"); + addStringLocalization("Interaction_DESCRIPTION_Index_007", "Import"); + addStringLocalization("Interaction_DESCRIPTION_Index_008", "Export (conditional)"); + addStringLocalization("Interaction_DESCRIPTION_Index_009", "Import (conditional)"); + addStringLocalization("Interaction_DESCRIPTION_Index_010", "Export (invert cond)"); + addStringLocalization("Interaction_DESCRIPTION_Index_011", "Import (invert cond)"); + addStringLocalization("Interaction_DESCRIPTION_Index_012", "Export allow Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_013", "Import allow Output"); + addStringLocalization("Interaction_DESCRIPTION_Index_014", "Export allow Input (conditional)"); + addStringLocalization("Interaction_DESCRIPTION_Index_015", "Import allow Output (conditional)"); + addStringLocalization("Interaction_DESCRIPTION_Index_016", "Export allow Input (invert cond)"); + addStringLocalization("Interaction_DESCRIPTION_Index_017", "Import allow Output (invert cond)"); + addStringLocalization("Interaction_DESCRIPTION_Index_018", "Normal"); + addStringLocalization("Interaction_DESCRIPTION_Index_019", "Inverted"); + addStringLocalization("Interaction_DESCRIPTION_Index_020", "Ready to work"); + addStringLocalization("Interaction_DESCRIPTION_Index_021", "Not ready to work"); + addStringLocalization("Interaction_DESCRIPTION_Index_022", "Import"); + addStringLocalization("Interaction_DESCRIPTION_Index_023", "Import (conditional)"); + addStringLocalization("Interaction_DESCRIPTION_Index_024", "Import (invert cond)"); + addStringLocalization("Interaction_DESCRIPTION_Index_025", "Keep Liquids Away"); + addStringLocalization("Interaction_DESCRIPTION_Index_026", "Keep Liquids Away (conditional)"); + addStringLocalization("Interaction_DESCRIPTION_Index_027", "Keep Liquids Away (invert cond)"); + addStringLocalization("Interaction_DESCRIPTION_Index_028", "Allow"); + addStringLocalization("Interaction_DESCRIPTION_Index_029", "Allow (conditional)"); + addStringLocalization("Interaction_DESCRIPTION_Index_030", "Disallow (conditional)"); + addStringLocalization("Interaction_DESCRIPTION_Index_031", "Normal Universal Storage"); + addStringLocalization("Interaction_DESCRIPTION_Index_032", "Inverted Universal Storage"); + addStringLocalization("Interaction_DESCRIPTION_Index_033", "Normal Electricity Storage"); + addStringLocalization("Interaction_DESCRIPTION_Index_034", "Inverted Electricity Storage"); + addStringLocalization("Interaction_DESCRIPTION_Index_035", "Normal Steam Storage"); + addStringLocalization("Interaction_DESCRIPTION_Index_036", "Inverted Steam Storage"); + addStringLocalization("Interaction_DESCRIPTION_Index_037", "Normal Average Electric Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_038", "Inverted Average Electric Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_039", "Normal Average Electric Output"); + addStringLocalization("Interaction_DESCRIPTION_Index_040", "Inverted Average Electric Output"); + addStringLocalization("Interaction_DESCRIPTION_Index_041", "Normal Electricity Storage(Including Batteries)"); + addStringLocalization("Interaction_DESCRIPTION_Index_042", "Inverted Electricity Storage(Including Batteries)"); + addStringLocalization("Interaction_DESCRIPTION_Index_043", "Allow input, no output"); + addStringLocalization("Interaction_DESCRIPTION_Index_044", "Deny input, no output"); + addStringLocalization("Interaction_DESCRIPTION_Index_045", "Allow input, permit any output"); + addStringLocalization("Interaction_DESCRIPTION_Index_046", "Deny input, permit any output"); + addStringLocalization("Interaction_DESCRIPTION_Index_047", "Filter Fluid: "); + addStringLocalization("Interaction_DESCRIPTION_Index_048", "Pump speed: "); + addStringLocalization("Interaction_DESCRIPTION_Index_049", "L/tick "); + addStringLocalization("Interaction_DESCRIPTION_Index_050", "L/sec"); + addStringLocalization("Interaction_DESCRIPTION_Index_051", "Normal"); + addStringLocalization("Interaction_DESCRIPTION_Index_052", "Inverted"); + addStringLocalization("Interaction_DESCRIPTION_Index_053", "Slot: "); + addStringLocalization("Interaction_DESCRIPTION_Index_054", "Inverted"); + addStringLocalization("Interaction_DESCRIPTION_Index_055", "Normal"); + addStringLocalization("Interaction_DESCRIPTION_Index_056", "Emit if 1 Maintenance Needed"); + addStringLocalization("Interaction_DESCRIPTION_Index_057", "Emit if 1 Maintenance Needed(inverted)"); + addStringLocalization("Interaction_DESCRIPTION_Index_058", "Emit if 2 Maintenance Needed"); + addStringLocalization("Interaction_DESCRIPTION_Index_059", "Emit if 2 Maintenance Needed(inverted)"); + addStringLocalization("Interaction_DESCRIPTION_Index_060", "Emit if 3 Maintenance Needed"); + addStringLocalization("Interaction_DESCRIPTION_Index_061", "Emit if 3 Maintenance Needed(inverted)"); + addStringLocalization("Interaction_DESCRIPTION_Index_062", "Emit if 4 Maintenance Needed"); + addStringLocalization("Interaction_DESCRIPTION_Index_063", "Emit if 4 Maintenance Needed(inverted)"); + addStringLocalization("Interaction_DESCRIPTION_Index_064", "Emit if 5 Maintenance Needed"); + addStringLocalization("Interaction_DESCRIPTION_Index_065", "Emit if 5 Maintenance Needed(inverted)"); + addStringLocalization("Interaction_DESCRIPTION_Index_066", "Emit if rotor needs maintainance"); + addStringLocalization("Interaction_DESCRIPTION_Index_067", "Emit if rotor needs maintainance(inverted)"); + addStringLocalization("Interaction_DESCRIPTION_Index_068", "Emit if any Player is close"); + addStringLocalization("Interaction_DESCRIPTION_Index_069", "Emit if other player is close"); + addStringLocalization("Interaction_DESCRIPTION_Index_070", "Emit if you are close"); + addStringLocalization("Interaction_DESCRIPTION_Index_071", "Conducts strongest Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_072", "Conducts from bottom Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_073", "Conducts from top Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_074", "Conducts from north Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_075", "Conducts from south Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_076", "Conducts from west Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_077", "Conducts from east Input"); + addStringLocalization("Interaction_DESCRIPTION_Index_078", "Signal = "); + addStringLocalization("Interaction_DESCRIPTION_Index_079", "Conditional Signal = "); + addStringLocalization("Interaction_DESCRIPTION_Index_080", "Inverted Conditional Signal = "); + addStringLocalization("Interaction_DESCRIPTION_Index_081", "Frequency: "); + addStringLocalization("Interaction_DESCRIPTION_Index_082", "Open if work enabled"); + addStringLocalization("Interaction_DESCRIPTION_Index_083", "Open if work disabled"); + addStringLocalization("Interaction_DESCRIPTION_Index_084", "Only Output allowed"); + addStringLocalization("Interaction_DESCRIPTION_Index_085", "Only Input allowed"); + addStringLocalization("Interaction_DESCRIPTION_Index_086", "Auto-Input: "); + addStringLocalization("Interaction_DESCRIPTION_Index_087", "Disabled"); + addStringLocalization("Interaction_DESCRIPTION_Index_088", "Enabled"); + addStringLocalization("Interaction_DESCRIPTION_Index_089", " Auto-Output: "); + addStringLocalization("Interaction_DESCRIPTION_Index_090", "Machine Processing: "); + addStringLocalization("Interaction_DESCRIPTION_Index_091", "Redstone Output at Side "); + addStringLocalization("Interaction_DESCRIPTION_Index_092", " set to: "); + addStringLocalization("Interaction_DESCRIPTION_Index_093", "Strong"); + addStringLocalization("Interaction_DESCRIPTION_Index_094", "Weak"); + addStringLocalization("Interaction_DESCRIPTION_Index_095", "Input from Output Side allowed"); + addStringLocalization("Interaction_DESCRIPTION_Index_096", "Input from Output Side forbidden"); + addStringLocalization("Interaction_DESCRIPTION_Index_097", "It's dangerous to go alone! Take this."); + addStringLocalization("Interaction_DESCRIPTION_Index_098", "Do not regulate Item Stack Size"); + addStringLocalization("Interaction_DESCRIPTION_Index_099", "Regulate Item Stack Size to: "); + addStringLocalization("Interaction_DESCRIPTION_Index_100", "This is ");//Spartaaaaaaa!!! + addStringLocalization("Interaction_DESCRIPTION_Index_101", " Ore."); + addStringLocalization("Interaction_DESCRIPTION_Index_102", "There is Lava behind this Rock."); + addStringLocalization("Interaction_DESCRIPTION_Index_103", "There is a Liquid behind this Rock."); + addStringLocalization("Interaction_DESCRIPTION_Index_104", "There is an Air Pocket behind this Rock."); + addStringLocalization("Interaction_DESCRIPTION_Index_105", "Material is changing behind this Rock."); + addStringLocalization("Interaction_DESCRIPTION_Index_106", "Found traces of "); + addStringLocalization("Interaction_DESCRIPTION_Index_107", "No Ores found."); + addStringLocalization("Interaction_DESCRIPTION_Index_108", "Outputs Liquids, Steam and Items"); + addStringLocalization("Interaction_DESCRIPTION_Index_109", "Outputs Steam and Items"); + addStringLocalization("Interaction_DESCRIPTION_Index_110", "Outputs Steam and Liquids"); + addStringLocalization("Interaction_DESCRIPTION_Index_111", "Outputs Steam"); + addStringLocalization("Interaction_DESCRIPTION_Index_112", "Outputs Liquids and Items"); + addStringLocalization("Interaction_DESCRIPTION_Index_113", "Outputs only Items"); + addStringLocalization("Interaction_DESCRIPTION_Index_114", "Outputs only Liquids"); + addStringLocalization("Interaction_DESCRIPTION_Index_115", "Outputs nothing"); + addStringLocalization("Interaction_DESCRIPTION_Index_116", "Emit Energy to Outputside"); + addStringLocalization("Interaction_DESCRIPTION_Index_117", "Don't emit Energy"); + addStringLocalization("Interaction_DESCRIPTION_Index_118", "Emit Redstone if no Slot is free"); + addStringLocalization("Interaction_DESCRIPTION_Index_119", "Don't emit Redstone"); + addStringLocalization("Interaction_DESCRIPTION_Index_120", "Invert Redstone"); + addStringLocalization("Interaction_DESCRIPTION_Index_121", "Don't invert Redstone"); + addStringLocalization("Interaction_DESCRIPTION_Index_122", "Emit Redstone if slots contain something"); + addStringLocalization("Interaction_DESCRIPTION_Index_123", "Don't emit Redstone"); + addStringLocalization("Interaction_DESCRIPTION_Index_124", "Invert Filter"); + addStringLocalization("Interaction_DESCRIPTION_Index_125", "Don't invert Filter"); + addStringLocalization("Interaction_DESCRIPTION_Index_126", "Ignore NBT"); + addStringLocalization("Interaction_DESCRIPTION_Index_127", "NBT has to match"); + addStringLocalization("Interaction_DESCRIPTION_Index_128", "Redstone "); + addStringLocalization("Interaction_DESCRIPTION_Index_129", "Energy "); + addStringLocalization("Interaction_DESCRIPTION_Index_130", "Fluids "); + addStringLocalization("Interaction_DESCRIPTION_Index_131", "Items "); + addStringLocalization("Interaction_DESCRIPTION_Index_132", "Pipe is loose."); + addStringLocalization("Interaction_DESCRIPTION_Index_133", "Screws are missing."); + addStringLocalization("Interaction_DESCRIPTION_Index_134", "Something is stuck."); + addStringLocalization("Interaction_DESCRIPTION_Index_135", "Platings are dented."); + addStringLocalization("Interaction_DESCRIPTION_Index_136", "Circuitry burned out."); + addStringLocalization("Interaction_DESCRIPTION_Index_137", "That doesn't belong there."); + addStringLocalization("Interaction_DESCRIPTION_Index_138", "Incomplete Structure."); + addStringLocalization("Interaction_DESCRIPTION_Index_139", "Hit with Soft Hammer"); + addStringLocalization("Interaction_DESCRIPTION_Index_140", "to (re-)start the Machine"); + addStringLocalization("Interaction_DESCRIPTION_Index_141", "if it doesn't start."); + addStringLocalization("Interaction_DESCRIPTION_Index_142", "Running perfectly."); + addStringLocalization("Interaction_DESCRIPTION_Index_143", "Missing Mining Pipe"); + addStringLocalization("Interaction_DESCRIPTION_Index_144", "Missing Turbine Rotor"); + addStringLocalization("Interaction_DESCRIPTION_Index_145", "Step Down, In: "); + addStringLocalization("Interaction_DESCRIPTION_Index_146", "Step Up, In: "); + addStringLocalization("Interaction_DESCRIPTION_Index_147", "Amp, Out: "); + addStringLocalization("Interaction_DESCRIPTION_Index_148", " V at "); + addStringLocalization("Interaction_DESCRIPTION_Index_149", " Amp"); + addStringLocalization("Interaction_DESCRIPTION_Index_150", "Chance: "); + addStringLocalization("Interaction_DESCRIPTION_Index_151", "Does not get consumed in the process"); + addStringLocalization("Interaction_DESCRIPTION_Index_152", "Total: "); + addStringLocalization("Interaction_DESCRIPTION_Index_153", "Usage: "); + addStringLocalization("Interaction_DESCRIPTION_Index_154", "Voltage: "); + addStringLocalization("Interaction_DESCRIPTION_Index_155", "Amperage: "); + addStringLocalization("Interaction_DESCRIPTION_Index_156", "Voltage: unspecified"); + addStringLocalization("Interaction_DESCRIPTION_Index_157", "Amperage: unspecified"); + addStringLocalization("Interaction_DESCRIPTION_Index_158", "Time: "); + addStringLocalization("Interaction_DESCRIPTION_Index_159", "Needs Low Gravity"); + addStringLocalization("Interaction_DESCRIPTION_Index_160", "Needs Cleanroom"); + addStringLocalization("Interaction_DESCRIPTION_Index_161", " secs"); + addStringLocalization("Interaction_DESCRIPTION_Index_162", "Name: "); + addStringLocalization("Interaction_DESCRIPTION_Index_163", " MetaData: "); + addStringLocalization("Interaction_DESCRIPTION_Index_164", "Hardness: "); + addStringLocalization("Interaction_DESCRIPTION_Index_165", " Blast Resistance: "); + addStringLocalization("Interaction_DESCRIPTION_Index_166", "Is valid Beacon Pyramid Material"); + addStringLocalization("Interaction_DESCRIPTION_Index_167", "Tank "); + addStringLocalization("Interaction_DESCRIPTION_Index_168", "Heat: "); + addStringLocalization("Interaction_DESCRIPTION_Index_169", " HEM: "); + addStringLocalization("Interaction_DESCRIPTION_Index_170", " Base EU Output: "); + addStringLocalization("Interaction_DESCRIPTION_Index_171", "Facing: "); + addStringLocalization("Interaction_DESCRIPTION_Index_172", " / Chance: "); + addStringLocalization("Interaction_DESCRIPTION_Index_173", "You can remove this with a Wrench"); + addStringLocalization("Interaction_DESCRIPTION_Index_174", "You can NOT remove this with a Wrench"); + addStringLocalization("Interaction_DESCRIPTION_Index_175", "Conduction Loss: "); + addStringLocalization("Interaction_DESCRIPTION_Index_176", "Contained Energy: "); + addStringLocalization("Interaction_DESCRIPTION_Index_177", "Has Muffler Upgrade"); + addStringLocalization("Interaction_DESCRIPTION_Index_178", "Progress: "); + addStringLocalization("Interaction_DESCRIPTION_Index_179", "Max IN: "); + addStringLocalization("Interaction_DESCRIPTION_Index_180", " EU"); + addStringLocalization("Interaction_DESCRIPTION_Index_181", "Max OUT: "); + addStringLocalization("Interaction_DESCRIPTION_Index_182", " EU at "); + addStringLocalization("Interaction_DESCRIPTION_Index_183", " Amperes"); + addStringLocalization("Interaction_DESCRIPTION_Index_184", "Energy: "); + addStringLocalization("Interaction_DESCRIPTION_Index_185", "EU"); + addStringLocalization("Interaction_DESCRIPTION_Index_186", "Owned by: "); + addStringLocalization("Interaction_DESCRIPTION_Index_187", "Type -- Crop-Name: "); + addStringLocalization("Interaction_DESCRIPTION_Index_188", " Growth: "); + addStringLocalization("Interaction_DESCRIPTION_Index_189", " Gain: "); + addStringLocalization("Interaction_DESCRIPTION_Index_190", " Resistance: "); + addStringLocalization("Interaction_DESCRIPTION_Index_191", "Plant -- Fertilizer: "); + addStringLocalization("Interaction_DESCRIPTION_Index_192", " Water: "); + addStringLocalization("Interaction_DESCRIPTION_Index_193", " Weed-Ex: "); + addStringLocalization("Interaction_DESCRIPTION_Index_194", " Scan-Level: "); + addStringLocalization("Interaction_DESCRIPTION_Index_195", "Environment -- Nutrients: "); + addStringLocalization("Interaction_DESCRIPTION_Index_196", " Humidity: "); + addStringLocalization("Interaction_DESCRIPTION_Index_197", " Air-Quality: "); + addStringLocalization("Interaction_DESCRIPTION_Index_198", "Attributes:"); + addStringLocalization("Interaction_DESCRIPTION_Index_199", "Discovered by: "); + addStringLocalization("Interaction_DESCRIPTION_Index_200", " L"); + addStringLocalization("Interaction_DESCRIPTION_Index_201", "Nothing"); + addStringLocalization("Interaction_DESCRIPTION_Index_202", "Pollution in Chunk: "); + addStringLocalization("Interaction_DESCRIPTION_Index_203", " gibbl"); + addStringLocalization("Interaction_DESCRIPTION_Index_204", "No Pollution in Chunk! HAYO!"); + addStringLocalization("Interaction_DESCRIPTION_Index_205", " of "); +// addStringLocalization("Interaction_DESCRIPTION_Index_206", "Grab"); +// addStringLocalization("Interaction_DESCRIPTION_Index_207", "Grab"); +// addStringLocalization("Interaction_DESCRIPTION_Index_208", "Grab"); +// addStringLocalization("Interaction_DESCRIPTION_Index_209", "Grab"); +// addStringLocalization("Interaction_DESCRIPTION_Index_210", "Grab"); + + } + }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 23d5c12110..8f09cbf7e1 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -588,6 +588,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * HashMap of Recipes based on their Fluids */ public final Map<Fluid, Collection<GT_Recipe>> mRecipeFluidMap = new /*Concurrent*/HashMap<Fluid, Collection<GT_Recipe>>(); + public final HashSet<String> mRecipeFluidNameMap = new HashSet<String>(); /** * The List of all Recipes */ @@ -696,6 +697,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { Collection<GT_Recipe> tList = mRecipeFluidMap.get(aFluid.getFluid()); if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<GT_Recipe>(1)); tList.add(aRecipe); + if(!mRecipeFluidNameMap.contains(aFluid.getFluid().getName())) + mRecipeFluidNameMap.add(aFluid.getFluid().getName()); } return addToItemMap(aRecipe); } @@ -728,7 +731,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * @return if this Fluid is a valid Input for any for the Recipes */ public boolean containsInput(Fluid aFluid) { - return aFluid != null && mRecipeFluidMap.containsKey(aFluid); + return aFluid != null && mRecipeFluidNameMap.contains(aFluid.getName()); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 2987448244..47c4dfb334 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -53,10 +53,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; @@ -73,6 +76,9 @@ import java.util.*; import java.util.Map.Entry; import static gregtech.api.enums.GT_Values.*; +import static gregtech.common.GT_Proxy.GTPOLLUTION; +import static gregtech.common.GT_Proxy.dimensionWiseChunkData; +import static gregtech.common.GT_UndergroundOil.undergroundOil; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -95,6 +101,14 @@ public class GT_Utility { GregTech_API.sItemStackMappings.add(sFilledContainerToData); GregTech_API.sItemStackMappings.add(sEmptyContainerToFluidToData); } + + public static int safeInt(long number, int margin){ + return number>Integer.MAX_VALUE-margin ? Integer.MAX_VALUE-margin :(int)number; + } + + public static int safeInt(long number){ + return number>GT_Values.V[GT_Values.V.length-1] ? safeInt(GT_Values.V[GT_Values.V.length-1],1) : number<Integer.MIN_VALUE ? Integer.MIN_VALUE : (int)number; +} public static Field getPublicField(Object aObject, String aField) { Field rField = null; @@ -1527,70 +1541,70 @@ public class GT_Utility { return (int)Math.floor(aValue / aScale); } - public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ) { - return getUndergroundOil(aWorld, aX, aZ, false); - } - - public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ, boolean needConsumeOil) { - - if (GT_Mod.gregtechproxy.mUndergroundOil.CheckBlackList(aWorld.provider.dimensionId)) - return null; - - Random tRandom = new Random((aWorld.getSeed() + aWorld.provider.dimensionId * 2 + (getScaleCoordinates(aX,96)) + (7 * (getScaleCoordinates(aZ,96))))); - int tAmount = 0; - int tFluidId = 0; - int tDecreasePerOperationAmount = 5; - Fluid tFluid = null; -// System.out.println("Dimension: "+GT_Mod.gregtechproxy.mUndergroundOil.GetDimension(aWorld.provider.dimensionId).Dimension); - try { - GT_UO_Fluid uoFluid = GT_Mod.gregtechproxy.mUndergroundOil.GetDimension(aWorld.provider.dimensionId).getRandomFluid(tRandom); - if (uoFluid != null) - { - tFluid = uoFluid.getFluid(); - tAmount = uoFluid.getRandomAmount(tRandom); - tDecreasePerOperationAmount = uoFluid.DecreasePerOperationAmount; - if (tFluid != null) - tFluidId = tFluid.getID(); - //System.out.println("Fluid: ("+tFluidId+")"+tFluid.getName()+" Amount:"+tAmount); - } - - } catch (Exception e) { - tAmount = 0; - tFluidId = 0; - } - - try { - ChunkPosition tPos = new ChunkPosition(getScaleCoordinates(aX,16), aWorld.provider.dimensionId, getScaleCoordinates(aZ,16)); - int[] tInts = new int[3]; - if(GT_Proxy.chunkData.containsKey(tPos)){ - tInts = GT_Proxy.chunkData.get(tPos); - if(tInts.length>0){ - if(tInts[0]>0){tAmount = tInts[0];} - } - if(tInts.length>2){ - if(tInts[2]>0&&tInts[2]!=tFluidId) - { - tFluidId = tInts[2]; - tFluid = FluidRegistry.getFluid(tFluidId); - } - } - GT_Proxy.chunkData.remove(tPos); - } - - if (needConsumeOil && tAmount >= 5000) - tAmount = tAmount - tDecreasePerOperationAmount; - - tInts[0] = tAmount; - tInts[2] = tFluidId; - GT_Proxy.chunkData.put(tPos, tInts); - } catch (Exception e) { - System.out.println("getUndergroundOil() - Error put data"); - } - if (tFluid!=null) - return new FluidStack(tFluid, tAmount); - return null; - } - +// public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ) { +// return getUndergroundOil(aWorld, aX, aZ, false); +// } +// +// public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ, boolean needConsumeOil) { +// +// if (GT_Mod.gregtechproxy.mUndergroundOil.CheckBlackList(aWorld.provider.dimensionId)) +// return null; +// +// Random tRandom = new Random((aWorld.getSeed() + aWorld.provider.dimensionId * 2 + (getScaleCoordinates(aX,96)) + (7 * (getScaleCoordinates(aZ,96))))); +// int tAmount = 0; +// int tFluidId = 0; +// int tDecreasePerOperationAmount = 5; +// Fluid tFluid = null; +//// System.out.println("Dimension: "+GT_Mod.gregtechproxy.mUndergroundOil.GetDimension(aWorld.provider.dimensionId).Dimension); +// try { +// GT_UO_Fluid uoFluid = GT_Mod.gregtechproxy.mUndergroundOil.GetDimension(aWorld.provider.dimensionId).getRandomFluid(tRandom); +// if (uoFluid != null) +// { +// tFluid = uoFluid.getFluid(); +// tAmount = uoFluid.getRandomAmount(tRandom); +// tDecreasePerOperationAmount = uoFluid.DecreasePerOperationAmount; +// if (tFluid != null) +// tFluidId = tFluid.getID(); +// //System.out.println("Fluid: ("+tFluidId+")"+tFluid.getName()+" Amount:"+tAmount); +// } +// +// } catch (Exception e) { +// tAmount = 0; +// tFluidId = 0; +// } +// +// try { +// ChunkPosition tPos = new ChunkPosition(getScaleCoordinates(aX,16), aWorld.provider.dimensionId, getScaleCoordinates(aZ,16)); +// int[] tInts = new int[3]; +// if(GT_Proxy.chunkData.containsKey(tPos)){ +// tInts = GT_Proxy.chunkData.get(tPos); +// if(tInts.length>0){ +// if(tInts[0]>0){tAmount = tInts[0];} +// } +// if(tInts.length>2){ +// if(tInts[2]>0&&tInts[2]!=tFluidId) +// { +// tFluidId = tInts[2]; +// tFluid = FluidRegistry.getFluid(tFluidId); +// } +// } +// GT_Proxy.chunkData.remove(tPos); +// } +// +// if (needConsumeOil && tAmount >= 5000) +// tAmount = tAmount - tDecreasePerOperationAmount; +// +// tInts[0] = tAmount; +// tInts[2] = tFluidId; +// GT_Proxy.chunkData.put(tPos, tInts); +// } catch (Exception e) { +// System.out.println("getUndergroundOil() - Error put data"); +// } +// if (tFluid!=null) +// return new FluidStack(tFluid, tAmount); +// return null; +// } + public static int getCoordinateScan(ArrayList<String> aList, EntityPlayer aPlayer, World aWorld, int aScanLevel, int aX, int aY, int aZ, int aSide, float aClickX, float aClickY, float aClickZ) { if (aList == null) return 0; @@ -1604,12 +1618,12 @@ public class GT_Utility { tList.add("----- X: " + aX + " Y: " + aY + " Z: " + aZ + " -----"); try { if (tTileEntity instanceof IInventory) - tList.add("Name: " + ((IInventory) tTileEntity).getInventoryName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); + tList.add(trans("162","Name: ") + ((IInventory) tTileEntity).getInventoryName() + trans("163"," MetaData: ") + aWorld.getBlockMetadata(aX, aY, aZ)); else - tList.add("Name: " + tBlock.getUnlocalizedName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); + tList.add(trans("162","Name: ") + tBlock.getUnlocalizedName() + trans("163"," MetaData: ") + aWorld.getBlockMetadata(aX, aY, aZ)); - tList.add("Hardness: " + tBlock.getBlockHardness(aWorld, aX, aY, aZ) + " Blast Resistance: " + tBlock.getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ)); - if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add("Is valid Beacon Pyramid Material"); + tList.add(trans("164","Hardness: ") + tBlock.getBlockHardness(aWorld, aX, aY, aZ) + trans("165"," Blast Resistance: ") + tBlock.getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ)); + if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add(trans("166","Is valid Beacon Pyramid Material")); } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } @@ -1619,7 +1633,7 @@ public class GT_Utility { rEUAmount += 500; FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity).getTankInfo(ForgeDirection.getOrientation(aSide)); if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) { - tList.add("Tank " + i + ": " + GT_Utility.formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) + " / " + GT_Utility.formatNumbers(tTanks[i].capacity) + " " + getFluidName(tTanks[i].fluid, true)); + tList.add(trans("167","Tank ") + i + ": " + GT_Utility.formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) + " / " + GT_Utility.formatNumbers(tTanks[i].capacity) + " " + getFluidName(tTanks[i].fluid, true)); } } } catch (Throwable e) { @@ -1636,8 +1650,8 @@ public class GT_Utility { try { if (tTileEntity instanceof ic2.api.reactor.IReactor) { rEUAmount += 500; - tList.add("Heat: " + ((ic2.api.reactor.IReactor) tTileEntity).getHeat() + "/" + ((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat() - + " HEM: " + ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() + " Base EU Output: "/* + ((ic2.api.reactor.IReactor)tTileEntity).getOutput()*/); + tList.add(trans("168","Heat: ") + ((ic2.api.reactor.IReactor) tTileEntity).getHeat() + "/" + ((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat() + + trans("169"," HEM: ") + ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() + trans("170"," Base EU Output: ")/* + ((ic2.api.reactor.IReactor)tTileEntity).getOutput()*/); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1645,8 +1659,8 @@ public class GT_Utility { try { if (tTileEntity instanceof ic2.api.tile.IWrenchable) { rEUAmount += 100; - tList.add("Facing: " + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() + " / Chance: " + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) + "%"); - tList.add(((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) ? "You can remove this with a Wrench" : "You can NOT remove this with a Wrench"); + tList.add(trans("171","Facing: ") + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() + trans("172"," / Chance: ") + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) + "%"); + tList.add(((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) ? trans("173","You can remove this with a Wrench") : trans("174","You can NOT remove this with a Wrench")); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1680,7 +1694,7 @@ public class GT_Utility { try { if (tTileEntity instanceof ic2.api.energy.tile.IEnergyConductor) { rEUAmount += 200; - tList.add("Conduction Loss: " + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss()); + tList.add(trans("175","Conduction Loss: ") + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss()); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1688,7 +1702,7 @@ public class GT_Utility { try { if (tTileEntity instanceof ic2.api.tile.IEnergyStorage) { rEUAmount += 200; - tList.add("Contained Energy: " + ((ic2.api.tile.IEnergyStorage) tTileEntity).getStored() + " of " + ((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()); + tList.add(trans("176","Contained Energy: ") + ((ic2.api.tile.IEnergyStorage) tTileEntity).getStored() + trans("205"," of ") + ((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()); //aList.add(((ic2.api.tile.IEnergyStorage)tTileEntity).isTeleporterCompatible(ic2.api.Direction.YP)?"Teleporter Compatible":"Not Teleporter Compatible"); } } catch (Throwable e) { @@ -1697,7 +1711,7 @@ public class GT_Utility { try { if (tTileEntity instanceof IUpgradableMachine) { rEUAmount += 500; - if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add("Has Muffler Upgrade"); + if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add(trans("177","Has Muffler Upgrade")); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1707,7 +1721,7 @@ public class GT_Utility { rEUAmount += 400; int tValue = 0; if (0 < (tValue = ((IMachineProgress) tTileEntity).getMaxProgress())) - tList.add("Progress: " + GT_Utility.formatNumbers(tValue) + " / " + GT_Utility.formatNumbers(((IMachineProgress) tTileEntity).getProgress())); + tList.add(trans("178","Progress: ") + GT_Utility.formatNumbers(tValue) + " / " + GT_Utility.formatNumbers(((IMachineProgress) tTileEntity).getProgress())); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1723,16 +1737,16 @@ public class GT_Utility { } try { if (tTileEntity instanceof IBasicEnergyContainer && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) { - tList.add("Max IN: " + ((IBasicEnergyContainer) tTileEntity).getInputVoltage() + " EU"); - tList.add("Max OUT: " + ((IBasicEnergyContainer) tTileEntity).getOutputVoltage() + " EU at " + ((IBasicEnergyContainer) tTileEntity).getOutputAmperage() + " Amperes"); - tList.add("Energy: " + GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) + " / " + GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) + "EU"); + tList.add(trans("179","Max IN: ") + ((IBasicEnergyContainer) tTileEntity).getInputVoltage() + trans("180"," EU")); + tList.add(trans("181","Max OUT: ") + ((IBasicEnergyContainer) tTileEntity).getOutputVoltage() + trans("182"," EU at ") + ((IBasicEnergyContainer) tTileEntity).getOutputAmperage() + trans("183"," Amperes")); + tList.add(trans("184","Energy: ") + GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) + " / " + GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) + trans("185","EU")); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } try { if (tTileEntity instanceof IGregTechTileEntity) { - tList.add("Owned by: " + ((IGregTechTileEntity) tTileEntity).getOwnerName()); + tList.add(trans("186","Owned by: ") + ((IGregTechTileEntity) tTileEntity).getOwnerName()); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1752,49 +1766,52 @@ public class GT_Utility { } if (((ic2.api.crops.ICropTile) tTileEntity).getID() >= 0 && ((ic2.api.crops.ICropTile) tTileEntity).getID() < ic2.api.crops.Crops.instance.getCropList().length && ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()] != null) { rEUAmount += 1000; - tList.add("Type -- Crop-Name: " + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].name() - + " Growth: " + ((ic2.api.crops.ICropTile) tTileEntity).getGrowth() - + " Gain: " + ((ic2.api.crops.ICropTile) tTileEntity).getGain() - + " Resistance: " + ((ic2.api.crops.ICropTile) tTileEntity).getResistance() + tList.add(trans("187","Type -- Crop-Name: ") + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].name() + + trans("188"," Growth: ") + ((ic2.api.crops.ICropTile) tTileEntity).getGrowth() + + trans("189"," Gain: ") + ((ic2.api.crops.ICropTile) tTileEntity).getGain() + + trans("190"," Resistance: ") + ((ic2.api.crops.ICropTile) tTileEntity).getResistance() ); - tList.add("Plant -- Fertilizer: " + ((ic2.api.crops.ICropTile) tTileEntity).getNutrientStorage() - + " Water: " + ((ic2.api.crops.ICropTile) tTileEntity).getHydrationStorage() - + " Weed-Ex: " + ((ic2.api.crops.ICropTile) tTileEntity).getWeedExStorage() - + " Scan-Level: " + ((ic2.api.crops.ICropTile) tTileEntity).getScanLevel() + tList.add(trans("191","Plant -- Fertilizer: ") + ((ic2.api.crops.ICropTile) tTileEntity).getNutrientStorage() + + trans("192"," Water: ") + ((ic2.api.crops.ICropTile) tTileEntity).getHydrationStorage() + + trans("193"," Weed-Ex: ") + ((ic2.api.crops.ICropTile) tTileEntity).getWeedExStorage() + + trans("194"," Scan-Level: ") + ((ic2.api.crops.ICropTile) tTileEntity).getScanLevel() ); - tList.add("Environment -- Nutrients: " + ((ic2.api.crops.ICropTile) tTileEntity).getNutrients() - + " Humidity: " + ((ic2.api.crops.ICropTile) tTileEntity).getHumidity() - + " Air-Quality: " + ((ic2.api.crops.ICropTile) tTileEntity).getAirQuality() + tList.add(trans("195","Environment -- Nutrients: ") + ((ic2.api.crops.ICropTile) tTileEntity).getNutrients() + + trans("196"," Humidity: ") + ((ic2.api.crops.ICropTile) tTileEntity).getHumidity() + + trans("197"," Air-Quality: ") + ((ic2.api.crops.ICropTile) tTileEntity).getAirQuality() ); StringBuilder tStringB = new StringBuilder(); for (String tAttribute : ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].attributes()) { tStringB.append(", ").append(tAttribute); } String tString = tStringB.toString(); - tList.add("Attributes:" + tString.replaceFirst(",", E)); - tList.add("Discovered by: " + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].discoveredBy()); + tList.add(trans("198","Attributes:") + tString.replaceFirst(",", E)); + tList.add(trans("199","Discovered by: ") + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].discoveredBy()); } } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } } - if (aPlayer.capabilities.isCreativeMode&>_Values.D1) { - FluidStack tFluid = getUndergroundOil(aWorld, aX, aZ); + + if (aPlayer.capabilities.isCreativeMode && GT_Values.D1) { + FluidStack tFluid = undergroundOil(aWorld.getChunkFromBlockCoords(aX,aZ),-1);//-# to only read if (tFluid!=null) - tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName()); - } -// if(aPlayer.capabilities.isCreativeMode){ - ChunkPosition tPos = new ChunkPosition(getScaleCoordinates(aX,16), aWorld.provider.dimensionId, getScaleCoordinates(aZ,16)); - if(GT_Proxy.chunkData.containsKey(tPos)){ - int[] tPollution = GT_Proxy.chunkData.get(tPos); - if(tPollution.length>1){ - tList.add("Pollution in Chunk: "+tPollution[1]); - }else{ - tList.add("No Pollution in Chunk"); - } - } -// } + tList.add(EnumChatFormatting.GOLD+tFluid.getLocalizedName()+EnumChatFormatting.RESET+": " +EnumChatFormatting.YELLOW+ tFluid.amount +EnumChatFormatting.RESET+trans("200"," L")); + else + tList.add(EnumChatFormatting.GOLD+trans("201","Nothing")+EnumChatFormatting.RESET+": " +EnumChatFormatting.YELLOW+ '0' +EnumChatFormatting.RESET+trans("200"," L")); + } +// if(aPlayer.capabilities.isCreativeMode){ + int[] chunkData = GT_Proxy.dimensionWiseChunkData.get(aWorld.provider.dimensionId).get(aWorld.getChunkFromBlockCoords(aX,aZ).getChunkCoordIntPair()); + if(chunkData !=null){ + if(chunkData[GTPOLLUTION]>0){ + tList.add(trans("202","Pollution in Chunk: ")+EnumChatFormatting.RED+chunkData[GTPOLLUTION]+EnumChatFormatting.RESET+trans("203"," gibbl")); + }else{ + tList.add(EnumChatFormatting.GREEN+trans("204","No Pollution in Chunk! HAYO!")+EnumChatFormatting.RESET); + } + }else{ + tList.add(EnumChatFormatting.GREEN+trans("204","No Pollution in Chunk! HAYO!")+EnumChatFormatting.RESET); +} try { if (tBlock instanceof IDebugableBlock) { @@ -1811,6 +1828,10 @@ public class GT_Utility { MinecraftForge.EVENT_BUS.post(tEvent); if (!tEvent.isCanceled()) aList.addAll(tList); return tEvent.mEUCost; + } + + public static String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); } /** diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index ff4968cd16..7d3f687b28 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -9,6 +9,7 @@ import codechicken.lib.vec.Rotation; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -30,6 +31,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.client.event.EntityViewRenderEvent; +import net.minecraftforge.event.terraingen.BiomeEvent; +import net.minecraftforge.oredict.OreDictionary; import org.lwjgl.opengl.GL11; import java.net.URL; @@ -139,6 +143,44 @@ public class GT_Client extends GT_Proxy GL11.glEnd(); GL11.glPopMatrix(); } + + @SubscribeEvent + public void manipulateDensity(EntityViewRenderEvent.FogDensity event) { + if(GT_Pollution.mPlayerPollution > (GT_Mod.gregtechproxy.mPollutionSmogLimit)){ + event.density = (0.15f*(Math.min(GT_Pollution.mPlayerPollution/((float)GT_Mod.gregtechproxy.mPollutionSourRainLimit),1.0f)))+0.1f; + event.setCanceled(true); + } + } + + @SubscribeEvent + public void manipulateColor(EntityViewRenderEvent.FogColors event) { + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.red = 140f/255f; + event.green = 80f/255f; + event.blue = 40f/255f; + } + } + + @SubscribeEvent + public void manipulateGrassColor(BiomeEvent.GetGrassColor event) { + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.newColor = 0xD2691E; + } + } + + @SubscribeEvent + public void manipulateWaterColor(BiomeEvent.GetWaterColor event) { + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.newColor = 0x556B2F; + } + } + + @SubscribeEvent + public void manipulateFoliageColor(BiomeEvent.GetFoliageColor event) { + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.newColor = 0xCD853F; + } + } public boolean isServerSide() { return true; @@ -327,6 +369,12 @@ public class GT_Client extends GT_Proxy @SubscribeEvent public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) { if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) { + if(changeDetected>0)changeDetected--; + int newHideValue=shouldHeldItemHideThings(); + if(newHideValue!=hideValue){ + hideValue=newHideValue; + changeDetected=5; + } mAnimationTick++; if (mAnimationTick % 50L == 0L) {mAnimationDirection = !mAnimationDirection;} @@ -493,4 +541,27 @@ public class GT_Client extends GT_Proxy else aWorld.playSound(aX, aY, aZ, tString, 3F, tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F, false); } + + public static int hideValue=0; + public static int changeDetected=0; + + private static int shouldHeldItemHideThings() { + try { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player == null) return 0; + ItemStack held = player.getCurrentEquippedItem(); + if (held == null) return 0; + int[] ids = OreDictionary.getOreIDs(held); + int hide = 0; + for (int i : ids) { + if (OreDictionary.getOreName(i).equals("craftingToolSolderingIron")) { + hide |= 0x1; + break; + } + } + return hide; + }catch(Exception e){ + return 0; + } + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/GT_Network.java b/src/main/java/gregtech/common/GT_Network.java index 2b19b98dff..ae444429bf 100644 --- a/src/main/java/gregtech/common/GT_Network.java +++ b/src/main/java/gregtech/common/GT_Network.java @@ -32,7 +32,7 @@ public class GT_Network public GT_Network() {
this.mChannel = NetworkRegistry.INSTANCE.newChannel("GregTech", new ChannelHandler[]{this, new HandlerShared()});
- this.mSubChannels = new GT_Packet[]{new GT_Packet_TileEntity(), new GT_Packet_Sound(), new GT_Packet_Block_Event(), new GT_Packet_Ores()};
+ this.mSubChannels = new GT_Packet[]{new GT_Packet_TileEntity(), new GT_Packet_Sound(), new GT_Packet_Block_Event(), new GT_Packet_Ores(), new GT_Packet_Pollution()};
}
protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List<Object> aOutput)
@@ -47,6 +47,12 @@ public class GT_Network }
public void sendToPlayer(GT_Packet aPacket, EntityPlayerMP aPlayer) {
+ if(aPacket==null){
+ System.out.println("packet null");return;
+ }
+ if(aPlayer==null){
+ System.out.println("player null");return;
+ }
((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer);
((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket);
diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index a950e8a2f2..6669bf861a 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -1,6 +1,8 @@ package gregtech.common; +import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.GT_Mod; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -10,12 +12,17 @@ import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.event.world.WorldEvent; -import java.util.ArrayList; -import java.util.List; +import java.util.*; + +import static gregtech.common.GT_Proxy.*; + +//import net.minecraft.entity.EntityLiving; public class GT_Pollution { /** @@ -49,95 +56,132 @@ public class GT_Pollution { * Muffler Hatch Pollution reduction: * LV (0%), MV (30%), HV (52%), EV (66%), IV (76%), LuV (84%), ZPM (89%), UV (92%), MAX (95%) */ + private static XSTR tRan = new XSTR(); + private List<ChunkCoordIntPair> pollutionList = new ArrayList<>();//chunks left to process + private HashMap<ChunkCoordIntPair,int[]> chunkData;//link to chunk data that is saved/loaded + private int operationsPerTick=0;//how much chunks should be processed in each cycle + private static final short cycleLen=1200; + private final World aWorld; + public static int mPlayerPollution; - static List<ChunkPosition> tList = null; - static int loops = 1; - static XSTR tRan = new XSTR(); + public GT_Pollution(World world){ + aWorld=world; + chunkData=dimensionWiseChunkData.get(aWorld.provider.dimensionId); + if(chunkData==null){ + chunkData=new HashMap<>(1024); + dimensionWiseChunkData.put(world.provider.dimensionId,chunkData); + } + dimensionWisePollution.put(aWorld.provider.dimensionId,this); + } - public static void onWorldTick(World aWorld, int aTick){ - if(!GT_Mod.gregtechproxy.mPollution)return; - if(aTick == 0 || (tList==null && GT_Proxy.chunkData!=null)){ - tList = new ArrayList<ChunkPosition>(GT_Proxy.chunkData.keySet()); - loops = (tList.size()/1200) + 1; -// System.out.println("new Pollution loop"+aTick); + public static void onWorldTick(TickEvent.WorldTickEvent aEvent){//called from proxy + //return if pollution disabled + if(!GT_Mod.gregtechproxy.mPollution) return; + final GT_Pollution pollutionInstance = dimensionWisePollution.get(aEvent.world.provider.dimensionId); + if(pollutionInstance==null)return; + pollutionInstance.tickPollutionInWorld((int)(aEvent.world.getTotalWorldTime()%cycleLen)); + } + + private void tickPollutionInWorld(int aTickID){//called from method above + //gen data set + if(aTickID==0){ + pollutionList = new ArrayList<>(chunkData.keySet()); + //set operations per tick + if(pollutionList.size()>0) operationsPerTick =(pollutionList.size()/cycleLen); + else operationsPerTick=0;//SANity } - if(tList!=null && tList.size() > 0){ - int i = 0; - for(; i < loops ; i++){ - if(tList.size()>0){ - ChunkPosition tPos = tList.get(0); - tList.remove(0); - if(tPos!=null && GT_Proxy.chunkData.containsKey(tPos)){ - int tPollution = GT_Proxy.chunkData.get(tPos)[1]; -// System.out.println("process: "+tPos.chunkPosY+" "+tPos.chunkPosX+" "+tPos.chunkPosZ+" "+tPollution); - //Reduce pollution in chunk - tPollution = (int)(0.99f*tPollution); - tPollution -= 2000; - if(tPollution<=0){tPollution = 0;} - //Spread Pollution - if(tPollution>50000){ - List<ChunkPosition> tNeighbor = new ArrayList(); - tNeighbor.add(new ChunkPosition(tPos.chunkPosX+1, tPos.chunkPosY, tPos.chunkPosZ)); - tNeighbor.add(new ChunkPosition(tPos.chunkPosX-1, tPos.chunkPosY, tPos.chunkPosZ)); - tNeighbor.add(new ChunkPosition(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ+1)); - tNeighbor.add(new ChunkPosition(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ-1)); - for(ChunkPosition tNPos : tNeighbor){ - if(GT_Proxy.chunkData.containsKey(tNPos)){ - int tNPol = GT_Proxy.chunkData.get(tNPos)[1]; - if(tNPol<tPollution && tNPol*12 < tPollution*10){ - int tDiff = tPollution - tNPol; - tDiff = tDiff/10; - tNPol += tDiff; - tPollution -= tDiff; - GT_Proxy.chunkData.get(tNPos)[1] = tNPol; - } - }else{ - GT_Utility.getUndergroundOil(aWorld,tNPos.chunkPosX<<4,tNPos.chunkPosZ<<4); + + for(int chunksProcessed=0;chunksProcessed<=operationsPerTick;chunksProcessed++){ + if(pollutionList.size()==0)break;//no more stuff to do + ChunkCoordIntPair actualPos=pollutionList.remove(pollutionList.size()-1);//faster + //add default data if missing + if(!chunkData.containsKey(actualPos)) chunkData.put(actualPos,getDefaultChunkDataOnCreation()); + //get pollution + int tPollution = chunkData.get(actualPos)[GTPOLLUTION]; + //remove some + tPollution = (int)(0.9945f*tPollution); + //tPollution -= 2000;//This does not really matter... + + if(tPollution<=0) tPollution = 0;//SANity check + else if(tPollution>400000){//Spread Pollution + + ChunkCoordIntPair[] tNeighbors = new ChunkCoordIntPair[4];//array is faster + tNeighbors[0]=(new ChunkCoordIntPair(actualPos.chunkXPos+1,actualPos.chunkZPos)); + tNeighbors[1]=(new ChunkCoordIntPair(actualPos.chunkXPos-1,actualPos.chunkZPos)); + tNeighbors[2]=(new ChunkCoordIntPair(actualPos.chunkXPos,actualPos.chunkZPos+1)); + tNeighbors[3]=(new ChunkCoordIntPair(actualPos.chunkXPos,actualPos.chunkZPos-1)); + for(ChunkCoordIntPair neighborPosition : tNeighbors){ + if(!chunkData.containsKey(neighborPosition)) chunkData.put(neighborPosition,getDefaultChunkDataOnCreation()); + + int neighborPollution = chunkData.get(neighborPosition)[GTPOLLUTION]; + if(neighborPollution*6 < tPollution*5){//METHEMATICS... + int tDiff = tPollution - neighborPollution; + tDiff = tDiff/20; + neighborPollution = GT_Utility.safeInt((long)neighborPollution+tDiff);//tNPol += tDiff; + tPollution -= tDiff; + chunkData.get(neighborPosition)[GTPOLLUTION] = neighborPollution; } - }} - int[] tArray = GT_Proxy.chunkData.get(tPos); - tArray[1] = tPollution; - GT_Proxy.chunkData.remove(tPos); - GT_Proxy.chunkData.put(tPos, tArray); + } + + //Create Pollution effects -// Smog filter TODO - if(tPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ - AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX<<4, 0, tPos.chunkPosZ<<4, (tPos.chunkPosX<<4)+16, 256, (tPos.chunkPosZ<<4)+16); - List<EntityLivingBase> tEntitys = aWorld.getEntitiesWithinAABB(EntityLivingBase.class, chunk); - for(EntityLivingBase tEnt : tEntitys){ - if(!GT_Utility.isWearingFullGasHazmat(tEnt) && tRan.nextInt(tPollution/2000) > 40){ - int ran = tRan.nextInt(3); - if(ran==0)tEnt.addPotionEffect(new PotionEffect(Potion.weakness.id, Math.min(tPollution/2500,1000), tPollution/400000)); - if(ran==1)tEnt.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, Math.min(tPollution/2500,1000), tPollution/400000)); - if(ran==2)tEnt.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, Math.min(tPollution/2500,1000), tPollution/400000)); + //Smog filter TODO + if(tPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit) { + AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(actualPos.chunkXPos << 4, 0, actualPos.chunkZPos << 4, (actualPos.chunkXPos << 4) + 16, 256, (actualPos.chunkZPos << 4) + 16); + List<EntityLivingBase> tEntitys = aWorld.getEntitiesWithinAABB(EntityLivingBase.class, chunk); + for (EntityLivingBase tEnt : tEntitys) { + if (!GT_Utility.isWearingFullGasHazmat(tEnt)) { + switch (tRan.nextInt(3)) { + default: + tEnt.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); + case 1: + tEnt.addPotionEffect(new PotionEffect(Potion.weakness.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); + case 2: + tEnt.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); + } } -} -// Poison effects - if(tPollution > GT_Mod.gregtechproxy.mPollutionPoisonLimit){ - for(EntityLivingBase tEnt : tEntitys){ - if(!GT_Utility.isWearingFullGasHazmat(tEnt) && tRan.nextInt(tPollution/2000) > 20){ - int ran = tRan.nextInt(3); - if(ran==0)tEnt.addPotionEffect(new PotionEffect(Potion.poison.id, Math.min(tPollution/2500,1000), tPollution/500000)); - if(ran==1)tEnt.addPotionEffect(new PotionEffect(Potion.confusion.id, Math.min(tPollution/2500,1000), 1)); - if(ran==2)tEnt.addPotionEffect(new PotionEffect(Potion.blindness.id, Math.min(tPollution/2500,1000), 1)); -} - } -// killing plants - if(tPollution > GT_Mod.gregtechproxy.mPollutionVegetationLimit){ - int f = 20; - for(;f<(tPollution/25000);f++){ - int x =tPos.chunkPosX<<4+(tRan.nextInt(16));; - int y =60 +(-f+tRan.nextInt(f*2+1)); - int z =tPos.chunkPosZ<<4+(tRan.nextInt(16)); - damageBlock(x, y, z, tPollution > GT_Mod.gregtechproxy.mPollutionSourRainLimit); - }}}} + } + + + // Poison effects + if (tPollution > GT_Mod.gregtechproxy.mPollutionPoisonLimit) { + //AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX*16, 0, tPos.chunkPosZ*16, tPos.chunkPosX*16+16, 256, tPos.chunkPosZ*16+16); + //List<EntityLiving> tEntitys = aWorld.getEntitiesWithinAABB(EntityLiving.class, chunk); + for (EntityLivingBase tEnt : tEntitys) { + if (!GT_Utility.isWearingFullGasHazmat(tEnt)) { + switch (tRan.nextInt(4)) { + default: + tEnt.addPotionEffect(new PotionEffect(Potion.hunger.id, tPollution / 500000)); + case 1: + tEnt.addPotionEffect(new PotionEffect(Potion.confusion.id, Math.min(tPollution / 2000, 1000), 1)); + case 2: + tEnt.addPotionEffect(new PotionEffect(Potion.poison.id, Math.min(tPollution / 4000, 1000), tPollution / 500000)); + case 3: + tEnt.addPotionEffect(new PotionEffect(Potion.blindness.id, Math.min(tPollution / 2000, 1000), 1)); + } + } + } + + + // killing plants + if (tPollution > GT_Mod.gregtechproxy.mPollutionVegetationLimit) { + int f = 20; + for (; f < (tPollution / 25000); f++) { + int x = (actualPos.chunkXPos << 4) + tRan.nextInt(16); + int y = 60 + (-f + tRan.nextInt(f * 2 + 1)); + int z = (actualPos.chunkZPos << 4) + tRan.nextInt(16); + damageBlock(aWorld, x, y, z, tPollution > GT_Mod.gregtechproxy.mPollutionSourRainLimit); + } + } + } } } - }} + //Write new pollution to Hashmap !!! + chunkData.get(actualPos)[GTPOLLUTION] = tPollution; + } } - public static void damageBlock(int x, int y, int z, boolean sourRain){ - World world = DimensionManager.getWorld(0); + private static void damageBlock(World world, int x, int y, int z, boolean sourRain){ if (world.isRemote) return; Block tBlock = world.getBlock(x, y, z); int tMeta = world.getBlockMetadata(x, y, z); @@ -187,24 +231,49 @@ public class GT_Pollution { } } - //Add aWorld to Save Pollution - public static void addPollution(World aWorld, ChunkPosition aPos, int aPollution){ + public static void addPollution(IGregTechTileEntity te, int aPollution){ + addPollution(te.getWorld().getChunkFromBlockCoords(te.getXCoord(),te.getZCoord()), aPollution); + } + + public static void addPollution(Chunk ch, int aPollution){ if(!GT_Mod.gregtechproxy.mPollution)return; - try{ - ChunkPosition tPos = new ChunkPosition(GT_Utility.getScaleCoordinates(aPos.chunkPosX,16), aWorld.provider.dimensionId, GT_Utility.getScaleCoordinates(aPos.chunkPosZ,16)); // OLD in coordinate -1 -1 chunk 0 0 -// System.out.println("add pollution dim: "+aWorld.provider.dimensionId+" x: "+ tPos.chunkPosX +" z: " + tPos.chunkPosZ +" poll: "+aPollution); - int[] tData = new int[3]; - if(GT_Proxy.chunkData.containsKey(tPos)){ - tData = GT_Proxy.chunkData.get(tPos); - if(tData.length>1){ - tData[1] += aPollution; - } - }else{ - tData[1] += aPollution; - GT_Proxy.chunkData.put(tPos, tData); + HashMap<ChunkCoordIntPair,int[]> dataMap=dimensionWiseChunkData.get(ch.worldObj.provider.dimensionId); + if(dataMap==null){ + dataMap=new HashMap<>(1024); + dimensionWiseChunkData.put(ch.worldObj.provider.dimensionId,dataMap); } - }catch(Exception e){ - + int[] dataArr=dataMap.get(ch.getChunkCoordIntPair()); + if(dataArr==null){ + dataArr=getDefaultChunkDataOnCreation(); + dataMap.put(ch.getChunkCoordIntPair(),dataArr); } + dataArr[GTPOLLUTION]+=aPollution; + if(dataArr[GTPOLLUTION]<0)dataArr[GTPOLLUTION]=0; + } + + public static int getPollution(IGregTechTileEntity te){ + return getPollution(te.getWorld().getChunkFromBlockCoords(te.getXCoord(),te.getZCoord())); + } + + public static int getPollution(Chunk ch){ + if(!GT_Mod.gregtechproxy.mPollution)return 0; + HashMap<ChunkCoordIntPair,int[]> dataMap=dimensionWiseChunkData.get(ch.worldObj.provider.dimensionId); + if(dataMap==null || dataMap.get(ch.getChunkCoordIntPair())==null) return 0; + return dataMap.get(ch.getChunkCoordIntPair())[GTPOLLUTION]; + } + + public static int getPollution(ChunkCoordIntPair aCh, int aDim){ + if(!GT_Mod.gregtechproxy.mPollution)return 0; + HashMap<ChunkCoordIntPair,int[]> dataMap=dimensionWiseChunkData.get(aDim); + if(dataMap==null || dataMap.get(aCh)==null) return 0; + return dataMap.get(aCh)[GTPOLLUTION]; + } + + //Add compatibility with old code + @Deprecated /*Don't use it... too weird way of passing position*/ + public static void addPollution(World aWorld, ChunkPosition aPos, int aPollution){ + //The abuse of ChunkPosition to store block position and dim... + //is just bad expacially when that is both used to store ChunkPos and BlockPos depeending on context + addPollution(aWorld.getChunkFromBlockCoords(aPos.chunkPosX,aPos.chunkPosZ),aPollution); } } diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index c60a0bdb13..f0706e7d69 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -6,6 +6,8 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.eventhandler.EventBus; +import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.FMLNetworkEvent; @@ -22,6 +24,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.net.GT_Packet_Pollution; import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_FluidStack; import gregtech.api.objects.GT_UO_DimensionList; @@ -36,6 +39,7 @@ import gregtech.common.items.armor.gui.ContainerElectricArmor1; import gregtech.common.items.armor.gui.GuiElectricArmor1; import gregtech.common.items.armor.gui.GuiModularArmor; import gregtech.common.items.armor.gui.InventoryArmor; +import gregtech.common.tools.GT_Tool; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; @@ -44,6 +48,7 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -55,20 +60,24 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; import net.minecraft.world.WorldSettings.GameType; import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.ChunkDataEvent; +import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; @@ -193,11 +202,13 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mEnableAllMaterials = false; public boolean mEnableAllComponents = false; public boolean mAddGTRecipesToIC2Machines = true; + public boolean mEnableCleanroom = true; public boolean mLowGravProcessing = false; public boolean mAprilFool = false; public boolean mCropNeedBlock = true; public boolean mReenableSimplifiedChemicalRecipes = false; public boolean mAMHInteraction = true; + public boolean mForceFreeFace = false; public GT_Proxy() { GameRegistry.registerFuelHandler(this); @@ -498,6 +509,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { break; } } + GT_LanguageManager.writePlaceholderStrings(); } public static long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE; @@ -582,6 +594,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + + dimensionWiseChunkData.clear();//!!! IMPORTANT for map switching... + dimensionWisePollution.clear();//!!! IMPORTANT for map switching... } public void onServerStarted() { @@ -1247,8 +1262,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } } - if(aEvent.world.provider.dimensionId==0) - GT_Pollution.onWorldTick(aEvent.world, (int) (aEvent.world.getTotalWorldTime() % 1200)); + + GT_Pollution.onWorldTick(aEvent); } } @@ -1260,7 +1275,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aEvent.player.setGameType(GameType.ADVENTURE); aEvent.player.capabilities.allowEdit = false; if (this.mAxeWhenAdventure) { - GT_Utility.sendChatToPlayer(aEvent.player, "It's dangerous to go alone! Take this."); + GT_Utility.sendChatToPlayer(aEvent.player, GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_097", "It's dangerous to go alone! Take this.", false)); aEvent.player.worldObj.spawnEntityInWorld(new EntityItem(aEvent.player.worldObj, aEvent.player.posX, aEvent.player.posY, aEvent.player.posZ, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.AXE, 1, Materials.Flint, Materials.Wood, null))); } @@ -1313,6 +1328,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aEvent.player.addExhaustion(Math.max(1.0F, tCount / 666.6F)); } } + if (aEvent.player.ticksExisted % 10 == 0) { + int tPollution = 0; + tPollution = GT_Pollution.getPollution(new ChunkCoordIntPair(aEvent.player.chunkCoordX,aEvent.player.chunkCoordZ), aEvent.player.dimension); + if(aEvent.player instanceof EntityPlayerMP)GT_Values.NW.sendToPlayer(new GT_Packet_Pollution(tPollution), (EntityPlayerMP) aEvent.player); + } } } @@ -1719,48 +1739,106 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { ProgressManager.pop(progressBar); } - public static final HashMap<ChunkPosition, int[]> chunkData = new HashMap<ChunkPosition, int[]>(5000); + public static final HashMap<Integer,HashMap<ChunkCoordIntPair,int []>> dimensionWiseChunkData = new HashMap<>(16);//stores chunk data that is loaded/saved + public static final HashMap<Integer,GT_Pollution> dimensionWisePollution = new HashMap<>(16);//stores GT_Polluttors objects + public static final byte GTOIL=3,GTOILFLUID=2,GTPOLLUTION=1,GTMETADATA=0,NOT_LOADED=0,LOADED=1;//consts + //@Deprecated + //public static final HashMap<ChunkPosition, int[]> chunkData = new HashMap<>(0); + + private static final byte oilVer=(byte)20;//non zero plz + + //TO get default's fast + public static int[] getDefaultChunkDataOnCreation(){ + return new int[]{NOT_LOADED,0,-1,-1}; + } + public static int[] getDefaultChunkDataOnLoad(){ + return new int[]{LOADED,0,-1,-1}; + } @SubscribeEvent - public void handleChunkSaveEvent(ChunkDataEvent.Save event) - { - ChunkPosition tPos = new ChunkPosition(event.getChunk().xPosition,event.getChunk().worldObj.provider.dimensionId,event.getChunk().zPosition); - if(chunkData.containsKey(tPos)){ - int[] tInts = chunkData.get(tPos); - if(tInts.length>0){event.getData().setInteger("GTOIL", tInts[0]);} - if(tInts.length>1){event.getData().setInteger("GTPOLLUTION", tInts[1]);} - if(tInts.length>2){event.getData().setInteger("GTOILFLUID", tInts[2]);} - } + public void handleChunkSaveEvent(ChunkDataEvent.Save event) {//ALWAYS SAVE FROM THE HASH MAP DATA + HashMap<ChunkCoordIntPair,int []> chunkData=dimensionWiseChunkData.get(event.world.provider.dimensionId); + if(chunkData==null) return;//no dim info stored + + int[] tInts = chunkData.get(event.getChunk().getChunkCoordIntPair()); + if(tInts==null) return;//no chunk data stored + //assuming len of this array 4 + if(tInts[3]>=0)event.getData().setInteger("GTOIL", tInts[GTOIL]); + else event.getData().removeTag("GTOIL"); + if(tInts[2]>=0)event.getData().setInteger("GTOILFLUID", tInts[GTOILFLUID]); + else event.getData().removeTag("GTOILFLUID"); + if(tInts[1]>0)event.getData().setInteger("GTPOLLUTION", tInts[GTPOLLUTION]); + else event.getData().removeTag("GTPOLLUTION"); + event.getData().setByte("GTOILVER", oilVer);//version mark } @SubscribeEvent - public void handleChunkLoadEvent(ChunkDataEvent.Load event) - { - int tOil = 0; - int tOilFluid = 0; - int tPollution = 0; - - ChunkPosition tPos = new ChunkPosition(event.getChunk().xPosition,event.getChunk().worldObj.provider.dimensionId,event.getChunk().zPosition); - int[] tData = new int[0]; - if(chunkData.containsKey(tPos)){ - tData = chunkData.get(tPos); - chunkData.remove(tPos); - if(tData.length>0) - tOil = tData[0]; - if(tData.length>1) - tPollution = tData[1]; - if(tData.length>2) - tOilFluid = tData[2]; + public void handleChunkLoadEvent(ChunkDataEvent.Load event) { + final int worldID=event.world.provider.dimensionId; + HashMap<ChunkCoordIntPair, int[]> chunkData = dimensionWiseChunkData.get(worldID); + if (chunkData == null){ + chunkData=new HashMap<>(1024); + dimensionWiseChunkData.put(worldID, chunkData); } + if (dimensionWisePollution.get(worldID) == null) + dimensionWisePollution.put(worldID, new GT_Pollution(event.world)); + + int[] tInts = chunkData.get(event.getChunk().getChunkCoordIntPair()); + if (tInts == null) { + //NOT LOADED and NOT PROCESSED by pollution algorithms + //regular load + tInts = getDefaultChunkDataOnLoad(); + + if (event.getData().getByte("GTOILVER") == oilVer) { + if (event.getData().hasKey("GTOIL")) + tInts[GTOIL] = event.getData().getInteger("GTOIL"); + if (event.getData().hasKey("GTOILFLUID")) + tInts[GTOILFLUID] = event.getData().getInteger("GTOILFLUID"); + } - if(tOil==0&&event.getData().hasKey("GTOIL")) - tOil = event.getData().getInteger("GTOIL"); - if(tPollution==0&&event.getData().hasKey("GTPOLLUTION")) - tPollution = event.getData().getInteger("GTPOLLUTION"); - if(tOilFluid==0&&event.getData().hasKey("GTOILFLUID")) - tOilFluid = event.getData().getInteger("GTOILFLUID"); + tInts[GTPOLLUTION] = event.getData().getInteger("GTPOLLUTION");//Defaults to 0 - chunkData.put(tPos, new int[]{tOil,tPollution,tOilFluid}); + //store in HASH MAP if has useful data + if (tInts[GTPOLLUTION] > 0 || tInts[GTOIL] >= 0 || tInts[GTOILFLUID] >= 0) + chunkData.put(event.getChunk().getChunkCoordIntPair(), tInts); + } else if (tInts[GTMETADATA] == NOT_LOADED) {//was NOT loaded from chunk save game data + //NOT LOADED but generated + //append load + if (event.getData().getByte("GTOILVER") == oilVer) { + if (tInts[GTOIL] < 0 && event.getData().hasKey("GTOIL"))//if was not yet initialized + tInts[GTOIL] = event.getData().getInteger("GTOIL"); + + if (tInts[GTOILFLUID] < 0 && event.getData().hasKey("GTOILFLUID"))//if was not yet initialized + tInts[GTOILFLUID] = event.getData().getInteger("GTOILFLUID"); + } else { + tInts[GTOIL] = -1; + tInts[GTOILFLUID] = -1; + } + + tInts[GTPOLLUTION] += event.getData().getInteger("GTPOLLUTION");//Defaults to 0, add stored pollution to data + tInts[GTMETADATA] = LOADED;//mark as = loaded + //store in HASHMAP + + chunkData.put(event.getChunk().getChunkCoordIntPair(), tInts); + }//else if(tInts[0]==1){ + ////Already loaded chunk data + ////DO NOTHING - this chunk data was already loaded and stored in hash map + //} + } + + @SubscribeEvent + public void onBlockBreakSpeedEvent(PlayerEvent.BreakSpeed aEvent) + { + if (aEvent.newSpeed > 0.0F) + { + if (aEvent.entityPlayer != null) + { + ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem(); + if ((aStack != null) && ((aStack.getItem() instanceof GT_MetaGenerated_Tool))) { + aEvent.newSpeed = ((GT_MetaGenerated_Tool)aStack.getItem()).onBlockBreakSpeedEvent(aEvent.newSpeed, aStack, aEvent.entityPlayer, aEvent.block, aEvent.x, aEvent.y, aEvent.z, (byte)aEvent.metadata, aEvent); + } + } + } } public static class OreDictEventContainer { diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index fbd57a8c74..346b8f4ba7 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -656,6 +656,9 @@ public class GT_RecipeAdder if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { return false; } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -100 : 0); return true; } @@ -685,6 +688,9 @@ public class GT_RecipeAdder if ((aDuration = GregTech_API.sRecipeFile.get("laserengraving", aEngravedItem, aDuration)) <= 0) { return false; } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.addRecipe(true, new ItemStack[]{aItemToEngrave, aLens}, new ItemStack[]{aEngravedItem}, null, null, null, aDuration, aEUt, aCleanroom ? -200 : 0); return true; } diff --git a/src/main/java/gregtech/common/GT_UndergroundOil.java b/src/main/java/gregtech/common/GT_UndergroundOil.java new file mode 100644 index 0000000000..a3e0962100 --- /dev/null +++ b/src/main/java/gregtech/common/GT_UndergroundOil.java @@ -0,0 +1,100 @@ +package gregtech.common; + +import gregtech.GT_Mod; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_UO_Fluid; +import gregtech.api.objects.XSTR; +import gregtech.common.GT_Proxy; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.HashMap; + +import static gregtech.api.util.GT_Utility.getScaleCoordinates; +import static gregtech.common.GT_Proxy.*; + +/** + * Created by Tec on 29.04.2017. + */ +public class GT_UndergroundOil { + public static final short DIVIDER=5000; + + public static FluidStack undergroundOil(IGregTechTileEntity te, float drainSpeedCoefficient){ + return undergroundOil(te.getWorld().getChunkFromBlockCoords(te.getXCoord(),te.getZCoord()),drainSpeedCoefficient); + } + + //Returns whole content for information purposes -> when drainSpeedCoeff < 0 + //Else returns extracted fluidStack if amount > 0, or null otherwise + public static FluidStack undergroundOil(Chunk chunk, float drainSpeedCoefficient) { + if (GT_Mod.gregtechproxy.mUndergroundOil.CheckBlackList(chunk.worldObj.provider.dimensionId)) return null; + World aWorld = chunk.worldObj; + + //Read hash map + HashMap<ChunkCoordIntPair, int[]> chunkData = dimensionWiseChunkData.get(aWorld.provider.dimensionId); + if(chunkData==null){ + chunkData=new HashMap<>(1024); + dimensionWiseChunkData.put(aWorld.provider.dimensionId,chunkData); + } + + int[] tInts = chunkData.get(chunk.getChunkCoordIntPair()); + + if(tInts==null) tInts=getDefaultChunkDataOnCreation();//init if null + else if(tInts[GTOIL]==0){//FAST stop + //can return 0 amount stack for info :D + return drainSpeedCoefficient>=0 ? null : new FluidStack(FluidRegistry.getFluid(tInts[GTOILFLUID]),0); + } + + //GEN IT TO GET OBJECT... + XSTR tRandom = new XSTR(aWorld.getSeed() + aWorld.provider.dimensionId * 2 + + (chunk.getChunkCoordIntPair().chunkXPos>>3) + + 8267 * (chunk.getChunkCoordIntPair().chunkZPos>>3)); + GT_UO_Fluid uoFluid = GT_Mod.gregtechproxy.mUndergroundOil.GetDimension(aWorld.provider.dimensionId).getRandomFluid(tRandom); + + //Fluid stack holder + FluidStack fluidInChunk; + + //Set fluidstack from uoFluid + if (uoFluid == null || uoFluid.getFluid()==null){ + tInts[GTOILFLUID]=Integer.MAX_VALUE;//null fluid pointer... kindof + tInts[GTOIL]=0; + chunkData.put(chunk.getChunkCoordIntPair(),tInts);//update hash map + return null; + } else { + if(tInts[GTOILFLUID]== uoFluid.getFluid().getID()){//if stored fluid matches uoFluid + fluidInChunk = new FluidStack(uoFluid.getFluid(),tInts[GTOIL]); + }else{ + fluidInChunk = new FluidStack(uoFluid.getFluid(), uoFluid.getRandomAmount(tRandom)); + tRandom=new XSTR(); + fluidInChunk.amount=(int)((float)fluidInChunk.amount*(0.75f+(tRandom.nextFloat()/2f)));//Randomly change amounts by +/- 25% + } + tInts[GTOIL]=fluidInChunk.amount; + tInts[GTOILFLUID]=fluidInChunk.getFluidID(); + } + + //do stuff on it if needed + if(drainSpeedCoefficient>=0){ + if(fluidInChunk.amount<DIVIDER){ + fluidInChunk=null; + tInts[GTOIL]=0;//so in next access it will stop way above + }else{ + fluidInChunk.amount = (int)(fluidInChunk.amount*(double)drainSpeedCoefficient/DIVIDER);//give appropriate amount + tInts[GTOIL]-=uoFluid.DecreasePerOperationAmount;//diminish amount + } + }else{//just get info + if(fluidInChunk.amount<DIVIDER){ + fluidInChunk.amount=0;//return informative stack + tInts[GTOIL]=0;//so in next access it will stop way above + }else{ + fluidInChunk.amount=fluidInChunk.amount/DIVIDER;//give moderate extraction speed + } + } + + chunkData.put(chunk.getChunkCoordIntPair(),tInts);//update hash map + return fluidInChunk; + } +} diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 73b720ca21..2b63f337c3 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -10,17 +10,15 @@ import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
+import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
-import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
-import net.minecraft.world.gen.ChunkProviderEnd;
-import net.minecraft.world.gen.ChunkProviderHell;
+import java.util.HashSet;
import java.util.Random;
-public class GT_Worldgenerator
- implements IWorldGenerator {
+public class GT_Worldgenerator implements IWorldGenerator {
private static int mEndAsteroidProbability = 300;
private static int mGCAsteroidProbability = 50;
private static int mSize = 100;
@@ -52,16 +50,16 @@ public class GT_Worldgenerator new WorldGenContainer(new XSTR(aRandom.nextInt()), aX * 16, aZ * 16, tempDimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName).run();
}
- public static class WorldGenContainer
- implements Runnable {
+ public static class WorldGenContainer implements Runnable {
public final Random mRandom;
- public final int mX;
- public final int mZ;
+ public int mX;
+ public int mZ;
public final int mDimensionType;
public final World mWorld;
public final IChunkProvider mChunkGenerator;
public final IChunkProvider mChunkProvider;
public final String mBiome;
+ public static HashSet<ChunkCoordIntPair> mGenerated = new HashSet<>(2000);
public WorldGenContainer(Random aRandom, int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider, String aBiome) {
this.mRandom = aRandom;
@@ -74,8 +72,22 @@ public class GT_Worldgenerator this.mBiome = aBiome;
}
+ //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square
+ public int getVeinCenterCoordinate(int c) {
+ c += c < 0 ? 1 : 3;
+ return c - c % 3 - 2;
+ }
+
+ public boolean surroundingChunksLoaded(int xCenter, int zCenter) {
+ return mWorld.checkChunksExist(xCenter - 16, 0, zCenter - 16, xCenter + 16, 0, zCenter + 16);
+ }
+
public void run() {
- if (((this.mX / 16 - 1) % 3 == 0) && ((this.mZ / 16 - 1) % 3 == 0)) {
+ int xCenter = getVeinCenterCoordinate(mX >> 4) << 4;
+ int zCenter = getVeinCenterCoordinate(mZ >> 4) << 4;
+ ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter);
+ if (surroundingChunksLoaded(xCenter, zCenter) && !mGenerated.contains(centerChunk)) {
+ mGenerated.add(centerChunk);
if ((GT_Worldgen_GT_Ore_Layer.sWeight > 0) && (GT_Worldgen_GT_Ore_Layer.sList.size() > 0)) {
boolean temp = true;
int tRandomWeight;
@@ -85,7 +97,7 @@ public class GT_Worldgenerator tRandomWeight -= ((GT_Worldgen_GT_Ore_Layer) tWorldGen).mWeight;
if (tRandomWeight <= 0) {
try {
- if (tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, this.mX, this.mZ, this.mChunkGenerator, this.mChunkProvider)) {
+ if (tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider)) {
temp = false;
}
break;
@@ -97,10 +109,9 @@ public class GT_Worldgenerator }
}
int i = 0;
- for (int tX = this.mX - 16; i < 3; tX += 16) {
+ for (int tX = xCenter - 16; i < 3; tX += 16) {
int j = 0;
- for (int tZ = this.mZ - 16; j < 3; tZ += 16) {
- String tBiome = this.mWorld.getBiomeGenForCoords(tX + 8, tZ + 8).biomeName;
+ for (int tZ = zCenter - 16; j < 3; tZ += 16) {
try {
for (GT_Worldgen tWorldGen : GregTech_API.sWorldgenList) {
tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, tX, tZ, this.mChunkGenerator, this.mChunkProvider);
@@ -118,7 +129,7 @@ public class GT_Worldgenerator String tDimensionName = this.mWorld.provider.getDimensionName();
Random aRandom = new Random();
if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0))) || ((tDimensionName.equals("Asteroids")) && gcAsteroids && ((mGCAsteroidProbability <= 1) || (aRandom.nextInt(mGCAsteroidProbability) == 0)))) {
- short primaryMeta = 0;
+ short primaryMeta = 0;
short secondaryMeta = 0;
short betweenMeta = 0;
short sporadicMeta = 0;
@@ -146,7 +157,7 @@ public class GT_Worldgenerator }
}
}
- if(GT_Values.D1)System.out.println("do asteroid gen: "+this.mX+" "+this.mZ);
+ if (GT_Values.D1) System.out.println("do asteroid gen: " + this.mX + " " + this.mZ);
int tX = mX + aRandom.nextInt(16);
int tY = 50 + aRandom.nextInt(200 - 50);
int tZ = mZ + aRandom.nextInt(16);
@@ -198,12 +209,7 @@ public class GT_Worldgenerator if (tDimensionType == 1) {
mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 2);
} else if (tDimensionName.equals("Asteroids")) {
- //int asteroidType = aRandom.nextInt(20);
- //if (asteroidType == 19) { //Rare Asteroid?
- //mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3);
- //} else {
mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3);
- //}
}
}
}
@@ -214,10 +220,8 @@ public class GT_Worldgenerator }
}
}
-
}
-
Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ);
if (tChunk != null) {
tChunk.isModified = true;
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index 3d8a814260..42e50794a2 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -196,6 +196,27 @@ public class GT_Block_Machines return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) {
+ return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+ return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = blockAccess.getTileEntity(aX, aY, aZ);
+ if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) {
+ AxisAlignedBB bbb = ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(((IGregTechTileEntity) tTileEntity).getWorld(), aX, aY, aZ).getOffsetBoundingBox(-aX, -aY, -aZ);
+ setBlockBounds((float) bbb.minX, (float) bbb.minY, (float) bbb.minZ, (float) bbb.maxX, (float) bbb.maxY, (float) bbb.maxZ);
+ return;
+ }
+ super.setBlockBoundsBasedOnState(blockAccess, aX, aY, aZ);
+ }
+
public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) {
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index d7a47c0bb6..c63882e944 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -184,7 +184,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { - return true; + return false; } public int damageDropped(int par1) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones.java index 05c294f0ee..993033051b 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones.java @@ -29,22 +29,11 @@ public class GT_Block_Stones extends GT_Block_Stones_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Mossy Basalt Bricks"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Chiseled Basalt"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Smooth Basalt"); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 0)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 1)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 2)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 3)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 4)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 5)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 6)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 7)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 8)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 9)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 10)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 11)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 12)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 13)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 14)); - GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 15)); + for(int i = 0;i<16;i++){ + GT_OreDictUnificator.registerOre(OrePrefixes.stone, i < 8 ? Materials.Marble : Materials.Basalt, new ItemStack(this, 1, i)); + GT_OreDictUnificator.registerOre(OrePrefixes.block, i < 8 ? Materials.Marble : Materials.Basalt, new ItemStack(this, 1, i)); + GT_OreDictUnificator.registerOre((i < 8 ? Materials.Marble.mName.toLowerCase() : Materials.Basalt.mName.toLowerCase()), new ItemStack(this, 1, i)); + } } public int getHarvestLevel(int aMeta) { diff --git a/src/main/java/gregtech/common/blocks/GT_Material_Casings.java b/src/main/java/gregtech/common/blocks/GT_Material_Casings.java index 211fbdd65f..94afcbd894 100644 --- a/src/main/java/gregtech/common/blocks/GT_Material_Casings.java +++ b/src/main/java/gregtech/common/blocks/GT_Material_Casings.java @@ -13,6 +13,6 @@ public class GT_Material_Casings }
public boolean isOpaque() {
- return false;
+ return true;
}
}
diff --git a/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java index a6cf425caa..4aa9ba6931 100644 --- a/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java @@ -12,6 +12,6 @@ public class GT_Material_Reinforced } public boolean isOpaque() { - return false; + return true; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java index d0c2ae3cc0..240ca3667d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -3,6 +3,7 @@ package gregtech.common.covers; import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IMachineProgress;
import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
@@ -38,7 +39,7 @@ public class GT_Cover_Arm } else {
aCoverVariable -= 16;
}
- GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? "Puts out into adjacent Slot #" : "Grabs in for own Slot #") + (Math.abs(aCoverVariable) - 1));
+ GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? trans("001","Puts out into adjacent Slot #") : trans("002","Grabs in for own Slot #")) + (Math.abs(aCoverVariable) - 1));
return aCoverVariable;
}
@@ -48,7 +49,7 @@ public class GT_Cover_Arm } else {
aCoverVariable--;
}
- GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? "Puts out into adjacent Slot #" : "Grabs in for own Slot #") + (Math.abs(aCoverVariable) - 1));
+ GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? trans("001","Puts out into adjacent Slot #") : trans("002","Grabs in for own Slot #")) + (Math.abs(aCoverVariable) - 1));
aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
return true;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java index abb6d0a3ad..f0bf72eacc 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -56,13 +56,13 @@ public class GT_Cover_ControlsWork aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 3;
if(aCoverVariable <0){aCoverVariable = 2;}
if (aCoverVariable == 0) {
- GT_Utility.sendChatToPlayer(aPlayer, "Normal");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("003", "Normal"));
}
if (aCoverVariable == 1) {
- GT_Utility.sendChatToPlayer(aPlayer, "Inverted");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("004", "Inverted"));
}
if (aCoverVariable == 2) {
- GT_Utility.sendChatToPlayer(aPlayer, "No Work at all");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("005", "No Work at all"));
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index 0168228bc5..ca3674efa4 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -38,18 +38,18 @@ public class GT_Cover_Conveyor aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12;
if(aCoverVariable <0){aCoverVariable = 11;}
switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Export"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); break;
- case 3: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break;
- case 4: GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); break;
- case 5: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break;
- case 6: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); break;
- case 7: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); break;
- case 8: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); break;
- case 9: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); break;
- case 10: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); break;
- case 11: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("006", "Export")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("007", "Import")); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("008", "Export (conditional)")); break;
+ case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("009", "Import (conditional)")); break;
+ case 4: GT_Utility.sendChatToPlayer(aPlayer, trans("010", "Export (invert cond)")); break;
+ case 5: GT_Utility.sendChatToPlayer(aPlayer, trans("011", "Import (invert cond)")); break;
+ case 6: GT_Utility.sendChatToPlayer(aPlayer, trans("012", "Export allow Input")); break;
+ case 7: GT_Utility.sendChatToPlayer(aPlayer, trans("013", "Import allow Output")); break;
+ case 8: GT_Utility.sendChatToPlayer(aPlayer, trans("014", "Export allow Input (conditional)")); break;
+ case 9: GT_Utility.sendChatToPlayer(aPlayer, trans("015", "Import allow Output (conditional)")); break;
+ case 10: GT_Utility.sendChatToPlayer(aPlayer, trans("016", "Export allow Input (invert cond)")); break;
+ case 11: GT_Utility.sendChatToPlayer(aPlayer, trans("017", "Import allow Output (invert cond)")); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java index 0a440c5ae4..7830b3824a 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -31,10 +31,10 @@ public class GT_Cover_DoesWork aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 4;
if(aCoverVariable <0){aCoverVariable = 3;}
switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Ready to work"); break;
- case 3: GT_Utility.sendChatToPlayer(aPlayer, "Not ready to work"); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("018", "Normal")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("019", "Inverted")); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("020", "Ready to work")); break;
+ case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("021", "Not ready to work")); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java index 09a7a9a36b..ee2ae8a303 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java @@ -61,12 +61,12 @@ public class GT_Cover_Drain aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 6;
if(aCoverVariable <0){aCoverVariable = 5;}
switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break;
- case 3: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away"); break;
- case 4: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (conditional)"); break;
- case 5: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (invert cond)"); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("022", "Import")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("023", "Import (conditional)")); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("024", "Import (invert cond)")); break;
+ case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("025", "Keep Liquids Away")); break;
+ case 4: GT_Utility.sendChatToPlayer(aPlayer, trans("026", "Keep Liquids Away (conditional)")); break;
+ case 5: GT_Utility.sendChatToPlayer(aPlayer, trans("027", "Keep Liquids Away (invert cond)")); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java index 8a59326236..87cb83598f 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -94,18 +94,18 @@ public class GT_Cover_EUMeter aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12;
if(aCoverVariable <0){aCoverVariable = 11;}
switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal Universal Storage"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Universal Storage"); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage"); break;
- case 3: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage"); break;
- case 4: GT_Utility.sendChatToPlayer(aPlayer, "Normal Steam Storage"); break;
- case 5: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Steam Storage"); break;
- case 6: GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Input"); break;
- case 7: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Input"); break;
- case 8: GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Output"); break;
- case 9: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Output"); break;
- case 10: GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage(Including Batteries)"); break;
- case 11: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage(Including Batteries)"); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("031", "Normal Universal Storage")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("032", "Inverted Universal Storage")); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("033", "Normal Electricity Storage")); break;
+ case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("034", "Inverted Electricity Storage")); break;
+ case 4: GT_Utility.sendChatToPlayer(aPlayer, trans("035", "Normal Steam Storage")); break;
+ case 5: GT_Utility.sendChatToPlayer(aPlayer, trans("036", "Inverted Steam Storage")); break;
+ case 6: GT_Utility.sendChatToPlayer(aPlayer, trans("037", "Normal Average Electric Input")); break;
+ case 7: GT_Utility.sendChatToPlayer(aPlayer, trans("038", "Inverted Average Electric Input")); break;
+ case 8: GT_Utility.sendChatToPlayer(aPlayer, trans("039", "Normal Average Electric Output")); break;
+ case 9: GT_Utility.sendChatToPlayer(aPlayer, trans("040", "Inverted Average Electric Output")); break;
+ case 10: GT_Utility.sendChatToPlayer(aPlayer, trans("041", "Normal Electricity Storage(Including Batteries)")); break;
+ case 11: GT_Utility.sendChatToPlayer(aPlayer, trans("042", "Inverted Electricity Storage(Including Batteries)")); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java index 2ab40531f3..46b34ebac9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java @@ -12,9 +12,9 @@ public class GT_Cover_EnergyOnly public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
aCoverVariable = (aCoverVariable + 1) % 3;
switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Allow"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Allow (conditional)"); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Disallow (conditional)"); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("028", "Allow")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("029", "Allow (conditional)")); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("030", "Disallow (conditional)")); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java index a8361a78dc..fd8e13504c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java @@ -72,7 +72,7 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { aCoverVariable = (0 - mTransferRate); } GT_Utility.sendChatToPlayer(aPlayer, - "Pump speed: " + aCoverVariable + "L/tick " + aCoverVariable * 20 + "L/sec"); + trans("048", "Pump speed: ") + aCoverVariable + trans("049", "L/tick ") + aCoverVariable * 20 + trans("050", "L/sec")); return aCoverVariable; } @@ -90,7 +90,7 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { aCoverVariable = (0 - mTransferRate); } GT_Utility.sendChatToPlayer(aPlayer, - "Pump speed: " + aCoverVariable + "L/tick " + aCoverVariable * 20 + "L/sec"); + trans("048", "Pump speed: ") + aCoverVariable + trans("049", "L/tick ") + aCoverVariable * 20 + trans("050", "L/sec")); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); return true; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java index 2b65e36994..9d54e83569 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java @@ -33,10 +33,10 @@ public class GT_Cover_Fluidfilter aFilterMode = (aFilterMode + (aPlayer.isSneaking()? -1 : 1)) % 4; if(aFilterMode < 0){aFilterMode = 3;} switch(aFilterMode) { - case 0: GT_Utility.sendChatToPlayer(aPlayer, "Allow input, no output"); break; - case 1: GT_Utility.sendChatToPlayer(aPlayer, "Deny input, no output"); break; - case 2: GT_Utility.sendChatToPlayer(aPlayer, "Allow input, permit any output"); break; - case 3: GT_Utility.sendChatToPlayer(aPlayer, "Deny input, permit any output"); break; + case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("043", "Allow input, no output")); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("044", "Deny input, no output")); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("045", "Allow input, permit any output")); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("046", "Deny input, permit any output")); break; } aCoverVariable|=aFilterMode; return aCoverVariable; @@ -54,7 +54,7 @@ public class GT_Cover_Fluidfilter aCoverVariable = (aCoverVariable & 7) | (aFluid << 3); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); FluidStack sFluid = new FluidStack(FluidRegistry.getFluid(aFluid),1000); - GT_Utility.sendChatToPlayer(aPlayer, "Filter Fluid: " + sFluid.getLocalizedName()); + GT_Utility.sendChatToPlayer(aPlayer, trans("047", "Filter Fluid: ") + sFluid.getLocalizedName()); }else if(tStack.getItem() instanceof IFluidContainerItem){ IFluidContainerItem tContainer = (IFluidContainerItem)tStack.getItem(); if(tContainer.getFluid(tStack) != null) { @@ -62,7 +62,7 @@ public class GT_Cover_Fluidfilter aCoverVariable = (aCoverVariable & 7) | (aFluid << 3); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); FluidStack sFluid = new FluidStack(FluidRegistry.getFluid(aFluid),1000); - GT_Utility.sendChatToPlayer(aPlayer, "Filter Fluid: " + sFluid.getLocalizedName()); + GT_Utility.sendChatToPlayer(aPlayer, trans("047", "Filter Fluid: ") + sFluid.getLocalizedName()); } } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index d353b715dc..448470f87f 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -38,9 +38,9 @@ public class GT_Cover_ItemMeter public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (1 + aTileEntity.getSizeInventory());
switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); break;
- default: GT_Utility.sendChatToPlayer(aPlayer, "Slot: " + (aCoverVariable - 2)); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("051", "Normal")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("052", "Inverted")); break;
+ default: GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (aCoverVariable - 2)); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java index 882c32e244..4874e4bd82 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -42,9 +42,9 @@ public class GT_Cover_LiquidMeter public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); + GT_Utility.sendChatToPlayer(aPlayer, trans("054", "Inverted")); } else { - GT_Utility.sendChatToPlayer(aPlayer, "Normal"); + GT_Utility.sendChatToPlayer(aPlayer, trans("055", "Normal")); } return aCoverVariable == 0 ? 1 : 0; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java index 1f5c5c2fbb..4c0f47751f 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -64,18 +64,18 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12; if(aCoverVariable <0){aCoverVariable = 11;} switch(aCoverVariable) { - case 0: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintenance Needed"); break; - case 1: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintenance Needed(inverted)"); break; - case 2: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintenance Needed"); break; - case 3: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintenance Needed(inverted)"); break; - case 4: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintenance Needed"); break; - case 5: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintenance Needed(inverted)"); break; - case 6: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 4 Maintenance Needed"); break; - case 7: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 4 Maintenance Needed(inverted)"); break; - case 8: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintenance Needed"); break; - case 9: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintenance Needed(inverted)"); break; - case 10: GT_Utility.sendChatToPlayer(aPlayer, "Emit if rotor needs maintainance"); break; - case 11: GT_Utility.sendChatToPlayer(aPlayer, "Emit if rotor needs maintainance(inverted)"); break; + case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("056", "Emit if 1 Maintenance Needed")); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("057", "Emit if 1 Maintenance Needed(inverted)")); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("058", "Emit if 2 Maintenance Needed")); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("059", "Emit if 2 Maintenance Needed(inverted)")); break; + case 4: GT_Utility.sendChatToPlayer(aPlayer, trans("060", "Emit if 3 Maintenance Needed")); break; + case 5: GT_Utility.sendChatToPlayer(aPlayer, trans("061", "Emit if 3 Maintenance Needed(inverted)")); break; + case 6: GT_Utility.sendChatToPlayer(aPlayer, trans("062", "Emit if 4 Maintenance Needed")); break; + case 7: GT_Utility.sendChatToPlayer(aPlayer, trans("063", "Emit if 4 Maintenance Needed(inverted)")); break; + case 8: GT_Utility.sendChatToPlayer(aPlayer, trans("064", "Emit if 5 Maintenance Needed")); break; + case 9: GT_Utility.sendChatToPlayer(aPlayer, trans("065", "Emit if 5 Maintenance Needed(inverted)")); break; + case 10: GT_Utility.sendChatToPlayer(aPlayer, trans("066", "Emit if rotor needs maintainance")); break; + case 11: GT_Utility.sendChatToPlayer(aPlayer, trans("067", "Emit if rotor needs maintainance(inverted)")); break; } return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java index d76a05117b..9e6c764170 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -56,9 +56,9 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 3; if(aCoverVariable <0){aCoverVariable = 2;} switch(aCoverVariable) { - case 0: GT_Utility.sendChatToPlayer(aPlayer, "Emit if any Player is close"); break; - case 1: GT_Utility.sendChatToPlayer(aPlayer, "Emit if other player is close"); break; - case 2: GT_Utility.sendChatToPlayer(aPlayer, "Emit if you are close"); break; + case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("068", "Emit if any Player is close")); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("069", "Emit if other Player is close")); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("070", "Emit if you are close")); break; } return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index 2bae554b76..1572d33edc 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -71,18 +71,18 @@ public class GT_Cover_Pump aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12;
if(aCoverVariable <0){aCoverVariable = 11;}
switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Export"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); break;
- case 3: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break;
- case 4: GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); break;
- case 5: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break;
- case 6: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); break;
- case 7: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); break;
- case 8: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); break;
- case 9: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); break;
- case 10: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); break;
- case 11: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("006", "Export")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("007", "Import")); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("008", "Export (conditional)")); break;
+ case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("009", "Import (conditional)")); break;
+ case 4: GT_Utility.sendChatToPlayer(aPlayer, trans("010", "Export (invert cond)")); break;
+ case 5: GT_Utility.sendChatToPlayer(aPlayer, trans("011", "Import (invert cond)")); break;
+ case 6: GT_Utility.sendChatToPlayer(aPlayer, trans("012", "Export allow Input")); break;
+ case 7: GT_Utility.sendChatToPlayer(aPlayer, trans("013", "Import allow Output")); break;
+ case 8: GT_Utility.sendChatToPlayer(aPlayer, trans("014", "Export allow Input (conditional)")); break;
+ case 9: GT_Utility.sendChatToPlayer(aPlayer, trans("015", "Import allow Output (conditional)")); break;
+ case 10: GT_Utility.sendChatToPlayer(aPlayer, trans("016", "Export allow Input (invert cond)")); break;
+ case 11: GT_Utility.sendChatToPlayer(aPlayer, trans("017", "Import allow Output (invert cond)")); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java index 9675ef6c99..d824727492 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java @@ -21,13 +21,13 @@ public class GT_Cover_RedstoneConductor aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 7;
if(aCoverVariable <0){aCoverVariable = 6;}
switch (aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Conducts strongest Input"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from bottom Input"); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from top Input"); break;
- case 3: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from north Input"); break;
- case 4: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from south Input"); break;
- case 5: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from west Input"); break;
- case 6: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from east Input"); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("071", "Conducts strongest Input")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("072", "Conducts from bottom Input")); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("073", "Conducts from top Input")); break;
+ case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("074", "Conducts from north Input")); break;
+ case 4: GT_Utility.sendChatToPlayer(aPlayer, trans("075", "Conducts from south Input")); break;
+ case 5: GT_Utility.sendChatToPlayer(aPlayer, trans("076", "Conducts from west Input")); break;
+ case 6: GT_Utility.sendChatToPlayer(aPlayer, trans("077", "Conducts from east Input")); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java index fa1af824b3..cda45256b9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java @@ -12,9 +12,9 @@ public class GT_Cover_RedstoneSignalizer public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
aCoverVariable = (aCoverVariable + 1) % 48;
switch(aCoverVariable / 16) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Signal = " + (aCoverVariable & 0xF)); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Conditional Signal = " + (aCoverVariable & 0xF)); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Conditional Signal = " + (aCoverVariable & 0xF)); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("078", "Signal = ") + (aCoverVariable & 0xF)); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("079", "Conditional Signal = ") + (aCoverVariable & 0xF)); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("080", "Inverted Conditional Signal = ") + (aCoverVariable & 0xF)); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index 490cfe05a2..960d3e6c56 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -19,7 +19,7 @@ public abstract class GT_Cover_RedstoneWirelessBase GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte) 0));
aCoverVariable = GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem());
aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
- GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + aCoverVariable);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("081", "Frequency: ") + aCoverVariable);
return true;
}
return false;
@@ -43,7 +43,7 @@ public abstract class GT_Cover_RedstoneWirelessBase aCoverVariable += 1024;
}
}
- GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + aCoverVariable);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("081", "Frequency: ") + aCoverVariable);
return aCoverVariable;
}
@@ -72,7 +72,7 @@ public abstract class GT_Cover_RedstoneWirelessBase }
public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return "Frequency: " + aCoverVariable;
+ return trans("081", "Frequency: ") + aCoverVariable;
}
public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java index a936d8db2a..0bc513c2d6 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -17,10 +17,10 @@ public class GT_Cover_Shutter aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 4;
if(aCoverVariable <0){aCoverVariable = 3;}
switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, "Open if work enabled"); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, "Open if work disabled"); break;
- case 2: GT_Utility.sendChatToPlayer(aPlayer, "Only Output allowed"); break;
- case 3: GT_Utility.sendChatToPlayer(aPlayer, "Only Input allowed"); break;
+ case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("082", "Open if work enabled")); break;
+ case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("083", "Open if work disabled")); break;
+ case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("084", "Only Output allowed")); break;
+ case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("085", "Only Intput allowed")); break;
}
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java index e22c2945b9..a0f24b3d02 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java @@ -29,6 +29,6 @@ public class GT_Cover_Vent }
public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return 60;
+ return 100;
}
}
diff --git a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java index 8cd6e9db54..b061cca2e5 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java @@ -39,27 +39,27 @@ public class GT_Container_ChestBuffer if (aSlotIndex == 27) {
((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("116","Emit Energy to Outputside"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("117","Don't emit Energy"));
}
return null;
}
if (aSlotIndex == 28) {
((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if no Slot is free");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("118","Emit Redstone if no Slot is free"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("119","Don't emit Redstone"));
}
return null;
}
if (aSlotIndex == 29) {
((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert) {
- GT_Utility.sendChatToPlayer(aPlayer, "Invert Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("120","Invert Redstone"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("121","Don't invert Redstone"));
}
return null;
}
diff --git a/src/main/java/gregtech/common/gui/GT_Container_Filter.java b/src/main/java/gregtech/common/gui/GT_Container_Filter.java index 2c2e4e8c13..9e5e2195fc 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Filter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Filter.java @@ -72,45 +72,45 @@ public class GT_Container_Filter if (aSlotIndex == 18) {
((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("116","Emit Energy to Outputside"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("117","Don't emit Energy"));
}
return null;
}
if (aSlotIndex == 19) {
((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if slots contain something");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("122","Emit Redstone if slots contain something"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("123","Don't emit Redstone"));
}
return null;
}
if (aSlotIndex == 20) {
((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert) {
- GT_Utility.sendChatToPlayer(aPlayer, "Invert Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("120","Invert Redstone"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("121","Don't invert Redstone"));
}
return null;
}
if (aSlotIndex == 21) {
((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter) {
- GT_Utility.sendChatToPlayer(aPlayer, "Invert Filter");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("124","Invert Filter"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Filter");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("125","Don't invert Filter"));
}
return null;
}
if (aSlotIndex == 22) {
((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT) {
- GT_Utility.sendChatToPlayer(aPlayer, "Ignore NBT");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("126","Ignore NBT"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "NBT has to match");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("127","NBT has to match"));
}
return null;
}
diff --git a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java index c9e51ecb81..b4e8e7aebb 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.automation.GT_MetaTileEntity_Regulator;
import net.minecraft.entity.player.EntityPlayer;
@@ -73,9 +74,9 @@ public class GT_Container_Regulator if (aSlotIndex == 28) {
((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("116", "Emit Energy to Outputside"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("117", "Don't emit Energy"));
}
return null;
}
diff --git a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java index 46d011dcb6..4ffa2b9e23 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java @@ -34,27 +34,27 @@ public class GT_Container_SuperBuffer if (aSlotIndex == 0) {
((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("116","Emit Energy to Outputside"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("117","Don't emit Energy"));
}
return null;
}
if (aSlotIndex == 1) {
((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if no Slot is free");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("118","Emit Redstone if no Slot is free"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("119","Don't emit Redstone"));
}
return null;
}
if (aSlotIndex == 2) {
((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert) {
- GT_Utility.sendChatToPlayer(aPlayer, "Invert Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("120","Invert Redstone"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("121","Don't invert Redstone"));
}
return null;
}
diff --git a/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java b/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java index d492ee2336..bedd14e8a6 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java @@ -53,45 +53,45 @@ public class GT_Container_TypeFilter if (aSlotIndex == 10) {
((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("116","Emit Energy to Outputside"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("117","Don't emit Energy"));
}
return null;
}
if (aSlotIndex == 11) {
((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if slots contain something");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("122","Emit Redstone if slots contain something"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("123","Don't emit Redstone"));
}
return null;
}
if (aSlotIndex == 12) {
((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bInvert);
if (((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bInvert) {
- GT_Utility.sendChatToPlayer(aPlayer, "Invert Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("120","Invert Redstone"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Redstone");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("121","Don't invert Redstone"));
}
return null;
}
if (aSlotIndex == 13) {
((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bInvertFilter = (!((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bInvertFilter);
if (((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bInvertFilter) {
- GT_Utility.sendChatToPlayer(aPlayer, "Invert Filter");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("124","Invert Filter"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Filter");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("125","Don't invert Filter"));
}
return null;
}
if (aSlotIndex == 14) {
((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bNBTAllowed = (!((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bNBTAllowed);
if (((GT_MetaTileEntity_TypeFilter) this.mTileEntity.getMetaTileEntity()).bNBTAllowed) {
- GT_Utility.sendChatToPlayer(aPlayer, "Allow Items with NBT");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("126","Ignore NBT"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, "Don't allow Items with NBT");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("127","NBT has to match"));
}
return null;
}
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 27e2356f0e..46e9a368ec 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -42,7 +42,7 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { setBurnValue(17000 + Materials.Wood.mMetaItemSubID, 1600);
GT_OreDictUnificator.addToBlacklist(new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID));
- GT_ModHandler.addCompressionRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 8L), new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID));
+ GT_ModHandler.addCompressionRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID));
GregTech_API.registerCover(new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID), new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE), null);
ItemStack tStack = new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID);
@@ -626,9 +626,9 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.Circuit_Data.set(addItem(tLastID = 704, "Workstation", "A extreme Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION}));
ItemList.Circuit_Elite.set(addItem(tLastID = 705, "Mainframe", "A elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION}));
ItemList.Circuit_Master.set(addItem(tLastID = 706, "Nanoprocessor Mainframe", "A master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION}));
- ItemList.Tool_DataOrb.set(addItem(tLastID = 707, "Data Orb", "A High Capacity Data Storage and Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION, new Behaviour_DataOrb()}));
+ ItemList.Tool_DataOrb.set(addItem(tLastID = 707, "Data Orb", "A High Capacity Data Storage", new Object[]{SubTag.NO_UNIFICATION, new Behaviour_DataOrb()}));
GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataOrb.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataOrb.get(1L, new Object[0])});
- ItemList.Tool_DataStick.set(addItem(tLastID = 708, "Data Stick", "A Low Capacity Data Storage and Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION, new Behaviour_DataStick()}));
+ ItemList.Tool_DataStick.set(addItem(tLastID = 708, "Data Stick", "A Low Capacity Data Storage", new Object[]{SubTag.NO_UNIFICATION, new Behaviour_DataStick()}));
GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataStick.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataStick.get(1L, new Object[0])});
ItemList.Circuit_Board_Basic.set(addItem(tLastID = 710, "Coated Circuit Board", "A basic Board", new Object[0])); ItemList.Circuit_Board_Coated.set(ItemList.Circuit_Board_Basic.get(1,new Object[0]));
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java index cf57b4edb6..b773b4d78d 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java @@ -81,9 +81,9 @@ public class GT_MetaGenerated_Item_03 *
* quantum chips
*/
- ItemList.Circuit_Silicon_Ingot.set(addItem(tLastID = 30, "Monocrystalline Silicon Ingot", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Ingot2.set(addItem(tLastID = 31, "Glowstone doped Monocrystalline Silicon Ingot", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Ingot3.set(addItem(tLastID = 32, "Naquadah doped Monocrystalline Silicon Ingot", "Raw Circuit", o));
+ ItemList.Circuit_Silicon_Ingot.set(addItem(tLastID = 30, "Monocrystalline Silicon Boule", "Raw Circuit", o));
+ ItemList.Circuit_Silicon_Ingot2.set(addItem(tLastID = 31, "Glowstone doped Monocrystalline Silicon Boule", "Raw Circuit", o));
+ ItemList.Circuit_Silicon_Ingot3.set(addItem(tLastID = 32, "Naquadah doped Monocrystalline Silicon Boule", "Raw Circuit", o));
ItemList.Circuit_Silicon_Wafer.set(addItem(tLastID = 33, "Wafer", "Raw Circuit", o));
ItemList.Circuit_Silicon_Wafer2.set(addItem(tLastID = 34, "Glowstone doped Wafer", "Raw Circuit", o));
@@ -146,7 +146,7 @@ public class GT_MetaGenerated_Item_03 ItemList.Circuit_Processor.set(addItem(tLastID = 80, "Integrated Processor", "Good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION}));
// ItemList.Circuit_Computer.set(addItem(tLastID = 81, "Processor Assembly", "Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION}));
- //Workstation/DataStick Item01 Datacircuit
+ //Workstation Item01 Datacircuit
//Mainframe Item01 DataProcessor
ItemList.Circuit_Nanoprocessor.set(addItem(tLastID = 82, "Nanoprocessor", "Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION}));
@@ -160,15 +160,15 @@ public class GT_MetaGenerated_Item_03 ItemList.Circuit_Quantummainframe.set(addItem(tLastID = 88, "Quantumprocessor Mainframe", "Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION}));
ItemList.Circuit_Crystalprocessor.set(addItem(tLastID = 89, "Crystalprocessor", "Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION}));
- //Dataorb Dataorb
- ItemList.Circuit_Crystalcomputer.set(addItem(tLastID = 90, "Crystalprocessor Assembly", "Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION}));
+ ItemList.Circuit_Crystalcomputer.set(addItem(tLastID = 96, "Crystalprocessor Assembly", "Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION}));
+ ItemList.Circuit_Ultimatecrystalcomputer.set(addItem(tLastID = 90, "Ultimate Crystalcomputer", "Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION}));
ItemList.Circuit_Crystalmainframe.set(addItem(tLastID = 91, "Crystalprocessor Mainframe", "Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION}));
ItemList.Circuit_Neuroprocessor.set(addItem(tLastID = 92, "Wetwareprocessor", "Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION}));
ItemList.Circuit_Wetwarecomputer.set(addItem(tLastID = 93, "Wetwareprocessor Assembly", "Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION}));
ItemList.Circuit_Wetwaresupercomputer.set(addItem(tLastID = 94, "Wetware Supercomputer", "Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION}));
ItemList.Circuit_Wetwaremainframe.set(addItem(tLastID = 95, "Wetware Mainframe", "Infinite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Ultimate.set(ItemList.Circuit_Crystalcomputer.get(1L, new Object[0]));
+ ItemList.Circuit_Ultimate.set(ItemList.Circuit_Ultimatecrystalcomputer.get(1L, new Object[0]));//maybe should be removed
}
public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java index 66ed8bb672..bad13f591f 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java @@ -3,6 +3,7 @@ package gregtech.common.items.behaviors; import gregtech.api.enums.SubTag;
import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.items.GT_MetaBase_Item;
+import gregtech.api.util.GT_LanguageManager;
import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
import net.minecraft.dispenser.IBlockSource;
@@ -68,5 +69,9 @@ public class Behaviour_None public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
return null;
+ }
+
+ public String trans(String aKey, String aEnglish){
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
}
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java index c950cc8fe1..de22776eb3 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java @@ -13,6 +13,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract;
import gregtech.common.blocks.GT_TileEntity_Ores;
import net.minecraft.block.Block;
+import net.minecraft.block.BlockLiquid;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -39,68 +40,70 @@ public class Behaviour_Prospecting if (aWorld.isRemote) {
return false;
}
- Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
-
-
+ Block aBlock = aWorld.getBlock(aX, aY, aZ);
+ if (aBlock == null) {
+ return false;
+ }
+ byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
- GT_Utility.sendChatToPlayer(aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
- return true;
- }
- if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone))) {
- if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
- int tX = aX;
- int tY = aY;
- int tZ = aZ;
- int tMetaID = 0;
- int tQuality = (aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0;
-
- int i = 0;
- for (int j = 6 + tQuality; i < j; i++) {
- tX -= ForgeDirection.getOrientation(aSide).offsetX;
- tY -= ForgeDirection.getOrientation(aSide).offsetY;
- tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
-
- Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if ((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Rock.");
- break;
- }
- if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock))) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Rock.");
- break;
- }
- if ((tBlock == Blocks.monster_egg) || (!GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ))) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Rock.");
- break;
- }
- if (tBlock != aBlock) {
- if (i >= 4) {
- break;
- }
- GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Rock.");
- break;
- }
- }
- Random tRandom = new XSTR(aX ^ aY ^ aZ ^ aSide);
- i = 0;
- for (int j = 9 + 2 * tQuality; i < j; i++) {
- tX = aX - 4 - tQuality + tRandom.nextInt(j);
- tY = aY - 4 - tQuality + tRandom.nextInt(j);
- tZ = aZ - 4 - tQuality + tRandom.nextInt(j);
- Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))){
+ GT_Utility.sendChatToPlayer(aPlayer, trans("100","This is ") + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + trans("101"," Ore."));
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ return true;
+ }
+
+ if (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) ||
+ aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack) ||
+ aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone) ||
+ aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockStones) ||
+ aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) ||
+ (aBlock == GregTech_API.sBlockOresUb1) ||
+ (aBlock == GregTech_API.sBlockOresUb2) ||
+ (aBlock == GregTech_API.sBlockOresUb3) ||
+ (aBlock == GregTech_API.sBlockOres1) ||
+ (aBlock == GregTech_API.sBlockOresGC)){
+ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ int tMetaID = 0;
+ int tQuality = (aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0;
+ int tX = aX, tY = aY, tZ = aZ;
+ Block tBlock;
+ for (int i = 0, j = (int)(6 + tQuality); i < j; i++) {
+ tX -= ForgeDirection.getOrientation(aSide).offsetX;
+ tY -= ForgeDirection.getOrientation(aSide).offsetY;
+ tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
+
+ tBlock = aWorld.getBlock(tX, tY, tZ);
+ if (tBlock == Blocks.lava || tBlock == Blocks.flowing_lava) {
+ GT_Utility.sendChatToPlayer(aPlayer, trans("102","There is Lava behind this Rock."));
+ break;
+ }
+ if (tBlock instanceof BlockLiquid || tBlock instanceof IFluidBlock) {
+ GT_Utility.sendChatToPlayer(aPlayer, trans("103","There is a Liquid behind this Rock."));
+ break;
+ }
+ if (tBlock == Blocks.monster_egg || !GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ)) {
+ GT_Utility.sendChatToPlayer(aPlayer, trans("104","There is an Air Pocket behind this Rock."));
+ break;
+ }
+ if (tBlock != aBlock) {
+ if (i < 4) GT_Utility.sendChatToPlayer(aPlayer, trans("105","Material is changing behind this Rock."));
+ break;
+ }
+ }
+
+ Random tRandom = new XSTR(aX^aY^aZ^aSide);
+ for (int i = 0, j = (int)(9+2*tQuality); i < j; i++) {
+ tX = aX-4-tQuality+tRandom.nextInt(j);
+ tY = aY-4-tQuality+tRandom.nextInt(j);
+ tZ = aZ-4-tQuality+tRandom.nextInt(j);
+ tBlock = aWorld.getBlock(tX, tY, tZ);
if ((tBlock instanceof GT_Block_Ores_Abstract)) {
TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
- GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("106","Found traces of ") + tMaterial.mDefaultLocalName + trans("101"," Ore."));
return true;
}
}
@@ -108,16 +111,16 @@ public class Behaviour_Prospecting tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
- GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ GT_Utility.sendChatToPlayer(aPlayer, trans("106","Found traces of ") + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + trans("101"," Ore."));
return true;
}
}
- }
- GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
- }
- return true;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, trans("107","No Ores found."));
+ return true;
+ }
}
- return false;
+ return false;
}
public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index b16986fffd..c725634030 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -148,7 +148,7 @@ public class GT_MetaTileEntity_Boiler_Bronze this.mTemperature += 1; } if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20); + GT_Pollution.addPollution(getBaseMetaTileEntity(), 20); } aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index 3e5afedba2..8aef783b6b 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -127,7 +127,7 @@ public class GT_MetaTileEntity_Boiler_Lava }
if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) {
- GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20);
+ GT_Pollution.addPollution(getBaseMetaTileEntity(), 20);
}
aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 5d7ec97401..208c4d4e91 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -25,7 +25,7 @@ public class GT_MetaTileEntity_Boiler_Steel super(aID, aName, aNameRegional, new String[]{
"Faster than the Bronze Boiler",
"Produces 300L of Steam per second",
- "Causes 20 Pollution per second"});
+ "Causes 30 Pollution per second"});
}
public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -153,7 +153,7 @@ public class GT_MetaTileEntity_Boiler_Steel this.mTemperature += 1;
}
if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) {
- GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20);
+ GT_Pollution.addPollution(getBaseMetaTileEntity(), 30);
}
aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java index 7501924f69..2ae23a0d80 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java @@ -29,7 +29,7 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],aSide==1?(aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)):Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; } @Override @@ -46,7 +46,12 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach World aWorld = aBaseMetaTileEntity.getWorld(); XSTR aXSTR = new XSTR(); if (!aWorld.isRemote) { - if(aBaseMetaTileEntity.getStoredEU()>0)aBaseMetaTileEntity.decreaseStoredEnergyUnits(aBaseMetaTileEntity.getStoredEU()/100+1, false); + if(aBaseMetaTileEntity.getStoredEU()>0){ + aBaseMetaTileEntity.setActive(true); + aBaseMetaTileEntity.decreaseStoredEnergyUnits(aBaseMetaTileEntity.getStoredEU()/100+1, false); + }else { + aBaseMetaTileEntity.setActive(false); + } if (aTick % 256 == 0 && (aWorld.isThundering() || (aWorld.isRaining() && aXSTR.nextInt(10) == 0))) { int aRodValue = 0; @@ -68,10 +73,8 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach } if (!aWorld.isThundering() && ((aY + aRodValue) < 128)) aRodValue = 0; if (aXSTR.nextInt(4 * aWorld.getHeight()) < (aRodValue * (aY + aRodValue))) { - aBaseMetaTileEntity.setActive(true); aBaseMetaTileEntity.increaseStoredEnergyUnits(maxEUStore() - aBaseMetaTileEntity.getStoredEU(), false); aWorld.addWeatherEffect(new EntityLightningBolt(aWorld, aX, aY + aRodValue, aZ)); - aBaseMetaTileEntity.setActive(false); } } } @@ -94,7 +97,7 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public boolean isFacingValid(byte aFacing) { - return true; + return aFacing==1; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 270fef65e3..24eaf87292 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -22,6 +22,7 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_UndergroundOil; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; import ic2.core.Ic2Items; @@ -31,6 +32,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraftforge.fluids.FluidStack; @@ -141,25 +143,24 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba int tLeftZBound = GT_Utility.getScaleCoordinates(this.getBaseMetaTileEntity().getZCoord() - radius, 16); int tRightZBound = GT_Utility.getScaleCoordinates(this.getBaseMetaTileEntity().getZCoord() + radius, 16); - HashMap<ChunkPosition, FluidStack> tFluids = new HashMap<ChunkPosition, FluidStack>(); + HashMap<ChunkCoordIntPair, FluidStack> tFluids = new HashMap<>(); try { for (int x = tLeftXBound; x <= tRightXBound; ++x) for (int z = tLeftZBound; z <= tRightZBound; ++z) { ChunkPosition tPos = new ChunkPosition(GT_Utility.getScaleCoordinates(x*16,96), 0, GT_Utility.getScaleCoordinates(z*16,96)); - FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), x*16, z*16); + ChunkCoordIntPair cInts = getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(tPos.chunkPosX,tPos.chunkPosZ).getChunkCoordIntPair(); + FluidStack tFluid = GT_UndergroundOil.undergroundOil(getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(tPos.chunkPosX,tPos.chunkPosZ),-1); if (tFluid != null) - if (tFluids.containsKey(tPos)) - { - if (tFluids.get(tPos).amount<tFluid.amount) - tFluids.get(tPos).amount = tFluid.amount; - } else if (tFluid.amount / 5000 > 0) - tFluids.put(tPos, tFluid); + if (tFluids.containsKey(cInts)) { + if (tFluids.get(cInts).amount<tFluid.amount) + tFluids.get(cInts).amount = tFluid.amount; + } else tFluids.put(cInts, tFluid); } - for (HashMap.Entry<ChunkPosition, FluidStack> fl : tFluids.entrySet()) { - aOils.put(fl.getKey().chunkPosX + "," + fl.getKey().chunkPosZ + "," + (fl.getValue().amount / 5000) + "," + fl.getValue().getLocalizedName(), fl.getValue().amount / 5000); + for (Map.Entry<ChunkCoordIntPair, FluidStack> fl : tFluids.entrySet()) { + aOils.put(fl.getKey().chunkXPos + "," + fl.getKey().chunkZPos + "," + fl.getValue().amount + "," + fl.getValue().getLocalizedName(), fl.getValue().amount); } } catch (Exception e) { // TODO: handle exception diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java index a60ed1daed..859dd0a6e1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java @@ -111,7 +111,8 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt mPassiveEnergyUse = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.PassiveEnergy", true); } - public void onFirstTick() { + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { if (getBaseMetaTileEntity().isServerSide()) { if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) { this.mTargetX = getBaseMetaTileEntity().getXCoord(); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index b088e10d69..85defad0cb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -12,6 +12,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_UndergroundOil; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; import ic2.core.Ic2Items; @@ -102,7 +103,7 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic } } if(tStringList.size()<1){tStringList.add("No Ores found.");} - FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()); + FluidStack tFluid = GT_UndergroundOil.undergroundOil(getBaseMetaTileEntity(),-1); String[] tStringArray = new String[tStringList.size()]; { for (int i = 0; i < tStringArray.length; i++) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index a834e48db7..aa4e5645a0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -205,7 +205,8 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { sFPowerMultiplyer = sPowerMultiplyer / 100.0; } - public void onFirstTick() { + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { if (getBaseMetaTileEntity().isServerSide()) { if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) { this.mTargetX = getBaseMetaTileEntity().getXCoord(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index ea8eb2f7ba..3b287d9ca4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -23,6 +23,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.ChunkPosition;
+import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_BronzeBlastFurnace
@@ -187,10 +188,6 @@ public class GT_MetaTileEntity_BronzeBlastFurnace }
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if ((aBaseMetaTileEntity.isClientSide()) &&
- (aBaseMetaTileEntity.isActive())) {
- aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D);
- }
if (aBaseMetaTileEntity.isServerSide()) {
if (this.mUpdate-- == 0) {
this.mMachine = checkMachine();
@@ -210,7 +207,7 @@ public class GT_MetaTileEntity_BronzeBlastFurnace }
}
if(this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){
- GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 50);
+ GT_Pollution.addPollution(getBaseMetaTileEntity(), 50);
}
aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
@@ -233,8 +230,20 @@ public class GT_MetaTileEntity_BronzeBlastFurnace this.mUpdate = 1;
}
}
+ }else if(aBaseMetaTileEntity.isActive()){
+ World aWorld=aBaseMetaTileEntity.getWorld();
+ double xPos=aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1);
+ double yPos=aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1)+0.05F;
+ double zPos=aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1);
+ XSTR floatGen=new XSTR();
+ aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.3D, 0.0D);
+ //Pollution particles intensify
+ if(GT_Pollution.getPollution(getBaseMetaTileEntity())>GT_Mod.gregtechproxy.mPollutionSmogLimit){
+ aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.45D, 0.0D);
+ aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.6D, 0.0D);
+ }
}
- }
+}
private void addOutputProducts() {
if (this.mOutputItem1 != null) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 11c0fd109a..ff3af18e53 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -87,7 +87,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock this.mEfficiency = 10000; this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), mMaxProgresstime*5); + GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime*5); return true; } else { this.mEfficiency = 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index ac7f7729d0..d68383272c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -33,12 +33,13 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas public String[] getDescription() { return new String[]{ "Controller Block for the Cleanroom", - "Min(WxHxD): 3x3x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)", - "Controller (Top center), Walls Plascrete", + "Min(WxHxD): 3x4x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)", + "Controller (Top center)", "Top besides contoller and edges Filter Machine Casings", - "1x Reinforced Door", + "1 Reinforced Door (keep closed for 100% efficency", "1x MV+ Energy Hatch, 1x Maintainance Hatch", - "up to 10 Machine Hulls to transfer Items & Energy inside"}; + "Up to 10 Machine Hulls to transfer Items & Energy through walls", + "Remaining Blocks Plascrete"}; } public boolean checkRecipe(ItemStack aStack) { @@ -148,9 +149,18 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas if (doorState) { mEfficiency = Math.max(0, mEfficiency - 200); } - + for(byte i = 0 ; i<6 ; i++){ + byte t = (byte) Math.max(1, (byte)(15/(10000f / mEfficiency))); + aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, t); + } + return true; } + + @Override + public boolean allowGeneralRedstoneOutput(){ + return true; + } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == 0 || aSide == 1) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index ed7100f30a..1c49f4fd9f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -41,9 +41,9 @@ public abstract class GT_MetaTileEntity_LargeBoiler "Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s",
"A programmed circuit in the main block throttles the boiler (-1000L/s per config)",
"Size(WxHxD): 3x5x3, Controller (Front middle in Fireboxes)",
- "3x1x3 of Firebox Casings (Bottom layer, Min 3)",
- "3x4x3 of Machine Casings/Plated Bricks (Above Fireboxes, hollow, Min 24!)",
- "1x3x1 of Pipe Casings (Inside the Hollow Machine Casings/Plated Bricks)",
+ "3x1x3 of " +getCasingMaterial()+ " Firebox Casings (Bottom layer, Min 3)",
+ "3x4x3 of " +getCasingMaterial()+ " Machine Casings/Plated Bricks (Above Fireboxes, hollow, Min 24!)",
+ "1x3x1 of " +getCasingMaterial()+ " Pipe Casings (Inside the Hollow Machine Casings/Plated Bricks)",
"1x Fuel Input Hatch/Bus (Any Firebox)",
"1x Water Input Hatch (Any Firebox)",
"1x Steam Output Hatch (Any Casing)",
@@ -53,6 +53,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler String.format("Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()),
"Causes up to " + 20 * getPollutionPerTick(null) + " Pollution per second"};
}
+
+ public abstract String getCasingMaterial();
public abstract Block getCasingBlock();
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java index 7c5dad3c96..cc494498da 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -18,6 +18,10 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName);
}
+
+ public String getCasingMaterial(){
+ return "Bronze";
+ }
public Block getCasingBlock() {
return GregTech_API.sBlockCasings1;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java index a68c0e6212..984290a3c6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -18,6 +18,10 @@ public class GT_MetaTileEntity_LargeBoiler_Steel public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName);
}
+
+ public String getCasingMaterial(){
+ return "Steel";
+ }
public Block getCasingBlock() {
return GregTech_API.sBlockCasings2;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index 6fc32f8c34..144c44aeed 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -18,6 +18,10 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName); } + + public String getCasingMaterial(){ + return "Titanium"; + } public Block getCasingBlock() { return GregTech_API.sBlockCasings4; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index 997a176e34..b69bac2f94 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -18,6 +18,10 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName);
}
+
+ public String getCasingMaterial(){
+ return "TungstenSteel";
+ }
public Block getCasingBlock() {
return GregTech_API.sBlockCasings4;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java index ec901e0dfc..7d6fe5935c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java @@ -18,6 +18,8 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import static gregtech.common.GT_UndergroundOil.undergroundOil; + public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase { private boolean completedCycle = false; @@ -73,12 +75,13 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase } } } - FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), true); + FluidStack tFluid = undergroundOil(getBaseMetaTileEntity(),.5F+(getInputTier()*.25F)); if (tFluid == null) { stopMachine(); return false; } if (getYOfPumpHead() > 0 && getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) { + if (completedCycle) { moveOneDown(); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 318d700195..5811743432 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -22,6 +23,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; + public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase { GT_Recipe mLastRecipe; @@ -64,7 +67,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl public GT_Recipe.GT_Recipe_Map getRecipeMap() { if (mInventory[1] == null) return null; - String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", ""); + String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt\\.blockmachines\\.basicmachine\\.", ""); if (tmp.startsWith("centrifuge")) { return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; } else if (tmp.startsWith("electrolyzer")) { @@ -131,8 +134,25 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl return GT_Recipe.GT_Recipe_Map.sPolarizerRecipes; } else if(tmp.startsWith("press")){ return GT_Recipe.GT_Recipe_Map.sPressRecipes; + } else if (tmp.startsWith("plasmaarcfurnace")) { + return GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes; + } else if (tmp.startsWith("printer")) { + return GT_Recipe.GT_Recipe_Map.sPrinterRecipes; + } else if (tmp.startsWith("press")) { + return GT_Recipe.GT_Recipe_Map.sPressRecipes; + } else if (tmp.startsWith("fluidcanner")) { + return GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes; + } else if (tmp.startsWith("fluidheater")) { + return GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes; + } else if (tmp.startsWith("distillery")) { + return GT_Recipe.GT_Recipe_Map.sDistilleryRecipes; + } else if (tmp.startsWith("slicer")) { + return GT_Recipe.GT_Recipe_Map.sSlicerRecipes; + } else if (tmp.startsWith("amplifier")) { + return GT_Recipe.GT_Recipe_Map.sAmplifiers; + } else if (tmp.startsWith("circuitassembler")) { + return GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes; } - return null; } @@ -153,9 +173,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl return false; } GT_Recipe.GT_Recipe_Map map = getRecipeMap(); - if (map == null) { - return false; - } + if (map == null) return false; ArrayList<ItemStack> tInputList = getStoredInputs(); int tTier = 0; if (mInventory[1].getUnlocalizedName().endsWith("1")) { @@ -186,6 +204,10 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl if (tInputList.size() > 0 || tFluids.length > 0) { GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if (tRecipe != null) { + if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && + !isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId)) + return false; + mLastRecipe = tRecipe; this.mEUt = 0; this.mOutputItems = null; diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java index 2bfc81caf4..a17f11d495 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java @@ -61,44 +61,6 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMach return true; } -// public void onRightclick(EntityPlayer aPlayer) -// { -// ItemStack tPlayerItem = aPlayer.inventory.getCurrentItem(); -// if (tPlayerItem == null) -// { -// if (this.mItemID > 0) -// { -// for (int i = 0; (this.mItemCount < getMaxItemCount()) && (i < aPlayer.field_71071_by.func_70302_i_()); i++) -// { -// if ((aPlayer.field_71071_by.func_70301_a(i) != null) && (aPlayer.field_71071_by.func_70301_a(i).field_77993_c == this.mItemID) && (aPlayer.field_71071_by.func_70301_a(i).func_77960_j() == this.mItemMeta) && (!aPlayer.field_71071_by.func_70301_a(i).func_77942_o())) -// { -// this.mItemCount += aPlayer.field_71071_by.func_70301_a(i).field_77994_a; -// if (aPlayer.field_71071_by.func_70301_a(i).field_77994_a == 111) -// { -// this.mItemCount = (getMaxItemCount() + 192 - (this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].field_77994_a) + (this.mInventory[1] == null ? 0 : this.mInventory[1].field_77994_a) + (this.mInventory[2] == null ? 0 : this.mInventory[2].field_77994_a))); -// } -// else if (this.mItemCount > getMaxItemCount()) -// { -// aPlayer.field_71071_by.func_70301_a(i).field_77994_a = (this.mItemCount - getMaxItemCount()); -// this.mItemCount = getMaxItemCount(); -// } -// else -// { -// aPlayer.field_71071_by.func_70301_a(i).field_77994_a = 0; -// } -// } -// if ((aPlayer.field_71071_by.func_70301_a(i) != null) && (aPlayer.field_71071_by.func_70301_a(i).field_77994_a <= 0)) { -// aPlayer.field_71071_by.func_70299_a(i, null); -// } -// } -// GT_Utility.sendChatToPlayer(aPlayer, this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].field_77994_a) + (this.mInventory[1] == null ? 0 : this.mInventory[1].field_77994_a) + (this.mInventory[2] == null ? 0 : this.mInventory[2].field_77994_a) + " of " + new ItemStack(this.mItemID, 1, this.mItemMeta).func_82833_r()); -// } -// } -// if (aPlayer.field_71069_bz != null) { -// aPlayer.field_71069_bz.func_75142_b(); -// } -// } - @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_QuantumChest(aPlayerInventory, aBaseMetaTileEntity); @@ -113,9 +75,6 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMach public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().isAllowedToWork()) { -// if(mInventory[0]!=null)System.out.println("input: "+mInventory[0].stackSize); -// System.out.println("store: "+mItemCount); -// if(mInventory[0]!=null)System.out.println("output: "+mInventory[2].stackSize); if ((getItemCount() <= 0)) { this.mItemStack = null; this.mItemCount = 0; diff --git a/src/main/java/gregtech/common/tools/GT_Tool.java b/src/main/java/gregtech/common/tools/GT_Tool.java index a1596ba93e..5f54f7bdc3 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool.java +++ b/src/main/java/gregtech/common/tools/GT_Tool.java @@ -14,6 +14,7 @@ import net.minecraft.stats.AchievementList; import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.IChatComponent;
+import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;
import java.util.List;
@@ -145,4 +146,9 @@ public abstract class GT_Tool public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
return aOriginalDamage;
}
+
+ @Override
+ public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, int aX, int aY, int aZ) {
+ return aDefault;
+ }
}
diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java index f74aeca505..c536361b1f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java @@ -12,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
+import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;
import java.util.List;
@@ -96,6 +97,21 @@ public class GT_Tool_Axe }
return rAmount;
}
+
+ public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ)
+ {
+ if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))){
+ float rAmount = 1.0F;float tIncrement = 1.0F;
+ if ((GregTech_API.sTimber) && !aPlayer.isSneaking()){
+ int tY = aY + 1;
+ for (int tH = aPlayer.worldObj.getHeight(); (tY < tH) && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); tY++){
+ tIncrement += 0.1F;rAmount += tIncrement;
+ }
+ }
+ return 2.0F * aDefault / rAmount;
+ }
+ return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault;
+ }
public ItemStack getBrokenItem(ItemStack aStack) {
return null;
diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java index a1acbf100b..93722c52f7 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java @@ -20,6 +20,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
+import net.minecraft.world.World;
import net.minecraftforge.common.IShearable;
import net.minecraftforge.event.world.BlockEvent;
@@ -135,6 +136,21 @@ public class GT_Tool_Chainsaw_LV }
return rAmount;
}
+
+ public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ)
+ {
+ if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))){
+ float rAmount = 1.0F;float tIncrement = 1.0F;
+ if ((GregTech_API.sTimber) && !aPlayer.isSneaking()){
+ int tY = aY + 1;
+ for (int tH = aPlayer.worldObj.getHeight(); (tY < tH) && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); tY++){
+ tIncrement += 0.1F;rAmount += tIncrement;
+ }
+ }
+ return 2.0F * aDefault / rAmount;
+ }
+ return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault;
+ }
public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV;
diff --git a/src/main/java/gregtech/loaders/load/GT_FuelLoader.java b/src/main/java/gregtech/loaders/load/GT_FuelLoader.java index ae7a3ad88c..188a6590b9 100644 --- a/src/main/java/gregtech/loaders/load/GT_FuelLoader.java +++ b/src/main/java/gregtech/loaders/load/GT_FuelLoader.java @@ -19,7 +19,7 @@ public class GT_FuelLoader implements Runnable {
public void run() {
GT_Log.out.println("GT_Mod: Initializing various Fuels.");
- ItemList.sNitricAcid = GT_Mod.gregtechproxy.addFluid("nitricacid", "Nitric acid ", Materials.NitricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.NitricAcid, 1), ItemList.Cell_Empty.get(1, new Object[0]), 1000);
+ ItemList.sNitricAcid = GT_Mod.gregtechproxy.addFluid("nitricacid", "Nitric Acid ", Materials.NitricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.NitricAcid, 1), ItemList.Cell_Empty.get(1, new Object[0]), 1000);
ItemList.sBlueVitriol = GT_Mod.gregtechproxy.addFluid("solution.bluevitriol", "Blue Vitriol water solution", null, 1, 295);
ItemList.sNickelSulfate = GT_Mod.gregtechproxy.addFluid("solution.nickelsulfate", "Nickel sulfate water solution", null, 1, 295);
ItemList.sIndiumConcentrate = GT_Mod.gregtechproxy.addFluid("indiumconcentrate", "Indium Concentrate", null, 1, 295);
diff --git a/src/main/java/gregtech/loaders/misc/GT_CoverLoader.java b/src/main/java/gregtech/loaders/misc/GT_CoverLoader.java index 9ceba95798..55d2e1afbe 100644 --- a/src/main/java/gregtech/loaders/misc/GT_CoverLoader.java +++ b/src/main/java/gregtech/loaders/misc/GT_CoverLoader.java @@ -1,10 +1,12 @@ package gregtech.loaders.misc;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
+import gregtech.common.covers.GT_Cover_Vent;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -14,10 +16,10 @@ public class GT_CoverLoader for (byte i = 0; i < 16; i = (byte) (i + 1)) {
GregTech_API.registerCover(new ItemStack(Blocks.carpet, 1, i), new GT_CopiedBlockTexture(Blocks.wool, 0, i), null);
}
- GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVent", 1L), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), null);
- GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentCore", 1L), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), null);
- GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentGold", 1L), new GT_RenderedTexture(Textures.BlockIcons.VENT_ADVANCED), null);
- GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentSpread", 1L), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), null);
- GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentDiamond", 1L), new GT_RenderedTexture(Textures.BlockIcons.VENT_ADVANCED), null);
+ GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVent", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_Vent(1));
+ GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentCore", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_Vent(1));
+ GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentGold", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_ADVANCED), new GT_Cover_Vent(2));
+ GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentSpread", 1L), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_Vent(2));
+ GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentDiamond", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_ADVANCED), new GT_Cover_Vent(3));
}
}
diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java index 2e00133a69..64a8edaa5b 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java @@ -85,7 +85,7 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist if (aMaterial.mFuelPower > 0) GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, aMaterial.mFuelPower, aMaterial.mFuelType); GT_Utility.removeSimpleIC2MachineRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_ModHandler.getCompressorRecipeList(), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L)); - GT_Values.RA.addImplosionRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), 2, GT_OreDictUnificator.get(OrePrefixes.compressed, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); + GT_Values.RA.addImplosionRecipe(GT_Utility.copyAmount(aMaterial == Materials.MeteoricIron ? 1 : 2, new Object[]{aStack}), 2, GT_OreDictUnificator.get(OrePrefixes.compressed, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, aMaterial, 2L), GT_Proxy.tBits, new Object[]{"hX", 'X', OrePrefixes.plate.get(aMaterial)}); if (aMaterial == Materials.Paper) diff --git a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java index eda9101a32..6fc2fdefd9 100644 --- a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java @@ -519,7 +519,7 @@ if(Loader.isModLoaded("Railcraft")){ //Highly Integrated Circuits GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Epoxy.get(1,o),ItemList.Circuit_Chip_CPU.get(1,o),ItemList.Circuit_Parts_Resistor.get(4,o),ItemList.Circuit_Parts_Capacitor.get(4,o),ItemList.Circuit_Parts_Transistor.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.RedAlloy, 4)},tMat.getMolten(144L * tMultiplier / 2L), ItemList.Circuit_Processor.get(1,o), 200, 60); GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Epoxy.get(1,o),ItemList.Circuit_Processor.get(3,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_Capacitor.get(4,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.RedAlloy, 12)},tMat.getMolten(144L * tMultiplier), ItemList.Circuit_Computer.get(1,o), 400, 90); - GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Epoxy.get(1,o),ItemList.Circuit_Chip_CPU.get(1,o),ItemList.Circuit_Chip_NAND.get(32,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.RedAlloy, 8),GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 4)},tMat.getMolten(144L * tMultiplier), ItemList.Tool_DataStick.get(1,o), 400, 90); + GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Epoxy.get(1,o),ItemList.Circuit_Processor.get(1,o),ItemList.Circuit_Chip_NAND.get(32,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.RedAlloy, 8),GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 4)},tMat.getMolten(144L * tMultiplier), ItemList.Tool_DataStick.get(1,o), 400, 90); GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Epoxy.get(2,o),ItemList.Circuit_Advanced.get(2,o),ItemList.Circuit_Parts_Diode.get(4,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 6)},tMat.getMolten(144L * tMultiplier), ItemList.Circuit_Data.get(1,o), 400, 90); GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1),ItemList.Circuit_Data.get(4,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_Capacitor.get(24,o),ItemList.Circuit_Chip_Ram.get(16,o),GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.AnnealedCopper, 12)},tMat.getMolten(144L * tMultiplier*2), ItemList.Circuit_Elite.get(1,o), 1600, 480); GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Epoxy.get(1,o),ItemList.Circuit_Chip_CPU.get(1,o),ItemList.Circuit_Parts_ResistorSMD.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(4,o),ItemList.Circuit_Parts_TransistorSMD.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.RedAlloy, 4)},tMat.getMolten(144L * tMultiplier / 2L), ItemList.Circuit_Processor.get(1,o), 200, 60); @@ -529,6 +529,7 @@ if(Loader.isModLoaded("Railcraft")){ //Nanotech Circuits GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Fiberglass.get(1,o),ItemList.Circuit_Chip_NanoCPU.get(1,o),ItemList.Circuit_Parts_ResistorSMD.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(4,o),ItemList.Circuit_Parts_TransistorSMD.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 2)},tMat.getMolten(144L * tMultiplier / 2L), ItemList.Circuit_Nanoprocessor.get(1,o), 200, 600); GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Fiberglass.get(1,o),ItemList.Circuit_Nanoprocessor.get(3,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(4,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 6)},tMat.getMolten(144L * tMultiplier), ItemList.Circuit_Nanocomputer.get(1,o), 400, 600); + GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Fiberglass.get(1,o),ItemList.Circuit_Nanoprocessor.get(1,o),ItemList.Circuit_Chip_Ram.get(4,o),ItemList.Circuit_Chip_NOR.get(32,o),ItemList.Circuit_Chip_NAND.get(64,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Platinum, 32)},tMat.getMolten(144L * tMultiplier), ItemList.Tool_DataOrb.get(1,o), 400, 1200); GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Fiberglass.get(2,o),ItemList.Circuit_Nanocomputer.get(2,o),ItemList.Circuit_Parts_DiodeSMD.get(4,o),ItemList.Circuit_Chip_NOR.get(4,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 6)},tMat.getMolten(144L * tMultiplier), ItemList.Circuit_Elitenanocomputer.get(1,o), 400, 600); GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1),ItemList.Circuit_Elitenanocomputer.get(4,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(24,o),ItemList.Circuit_Chip_Ram.get(16,o),GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.AnnealedCopper, 12)},tMat.getMolten(144L * tMultiplier*2), ItemList.Circuit_Master.get(1,o), 1600, 1920); //Quantum Circuits @@ -538,9 +539,9 @@ if(Loader.isModLoaded("Railcraft")){ GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1),ItemList.Circuit_Masterquantumcomputer.get(4,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(24,o),ItemList.Circuit_Chip_Ram.get(16,o),GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.AnnealedCopper, 12)},tMat.getMolten(144L * tMultiplier*2), ItemList.Circuit_Quantummainframe.get(1,o), 1600, 7680); //Crystallized Circuits GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Multifiberglass.get(1,o),ItemList.Circuit_Chip_CrystalCPU.get(1,o),ItemList.Circuit_Chip_NanoCPU.get(1,o),ItemList.Circuit_Parts_CapacitorSMD.get(4,o),ItemList.Circuit_Parts_TransistorSMD.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.NiobiumTitanium, 2)},tMat.getMolten(144L * tMultiplier / 2L), ItemList.Circuit_Crystalprocessor.get(1,o), 200, 9600); - GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Multifiberglass.get(1,o),ItemList.Circuit_Crystalprocessor.get(3,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(4,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.NiobiumTitanium, 6)},tMat.getMolten(144L * tMultiplier), ItemList.Circuit_Crystalcomputer.get(1,o), 400, 9600); - GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Multifiberglass.get(1,o),ItemList.Circuit_Crystalprocessor.get(1,o),ItemList.Circuit_Chip_Ram.get(4,o),ItemList.Circuit_Chip_NOR.get(32,o),ItemList.Circuit_Chip_NAND.get(64,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.NiobiumTitanium, 32)},tMat.getMolten(144L * tMultiplier), ItemList.Tool_DataOrb.get(1,o), 400, 9600); - GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1),ItemList.Circuit_Crystalcomputer.get(8,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(24,o),ItemList.Circuit_Chip_Ram.get(16,o),GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 12)},tMat.getMolten(144L * tMultiplier*2), ItemList.Circuit_Crystalmainframe.get(1,o), 1600, 30720); + GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Multifiberglass.get(1,o),ItemList.Circuit_Crystalprocessor.get(3,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(4,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.NiobiumTitanium, 6)},tMat.getMolten(144L * tMultiplier), ItemList.Circuit_Crystalcomputer.get(1,o), 400, 9600); + GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Multifiberglass.get(2,o),ItemList.Circuit_Crystalcomputer.get(2,o),ItemList.Circuit_Parts_DiodeSMD.get(4,o),ItemList.Circuit_Chip_NOR.get(4,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.NiobiumTitanium, 6)},tMat.getMolten(144L * tMultiplier), ItemList.Circuit_Ultimatecrystalcomputer.get(1,o), 400, 9600); + GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1),ItemList.Circuit_Ultimatecrystalcomputer.get(4,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(24,o),ItemList.Circuit_Chip_Ram.get(16,o),GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 12)},tMat.getMolten(144L * tMultiplier*2), ItemList.Circuit_Crystalmainframe.get(1,o), 1600, 30720); //Wetware Circuits GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Wetware.get(1,o),ItemList.Circuit_Chip_NeuroCPU.get(1,o),ItemList.Circuit_Chip_CrystalCPU.get(1,o),ItemList.Circuit_Parts_CapacitorSMD.get(4,o),ItemList.Circuit_Parts_TransistorSMD.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.YttriumBariumCuprate, 2)},tMat.getMolten(144L * tMultiplier / 2L), ItemList.Circuit_Neuroprocessor.get(1,o), 200, 38400); GT_Values.RA.addCircuitAssemblerRecipe(new ItemStack[]{ItemList.Circuit_Board_Wetware.get(1,o),ItemList.Circuit_Neuroprocessor.get(3,o),ItemList.Circuit_Parts_Coil.get(4,o),ItemList.Circuit_Parts_CapacitorSMD.get(4,o),ItemList.Circuit_Chip_Ram.get(4,o),GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.YttriumBariumCuprate, 6)},tMat.getMolten(144L * tMultiplier), ItemList.Circuit_Wetwarecomputer.get(1,o), 400, 38400); @@ -2148,9 +2149,9 @@ if(Loader.isModLoaded("Railcraft")){ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 64), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 4), }, new FluidStack[]{ - new FluidStack(FluidRegistry.getFluid("ic2biomass"), 250), + GregTech_API.mIC2Classic ? Materials.Water.getFluid(250) : new FluidStack(FluidRegistry.getFluid("ic2biomass"), 250), Materials.UUMatter.getFluid(100), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 1000) + GregTech_API.mIC2Classic ? Materials.Lava.getFluid(1000) : new FluidStack(FluidRegistry.getFluid("ic2coolant"), 1000) }, ItemList.Circuit_Chip_NeuroCPU.get(1,o), 200, 80000); GT_Values.RA.addAssemblylineRecipe(ItemList.Circuit_Wetwaresupercomputer.get(1,o), 288000, new ItemStack[]{ @@ -2165,7 +2166,7 @@ if(Loader.isModLoaded("Railcraft")){ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 64) }, new FluidStack[]{ Materials.SolderingAlloy.getMolten(2880), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 10000) + GregTech_API.mIC2Classic ? Materials.Water.getFluid(10000) : new FluidStack(FluidRegistry.getFluid("ic2coolant"), 10000) }, ItemList.Circuit_Wetwaremainframe.get(1,o), 2000, 300000); GT_Values.RA.addAssemblylineRecipe(ItemList.Energy_LapotronicOrb2.get(1,o), 288000, new ItemStack[]{ @@ -2182,7 +2183,7 @@ if(Loader.isModLoaded("Railcraft")){ GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 32), }, new FluidStack[]{ Materials.SolderingAlloy.getMolten(2880), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000) + GregTech_API.mIC2Classic ? Materials.Water.getFluid(16000) : new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000) }, ItemList.ZPM2.get(1,o), 2000, 300000); GT_Values.RA.addAssemblylineRecipe(GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 1), 144000, new ItemStack[]{ diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java index 47968f37b2..de9b9b724e 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java @@ -1,6 +1,7 @@ package gregtech.loaders.preload; import cpw.mods.fml.common.Loader; +import codechicken.nei.api.API;
import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.*; @@ -38,6 +39,8 @@ public class GT_Loader_MetaTileEntities implements Runnable { private final static String aTextWireHull = "WMW"; private final static String aTextWireChest = "WTW"; private final static String aTextWireCoil = "WCW"; private final static String aTextMotorWire = "EWE"; private final static String aTextWirePump = "WPW"; private final static boolean aBoolConst_0 = false; + private final static Boolean isNEILoaded = Loader.isModLoaded("NotEnoughItems");
+
private static void run1() { long bits = GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED; long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED; @@ -1242,7 +1245,15 @@ public class GT_Loader_MetaTileEntities implements Runnable { GT_ModHandler.addCraftingRecipe(ItemList.Casing_EngineIntake.get(2L, new Object[0]), bitsd, new Object[]{"PhP", "RFR", aTextPlateWrench, 'R', OrePrefixes.pipeMedium.get(Materials.Titanium), 'F', ItemList.Casing_StableTitanium, 'P', OrePrefixes.rotor.get(Materials.Titanium)}); ItemList.Machine_Multi_Cleanroom.set(new GT_MetaTileEntity_Cleanroom(1172, "multimachine.cleanroom", "Cleanroom Controller").getStackForm(1)); + //If Cleanroom is enabled, add a recipe, else hide from NEI.
+ if (GT_Mod.gregtechproxy.mEnableCleanroom){
GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_Cleanroom.get(1L, new Object[0]), bitsd, new Object[]{"FFF", "RHR", "MCM", 'H', ItemList.Hull_HV, 'F', ItemList.Component_Filter, 'R', OrePrefixes.rotor.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.circuit.get(Materials.Advanced)}); + }
+ else {
+ if (isNEILoaded){
+ API.hideItem(ItemList.Machine_Multi_Cleanroom.get(1L, new Object[0]));
+ }
+ }
ItemList.Machine_LV_CircuitAssembler.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 1180, "basicmachine.circuitassembler.tier.01", "Basic Circuit Assembling Machine", 1, "Avengers, Assemble!", GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes, 6, 1, 16000, 0, 1, "CircuitAssembler.png", "", aBoolConst_0, aBoolConst_0, 0, "CIRCUITASSEMBLER", new Object[]{"ACE", "VMV", aTextWireCoil, 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CONVEYOR, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.BETTER_CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'E', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.EMITTER}).getStackForm(1L)); ItemList.Machine_MV_CircuitAssembler.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 1181, "basicmachine.circuitassembler.tier.02", "Advanced Circuit Assembling Machine", 2, "Avengers, Assemble!", GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes, 6, 1, 16000, 0, 1, "CircuitAssembler.png", "", aBoolConst_0, aBoolConst_0, 0, "CIRCUITASSEMBLER", new Object[]{"ACE", "VMV", aTextWireCoil, 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CONVEYOR, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.BETTER_CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'E', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.EMITTER}).getStackForm(1L)); @@ -1338,32 +1349,32 @@ public class GT_Loader_MetaTileEntities implements Runnable { GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(Materials.Copper), new GT_MetaPipeEntity_Fluid(5111, "GT_Pipe_Copper_Small", "Small Copper Fluid Pipe", 0.375F, Materials.Copper, 20, 1000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Copper), new GT_MetaPipeEntity_Fluid(5112, "GT_Pipe_Copper", "Copper Fluid Pipe", 0.5F, Materials.Copper, 60, 1000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Copper), new GT_MetaPipeEntity_Fluid(5113, "GT_Pipe_Copper_Large", "Large Copper Fluid Pipe", 0.75F, Materials.Copper, 120, 1000, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Copper), new GT_MetaPipeEntity_Fluid(5114, "GT_Pipe_Copper_Huge", "Huge Copper Fluid Pipe", 1.0F, Materials.Copper, 240, 1000, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Copper), new GT_MetaPipeEntity_Fluid(5114, "GT_Pipe_Copper_Huge", "Huge Copper Fluid Pipe", 0.875F, Materials.Copper, 240, 1000, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(Materials.Bronze), new GT_MetaPipeEntity_Fluid(5120, "GT_Pipe_Bronze_Tiny", "Tiny Bronze Fluid Pipe", 0.25F, Materials.Bronze, 20, 2000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(Materials.Bronze), new GT_MetaPipeEntity_Fluid(5121, "GT_Pipe_Bronze_Small", "Small Bronze Fluid Pipe", 0.375F, Materials.Bronze, 40, 2000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Bronze), new GT_MetaPipeEntity_Fluid(5122, "GT_Pipe_Bronze", "Bronze Fluid Pipe", 0.5F, Materials.Bronze, 120, 2000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Bronze), new GT_MetaPipeEntity_Fluid(5123, "GT_Pipe_Bronze_Large", "Large Bronze Fluid Pipe", 0.75F, Materials.Bronze, 240, 2000, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Bronze), new GT_MetaPipeEntity_Fluid(5124, "GT_Pipe_Bronze_Huge", "Huge Bronze Fluid Pipe", 1.0F, Materials.Bronze, 480, 2000, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Bronze), new GT_MetaPipeEntity_Fluid(5124, "GT_Pipe_Bronze_Huge", "Huge Bronze Fluid Pipe", 0.875F, Materials.Bronze, 480, 2000, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(Materials.Steel), new GT_MetaPipeEntity_Fluid(5130, "GT_Pipe_Steel_Tiny", "Tiny Steel Fluid Pipe", 0.25F, Materials.Steel, 40, 2500, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(Materials.Steel), new GT_MetaPipeEntity_Fluid(5131, "GT_Pipe_Steel_Small", "Small Steel Fluid Pipe", 0.375F, Materials.Steel, 80, 2500, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Steel), new GT_MetaPipeEntity_Fluid(5132, "GT_Pipe_Steel", "Steel Fluid Pipe", 0.5F, Materials.Steel, 240, 2500, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Steel), new GT_MetaPipeEntity_Fluid(5133, "GT_Pipe_Steel_Large", "Large Steel Fluid Pipe", 0.75F, Materials.Steel, 480, 2500, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Steel), new GT_MetaPipeEntity_Fluid(5134, "GT_Pipe_Steel_Huge", "Huge Steel Fluid Pipe", 1.0F, Materials.Steel, 960, 2500, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Steel), new GT_MetaPipeEntity_Fluid(5134, "GT_Pipe_Steel_Huge", "Huge Steel Fluid Pipe", 0.875F, Materials.Steel, 960, 2500, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(Materials.StainlessSteel), new GT_MetaPipeEntity_Fluid(5140, "GT_Pipe_StainlessSteel_Tiny", "Tiny Stainless Steel Fluid Pipe", 0.25F, Materials.StainlessSteel, 60, 3000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(Materials.StainlessSteel), new GT_MetaPipeEntity_Fluid(5141, "GT_Pipe_StainlessSteel_Small", "Small Stainless Steel Fluid Pipe", 0.375F, Materials.StainlessSteel, 120, 3000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.StainlessSteel), new GT_MetaPipeEntity_Fluid(5142, "GT_Pipe_StainlessSteel", "Stainless Steel Fluid Pipe", 0.5F, Materials.StainlessSteel, 360, 3000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.StainlessSteel), new GT_MetaPipeEntity_Fluid(5143, "GT_Pipe_StainlessSteel_Large", "Large Stainless Steel Fluid Pipe", 0.75F, Materials.StainlessSteel, 720, 3000, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.StainlessSteel), new GT_MetaPipeEntity_Fluid(5144, "GT_Pipe_StainlessSteel_Huge", "Huge Stainless Steel Fluid Pipe", 1.0F, Materials.StainlessSteel, 1440, 3000, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.StainlessSteel), new GT_MetaPipeEntity_Fluid(5144, "GT_Pipe_StainlessSteel_Huge", "Huge Stainless Steel Fluid Pipe", 0.875F, Materials.StainlessSteel, 1440, 3000, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(Materials.Titanium), new GT_MetaPipeEntity_Fluid(5150, "GT_Pipe_Titanium_Tiny", "Tiny Titanium Fluid Pipe", 0.25F, Materials.Titanium, 80, 5000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(Materials.Titanium), new GT_MetaPipeEntity_Fluid(5151, "GT_Pipe_Titanium_Small", "Small Titanium Fluid Pipe", 0.375F, Materials.Titanium, 160, 5000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Titanium), new GT_MetaPipeEntity_Fluid(5152, "GT_Pipe_Titanium", "Titanium Fluid Pipe", 0.5F, Materials.Titanium, 480, 5000, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Titanium), new GT_MetaPipeEntity_Fluid(5153, "GT_Pipe_Titanium_Large", "Large Titanium Fluid Pipe", 0.75F, Materials.Titanium, 960, 5000, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Titanium), new GT_MetaPipeEntity_Fluid(5154, "GT_Pipe_Titanium_Huge", "Huge Titanium Fluid Pipe", 1.0F, Materials.Titanium, 1920, 5000, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Titanium), new GT_MetaPipeEntity_Fluid(5154, "GT_Pipe_Titanium_Huge", "Huge Titanium Fluid Pipe", 0.875F, Materials.Titanium, 1920, 5000, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(Materials.TungstenSteel), new GT_MetaPipeEntity_Fluid(5160, "GT_Pipe_TungstenSteel_Tiny", "Tiny Tungstensteel Fluid Pipe", 0.25F, Materials.TungstenSteel, 100, 7500, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(Materials.TungstenSteel), new GT_MetaPipeEntity_Fluid(5161, "GT_Pipe_TungstenSteel_Small", "Small Tungstensteel Fluid Pipe", 0.375F, Materials.TungstenSteel, 200, 7500, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.TungstenSteel), new GT_MetaPipeEntity_Fluid(5162, "GT_Pipe_TungstenSteel", "Tungstensteel Fluid Pipe", 0.5F, Materials.TungstenSteel, 600, 7500, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.TungstenSteel), new GT_MetaPipeEntity_Fluid(5163, "GT_Pipe_TungstenSteel_Large", "Large Tungstensteel Fluid Pipe", 0.75F, Materials.TungstenSteel, 1200, 7500, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.TungstenSteel), new GT_MetaPipeEntity_Fluid(5164, "GT_Pipe_TungstenSteel_Huge", "Huge Tungstensteel Fluid Pipe", 1.0F, Materials.TungstenSteel, 2400, 7500, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.TungstenSteel), new GT_MetaPipeEntity_Fluid(5164, "GT_Pipe_TungstenSteel_Huge", "Huge Tungstensteel Fluid Pipe", 0.875F, Materials.TungstenSteel, 2400, 7500, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(Materials.Ultimate), new GT_MetaPipeEntity_Fluid(5165, "GT_Pipe_HighPressure_Small", "Small High Pressure Fluid Pipe", 0.375F, Materials.Redstone, 4800, 1500, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Ultimate), new GT_MetaPipeEntity_Fluid(5166, "GT_Pipe_HighPressure", "High Pressure Fluid Pipe", 0.5F, Materials.Redstone, 7200, 1500, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Ultimate), new GT_MetaPipeEntity_Fluid(5167, "GT_Pipe_HighPressure_Large", "Large High Pressure Fluid Pipe", 0.75F, Materials.Redstone, 9600, 1500, true).getStackForm(1L)); @@ -1372,7 +1383,7 @@ public class GT_Loader_MetaTileEntities implements Runnable { GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5171, "GT_Pipe_Plastic_Small", "Small Plastic Fluid Pipe", 0.375F, Materials.Plastic, 120, 350, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5172, "GT_Pipe_Plastic", "Plastic Pipe", 0.5F, Materials.Plastic, 360, 350, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5173, "GT_Pipe_Plastic_Large", "Large Plastic Fluid Pipe", 0.75F, Materials.Plastic, 720, 350, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5174, "GT_Pipe_Plastic_Huge", "Huge Plastic Fluid Pipe", 1.0F, Materials.Plastic, 1440, 350, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5174, "GT_Pipe_Plastic_Huge", "Huge Plastic Fluid Pipe", 0.875F, Materials.Plastic, 1440, 350, true).getStackForm(1L));
generateFluidPipes(Materials.Polytetrafluoroethylene, Materials.Polytetrafluoroethylene.mName, "PTFE", 5175, 480, 600, true); GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.TungstenSteel, 1L), ItemList.Electric_Pump_EV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.Ultimate, 1L), 300, 96); @@ -1384,28 +1395,28 @@ public class GT_Loader_MetaTileEntities implements Runnable { GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Brass), new GT_MetaPipeEntity_Item(5602, "GT_Pipe_Brass", "Brass Item Pipe", 0.5F, Materials.Brass, 1, 32768, aBoolConst_0).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Brass), new GT_MetaPipeEntity_Item(5603, "GT_Pipe_Brass_Large", "Large Brass Item Pipe", 0.75F, Materials.Brass, 2, 16384, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Brass), new GT_MetaPipeEntity_Item(5604, "GT_Pipe_Brass_Huge", "Huge Brass Item Pipe", 1.0F, Materials.Brass, 4, 8192, aBoolConst_0).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Brass), new GT_MetaPipeEntity_Item(5604, "GT_Pipe_Brass_Huge", "Huge Brass Item Pipe", 0.875F, Materials.Brass, 4, 8192, aBoolConst_0).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveMedium.get(Materials.Brass), new GT_MetaPipeEntity_Item(5607, "GT_Pipe_Restrictive_Brass", "Restrictive Brass Item Pipe", 0.5F, Materials.Brass, 1, 3276800, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveLarge.get(Materials.Brass), new GT_MetaPipeEntity_Item(5608, "GT_Pipe_Restrictive_Brass_Large", "Large Restrictive Brass Item Pipe", 0.75F, Materials.Brass, 2, 1638400, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(Materials.Brass), new GT_MetaPipeEntity_Item(5609, "GT_Pipe_Restrictive_Brass_Huge", "Huge Restrictive Brass Item Pipe", 1.0F, Materials.Brass, 4, 819200, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(Materials.Brass), new GT_MetaPipeEntity_Item(5609, "GT_Pipe_Restrictive_Brass_Huge", "Huge Restrictive Brass Item Pipe", 0.875F, Materials.Brass, 4, 819200, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Electrum), new GT_MetaPipeEntity_Item(5612, "GT_Pipe_Electrum", "Electrum Item Pipe", 0.5F, Materials.Electrum, 2, 16384, aBoolConst_0).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Electrum), new GT_MetaPipeEntity_Item(5613, "GT_Pipe_Electrum_Large", "Large Electrum Item Pipe", 0.75F, Materials.Electrum, 4, 8192, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Electrum), new GT_MetaPipeEntity_Item(5614, "GT_Pipe_Electrum_Huge", "Huge Electrum Item Pipe", 1.0F, Materials.Electrum, 8, 4096, aBoolConst_0).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Electrum), new GT_MetaPipeEntity_Item(5614, "GT_Pipe_Electrum_Huge", "Huge Electrum Item Pipe", 0.875F, Materials.Electrum, 8, 4096, aBoolConst_0).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveMedium.get(Materials.Electrum), new GT_MetaPipeEntity_Item(5617, "GT_Pipe_Restrictive_Electrum", "Restrictive Electrum Item Pipe", 0.5F, Materials.Electrum, 2, 1638400, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveLarge.get(Materials.Electrum), new GT_MetaPipeEntity_Item(5618, "GT_Pipe_Restrictive_Electrum_Large", "Large Restrictive Electrum Item Pipe", 0.75F, Materials.Electrum, 4, 819200, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(Materials.Electrum), new GT_MetaPipeEntity_Item(5619, "GT_Pipe_Restrictive_Electrum_Huge", "Huge Restrictive Electrum Item Pipe", 1.0F, Materials.Electrum, 8, 409600, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(Materials.Electrum), new GT_MetaPipeEntity_Item(5619, "GT_Pipe_Restrictive_Electrum_Huge", "Huge Restrictive Electrum Item Pipe", 0.875F, Materials.Electrum, 8, 409600, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Platinum), new GT_MetaPipeEntity_Item(5622, "GT_Pipe_Platinum", "Platinum Item Pipe", 0.5F, Materials.Platinum, 4, 8192, aBoolConst_0).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Platinum), new GT_MetaPipeEntity_Item(5623, "GT_Pipe_Platinum_Large", "Large Platinum Item Pipe", 0.75F, Materials.Platinum, 8, 4096, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Platinum), new GT_MetaPipeEntity_Item(5624, "GT_Pipe_Platinum_Huge", "Huge Platinum Item Pipe", 1.0F, Materials.Platinum, 16, 2048, aBoolConst_0).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Platinum), new GT_MetaPipeEntity_Item(5624, "GT_Pipe_Platinum_Huge", "Huge Platinum Item Pipe", 0.875F, Materials.Platinum, 16, 2048, aBoolConst_0).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveMedium.get(Materials.Platinum), new GT_MetaPipeEntity_Item(5627, "GT_Pipe_Restrictive_Platinum", "Restrictive Platinum Item Pipe", 0.5F, Materials.Platinum, 4, 819200, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveLarge.get(Materials.Platinum), new GT_MetaPipeEntity_Item(5628, "GT_Pipe_Restrictive_Platinum_Large", "Large Restrictive Platinum Item Pipe", 0.75F, Materials.Platinum, 8, 409600, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(Materials.Platinum), new GT_MetaPipeEntity_Item(5629, "GT_Pipe_Restrictive_Platinum_Huge", "Huge Restrictive Platinum Item Pipe", 1.0F, Materials.Platinum, 16, 204800, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(Materials.Platinum), new GT_MetaPipeEntity_Item(5629, "GT_Pipe_Restrictive_Platinum_Huge", "Huge Restrictive Platinum Item Pipe", 0.875F, Materials.Platinum, 16, 204800, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(Materials.Osmium), new GT_MetaPipeEntity_Item(5632, "GT_Pipe_Osmium", "Osmium Item Pipe", 0.5F, Materials.Osmium, 8, 4096, aBoolConst_0).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Osmium), new GT_MetaPipeEntity_Item(5633, "GT_Pipe_Osmium_Large", "Large Osmium Item Pipe", 0.75F, Materials.Osmium, 16, 2048, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Osmium), new GT_MetaPipeEntity_Item(5634, "GT_Pipe_Osmium_Huge", "Huge Osmium Item Pipe", 1.0F, Materials.Osmium, 32, 1024, aBoolConst_0).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Osmium), new GT_MetaPipeEntity_Item(5634, "GT_Pipe_Osmium_Huge", "Huge Osmium Item Pipe", 0.875F, Materials.Osmium, 32, 1024, aBoolConst_0).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveMedium.get(Materials.Osmium), new GT_MetaPipeEntity_Item(5637, "GT_Pipe_Restrictive_Osmium", "Restrictive Osmium Item Pipe", 0.5F, Materials.Osmium, 8, 409600, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveLarge.get(Materials.Osmium), new GT_MetaPipeEntity_Item(5638, "GT_Pipe_Restrictive_Osmium_Large", "Large Restrictive Osmium Item Pipe", 0.75F, Materials.Osmium, 16, 204800, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(Materials.Osmium), new GT_MetaPipeEntity_Item(5639, "GT_Pipe_Restrictive_Osmium_Huge", "Huge Restrictive Osmium Item Pipe", 1.0F, Materials.Osmium, 32, 102400, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(Materials.Osmium), new GT_MetaPipeEntity_Item(5639, "GT_Pipe_Restrictive_Osmium_Huge", "Huge Restrictive Osmium Item Pipe", 0.875F, Materials.Osmium, 32, 102400, true).getStackForm(1L));
generateItemPipes(Materials.PolyvinylChloride, Materials.PolyvinylChloride.mName, "PVC", 5640, 4); ItemList.Automation_ChestBuffer_ULV.set(new GT_MetaTileEntity_ChestBuffer(9230, "automation.chestbuffer.tier.00", "Ultra Low Voltage Chest Buffer", 0).getStackForm(1L)); @@ -1531,18 +1542,19 @@ public class GT_Loader_MetaTileEntities implements Runnable { } private static void makeWires(Materials aMaterial, int aStartID, long aLossInsulated, long aLoss, long aAmperage, long aVoltage, boolean aInsulatable, boolean aAutoInsulated) { - GT_OreDictUnificator.registerOre(OrePrefixes.wireGt01, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 0, aTextWire1 + aMaterial.name().toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + aTextWire2, 0.125F, aMaterial, aLoss, 1L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.wireGt02, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 1, aTextWire1 + aMaterial.name().toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + aTextWire2, 0.25F, aMaterial, aLoss, 2L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.wireGt04, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 2, aTextWire1 + aMaterial.name().toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + aTextWire2, 0.375F, aMaterial, aLoss, 4L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.wireGt08, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 3, aTextWire1 + aMaterial.name().toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + aTextWire2, 0.5F, aMaterial, aLoss, 8L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.wireGt12, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 4, aTextWire1 + aMaterial.name().toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + aTextWire2, 0.75F, aMaterial, aLoss, 12L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.wireGt16, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 5, aTextWire1 + aMaterial.name().toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + aTextWire2, 1.0F, aMaterial, aLoss, 16L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.wireGt01, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 0, aTextWire1 + aMaterial.mName.toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + aTextWire2, 0.125F, aMaterial, aLoss, 1L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt02, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 1, aTextWire1 + aMaterial.mName.toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + aTextWire2, 0.25F, aMaterial, aLoss, 2L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt04, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 2, aTextWire1 + aMaterial.mName.toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + aTextWire2, 0.375F, aMaterial, aLoss, 4L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt08, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 3, aTextWire1 + aMaterial.mName.toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + aTextWire2, 0.5F, aMaterial, aLoss, 8L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt12, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 4, aTextWire1 + aMaterial.mName.toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + aTextWire2, 0.625F, aMaterial, aLoss, 12L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt16, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 5, aTextWire1 + aMaterial.mName.toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + aTextWire2, 0.75F, aMaterial, aLoss, 16L * aAmperage, aVoltage, aBoolConst_0, !aAutoInsulated).getStackForm(1L));
if (aInsulatable) { - GT_OreDictUnificator.registerOre(OrePrefixes.cableGt01, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 6, aTextCable1 + aMaterial.name().toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + aTextCable2, 0.25F, aMaterial, aLossInsulated, 1L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.cableGt02, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 7, aTextCable1 + aMaterial.name().toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + aTextCable2, 0.375F, aMaterial, aLossInsulated, 2L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.cableGt04, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 8, aTextCable1 + aMaterial.name().toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + aTextCable2, 0.5F, aMaterial, aLossInsulated, 4L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.cableGt08, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 9, aTextCable1 + aMaterial.name().toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + aTextCable2, 0.75F, aMaterial, aLossInsulated, 8L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.cableGt12, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 10, aTextCable1 + aMaterial.name().toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + aTextCable2, 1.0F, aMaterial, aLossInsulated, 12L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.cableGt01, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 6, aTextCable1 + aMaterial.mName.toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + aTextCable2, 0.25F, aMaterial, aLossInsulated, 1L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt02, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 7, aTextCable1 + aMaterial.mName.toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + aTextCable2, 0.375F, aMaterial, aLossInsulated, 2L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt04, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 8, aTextCable1 + aMaterial.mName.toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + aTextCable2, 0.5F, aMaterial, aLossInsulated, 4L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt08, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 9, aTextCable1 + aMaterial.mName.toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + aTextCable2, 0.625F, aMaterial, aLossInsulated, 8L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt12, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 10, aTextCable1 + aMaterial.mName.toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + aTextCable2, 0.75F, aMaterial, aLossInsulated, 12L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L));
+ //GT_OreDictUnificator.registerOre(OrePrefixes.cableGt16, aMaterial, new GT_MetaPipeEntity_Cable(aStartID + 11, aTextCable1 + aMaterial.mName.toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + aTextCable2, 0.875F, aMaterial, aLossInsulated, 16L * aAmperage, aVoltage, true, aBoolConst_0).getStackForm(1L));
} } @@ -1555,12 +1567,12 @@ public class GT_Loader_MetaTileEntities implements Runnable { } private static void generateItemPipes(Materials aMaterial, String name, String displayName, int startID, int baseInvSlots){ - GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(aMaterial), new GT_MetaPipeEntity_Item(startID, "GT_Pipe_" + displayName, displayName + " Item Pipe", 0.50F, aMaterial, baseInvSlots, 32768 / baseInvSlots, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 1, "GT_Pipe_" + displayName + "_Large", "Large " + displayName + " Item Pipe", 0.75F, aMaterial, baseInvSlots * 2, 16384 / baseInvSlots, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 2, "GT_Pipe_" + displayName + "_Huge", "Huge " + displayName +" Item Pipe", 1.00F, aMaterial, baseInvSlots * 4, 8192 / baseInvSlots, aBoolConst_0).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveMedium.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 3, "GT_Pipe_Restrictive_" + displayName, "Restrictive " + displayName + " Item Pipe", 0.50F, aMaterial, baseInvSlots, 3276800 / baseInvSlots, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveLarge.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 4, "GT_Pipe_Restrictive_" + displayName + "_Large","Large Restrictive " + displayName + " Item Pipe", 0.75F, aMaterial, baseInvSlots * 2, 1638400 / baseInvSlots, true).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 5, "GT_Pipe_Restrictive_" + displayName + "_Huge", "Huge Restrictive " + displayName + " Item Pipe", 1.00F, aMaterial, baseInvSlots * 2, 819200 / baseInvSlots, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(aMaterial), new GT_MetaPipeEntity_Item(startID, "GT_Pipe_" + displayName, displayName + " Item Pipe", 0.50F, aMaterial, baseInvSlots, 32768 / baseInvSlots, aBoolConst_0).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 1, "GT_Pipe_" + displayName + "_Large", "Large " + displayName + " Item Pipe", 0.75F, aMaterial, baseInvSlots * 2, 16384 / baseInvSlots, aBoolConst_0).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 2, "GT_Pipe_" + displayName + "_Huge", "Huge " + displayName +" Item Pipe", 1.00F, aMaterial, baseInvSlots * 4, 8192 / baseInvSlots, aBoolConst_0).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveMedium.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 3, "GT_Pipe_Restrictive_" + displayName, "Restrictive " + displayName + " Item Pipe", 0.50F, aMaterial, baseInvSlots, 3276800 / baseInvSlots, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveLarge.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 4, "GT_Pipe_Restrictive_" + displayName + "_Large","Large Restrictive " + displayName + " Item Pipe", 0.75F, aMaterial, baseInvSlots * 2, 1638400 / baseInvSlots, true).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeRestrictiveHuge.get(aMaterial), new GT_MetaPipeEntity_Item(startID + 5, "GT_Pipe_Restrictive_" + displayName + "_Huge", "Huge Restrictive " + displayName + " Item Pipe", 0.875F, aMaterial, baseInvSlots * 2, 819200 / baseInvSlots, true).getStackForm(1L)); } @@ -1569,6 +1581,6 @@ public class GT_Loader_MetaTileEntities implements Runnable { GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 1, "GT_Pipe_" + name + "_Small", "Small " + displayName + " Fluid Pipe", 0.375F, aMaterial, baseCapacity / 3, heatCapacity, gasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 2, "GT_Pipe_" + name, displayName + " Pipe", 0.5F, aMaterial, baseCapacity, heatCapacity, gasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 3, "GT_Pipe_" + name + "_Large", "Large " + displayName + " Fluid Pipe", 0.75F, aMaterial, baseCapacity * 2, heatCapacity, gasProof).getStackForm(1L)); - GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 4, "GT_Pipe_" + name + "_Huge", "Huge " + displayName + " Fluid Pipe", 1.0F, aMaterial, baseCapacity * 4, heatCapacity, gasProof).getStackForm(1L)); + GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 4, "GT_Pipe_" + name + "_Huge", "Huge " + displayName + " Fluid Pipe", 0.875F, aMaterial, baseCapacity * 4, heatCapacity, gasProof).getStackForm(1L)); } } diff --git a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java index 26bc6a187b..1425dba1e9 100644 --- a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java @@ -180,7 +180,7 @@ public class GT_NEI_DefaultHandler if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) {
break;
}
- currenttip.add("Chance: " + ((FixedPositionedStack) tStack).mChance / 100 + "." + (((FixedPositionedStack) tStack).mChance % 100 < 10 ? "0" + ((FixedPositionedStack) tStack).mChance % 100 : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%");
+ currenttip.add(trans("150","Chance: ") + ((FixedPositionedStack) tStack).mChance / 100 + "." + (((FixedPositionedStack) tStack).mChance % 100 < 10 ? "0" + ((FixedPositionedStack) tStack).mChance % 100 : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%");
break;
}
}
@@ -190,7 +190,7 @@ public class GT_NEI_DefaultHandler (tStack.item.stackSize != 0)) {
break;
}
- currenttip.add("Does not get consumed in the process");
+ currenttip.add(trans("151","Does not get consumed in the process"));
break;
}
}
@@ -204,25 +204,25 @@ public class GT_NEI_DefaultHandler String[] recipeDesc = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc();
if (recipeDesc == null) {
if (tEUt != 0) {
- drawText(10, 73, "Total: " + tDuration * tEUt + " EU", -16777216);
- drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216);
+ drawText(10, 73, trans("152","Total: ") + tDuration * tEUt + " EU", -16777216);
+ drawText(10, 83, trans("153","Usage: ") + tEUt + " EU/t", -16777216);
if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
- drawText(10, 93, "Voltage: " + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216);
- drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216);
+ drawText(10, 93, trans("154","Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216);
+ drawText(10, 103, trans("155","Amperage: ") + this.mRecipeMap.mAmperage, -16777216);
} else {
- drawText(10, 93, "Voltage: unspecified", -16777216);
- drawText(10, 103, "Amperage: unspecified", -16777216);
+ drawText(10, 93, trans("156","Voltage: unspecified"), -16777216);
+ drawText(10, 103, trans("157","Amperage: unspecified"), -16777216);
}
}
if (tDuration > 0) {
-// drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216);
- drawText(10, 113, String.format("Time: %.2f secs", 0.05 * tDuration), -16777216);
+// drawText(10, 113, trans("158","Time: ") + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + trans("161"," secs"), -16777216);
+ drawText(10, 113, String.format("%s%.2f%s", trans("158","Time: "), 0.05 * tDuration, trans("161"," secs")), -16777216);
}
int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
if (tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) {
- drawText(10, 123, "Needs Low Gravity", -16777216);
- } else if (tSpecial == -200) {
- drawText(10, 123, "Needs Cleanroom", -16777216);
+ drawText(10, 123, trans("159","Needs Low Gravity"), -16777216);
+ } else if (tSpecial == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) {
+ drawText(10, 123, trans("160","Needs Cleanroom"), -16777216);
} else if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) {
drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216);
}
@@ -820,5 +820,9 @@ public class GT_NEI_DefaultHandler public List<PositionedStack> getOtherStacks() {
return this.mOutputs;
}
+ }
+
+ public String trans(String aKey, String aEnglish){
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
}
}
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/INSULATION_LARGE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/INSULATION_LARGE.png Binary files differindex 72c4f05658..7f896a09f0 100644 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/INSULATION_LARGE.png +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/INSULATION_LARGE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/INSULATION_MEDIUM_PLUS.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/INSULATION_MEDIUM_PLUS.png Binary files differnew file mode 100644 index 0000000000..666d51b82f --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/INSULATION_MEDIUM_PLUS.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/90.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/90.png Binary files differindex d6ff394c66..ad7b99d233 100644 --- a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/90.png +++ b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/90.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/96.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/96.png Binary files differnew file mode 100644 index 0000000000..d6ff394c66 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/96.png |