aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/enums/ItemList.java2
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java2
-rw-r--r--src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java5
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java31
-rw-r--r--src/main/java/gregtech/api/interfaces/IToolStats.java3
-rw-r--r--src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java6
-rw-r--r--src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java4
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java10
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java4
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java27
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseTileEntity.java5
-rw-r--r--src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java20
-rw-r--r--src/main/java/gregtech/api/metatileentity/MetaTileEntity.java19
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java43
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java40
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java57
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java6
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java38
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java59
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java21
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java2
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java10
-rw-r--r--src/main/java/gregtech/api/net/GT_Packet_Pollution.java43
-rw-r--r--src/main/java/gregtech/api/objects/GT_Cover_Default.java2
-rw-r--r--src/main/java/gregtech/api/objects/GT_UO_Dimension.java8
-rw-r--r--src/main/java/gregtech/api/objects/GT_UO_DimensionList.java13
-rw-r--r--src/main/java/gregtech/api/objects/GT_UO_Fluid.java25
-rw-r--r--src/main/java/gregtech/api/util/GT_CoverBehavior.java4
-rw-r--r--src/main/java/gregtech/api/util/GT_LanguageManager.java215
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java5
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java239
32 files changed, 776 insertions, 201 deletions
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&&GT_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);
}
/**