aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorBass <tudurap.com@gmail.com>2019-08-28 13:11:51 +0100
committerBass <tudurap.com@gmail.com>2019-08-28 13:11:51 +0100
commit2928aac711dea97c93441a1886816a0954623da7 (patch)
treed93c3babe138bbef4643a4fd1b72247eeb495d21 /src/main/java
parent2edad307e1648142d52808590c102a0a9161769e (diff)
downloadGT5-Unofficial-2928aac711dea97c93441a1886816a0954623da7.tar.gz
GT5-Unofficial-2928aac711dea97c93441a1886816a0954623da7.tar.bz2
GT5-Unofficial-2928aac711dea97c93441a1886816a0954623da7.zip
Minor refactors to please the gods
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/technus/tectech/Util.java49
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java9
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/data/thaumSpark.java53
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java5
6 files changed, 64 insertions, 60 deletions
diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java
index 70e3a4562c..f73bb30c52 100644
--- a/src/main/java/com/github/technus/tectech/Util.java
+++ b/src/main/java/com/github/technus/tectech/Util.java
@@ -161,55 +161,6 @@ public final class Util {
return result.toString();
}
- public static class thaumSpark implements Serializable {
- private static final long serialVersionUID = -7037856938316679566L;
- public int x, y, z, wID;
- public byte xR, yR, zR;
-
- public thaumSpark(){
- this.x = 0;
- this.z = 0;
- this.y = 0;
-
- this.xR = 0;
- this.yR = 0;
- this.zR = 0;
-
- this.wID = 0;
- }
-
- public thaumSpark(int x, int y, int z, byte xR, byte yR, byte zR, int wID) {
- this.x = x;
- this.z = z;
- this.y = y;
-
- this.xR = xR;
- this.yR = yR;
- this.zR = zR;
-
- this.wID = wID;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- thaumSpark that = (thaumSpark) o;
- return x == that.x &&
- y == that.y &&
- z == that.z &&
- wID == that.wID &&
- xR == that.xR &&
- yR == that.yR &&
- zR == that.zR;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(x, y, z, wID, xR, yR, zR);
- }
- }
-
public static float map(float x, float in_min, float in_max, float out_min, float out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java b/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java
index a4e5bb318e..792255cd4d 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java
@@ -1,6 +1,5 @@
package com.github.technus.tectech.mechanics.data;
-import com.github.technus.tectech.Util;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
@@ -16,7 +15,7 @@ import java.util.Arrays;
import java.util.HashSet;
public class RendererMessage implements IMessage {
- HashSet<Util.thaumSpark> sparkList = new HashSet<Util.thaumSpark>();
+ HashSet<thaumSpark> sparkList = new HashSet<thaumSpark>();
public RendererMessage() {
}
@@ -30,7 +29,7 @@ public class RendererMessage implements IMessage {
InputStream is = new ByteArrayInputStream(boop);
ObjectInputStream ois = new ObjectInputStream(is);
Object data = ois.readObject();
- sparkList = (HashSet<Util.thaumSpark>) data;
+ sparkList = (HashSet<thaumSpark>) data;
} catch (IOException | ClassNotFoundException ex) {
}
}
@@ -52,7 +51,7 @@ public class RendererMessage implements IMessage {
public RendererData() {
}
- public RendererData(HashSet<Util.thaumSpark> eSparkList) {
+ public RendererData(HashSet<thaumSpark> eSparkList) {
sparkList = eSparkList;
}
}
@@ -61,7 +60,7 @@ public class RendererMessage implements IMessage {
public static class ClientHandler extends AbstractClientMessageHandler<RendererData> {
@Override
public IMessage handleClientMessage(EntityPlayer pPlayer, RendererData pMessage, MessageContext pCtx) {
- for (Util.thaumSpark sp : pMessage.sparkList) {
+ for (thaumSpark sp : pMessage.sparkList) {
thaumLightning(sp.x, sp.y, sp.z, sp.xR, sp.yR, sp.zR, sp.wID);
}
pMessage.sparkList.clear();
diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/thaumSpark.java b/src/main/java/com/github/technus/tectech/mechanics/data/thaumSpark.java
new file mode 100644
index 0000000000..df578e7849
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/data/thaumSpark.java
@@ -0,0 +1,53 @@
+package com.github.technus.tectech.mechanics.data;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+public class thaumSpark implements Serializable {
+ private static final long serialVersionUID = -7037856938316679566L;
+ public int x, y, z, wID;
+ public byte xR, yR, zR;
+
+ public thaumSpark(){
+ this.x = 0;
+ this.z = 0;
+ this.y = 0;
+
+ this.xR = 0;
+ this.yR = 0;
+ this.zR = 0;
+
+ this.wID = 0;
+ }
+
+ public thaumSpark(int x, int y, int z, byte xR, byte yR, byte zR, int wID) {
+ this.x = x;
+ this.z = z;
+ this.y = y;
+
+ this.xR = xR;
+ this.yR = yR;
+ this.zR = zR;
+
+ this.wID = wID;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ thaumSpark that = (thaumSpark) o;
+ return x == that.x &&
+ y == that.y &&
+ z == that.z &&
+ wID == that.wID &&
+ xR == that.xR &&
+ yR == that.yR &&
+ zR == that.zR;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(x, y, z, wID, xR, yR, zR);
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java
index 466b0e64af..2b2c54526f 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java
@@ -47,4 +47,4 @@ public class GT_MetaTileEntity_Hatch_InputElemental extends GT_MetaTileEntity_Ha
public boolean canConnect(byte side) {
return isInputFacing(side);
}
-}
+} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java
index 40ea3084c8..08050ad40c 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java
@@ -2,9 +2,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.data.RendererMessage;
+import com.github.technus.tectech.mechanics.data.thaumSpark;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
@@ -42,7 +42,7 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat
import static gregtech.api.enums.GT_Values.E;
public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
- private final static HashSet<Util.thaumSpark> sparkList = new HashSet<Util.thaumSpark>();
+ private final static HashSet<thaumSpark> sparkList = new HashSet<>();
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
@@ -537,7 +537,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
int wID = mte.getWorld().provider.dimensionId;
- sparkList.add(new Util.thaumSpark(posTop[0], posTop[1], posTop[2], xR, yR, zR, wID));
+ sparkList.add(new thaumSpark(posTop[0], posTop[1], posTop[2], xR, yR, zR, wID));
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
index c4ea1d91df..802fa8fb21 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
@@ -5,6 +5,7 @@ import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.Util;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.data.RendererMessage;
+import com.github.technus.tectech.mechanics.data.thaumSpark;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_TM_teslaCoil;
@@ -33,7 +34,7 @@ import static java.lang.Math.round;
public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryBuffer {
- private final static HashSet<Util.thaumSpark> sparkList = new HashSet<>();
+ private final static HashSet<thaumSpark> sparkList = new HashSet<>();
private byte sparkCount = 0;
private int maxTier = 4; //Max tier of transceiver
@@ -213,7 +214,7 @@ public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryB
int wID = mte.getWorld().provider.dimensionId;
- sparkList.add(new Util.thaumSpark(x, y, z, xR, yR, zR, wID));
+ sparkList.add(new thaumSpark(x, y, z, xR, yR, zR, wID));
}
private long getEnergyEfficiency(long voltage, int distance, boolean overDriveToggle) {