aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDream-Master <dream-master@gmx.net>2018-12-16 21:41:15 +0100
committerDream-Master <dream-master@gmx.net>2018-12-16 21:41:15 +0100
commite8a0739f356f1160da132b0f52e93341046cfde9 (patch)
tree74c649c7856b95c0c66d12a160b9c0a5c437c56f /src
parentca320d55236e94647d7de5999141b160db7de796 (diff)
parent344f2105ca598daf6ef2620d6f1f466d0d56e13c (diff)
downloadGT5-Unofficial-e8a0739f356f1160da132b0f52e93341046cfde9.tar.gz
GT5-Unofficial-e8a0739f356f1160da132b0f52e93341046cfde9.tar.bz2
GT5-Unofficial-e8a0739f356f1160da132b0f52e93341046cfde9.zip
Merge branch 'experimental' of https://github.com/GTNewHorizons/GT5-Unofficial into experimental
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java
index f3fcb3c5a7..7079713acf 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java
@@ -15,14 +15,24 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.Iterator;
public class GT_MetaTileEntity_Replicator
extends GT_MetaTileEntity_BasicMachine {
private static int sHeaviestElementMass = 0;
+ public static final HashMap<Materials,Long> MASS_OVERRIDES =new HashMap<>();
+ static{
+ //put overrides here
+ //ex.
+ //MASS_OVERRIDES.put(Materials.get("cake"),Materials.get("cake").getMass());
+ //MASS_OVERRIDES.put(Materials.get("otherCake"),1235234L);
+ //MASS_OVERRIDES.put(Materials.Kalendrite,1235234L);
+ //MASS_OVERRIDES.put(Materials.Kalendrite,Materials.Kalendrite.getMass()*2);
+ }
public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR)});
+ super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR));
}
public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
@@ -42,8 +52,8 @@ public class GT_MetaTileEntity_Replicator
if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) {
ItemStack tDataOrb = getSpecialSlot();
if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) {
- Materials tMaterial = (Materials) Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0);
- long tMass = tMaterial.getMass();
+ Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0);
+ long tMass = MASS_OVERRIDES.getOrDefault(tMaterial,tMaterial.getMass());
if ((tFluid.amount >= tMass) && (tMass > 0L)) {
this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.V[this.mTier],1);
@@ -56,26 +66,22 @@ public class GT_MetaTileEntity_Replicator
if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) {
if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) == null) {
if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) {
- if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ if (canOutput(this.mOutputItems[0])) {
getInputAt(0).stackSize -= 1;
- FluidStack
- tmp231_230 = tFluid;
- tmp231_230.amount = ((int) (tmp231_230.amount - tMass));
+ tFluid.amount = ((int) (tFluid.amount - tMass));
return 2;
}
}
} else {
this.mOutputItems[0] = null;
if ((getDrainableStack() == null) || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) && (getDrainableStack().amount < 16000))) {
- FluidStack tmp287_286 = tFluid;
- tmp287_286.amount = ((int) (tmp287_286.amount - tMass));
+ tFluid.amount = ((int) (tFluid.amount - tMass));
return 2;
}
}
}
- } else if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
- FluidStack tmp322_321 = tFluid;
- tmp322_321.amount = ((int) (tmp322_321.amount - tMass));
+ } else if (canOutput(this.mOutputItems[0])) {
+ tFluid.amount = ((int) (tFluid.amount - tMass));
return 2;
}
}