aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-04-07 07:08:39 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-04-07 07:08:39 +0200
commite47085d1eae7fcd3f1e858c67e75bb4ed936e351 (patch)
tree787b6453ef1c8d7ae2ed7e14dd05505f744787d2 /src/main
parent6ba77e6b461080be8389d721ff8656e5b0c93281 (diff)
downloadGT5-Unofficial-e47085d1eae7fcd3f1e858c67e75bb4ed936e351.tar.gz
GT5-Unofficial-e47085d1eae7fcd3f1e858c67e75bb4ed936e351.tar.bz2
GT5-Unofficial-e47085d1eae7fcd3f1e858c67e75bb4ed936e351.zip
Giant Materials/Space Compat update
+added ASM +added a shit ton of materials and got my own Materials system up and running +added Ross128 when GC is installed Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 6e298a2662d8874903210037f7faa53d9aa83f40
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/github/bartimaeusnek/ASM/BWCore.java79
-rw-r--r--src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java63
-rw-r--r--src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java31
-rw-r--r--src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java212
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java48
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java92
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java95
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java206
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java233
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java101
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java67
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java172
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java180
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java390
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java616
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java74
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java65
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java84
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java81
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java46
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java45
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java126
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java195
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java186
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java33
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java178
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java91
-rw-r--r--src/main/resources/assets/bartworks/lang/en_US.lang9
-rw-r--r--src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128.pngbin0 -> 934 bytes
-rw-r--r--src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128b.pngbin0 -> 1048 bytes
-rw-r--r--src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128ba.pngbin0 -> 990 bytes
-rw-r--r--src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/World/SunRoss128.pngbin0 -> 1260 bytes
37 files changed, 3816 insertions, 4 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java
new file mode 100644
index 0000000000..bddf66ae5e
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.ASM;
+
+import com.github.bartimaeusnek.crossmod.BartWorksCrossmod;
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+import cpw.mods.fml.common.DummyModContainer;
+import cpw.mods.fml.common.LoadController;
+import cpw.mods.fml.common.ModMetadata;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.versioning.ArtifactVersion;
+import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
+import net.minecraftforge.common.config.Configuration;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BWCore extends DummyModContainer {
+
+ public static final String BWCORE_NAME = "BartWorks ASM Core";
+ public static final Logger BWCORE_LOG = LogManager.getLogger(BWCORE_NAME);
+
+ public BWCore() {
+ super(new ModMetadata());
+ ModMetadata metadata = getMetadata();
+ metadata.modId = "BWCore";
+ metadata.name = BWCORE_NAME;
+ metadata.version = "0.0.1";
+ metadata.authorList.add("bartimaeusnek");
+ metadata.dependants = getDependants();
+ }
+
+ @Subscribe
+ public void preInit(FMLPreInitializationEvent event) {
+ Configuration asmconfighandler = new Configuration(event.getSuggestedConfigurationFile());
+ for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) {
+ BWCoreTransformer.shouldTransform[i]=asmconfighandler.get("ASM fixes",BWCoreTransformer.DESCRIPTIONFORCONFIG[i]+" in class: "+BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i],true).getBoolean(true);
+ }
+ if (asmconfighandler.hasChanged())
+ asmconfighandler.save();
+ }
+
+ @Override
+ public List<ArtifactVersion> getDependants() {
+ List<ArtifactVersion> ret = new ArrayList<ArtifactVersion>();
+ ret.add(new DefaultArtifactVersion("ExtraUtilities", true));
+ ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true));
+ return ret;
+ }
+
+ @Override
+ public boolean registerBus(EventBus bus, LoadController controller) {
+ bus.register(this);
+ return true;
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java
new file mode 100644
index 0000000000..becd28f524
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.ASM;
+
+import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
+
+import java.util.Map;
+
+@IFMLLoadingPlugin.MCVersion("1.7.10")
+@IFMLLoadingPlugin.TransformerExclusions({"com.github.bartimaeusnek.ASM"})
+@IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME)
+public class BWCorePlugin implements IFMLLoadingPlugin {
+
+ public static final String BWCORE_PLUGIN_NAME="BartWorks ASM Core Plugin";
+
+ @Override
+ public String[] getASMTransformerClass() {
+ return new String[]{BWCoreTransformer.class.getName()};
+ }
+
+ @Override
+ public String getModContainerClass() {
+ return BWCore.class.getName();
+ }
+
+ @Override
+ public String getSetupClass() {
+ return null;
+ }
+
+ @Override
+ public void injectData(Map<String, Object> data) {
+ if (data.get("runtimeDeobfuscationEnabled") != null){
+ BWCoreTransformer.obfs=(boolean)data.get("runtimeDeobfuscationEnabled");
+ }
+
+ }
+
+ @Override
+ public String getAccessTransformerClass() {
+ return null;
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java
new file mode 100644
index 0000000000..0d98c72564
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.ASM;
+
+import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b;
+import net.minecraft.client.multiplayer.WorldClient;
+
+public class BWCoreStaticReplacementMethodes {
+ private BWCoreStaticReplacementMethodes(){}
+
+}
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java
new file mode 100644
index 0000000000..0a6f44712d
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.ASM;
+
+import net.minecraft.launchwrapper.IClassTransformer;
+import org.apache.commons.lang3.ArrayUtils;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.tree.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.objectweb.asm.Opcodes.*;
+
+public class BWCoreTransformer implements IClassTransformer {
+ public static boolean obfs = false;
+ public static final String[] DESCRIPTIONFORCONFIG = {
+ "REMOVING RAIN FROM LAST MILLENIUM (EXU)",
+ "REMVOING CREATURES FROM LAST MILLENIUM (EXU)",
+ "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS"
+ };
+
+ public static final String[] CLASSESBEEINGTRANSFORMED = {
+ "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime",
+ "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime",
+ //"micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld",
+ "net.minecraft.client.renderer.RenderGlobal",
+ };
+
+ public static boolean[] shouldTransform = ArrayUtils.toPrimitive(new Boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length],true);
+
+ @Override
+ public byte[] transform(String name, String transformedName, byte[] basicClass) {
+ for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) {
+ if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]))
+ return BWCoreTransformer.transform(i,basicClass);
+ }
+ return basicClass;
+ }
+
+ public static byte[] transform(int id, byte[] basicClass) {
+ if (!BWCoreTransformer.shouldTransform[id])
+ return basicClass;
+
+ if (id < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length) {
+ BWCore.BWCORE_LOG.info(DESCRIPTIONFORCONFIG[id]);
+ ClassReader classReader = new ClassReader(basicClass);
+ ClassNode classNode = new ClassNode();
+ classReader.accept(classNode, ClassReader.SKIP_FRAMES);
+ List<MethodNode> methods = classNode.methods;
+ switch (id) {
+ case 0: {
+ BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]);
+ String name_deObfs = "canDoRainSnowIce";
+
+ String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z";
+ String dsc_Obfs = "(Lapx;)Z";
+ for (int i = 0; i < methods.size(); i++) {
+ if (methods.get(i).name.equalsIgnoreCase(name_deObfs)) {
+ BWCore.BWCORE_LOG.info("Found "+name_deObfs+"! Removing!");
+ methods.remove(i);
+ break;
+ }
+ }
+ BWCore.BWCORE_LOG.info("Creating new "+name_deObfs+"!");
+ MethodNode nu = new MethodNode(Opcodes.ACC_PUBLIC, name_deObfs,
+ /*obfs ? dsc_Obfs :*/ dsc_deObfs,
+ name_deObfs+dsc_deObfs.substring(0,dsc_deObfs.length()-1),
+ new String[0]
+ );
+ InsnList insnList = new InsnList();
+ insnList.add(new InsnNode(Opcodes.ICONST_0));
+ insnList.add(new InsnNode(Opcodes.IRETURN));
+ nu.instructions = insnList;
+ nu.maxLocals = 1;
+ nu.maxStack = 1;
+ methods.add(nu);
+ break;
+ }
+ case 1: {
+ BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]);
+ String name_deObfs = "getPossibleCreatures";
+ String name_Obfs = "func_73155_a";
+ String dsc_deObfs = "(Lnet/minecraft/entity/EnumCreatureType;III)Ljava/util/List;";
+ String dsc_Obfs = "(Lsx;III)Ljava/util/List;";
+ for (int i = 0; i < methods.size(); i++) {
+ if ((methods.get(i).name.equalsIgnoreCase(obfs?name_Obfs:name_deObfs) && methods.get(i).desc.equalsIgnoreCase(obfs?dsc_Obfs:dsc_deObfs))||(methods.get(i).name.equalsIgnoreCase(!obfs?name_Obfs:name_deObfs) && methods.get(i).desc.equalsIgnoreCase(!obfs?dsc_Obfs:dsc_deObfs))) {
+ BWCore.BWCORE_LOG.info("Found "+(name_deObfs)+"! Patching!");
+ MethodNode toPatch = methods.get(i);
+ InsnList insnList = new InsnList();
+ insnList.add(new InsnNode(Opcodes.ACONST_NULL));
+ insnList.add(new InsnNode(Opcodes.ARETURN));
+ toPatch.instructions = insnList;
+ toPatch.maxStack = 1;
+ toPatch.maxLocals = 5;
+ methods.set(i, toPatch);
+ break;
+ }
+ }
+ break;
+ }
+ case 2:{
+ String name_deObfs = "renderSky";
+ String name_Obfs = "func_72714_a";
+ String dsc_deObfs = "(F)V";
+ BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]);
+ for (int i = 0; i < methods.size(); i++) {
+ MethodNode toPatch = methods.get(i);
+ if ((toPatch.name.equalsIgnoreCase(name_Obfs) || toPatch.name.equalsIgnoreCase(name_deObfs)) && methods.get(i).desc.equalsIgnoreCase(dsc_deObfs)) {
+ BWCore.BWCORE_LOG.info("Found "+(name_deObfs)+"! Patching!");
+ InsnList nu = new InsnList();
+ LabelNode[] LabelNodes = { new LabelNode(),new LabelNode()};
+ for (int j = 0; j < toPatch.instructions.size(); j++) {
+ if (toPatch.instructions.get(j) instanceof LineNumberNode && ((LineNumberNode) toPatch.instructions.get(j)).line == 1190) {
+ nu.add(toPatch.instructions.get(j));
+ nu.add(new VarInsnNode(ALOAD, 0));
+ nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;"));
+ nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", "provider", "Lnet/minecraft/world/WorldProvider;"));
+ nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b"));
+ nu.add(new JumpInsnNode(IFEQ, LabelNodes[0]));
+ nu.add(new VarInsnNode(ALOAD, 0));
+ nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;"));
+ nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;"));
+ nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false));
+ nu.add(new JumpInsnNode(GOTO, LabelNodes[1]));
+ nu.add(LabelNodes[0]);
+ nu.add(new VarInsnNode(ALOAD, 0));
+ nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;"));
+ nu.add(new FieldInsnNode(GETSTATIC, "net/minecraft/client/renderer/RenderGlobal", "locationSunPng", "Lnet/minecraft/util/ResourceLocation;"));
+ nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false));
+ nu.add(LabelNodes[1]);
+ j+=5;
+
+// if (toPatch.instructions.get(j) instanceof LineNumberNode && ((LineNumberNode) toPatch.instructions.get(j)).line == 308) {
+// nu.add(toPatch.instructions.get(j));
+// nu.add(new VarInsnNode(ALOAD, 0));
+// nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b"));
+// nu.add(new JumpInsnNode(IFEQ, LabelNodes[0]));
+// nu.add(new VarInsnNode(ALOAD, 0));
+// nu.add(new FieldInsnNode(GETFIELD, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "minecraft", "Lnet/minecraft/client/Minecraft;"));
+// nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/Minecraft", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;"));
+// nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;"));
+// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false));
+// nu.add(new JumpInsnNode(GOTO, LabelNodes[1]));
+// nu.add(LabelNodes[0]);
+// nu.add(new VarInsnNode(ALOAD, 0));
+// nu.add(new FieldInsnNode(GETFIELD, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "minecraft", "Lnet/minecraft/client/Minecraft;"));
+// nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/Minecraft", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;"));
+// nu.add(new FieldInsnNode(GETSTATIC, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "sunTexture", "Lnet/minecraft/util/ResourceLocation;"));
+// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false));
+// nu.add(LabelNodes[1]);
+// j+=5;
+ } else {
+ nu.add(toPatch.instructions.get(j));
+ }
+ }
+ toPatch.instructions=nu;
+ break;
+ }
+ }
+ break;
+ }
+ default: {
+ BWCore.BWCORE_LOG.info("Could not find: "+CLASSESBEEINGTRANSFORMED[id]);
+ return basicClass;
+ }
+ }
+
+ classNode.methods=methods;
+ ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
+ classNode.accept(classWriter);
+ byte[] ret = classWriter.toByteArray();
+ if (Arrays.hashCode(basicClass) == Arrays.hashCode(ret))
+ BWCore.BWCORE_LOG.warn("Could not patch: "+CLASSESBEEINGTRANSFORMED[id]);
+// try {
+// OutputStream os = new FileOutputStream(new File("C:/test/"+CLASSESBEEINGTRANSFORMED[id]+".class"));
+// os.write(classWriter.toByteArray());
+// } catch (FileNotFoundException e) {
+// e.printStackTrace();
+// } catch (IOException e) {
+// e.printStackTrace();
+// }
+
+ return ret;
+ }
+ return basicClass;
+ }
+
+
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java
new file mode 100644
index 0000000000..29c45e5074
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.bartworks.API;
+
+import java.util.HashSet;
+
+public final class WerkstoffAdderRegistry implements Runnable {
+
+ private WerkstoffAdderRegistry(){}
+
+ static final WerkstoffAdderRegistry INSTANCE = new WerkstoffAdderRegistry();
+
+ final HashSet<Runnable> toRun= new HashSet<>();
+
+ public static final WerkstoffAdderRegistry getINSTANCE() {
+ return INSTANCE;
+ }
+
+ public static void addWerkstoffAdder(Runnable adder){
+ INSTANCE.toRun.add(adder);
+ }
+
+ @Override
+ public void run() {
+ for (Runnable r : toRun)
+ r.run();
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index 56d15fa479..461d8e0f81 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -35,7 +35,9 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader;
import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks;
import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry;
import com.github.bartimaeusnek.bartworks.common.net.BW_Network;
+import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
@@ -104,6 +106,7 @@ public final class MainMod {
BioCultureLoader bioCultureLoader = new BioCultureLoader();
bioCultureLoader.run();
}
+ WerkstoffLoader.INSTANCE.init();
}
@Mod.EventHandler
@@ -113,6 +116,7 @@ public final class MainMod {
new LoaderRegistry().run();
if (ConfigHandler.BioLab)
new BioLabLoader().run();
+ WerkstoffLoader.INSTANCE.runInit();
}
@Mod.EventHandler
@@ -121,6 +125,8 @@ public final class MainMod {
if (ConfigHandler.BioLab)
new GTNHBlocks().run();
BioObjectAdder.regenerateBioFluids();
+ new BW_WordGenerator();
+ WerkstoffLoader.INSTANCE.run();
}
@Mod.EventHandler
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java
new file mode 100644
index 0000000000..1105ae39ea
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnish