diff options
| author | Unknown <tudurap.com@gmail.com> | 2019-07-18 10:21:19 +0200 |
|---|---|---|
| committer | Unknown <tudurap.com@gmail.com> | 2019-07-18 10:21:19 +0200 |
| commit | 3db34bec2ef002d9e489eda4b01d75021172e003 (patch) | |
| tree | 04ab85608ffc8f975c1062427e5048f98c2aa23c | |
| parent | 1b4b27221ed97a3a4954d0136dc978ed5ee139d4 (diff) | |
| parent | cd306be2a326f283bda73abba7f6f20e67384e8c (diff) | |
| download | GT5-Unofficial-3db34bec2ef002d9e489eda4b01d75021172e003.tar.gz GT5-Unofficial-3db34bec2ef002d9e489eda4b01d75021172e003.tar.bz2 GT5-Unofficial-3db34bec2ef002d9e489eda4b01d75021172e003.zip | |
Merge remote-tracking branch 'origin/BassAddons' into BassAddons
39 files changed, 690 insertions, 109 deletions
diff --git a/build.gradle b/build.gradle index 0d563706a2..ed05a63381 100644 --- a/build.gradle +++ b/build.gradle @@ -89,6 +89,10 @@ task getGregTech(type: Download) { dest file("libs/gregtech-${config.gregtech.version}-dev.jar") mustRunAfter "deobfBinJar" mustRunAfter "repackMinecraft" + delete fileTree("$projectDir/libs/") { + include 'gregtech-*-dev.jar' + exclude "gregtech-${config.gregtech.version}-dev.jar" + } } tasks.setupCIWorkspace.dependsOn getGregTech diff --git a/gregtech-5.09.32.06-dev-.jar b/gregtech-5.09.32.06-dev-.jar Binary files differdeleted file mode 100644 index e771833469..0000000000 --- a/gregtech-5.09.32.06-dev-.jar +++ /dev/null diff --git a/gregtech-5.09.32pre3-1428.jar b/gregtech-5.09.32pre3-1428.jar Binary files differdeleted file mode 100644 index c436de0cd1..0000000000 --- a/gregtech-5.09.32pre3-1428.jar +++ /dev/null diff --git a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java index a7cb8bb8a0..ad24f72cb0 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java @@ -6,7 +6,7 @@ import net.minecraftforge.fluids.FluidStack; import java.lang.reflect.Method; -import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition.*; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.*; public class GtppAtomLoader implements Runnable{ //region reflect a bit diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java index c22c6c4b95..e8163833ee 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java @@ -3,7 +3,7 @@ package com.github.technus.tectech.compatibility.openmodularturrets.entity.proje import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; import gregtech.api.GregTech_API; import gregtech.api.util.GT_Utility; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java index 77dffad225..059ac44da3 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java @@ -109,6 +109,25 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme } @Override + public String getShortSymbol() { + StringBuilder symbol = new StringBuilder(8); + for (cElementalDefinitionStack aspect : aspectStacks.values()) { + if (aspect.definition instanceof ePrimalAspectDefinition) { + for (int i = 0; i < aspect.amount; i++) { + symbol.append(aspect.definition.getShortSymbol()); + } + } else { + symbol.append('('); + for (int i = 0; i < aspect.amount; i++) { + symbol.append(aspect.definition.getShortSymbol()); + } + symbol.append(')'); + } + } + return symbol.toString(); + } + + @Override public NBTTagCompound toNBT() { return getNbtTagCompound(nbtType, aspectStacks); } @@ -267,6 +286,13 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme } @Override + public void addScanShortSymbols(ArrayList<String> lines, int capabilities, long energyLevel) { + if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS, capabilities)) { + lines.add(getShortSymbol()); + } + } + + @Override public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) { if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { lines.add("CLASS = " + nbtType + ' ' + getClassType()); diff --git a/src/main/java/com/github/technus/tectech/font/TecTechFontRender.java b/src/main/java/com/github/technus/tectech/font/TecTechFontRender.java new file mode 100644 index 0000000000..a7130bab90 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/font/TecTechFontRender.java @@ -0,0 +1,277 @@ +package com.github.technus.tectech.font; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +@SideOnly(Side.CLIENT) +public class TecTechFontRender extends FontRenderer { + public static final TecTechFontRender INSTANCE = new TecTechFontRender(); + + private static float DISTANCE_L = .125F; + private static float DISTANCE_L2 = DISTANCE_L *2F; + + private static float DISTANCE_M = 0.06F; + private static float DISTANCE_M2 = DISTANCE_M *2F; + + private static float DISTANCE_A = 0.06F; + private static float DISTANCE_A2 = DISTANCE_A *2F; + + private static final Method reset; + private static final Method render; + + private final GameSettings gameSettings; + + static { + Method resetMethod,renderMethod; + try { + resetMethod =FontRenderer.class.getDeclaredMethod("resetStyles"); + renderMethod=FontRenderer.class.getDeclaredMethod("renderString", String.class, int.class, int.class, int.class, boolean.class); + } catch (NoSuchMethodException e) { + try { + resetMethod =FontRenderer.class.getDeclaredMethod("func_78265_b"); + renderMethod=FontRenderer.class.getDeclaredMethod("func_78258_a", String.class, int.class, int.class, int.class, boolean.class); + } catch (NoSuchMethodException ex) { + throw new RuntimeException("Cannot get methods!",ex); + } + } + resetMethod.setAccessible(true); + renderMethod.setAccessible(true); + reset=resetMethod; + render=renderMethod; + } + + private TecTechFontRender() { + super(Minecraft.getMinecraft().gameSettings, new ResourceLocation("textures/font/ascii.png"), Minecraft.getMinecraft().renderEngine, false); + gameSettings = Minecraft.getMinecraft().gameSettings; + } + + private void resetStyles2(){ + try { + reset.invoke(this); + } catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException("Cannot run method resetStyles!",e); + } + } + + private int renderString2(String str, int x, int y, int color, boolean dropShadow){ + try { + return (int)render.invoke(this,str,x,y,color,dropShadow); + } catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException("Cannot run method renderString!",e); + } + } + + + @Override + public int drawString(String str, int x, int y, int color, boolean dropShadow) { + switch (gameSettings.guiScale){ + case 0: + setUnicodeFlag(true); + y--; + GL11.glPushMatrix(); + + if (dropShadow) + { + GL11.glTranslatef(DISTANCE_A, DISTANCE_A, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(-DISTANCE_A2, 0, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(0, -DISTANCE_A2, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(DISTANCE_A2, 0, 0F); + } + + GL11.glTranslatef(DISTANCE_A, DISTANCE_A, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(-DISTANCE_A2, 0, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(0, -DISTANCE_A2, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(DISTANCE_A2, 0, 0F); + + GL11.glPopMatrix(); + break; + case 1: + return Minecraft.getMinecraft().fontRenderer.drawString(str, x, y, color, dropShadow); + case 2: + setUnicodeFlag(true); + y--; + GL11.glPushMatrix(); + + if (dropShadow) + { + GL11.glTranslatef(DISTANCE_M, DISTANCE_M, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(-DISTANCE_M2, 0, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(0, -DISTANCE_M2, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(DISTANCE_M2, 0, 0F); + } + + GL11.glTranslatef(DISTANCE_M, DISTANCE_M, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(-DISTANCE_M2, 0, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(0, -DISTANCE_M2, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(DISTANCE_M2, 0, 0F); + + GL11.glPopMatrix(); + break; + case 3: + setUnicodeFlag(true); + y--; + GL11.glPushMatrix(); + + if (dropShadow) + { + GL11.glTranslatef(DISTANCE_L, DISTANCE_L, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(-DISTANCE_L2, 0, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(0, -DISTANCE_L2, 0F); + drawStringBack(str, x, y, color); + GL11.glTranslatef(DISTANCE_L2, 0, 0F); + } + + GL11.glTranslatef(DISTANCE_L, DISTANCE_L, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(-DISTANCE_L2, 0, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(0, -DISTANCE_L2, 0F); + drawStringFront(str, x, y, color); + GL11.glTranslatef(DISTANCE_L2, 0, 0F); + + GL11.glPopMatrix(); + break; + } + return drawStringFront(str, x, y, color); + } + + @Override + public void drawSplitString(String str, int x, int y, int maxWidth, int color) { + switch (gameSettings.guiScale){ + case 0: + setUnicodeFlag(true); + y--; + GL11.glPushMatrix(); + + GL11.glTranslatef(DISTANCE_A, DISTANCE_A, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(-DISTANCE_A2, 0, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(0, -DISTANCE_A2, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(DISTANCE_A2, 0, 0F); + + GL11.glPopMatrix(); + break; + case 1: + Minecraft.getMinecraft().fontRenderer.drawSplitString(str, x, y, maxWidth, color); + break; + case 2: + setUnicodeFlag(true); + y--; + GL11.glPushMatrix(); + + GL11.glTranslatef(DISTANCE_M, DISTANCE_M, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(-DISTANCE_M2, 0, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(0, -DISTANCE_M2, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(DISTANCE_M2, 0, 0F); + + GL11.glPopMatrix(); + break; + case 3: + setUnicodeFlag(true); + y--; + GL11.glPushMatrix(); + + GL11.glTranslatef(DISTANCE_L, DISTANCE_L, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(-DISTANCE_L2, 0, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(0, -DISTANCE_L2, 0F); + super.drawSplitString(str, x, y, maxWidth, color); + GL11.glTranslatef(DISTANCE_L2, 0, 0F); + + GL11.glPopMatrix(); + break; + } + } + + private int drawStringFront(String p_85187_1_, int p_85187_2_, int p_85187_3_, int p_85187_4_) { + enableAlpha(); + resetStyles2(); + return renderString2(p_85187_1_, p_85187_2_, p_85187_3_, p_85187_4_, false); + } + + private int drawStringBack(String p_85187_1_, int p_85187_2_, int p_85187_3_, int p_85187_4_) { + enableAlpha(); + resetStyles2(); + return renderString2(p_85187_1_, p_85187_2_ + 1, p_85187_3_ + 1, p_85187_4_, true); + } + + @Override + public int getStringWidth(String p_78256_1_) + { + if(gameSettings.guiScale==1){ + return Minecraft.getMinecraft().fontRenderer.getStringWidth(p_78256_1_); + } + if (p_78256_1_ == null) + { + return 0; + } + else + { + int i = 0; + boolean flag = false; + + for (int j = 0; j < p_78256_1_.length(); ++j) + { + char c0 = p_78256_1_.charAt(j); + int k = this.getCharWidth(c0); + + if (k < 0 && j < p_78256_1_.length() - 1) + { + ++j; + c0 = p_78256_1_.charAt(j); + + if (c0 != 108 && c0 != 76) + { + if (c0 == 114 || c0 == 82) + { + flag = false; + } + } + else + { + flag = true; + } + + k = 0; + } + + i += k; + + if (flag && k > 0) + { + ++i; + } + } + + return i; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java b/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java index 130106a76b..79ad5dc98c 100644 --- a/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java @@ -3,9 +3,9 @@ package com.github.technus.tectech.loader; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.iaeaNuclide; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.iaeaNuclide; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.*; /** diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java index 56f461eeb5..8a0fb20c59 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java @@ -2,8 +2,8 @@ package com.github.technus.tectech.loader.recipe; import com.github.technus.tectech.Reference; import com.github.technus.tectech.compatibility.dreamcraft.DreamCraftRecipeLoader; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.item.ConstructableTriggerItem; diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index dc7e8faef7..2a770ea332 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -8,7 +8,7 @@ import com.github.technus.tectech.mechanics.data.ChunkDataHandler; import com.github.technus.tectech.mechanics.data.ChunkDataMessage; import com.github.technus.tectech.mechanics.data.IChunkMetaDataHandler; import com.github.technus.tectech.mechanics.data.PlayerDataMessage; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition; import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalInstanceStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalInstanceStackMap.java index bfbe93bb4f..5893ac1a1f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalInstanceStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalInstanceStackMap.java @@ -316,6 +316,15 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn return var.toArray(new cElementalInstanceStack[0])[i]; } + public String[] getShortSymbolsInfo() { + String[] info = new String[map.size()]; + int i = 0; + for (cElementalInstanceStack instance : map.values()) { + info[i++] = instance.definition.getShortSymbol(); + } + return info; + } + public String[] getElementalInfo() { String[] info = new String[map.size() * 4]; int i = 0; @@ -329,6 +338,14 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn return info; } + public ArrayList<String> getScanShortSymbols(int[] capabilities) { + ArrayList<String> list=new ArrayList<>(16); + for(Map.Entry<iElementalDefinition,cElementalInstanceStack> e:map.entrySet()){ + e.getValue().addScanShortSymbols(list,capabilities); + } + return list; + } + public ArrayList<String> getScanInfo(int[] capabilities) { ArrayList<String> list=new ArrayList<>(16); for(Map.Entry<iElementalDefinition,cElementalInstanceStack> e:map.entrySet()){ @@ -412,6 +429,16 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn } //NBT + public NBTTagCompound getShortSymbolsNBT() { + NBTTagCompound nbt = new NBTTagCompound(); + String[] info = getShortSymbolsInfo(); + nbt.setInteger("i", info.length); + for (int i = 0; i < info.length; i++) { + nbt.setString(Integer.toString(i), info[i]); + } + return nbt; + } + public NBTTagCompound getInfoNBT() { NBTTagCompound nbt = new NBTTagCompound(); String[] info = getElementalInfo(); @@ -422,6 +449,16 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn return nbt; } + public NBTTagCompound getScanShortSymbolsNBT(int[] capabilities) { + NBTTagCompound nbt = new NBTTagCompound(); + ArrayList<String> info = getScanShortSymbols(capabilities); + nbt.setInteger("i", info.size()); + for (int i = 0; i < info.size(); i++) { + nbt.setString(Integer.toString(i), info.get(i)); + } + return nbt; + } + public NBTTagCompound getScanInfoNBT(int[] capabilities) { NBTTagCompound nbt = new NBTTagCompound(); ArrayList<String> info = getScanInfo(capabilities); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java index fb6acec084..dbbfa7bf66 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java @@ -34,6 +34,15 @@ abstract class cElementalStackMap implements Comparable<cElementalStackMap> { return map.get(def); } + public String[] getShortSymbolsInfo() { + String[] info = new Stri |
