aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2017-12-16 12:50:37 +0100
committerTechnus <daniel112092@gmail.com>2017-12-16 12:50:37 +0100
commitcee36839a9591eca49fed57d7bd74aa017238e2a (patch)
treeb4a4a704226baf975a8b3da8c54ec3aca1eff3ce
parent684776a09d76d84fd11c7d7df7b34d8d09a5edef (diff)
downloadGT5-Unofficial-cee36839a9591eca49fed57d7bd74aa017238e2a.tar.gz
GT5-Unofficial-cee36839a9591eca49fed57d7bd74aa017238e2a.tar.bz2
GT5-Unofficial-cee36839a9591eca49fed57d7bd74aa017238e2a.zip
Draft of parametrizer X
-rw-r--r--src/main/java/com/github/technus/tectech/loader/MachineLoader.java1
-rw-r--r--src/main/java/com/github/technus/tectech/thing/CustomItemList.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java30
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java79
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java94
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java243
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java12
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java43
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java4
-rw-r--r--src/main/resources/assets/gregtech/textures/gui/Parametrizer.pngbin262972 -> 262972 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.pngbin0 -> 262972 bytes
11 files changed, 415 insertions, 93 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java
index 4a41a9dfc8..415e3ff160 100644
--- a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java
@@ -259,6 +259,7 @@ public class MachineLoader implements Runnable {
// ===================================================================================================
Parametrizer_Hatch.set(new GT_MetaTileEntity_Hatch_Param(15420, "hatch.param.tier.07", "Parametrizer", 7).getStackForm(1L));
+ ParametrizerX_Hatch.set(new GT_MetaTileEntity_Hatch_Param(15420, "hatch.param.tier.10", "Parametrizer X", 10).getStackForm(1L));
Uncertainty_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(15430, "hatch.certain.tier.07", "Uncertainty Resolver", 7).getStackForm(1L));
UncertaintyX_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(15431, "hatch.certain.tier.10", "Uncertainty Resolver X", 10).getStackForm(1L));
diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java
index 5c2d6c631d..f9a4f6028a 100644
--- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java
+++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java
@@ -37,7 +37,7 @@ public enum CustomItemList implements IItemContainer {
eM_in_UV, eM_in_UHV, eM_in_UEV, eM_in_UIV, eM_in_UMV, eM_in_UXV,
eM_out_UV, eM_out_UHV, eM_out_UEV, eM_out_UIV, eM_out_UMV, eM_out_UXV,
eM_muffler_UV, eM_muffler_UHV, eM_muffler_UEV, eM_muffler_UIV, eM_muffler_UMV, eM_muffler_UXV,
- Parametrizer_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch, dataIn_Hatch, dataOut_Hatch,
+ Parametrizer_Hatch, ParametrizerX_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch, dataIn_Hatch, dataOut_Hatch,
eM_Containment, eM_Containment_Field, eM_Containment_Advanced, eM_Coil, eM_Teleportation, eM_Dimensional, eM_Ultimate_Containment, eM_Ultimate_Containment_Advanced, eM_Ultimate_Containment_Field, eM_Spacetime, eM_Computer_Casing, eM_Computer_Bus, eM_Computer_Vent, eM_Hollow, eM_Power,
debugBlock,
Machine_Multi_Microwave,
diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java
index af733ac296..0e38d253e8 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java
@@ -51,20 +51,20 @@ public class ParametrizerMemoryCard extends Item {
NBTTagCompound tNBT=aStack.getTagCompound();
if (aStack.getItemDamage()==1) {
//write to parametrizer
- parametrizer.exponent = tNBT.getInteger("exponent");
- parametrizer.value2 = tNBT.getInteger("value2");
- parametrizer.value1 = tNBT.getInteger("value1");
parametrizer.param = tNBT.getInteger("param");
- parametrizer.value1f = tNBT.getFloat("value1f");
- parametrizer.value2f = tNBT.getFloat("value2f");
+ parametrizer.data0 = tNBT.getInteger("value1");
+ parametrizer.data1 = tNBT.getInteger("value2");
+ parametrizer.value0f = tNBT.getFloat("value1f");
+ parametrizer.value1f = tNBT.getFloat("value2f");
+ parametrizer.extra = tNBT.getInteger("exponent");
} else {
//read from parametrizer
- tNBT.setInteger("exponent", parametrizer.exponent);
- tNBT.setInteger("value2", parametrizer.value2);
- tNBT.setInteger("value1", parametrizer.value1);
tNBT.setInteger("param", parametrizer.param);
- tNBT.setFloat("value1f", parametrizer.value1f);
- tNBT.setFloat("value2f", parametrizer.value2f);
+ tNBT.setInteger("value1", parametrizer.data0);
+ tNBT.setInteger("value2", parametrizer.data1);
+ tNBT.setFloat("value2f", parametrizer.value1f);
+ tNBT.setFloat("value1f", parametrizer.value0f);
+ tNBT.setInteger("exponent", parametrizer.extra);
}
return true;
}
@@ -102,11 +102,11 @@ public class ParametrizerMemoryCard extends Item {
if(tNBT!=null && tNBT.hasKey("param")) {
aList.add("Hatch ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param"));
- aList.add("Value 0: "+EnumChatFormatting.AQUA + tNBT.getFloat("value1f"));
- aList.add("Value 1: "+EnumChatFormatting.AQUA + tNBT.getFloat("value2f"));
- aList.add("Mantissa 0: "+EnumChatFormatting.AQUA + tNBT.getInteger("value1"));
- aList.add("Mantissa 1: "+EnumChatFormatting.AQUA + tNBT.getInteger("value2"));
- aList.add("Exponent: "+EnumChatFormatting.AQUA + tNBT.getInteger("exponent"));
+ aList.add("Value 0|F: "+EnumChatFormatting.AQUA + tNBT.getFloat("value1f"));
+ aList.add("Value 1|F: "+EnumChatFormatting.AQUA + tNBT.getFloat("value2f"));
+ aList.add("Data 0|I: "+EnumChatFormatting.AQUA + tNBT.getInteger("value1"));
+ aList.add("Data 1|I: "+EnumChatFormatting.AQUA + tNBT.getInteger("value2"));
+ aList.add("Data x|I: "+EnumChatFormatting.AQUA + tNBT.getInteger("exponent"));
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java
index 3cf5eeba48..cb83c9eb93 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java
@@ -1,8 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.Util;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Param;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamAdv;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Param;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamAdv;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -23,12 +26,12 @@ import net.minecraftforge.fluids.FluidStack;
* Created by danie_000 on 15.12.2016.
*/
public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
- public int exponent = 0;
- public int value2 = 0;
- public int value1 = 0;
+ public int extra = 0;
+ public int data1 = 0;
+ public int data0 = 0;
public int param = -1;
+ public float value0f = 0;
public float value1f = 0;
- public float value2f = 0;
public float input1f = 0;
public float input2f = 0;
private static Textures.BlockIcons.CustomIcon ScreenON;
@@ -52,11 +55,13 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ if (mTier >= 10) return new GT_Container_ParamAdv(aPlayerInventory, aBaseMetaTileEntity);
return new GT_Container_Param(aPlayerInventory, aBaseMetaTileEntity);
}
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ if (mTier >= 10) return new GT_GUIContainer_ParamAdv(aPlayerInventory, aBaseMetaTileEntity);
return new GT_GUIContainer_Param(aPlayerInventory, aBaseMetaTileEntity);
}
@@ -96,12 +101,36 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
@Override
public String[] getInfoData() {
+ int temp;
+ if(mTier>=10){
+ return new String[]{
+ "Parametrizer ID: " + EnumChatFormatting.GREEN + param,
+ "Value 0|F: " + EnumChatFormatting.AQUA + value0f,
+ "Value 0|I: " + EnumChatFormatting.AQUA + (temp=Float.floatToIntBits(value0f)),
+ "Value 0|B: " + EnumChatFormatting.AQUA + Util.intToString(temp,8),
+ "Value 1|F: " + EnumChatFormatting.BLUE + value1f,
+ "Value 1|I: " + EnumChatFormatting.BLUE + (temp=Float.floatToIntBits(value1f)),
+ "Value 1|B: " + EnumChatFormatting.BLUE + Util.intToString(temp,8),
+ "Input 0|F: " + EnumChatFormatting.GOLD + input1f,
+ "Input 0|I: " + EnumChatFormatting.GOLD + (temp=Float.floatToIntBits(input1f)),
+ "Input 0|B: " + EnumChatFormatting.GOLD + Util.intToString(temp,8),
+ "Input 1|F: " + EnumChatFormatting.YELLOW + input2f,
+ "Input 1|I: " + EnumChatFormatting.YELLOW + (temp=Float.floatToIntBits(input2f)),
+ "Input 1|B: " + EnumChatFormatting.YELLOW + Util.intToString(temp,8),
+ "Data 0|I" + data0,
+ "Data 1|I" + data1,
+ "Data x|I" + extra,
+ };
+ }
return new String[]{
- "Parameter ID: " + EnumChatFormatting.GREEN + param,
- "Value 1: " + EnumChatFormatting.AQUA + value1f,
- "Value 2: " + EnumChatFormatting.BLUE + value2f,
- "Input 1: " + EnumChatFormatting.GOLD + input1f,
- "Input 2: " + EnumChatFormatting.YELLOW + input2f
+ "Parametrizer ID: " + EnumChatFormatting.GREEN + param,
+ "Value 0|F: " + EnumChatFormatting.AQUA + value0f,
+ "Value 1|F: " + EnumChatFormatting.BLUE + value1f,
+ "Input 0|F: " + EnumChatFormatting.GOLD + input1f,
+ "Input 1|F: " + EnumChatFormatting.YELLOW + input2f,
+ "Data 0|I" + data0,
+ "Data 1|I" + data1,
+ "Data x|I" + extra,
};
}
@@ -122,24 +151,30 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setInteger("mEXP", exponent);
- aNBT.setInteger("mV2", value2);
- aNBT.setInteger("mV1", value1);
+ aNBT.setInteger("mEXP", extra);
+ if(mTier>=10) {
+ aNBT.setInteger("mV2", Float.floatToIntBits(value1f));
+ aNBT.setInteger("mV1", Float.floatToIntBits(value0f));
+ }else {
+ aNBT.setInteger("mV2", data1);
+ aNBT.setInteger("mV1", data0);
+ }
aNBT.setInteger("mParam", param);
- //aNBT.setFloat("mI1",input1f);//no need to store this.
- //aNBT.setFloat("mI2",input2f);
}
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- exponent = aNBT.getInteger("mEXP");
- value2 = aNBT.getInteger("mV2");
- value1 = aNBT.getInteger("mV1");
+ extra = aNBT.getInteger("mEXP");
+ data1 = aNBT.getInteger("mV2");
+ data0 = aNBT.getInteger("mV1");
param = aNBT.getInteger("mParam");
- value1f = (float) (value1 * Math.pow(2, exponent));
- value2f = (float) (value2 * Math.pow(2, exponent));
- //input1f=aNBT.getFloat("mI1");
- //input2f=aNBT.getFloat("mI2");
+ if(mTier>=10) {
+ value0f =Float.intBitsToFloat(data0);
+ value1f =Float.intBitsToFloat(data1);
+ }else{
+ value0f = (float) (data0 * Math.pow(2, extra));
+ value1f = (float) (data1 * Math.pow(2, extra));
+ }
}
@Override
@@ -179,7 +214,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
return new String[]{
CommonValues.TEC_MARK_GENERAL,
mDescription,
- EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "E=M*C^2"
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "E=mine*craft^2"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java
index ef0b9ddfb1..0ff0e284ee 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java
@@ -16,15 +16,15 @@ import java.util.Iterator;
public class GT_Container_Param extends GT_ContainerMetaTile_Machine {
public int exponent = 0;
- public int value2 = 0;
public int value1 = 0;
+ public int value0 = 0;
public int param = 0;
- public float value2f = 0;
public float value1f = 0;
+ public float value0f = 0;
+ public float input0f = 0;
public float input1f = 0;
+ private int input0Bits = 0;
private int input1Bits = 0;
- public float input2f = 0;
- private int input2Bits = 0;
public GT_Container_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
@@ -67,58 +67,58 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine {
paramH.param -= (aShifthold == 1 ? 512 : 64);
break;
case 1:
- paramH.value1 -= (aShifthold == 1 ? 512 : 64);
+ paramH.data0 -= (aShifthold == 1 ? 512 : 64);
break;
case 2:
- paramH.value2 -= (aShifthold == 1 ? 512 : 64);
+ paramH.data1 -= (aShifthold == 1 ? 512 : 64);
break;
case 3:
- paramH.exponent -= (aShifthold == 1 ? 16 : 8);
+ paramH.extra -= (aShifthold == 1 ? 16 : 8);
break;
case 4:
paramH.param -= (aShifthold == 1 ? 16 : 1);
break;
case 5:
- paramH.value1 -= (aShifthold == 1 ? 16 : 1);
+ paramH.data0 -= (aShifthold == 1 ? 16 : 1);
break;
case 6:
- paramH.value2 -= (aShifthold == 1 ? 16 : 1);
+ paramH.data1 -= (aShifthold == 1 ? 16 : 1);
break;
case 7:
- paramH.exponent -= (aShifthold == 1 ? 4 : 1);
+ paramH.extra -= (aShifthold == 1 ? 4 : 1);
break;
case 8:
paramH.param += (aShifthold == 1 ? 512 : 64);
break;
case 9:
- paramH.value1 += (aShifthold == 1 ? 512 : 64);
+ paramH.data0 += (aShifthold == 1 ? 512 : 64);
break;
case 10:
- paramH.value2 += (aShifthold == 1 ? 512 : 64);
+ paramH.data1 += (aShifthold == 1 ? 512 : 64);
break;
case 11:
- paramH.exponent += (aShifthold == 1 ? 16 : 8);
+ paramH.extra += (aShifthold == 1 ? 16 : 8);
break;
case 12:
paramH.param += (aShifthold == 1 ? 16 : 1);
break;
case 13:
- paramH.value1 += (aShifthold == 1 ? 16 : 1);
+ paramH.data0 += (aShifthold == 1 ? 16 : 1);
break;
case 14:
- paramH.value2 += (aShifthold == 1 ? 16 : 1);
+ paramH.data1 += (aShifthold == 1 ? 16 : 1);
break;
case 15:
- paramH.exponent += (aShifthold == 1 ? 4 : 1);
+ paramH.extra += (aShifthold == 1 ? 4 : 1);
break;
default:
doStuff = false;
}
if (doStuff) {
if (paramH.param > 9) paramH.param = 9;
- if (paramH.param < -1) paramH.param = -1;
- paramH.value1f = (float) (paramH.value1 * Math.pow(2, paramH.exponent));
- paramH.value2f = (float) (paramH.value2 * Math.pow(2, paramH.exponent));
+ else if (paramH.param < -1) paramH.param = -1;
+ paramH.value0f =Float.intBitsToFloat(Float.floatToIntBits((float) (paramH.data0 * Math.pow(2, paramH.extra))));
+ paramH.value1f =Float.intBitsToFloat(Float.floatToIntBits((float) (paramH.data1 * Math.pow(2, paramH.extra))));
}
}
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
@@ -131,27 +131,27 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine {
return;
}
this.param = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).param;
- this.value1 = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).value1;
- this.value2 = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).value2;
- this.exponent = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).exponent;
- this.input1Bits = Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input1f);
- this.input2Bits = Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input2f);
+ this.value0 = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).data0;
+ this.value1 = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).data1;
+ this.exponent = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).extra;
+ this.input0Bits = Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input1f);
+ this.input1Bits = Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input2f);
Iterator var2 = this.crafters.iterator();
while (var2.hasNext()) {
ICrafting var1 = (ICrafting) var2.next();
var1.sendProgressBarUpdate(this, 100, this.param & 0xFFFF);
var1.sendProgressBarUpdate(this, 101, this.param >>> 16);
- var1.sendProgressBarUpdate(this, 102, this.value1 & 0xFFFF);
- var1.sendProgressBarUpdate(this, 103, this.value1 >>> 16);
- var1.sendProgressBarUpdate(this, 104, this.value2 & 0xFFFF);
- var1.sendProgressBarUpdate(this, 105, this.value2 >>> 16);
+ var1.sendProgressBarUpdate(this, 102, this.value0 & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 103, this.value0 >>> 16);
+ var1.sendProgressBarUpdate(this, 104, this.value1 & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 105, this.value1 >>> 16);
var1.sendProgressBarUpdate(this, 106, this.exponent & 0xFFFF);
var1.sendProgressBarUpdate(this, 107, this.exponent >>> 16);
- var1.sendProgressBarUpdate(this, 108, this.input1Bits & 0xFFFF);
- var1.sendProgressBarUpdate(this, 109, this.input1Bits >>> 16);
- var1.sendProgressBarUpdate(this, 110, this.input2Bits & 0xFFFF);
- var1.sendProgressBarUpdate(this, 111, this.input2Bits >>> 16);
+ var1.sendProgressBarUpdate(this, 108, this.input0Bits & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 109, this.input0Bits >>> 16);
+ var1.sendProgressBarUpdate(this, 110, this.input1Bits & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 111, this.input1Bits >>> 16);
}
}
@@ -163,46 +163,46 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine {
this.param = (this.param & 0xFFFF0000 | par2);
return;
case 101:
- this.param = (this.param & 0xFFFF | par2 << 16);
+ this.param = (this.param & 0xFFFF | (par2 << 16));
return;
case 102:
- this.value1 = (this.value1 & 0xFFFF0000 | par2);
+ this.value0 = (this.value0 & 0xFFFF0000 | par2);
break;
case 103:
- this.value1 = (this.value1 & 0xFFFF | par2 << 16);
+ this.value0 = (this.value0 & 0xFFFF | (par2 << 16));
break;
case 104:
- this.value2 = (this.value2 & 0xFFFF0000 | par2);
+ this.value1 = (this.value1 & 0xFFFF0000 | par2);
break;
case 105:
- this.value2 = (this.value2 & 0xFFFF | par2 << 16);
+ this.value1 = (this.value1 & 0xFFFF | (par2 << 16));
break;
case 106:
this.exponent = (this.exponent & 0xFFFF0000 | par2);
break;
case 107:
- this.exponent = (this.exponent & 0xFFFF | par2 << 16);
+ this.exponent = (this.exponent & 0xFFFF | (par2 << 16));
break;
case 108:
- this.input1Bits = (this.input1Bits & 0xFFFF0000 | par2);
- this.input1f = Float.intBitsToFloat(input1Bits);
+ this.input0Bits = (this.input0Bits & 0xFFFF0000 | par2);
+ this.input0f = Float.intBitsToFloat(input0Bits);
return;
case 109:
- this.input1Bits = (this.input1Bits & 0xFFFF | par2 << 16);
- this.input1f = Float.intBitsToFloat(input1Bits);
+ this.input0Bits = (this.input0Bits & 0xFFFF | (par2 << 16));
+ this.input0f = Float.intBitsToFloat(input0Bits);
return;
case 110:
- this.input2Bits = (this.input2Bits & 0xFFFF0000 | par2);
- this.input2f = Float.intBitsToFloat(input2Bits);
+ this.input1Bits = (this.input1Bits & 0xFFFF0000 | par2);
+ this.input1f = Float.intBitsToFloat(input1Bits);
return;
case 111:
- this.input2Bits = (this.input2Bits & 0xFFFF | par2 << 16);
- this.input2f = Float.intBitsToFloat(input2Bits);
+ this.input1Bits = (this.input1Bits & 0xFFFF | (par2 << 16));
+ this.input1f = Float.intBitsToFloat(input1Bits);
return;
default:
return;
}
+ this.value0f = (float) (this.value0 * Math.pow(2, this.exponent));
this.value1f = (float) (this.value1 * Math.pow(2, this.exponent));
- this.value2f = (float) (this.value2 * Math.pow(2, this.exponent));
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java
new file mode 100644
index 0000000000..5c67caa42a
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java
@@ -0,0 +1,243 @@
+package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
+
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.gui.GT_Slot_Holo;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+import java.util.Iterator;
+
+public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine {
+ public int extra = 0;
+ public int data1 = 0;
+ public int data0 = 0;
+ public int param = 0;
+ public float value1f = 0;
+ public float value0f = 0;
+ public float input0f = 0;
+ public float input1f = 0;
+ private int input0Bits = 0;
+ private int input1Bits = 0;
+
+ public GT_Container_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 8, 5, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 8, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 8, 41, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 8, 59, false, false, 1));
+
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 26, 5, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 26, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 26, 41, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 26, 59, false, false, 1));
+
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 152, 5, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 152, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 152, 41, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 152, 59, false, false, 1));
+
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 134, 5, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 134, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 134, 41, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 134, 59, false, false, 1));
+ }
+
+ @Override
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ if (aSlotIndex < 0) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
+ boolean doStuff = true;
+ if ((tSlot != null) && (this.mTileEntity.getMetaTileEntity() != null)) {
+ GT_MetaTileEntity_Hatch_Param paramH = (GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity();
+ int columnPointer=paramH.extra&0xff;
+ boolean secondRow=(paramH.extra&0x0100)!=0;
+ boolean showInts=(paramH.extra&0x10000)!=0;
+ switch (aSlotIndex) {
+ case 0:
+ paramH.param -= (aShifthold == 1 ? 16 : 4);
+ break;
+ case 1:
+ if (secondRow) {secondRow=false;} else {columnPointer -= (aShifthold == 1 ? 16 : 4);}
+ break;
+ case 2:
+ if (secondRow) {columnPointer -= (aShifthold == 1 ? 16 : 4);} else {secondRow=true;}
+ break;
+ case 3:
+ if(aShifthold==1){
+ if(secondRow) data1=0xFFFFFFFF;
+ else data0=0xFFFFFFFF;
+ }else {
+ if(secondRow){
+ data1|=1<<columnPointer;
+ }else {
+ data0|=1<<columnPointer;
+ }
+ }
+ break;
+ case 4:
+ paramH.param -= (aShifthold == 1 ? 2 : 1);
+ break;
+ case 5:
+ if (secondRow) {secondRow=false;} else {columnPointer -= (aShifthold == 1 ? 2 : 1);}
+ break;
+ case 6:
+ if (secondRow) {columnPointer -= (aShifthold == 1 ? 2 : 1);} else {secondRow=true;}
+ break;
+ case 7:
+ if(aShifthold==1){
+ if(secondRow) data1=0;
+ else data0=0;
+ }else {
+ if(secondRow){
+ data1&=~(1<<columnPointer);
+ }else {
+ data0&=~(1<<columnPointer);
+ }
+ }
+ break;
+ case 8:
+ paramH.param += (aShifthold == 1 ? 16 : 4);
+ break;
+ case 9:
+ if (secondRow) {secondRow=false;} else {columnPointer += (aShifthold == 1 ? 16 : 4);}
+ break;
+ case 10:
+ if (secondRow) {columnPointer += (aShifthold == 1 ? 16 : 4);} else {secondRow=true;}
+ break;
+ case 11:
+ if(aShifthold==1){
+ if(secondRow) data1^=0xFFFFFFFF;
+ else data0^=0xFFFFFFFF;
+ }else {
+ if(secondRow){
+ data1^=1<<columnPointer;
+ }else {
+ data0^=1<<columnPointer;
+ }
+ }
+ break;
+ case 12:
+ paramH.param += (aShifthold == 1 ? 2 : 1);
+ break;
+ case 13:
+ if (secondRow) {secondRow=false;} else {columnPointer += (aShifthold == 1 ? 2 : 1);}
+ break;
+ case 14:
+ if (secondRow) {columnPointer += (aShifthold == 1 ? 2 : 1);} else {secondRow=true;}
+ break;
+ case 15:
+ showInts^=true;
+ break;
+ default:
+ doStuff = false;
+ }
+ if (doStuff) {
+ if(columnPointer>=32) columnPointer=31;
+ else if(columnPointer<0) columnPointer=0;
+ paramH.extra=columnPointer;
+ if(secondRow) paramH.extra|=0x0100;
+ if(showInts) paramH.extra|=0x10000;
+ if (paramH.param > 9) paramH.param = 9;
+ else if (paramH.param < -1) paramH.param = -1;
+ paramH.value0f =Float.intBitsToFloat(Float.floatToIntBits(paramH.data0));
+ paramH.value1f =Float.intBitsToFloat(Float.floatToIntBits(paramH.data1));
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return;
+ }
+ this.param = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).param;
+ this.data0 = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).data0;
+ this.data1 = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).data1;
+ this.extra = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).extra;
+ this.input0Bits = Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input1f);
+ this.input1Bits = Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input2f);
+
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.param & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 101, this.param >>> 16);
+ var1.sendProgressBarUpdate(this, 102, this.data0 & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 103, this.data0 >>> 16);
+ var1.sendProgressBarUpdate(this, 104, this.data1 & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 105, this.data1 >>> 16);
+ var1.sendProgressBarUpdate(this, 106, this.extra & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 107, this.extra >>> 16);
+ var1.sendProgressBarUpdate(this, 108, this.input0Bits & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 109, this.input0Bits >>> 16);
+ var1.sendProgressBarUpdate(this, 110, this.input1Bits & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 111, this.input1Bits >>> 16);
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ this.param = (this.param & 0xFFFF0000 | par2);
+ return;
+ case 101:
+ this.param = (this.param & 0xFFFF | (par2 << 16));
+ return;
+ case 102:
+ this.data0 = (this.data0 & 0xFFFF0000 | par2);
+ break;
+ case 103:
+ this.data0 = (this.data0 & 0xFFFF | (par2 << 16));
+ break;
+ case 104:
+ this.data1 = (this.data1 & 0xFFFF0000 | par2);
+ break;
+ case 105:
+ this.data1 = (this.data1 & 0xFFFF | (par2 << 16));
+ break;
+ case 106:
+ this.extra = (this.extra & 0xFFFF0000 | par2);
+ break;
+ case 107:
+ this.extra = (this.extra & 0xFFFF | (par2 << 16));
+ break;
+ case 108:
+ this.input0Bits = (this.input0Bits & 0xFFFF0000 | par2);
+ this.input0f = Float.intBitsToFloat(input0Bits);
+ return;
+ case 109:
+ this.input0Bits = (this.input0Bits & 0xFFFF | (par2 << 16));
+ this.input0f = Float.intBitsToFloat(input0Bits);
+ return;
+ case 110:
+ this.input1Bits = (this.input1Bits & 0xFFFF0000 | par2);
+ this.input1f = Float.intBitsToFloat(input1Bits);
+ return;
+ case 111:
+ this.input1Bits = (this.input1Bits & 0xFFFF | (par2 << 16));
+ this.input1f = Float.intBitsToFloat(input1Bits);
+ return;
+ default:
+ return;
+ }
+ value0f =Float.intBitsToFloat(data0);
+ value1f =Float.intBitsToFloat(data1);
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java
index d883cb3332..b40bbc9654 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java
@@ -15,12 +15,12 @@ public class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
if (this.mContainer != null) {
proxy.renderUnicodeString("Parametrizer: " + ((GT_Container_Param) this.mContainer).param, 46, 7, 167, 0xffffff);
- proxy.renderUnicodeString("\u24EA\u2b07" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).input1f), 46, 16, 167, 0x22ddff);
- proxy.renderUnicodeString("\u2460\u2b07" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).input2f), 46, 24, 167, 0x00ffff);
- proxy.renderUnicodeString("\u24EA\u2b06" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).value1f), 46, 33, 167, 0x00bbff);
- proxy.renderUnicodeString("\u2460\u2b06" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).value2f), 46, 41, 167, 0x0077ff);
- proxy.renderUnicodeString("M\u24EA: " + ((GT_Container_Param) this.mContainer).value1, 46, 50, 167, 0x00bbff);
- proxy.renderUnicodeString("M\u2460: " + ((GT_Container_Param) this.mContainer).value2, 46, 58, 167, 0x0077ff);
+ proxy.renderUnicodeString("\u24EA\u2b07" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).input0f), 46, 16, 167, 0x22ddff);
+ proxy.renderUnicodeString("\u2460\u2b07" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).input1f), 46, 24, 167, 0x00ffff);
+ proxy.renderUnicodeString("\u24EA\u2b06" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).value0f), 46, 33, 167, 0x00bbff);
+ proxy.renderUnicodeString("\u2460\u2b06" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).value1f), 46, 41, 167, 0x0077ff);
+ proxy.renderUnicodeString("M\u24EA: " + ((GT_Container_Param) this.mContainer).value0, 46, 50, 167, 0x00bbff);
+ proxy.renderUnicodeString("M\u2460: " + ((GT_Container_Param) this.mContainer).value1, 46, 58, 167, 0x0077ff);
proxy.renderUnicodeString("E\u24EA\u2460: " + ((GT_Container_Param) this.mContainer).exponent, 46, 66, 167, 0x0033ff);
} else {
proxy.renderUnicodeString("Parametrizer", 46, 7, 167, 0xffffff);
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java
new file mode 100644
index 0000000000..12257ef979
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java
@@ -0,0 +1,43 @@
+package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+import static com.github.technus.tectech.TecTech.proxy;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+public class GT_GUIContainer_ParamAdv extends GT_GUIContainerMetaTile_Machine {
+ public GT_GUIContainer_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(new GT_Container_ParamAdv(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerAdv.png");
+ }
+
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ if (this.mContainer != null) {
+ proxy.renderUnicodeString("Parametrizer X: " + ((GT_Container_Param) this.mContainer).param, 46, 7, 167, 0xffffff);
+ if(((GT_Container_Param) this.mContainer).exponent>=0x10000){
+ proxy.renderUnicodeString("\u24EA\u2b07|I" + String.format(java.util.Locale.ENGLISH, "%d", Float.floatToIntBits(((GT_Container_Param) this.mContainer).input0f)), 46, 16, 167, 0x22ddff);
+ proxy.renderUnicodeString("\u2460\u2b07|I" + String.format(java.util.Locale.ENGLISH, "%d", Float.floatToIntBits(((GT_Container_Param) this.mContainer).input1f)), 46, 24, 167, 0x00ffff);
+ proxy.renderUnicodeString("\u24EA\u2b06|I" + String.format(java.util.Locale.ENGLISH, "%d", Float.floatToIntBits(((GT_Container_Param) this.mContainer).input0f)), 46, 33, 167, 0x00bbff);
+ proxy.renderUnicodeString("\u2460\u2b06|I" + String.format(java.util.Locale.ENGLISH, "%d", Float.floatToIntBits(((GT_Container_Param) this.mContainer).input1f)), 46, 41, 167, 0x0077ff);
+ }else {
+ proxy.renderUnicodeString("\u24EA\u2b07|F" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).input0f), 46, 16, 167, 0x22ddff);
+ proxy.renderUnicodeString("\u2460\u2b07|F" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).input1f), 46, 24, 167, 0x00ffff);
+ proxy.renderUnicodeString("\u24EA\u2b06|F" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).value0f), 46, 33, 167, 0x00bbff);
+ proxy.renderUnicodeString("\u2460\u2b06|F" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).value1f), 46, 41, 167, 0x0077ff);
+ }
+ proxy.renderUnicodeString("\u24EA\u2b06|B" + ((GT_Container_Param) this.mContainer).value0, 46, 50, 167, 0x00bbff);
+ proxy.renderUnicodeString("\u2460\u2b06|B" + ((GT_Container_Param) this.mContainer).value1, 46, 58, 167, 0x0077ff);
+ proxy.renderUnicodeString("Pointer: 0x" + Integer.toHexString(((((GT_Container_Param) this.mContainer).exponent&0xFFFF))|0x10000).substring(1), 46, 66, 167, 0x0033ff);
+ } else {
+ proxy.renderUnicodeString("Parametrizer X", 46, 7, 167, 0xffffff);
+ }
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java
index 9dbb3845b0..41bb3f9998 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java
@@ -1050,8 +1050,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
for (GT_MetaTileEntity_Hatch_Param param : eParamHatches) {
final int paramID = param.param;
if (paramID < 0) continue;
- eParamsIn[paramID] = param.value1f;
- eParamsIn[paramID + 10] = param.value2f;
+ eParamsIn[paramID] = param.value0f;
+ eParamsIn[paramID + 10] = param.value1f;
param.input1f = eParamsOut[paramID];
param.input2f = eParamsOut[paramID + 10];
}
diff --git a/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png b/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png
index f0fb76ad0f..b754d2cfa5 100644
--- a/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png
+++ b/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png b/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png
new file mode 100644
index 0000000000..3366ab1c14
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png
Binary files differ