diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-01-03 23:38:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-03 23:38:44 +0100 |
commit | 36958daf28004293c96b8a16891bd5903ce4bbea (patch) | |
tree | 6bcd881b22141b0c756b316d59d203b3d552527e | |
parent | 2616ba28c946150a3d802c6414fbd403a8a412ed (diff) | |
parent | 501134f1e1457fb3b5762f12471e1c930ee1fa94 (diff) | |
download | GT5-Unofficial-36958daf28004293c96b8a16891bd5903ce4bbea.tar.gz GT5-Unofficial-36958daf28004293c96b8a16891bd5903ce4bbea.tar.bz2 GT5-Unofficial-36958daf28004293c96b8a16891bd5903ce4bbea.zip |
Merge pull request #47 from bartimaeusnek/SelfSortingListTest
Main Version Release 0.5.5
Former-commit-id: 3baf57c67a6a8c3e2763cfb7ceb9748f88d47d57
384 files changed, 7959 insertions, 1685 deletions
diff --git a/.gitignore b/.gitignore index 4d4c2b25eb..edc0472679 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,12 @@ hs_err_pid* /eclipse /build /out +/run /.gradle /venv -/libs
\ No newline at end of file +/libs/* +!/libs/TecTech-1.7.10-3.7.3-deobf.jar +!/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar +!/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar +!/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar +!/libs/gregtech-5.09.32-dev.jar
\ No newline at end of file diff --git a/build.gradle b/build.gradle index bd21e845de..2954d6f60d 100644 --- a/build.gradle +++ b/build.gradle @@ -92,11 +92,24 @@ repositories { dependencies { compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" - compileOnly "applecore:AppleCore:${config.applecore.version}:api" compile "micdoodle8.mods:MicdoodleCore:${config.galacticraft.version}:Dev" compile "micdoodle8.mods:GalacticraftCore:${config.galacticraft.version}:Dev" compile "micdoodle8.mods:Galacticraft-Planets:${config.galacticraft.version}:Dev" compile "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api" + compileOnly "applecore:AppleCore:${config.applecore.version}:api" + compileOnly "com.enderio.core:EnderCore:${config.enderiocore.version}:dev" + compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" + compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" +} + +task getRailCraft(type: Download) { + onlyIf { + !file("libs/Railcraft_1.7.10-9.12.2.0-dev.jar").exists() + } + src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/Railcraft_1.7.10-9.12.2.0-dev.jar' + dest file("libs/Railcraft_1.7.10-9.12.2.0-dev.jar") + mustRunAfter "deobfBinJar" + mustRunAfter "repackMinecraft" } //task getGregTech(type: Download) { @@ -109,10 +122,10 @@ dependencies { // mustRunAfter "repackMinecraft" //} -//tasks.setupCIWorkspace.dependsOn getGregTech -//tasks.setupDevWorkspace.dependsOn getGregTech -//tasks.setupDecompWorkspace.dependsOn getGregTech -//tasks.compileJava.dependsOn getGregTech +tasks.setupCIWorkspace.dependsOn getRailCraft +tasks.setupDevWorkspace.dependsOn getRailCraft +tasks.setupDecompWorkspace.dependsOn getRailCraft +tasks.compileJava.dependsOn getRailCraft processResources { diff --git a/build.properties b/build.properties index e314c6ce35..475a046f35 100644 --- a/build.properties +++ b/build.properties @@ -19,14 +19,15 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # - mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2 +buildNumber=5 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 applecore.version=1.7.10-3.1.1 -galacticraft.version=1.7-3.0.12.504
\ No newline at end of file +galacticraft.version=1.7-3.0.12.504 +enderio.version=1.7.10-2.3.0.429_beta +enderiocore.version=1.7.10-0.2.0.39_beta
\ No newline at end of file diff --git a/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id new file mode 100644 index 0000000000..ffef551870 --- /dev/null +++ b/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id @@ -0,0 +1 @@ +848964ad2a6250cb5adc79bde00136058f994d99
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java index f4b61a17ba..bdfdb29ca8 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -32,9 +32,9 @@ import java.io.OutputStream; public class ASMUtils { public static String matchAny(String toCompare, String... args) { - for (int i = 0; i < args.length; i++) { - if (toCompare.equalsIgnoreCase(args[i])) - return args[i]; + for (String arg : args) { + if (toCompare.equalsIgnoreCase(arg)) + return arg; } return ""; } @@ -43,8 +43,8 @@ public class ASMUtils { * Call this Method twice, one time for the Descriptor and one time for the Name. */ public static boolean isCorrectMethod(MethodNode methodNode, String... args) { - for (int i = 0; i < args.length; i++) { - if (methodNode.name.equalsIgnoreCase(args[i]) || methodNode.desc.equalsIgnoreCase(args[i])) + for (String arg : args) { + if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) return true; } return false; diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index 2b4eafb9a1..578b768652 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.ASM; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.eventbus.EventBus; @@ -41,6 +42,7 @@ import java.util.List; import static com.github.bartimaeusnek.ASM.BWCoreTransformer.shouldTransform; +@SuppressWarnings("ALL") public class BWCore extends DummyModContainer { public static final String BWCORE_NAME = "BartWorks ASM Core"; @@ -61,8 +63,13 @@ public class BWCore extends DummyModContainer { shouldTransform[0] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[0]; shouldTransform[1] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[1]; shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3]; + shouldTransform[4] = true; + shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5]; + shouldTransform[6] = ConfigHandler.enabledPatches[6]; + //shouldTransform[6] = true; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); + BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); } @Override @@ -70,6 +77,10 @@ public class BWCore extends DummyModContainer { List<ArtifactVersion> ret = new ArrayList<>(); ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); ret.add(new DefaultArtifactVersion("Thaumcraft", true)); + ret.add(new DefaultArtifactVersion("miscutils", true)); + ret.add(new DefaultArtifactVersion("RWG", true)); + ret.add(new DefaultArtifactVersion("gregtech", true)); + ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true)); ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java index 97f4702d4c..3d8811142d 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -67,6 +67,7 @@ public class BWCorePlugin implements IFMLLoadingPlugin { } @Override + @SuppressWarnings("rawtypes") public void injectData(Map<String, Object> data) { if (data.get("runtimeDeobfuscationEnabled") != null) { BWCoreTransformer.obfs = (boolean) data.get("runtimeDeobfuscationEnabled"); diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 505612cd35..d9ff910ff8 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,7 +22,94 @@ package com.github.bartimaeusnek.ASM; +import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + public class BWCoreStaticReplacementMethodes { + + public static final AccessPriorityList<IRecipe> RECENTLYUSEDRECIPES = new AccessPriorityList<>(); + + @SuppressWarnings("ALL") + public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) { + int i = 0; + ItemStack itemstack = null; + ItemStack itemstack1 = null; + int j; + + for (j = 0; j < inventoryCrafting.getSizeInventory(); ++j) + { + ItemStack itemstack2 = inventoryCrafting.getStackInSlot(j); + + if (itemstack2 != null) + { + if (i == 0) + { + itemstack = itemstack2; + } + + if (i == 1) + { + itemstack1 = itemstack2; + } + + ++i; + } + } + + if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) + { + Item item = itemstack.getItem(); + int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); + int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); + int l = j1 + k + item.getMaxDamage() * 5 / 100; + int i1 = item.getMaxDamage() - l; + + if (i1 < 0) + { + i1 = 0; + } + + return new ItemStack(itemstack.getItem(), 1, i1); + } else { + IRecipe iPossibleRecipe = null; + int index = 0; + for (Iterator<IRecipe> it = RECENTLYUSEDRECIPES.iterator(); it.hasNext(); ++index) { + IRecipe RECENTLYUSEDRECIPE = it.next(); + if (RECENTLYUSEDRECIPE.matches(inventoryCrafting, world)) { + iPossibleRecipe = RECENTLYUSEDRECIPE; + break; + } + } + + if (iPossibleRecipe != null) { + RECENTLYUSEDRECIPES.addPrioToNode(index); + return iPossibleRecipe.getCraftingResult(inventoryCrafting); + } + + ItemStack stack = null; + HashSet<IRecipe> recipeHashSet = new HashSet<>(); + for (IRecipe recipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) + if (recipe.matches(inventoryCrafting, world)) + recipeHashSet.add(recipe); + + for (IRecipe recipe : recipeHashSet){ + stack = recipe.getCraftingResult(inventoryCrafting); + if (stack != null && recipeHashSet.size() == 1) + RECENTLYUSEDRECIPES.addLast(recipe); + } + return stack; + } + } + private BWCoreStaticReplacementMethodes() { } diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 06261bea9f..99a748fbd7 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -38,16 +38,20 @@ public class BWCoreTransformer implements IClassTransformer { "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API" - // "ADD EXECTION HANDLEING TO FIND OREIDS/OREDICT" + "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", + "DUCTTAPING RWG WORLDEN FAILS", + "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" + // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" }; public static final String[] CLASSESBEEINGTRANSFORMED = { "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", - "gregtech.GT_Mod" - // "net.minecraftforge.oredict.OreDictionary" + "gregtech.GT_Mod", + "rwg.world.ChunkGeneratorRealistic", + "net.minecraft.item.crafting.CraftingManager" + // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" }; static boolean obfs; @@ -92,6 +96,7 @@ public class BWCoreTransformer implements IClassTransformer { ClassNode classNode = new ClassNode(); classReader.accept(classNode, ClassReader.SKIP_FRAMES); List<MethodNode> methods = classNode.methods; + scase: switch (id) { case 0: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -140,10 +145,9 @@ public class BWCoreTransformer implements IClassTransformer { toPatch.maxStack = 1; toPatch.maxLocals = 5; methods.set(i, toPatch); - break; + break scase; } } - break; } case 2: { String name_deObfs = "renderSky"; @@ -153,9 +157,8 @@ public class BWCoreTransformer implements IClassTransformer { String field_deObfs = "locationSunPng"; String field_src = "field_110928_i"; BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - for (int i = 0; i < methods.size(); i++) { - MethodNode toPatch = methods.get(i); - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal)) { + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; @@ -175,7 +178,7 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(new VarInsnNode(ALOAD, 0)); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? theWorld_src : "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", useSrc ? provider_src : "provider", "Lnet/minecraft/world/WorldProvider;")); - nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b")); + nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); nu.add(new VarInsnNode(ALOAD, 0)); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); @@ -201,10 +204,9 @@ public class BWCoreTransformer implements IClassTransformer { } } toPatch.instructions = nu; - break; + break scase; } } - break; } case 3: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -217,17 +219,15 @@ public class BWCoreTransformer implements IClassTransformer { if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); - break; + break scase; } } - break; } case 4 : { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "<clinit>"; - for (int i = 0; i < methods.size(); i++) { - MethodNode toPatch = methods.get(i); - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs) && (methods.get(i).access & ACC_STATIC) != 0) { + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs) && (toPatch.access & ACC_STATIC) != 0) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; @@ -244,153 +244,68 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(toPatch.instructions.get(j)); } toPatch.instructions = nu; - break; + break scase; } } - - break; } case 5: { -// String name_deObfs = "getOreIDs"; -// String dsc_deObfs = "(Lnet/minecraft/item/ItemStack;)[I"; -// String dsc_Obfs = "(Ladd;)[I"; -// -// for (int i = 0; i < methods.size(); i++) { -// if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { -// MethodNode toPatch = methods.get(i); -// LabelNode[] LabelNodes = {new LabelNode(), new LabelNode(), new LabelNode(),new LabelNode(),new LabelNode(),new LabelNode(),new LabelNode()}; -// InsnList nu = new InsnList(); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new JumpInsnNode(IFNULL, LabelNodes[0])); //L1 -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false)); -// nu.add(new JumpInsnNode(IFNONNULL, LabelNodes[1])); //L2 -// nu.add(LabelNodes[0]); //L1 -// nu.add(new TypeInsnNode(NEW, "java/lang/IllegalArgumentException")); -// nu.add(new InsnNode(DUP)); -// nu.add(new TypeInsnNode(LDC,"Stack can not be invalid!")); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL,"java/lang/IllegalArgumentException","<init>","(Ljava/lang/String;)V",false)); -// nu.add(new InsnNode(ATHROW)); -// nu.add(LabelNodes[1]); //L2 -// nu.add(new TypeInsnNode(NEW, "java/util/HashSet")); -// nu.add(new InsnNode(DUP)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL,"java/util/HashSet","<init>","()V",false)); -// nu.add(new VarInsnNode(ASTORE, 1)); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false)); -// nu.add(new FieldInsnNode(GETFIELD,"net/minecraft/item/Item","delegate","Lcpw/mods/fml/common/registry/RegistryDelegate;")); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "cpw/mods/fml/common/registry/RegistryDelegate", "name", "()Ljava/lang/String;", true)); -// nu.add(new VarInsnNode(ASTORE, 2)); -// nu.add(new VarInsnNode(ALOAD, 2)); -// nu.add(new JumpInsnNode(IFNONNULL, LabelNodes[2])); //L5 -// nu.add(new FieldInsnNode(GETSTATIC,"org/apache/logging/log4j/Level","DEBUG","Lorg/apache/logging/log4j/Level;")); -// nu.add(new TypeInsnNode(LDC,"Attempted to find the oreIDs for an unregistered object (%s). This won't work very well.")); -// nu.add(new InsnNode(ICONST_1)); -// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Object")); -// nu.add(new InsnNode(DUP)); -// nu.add(new InsnNode(ICONST_0)); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new InsnNode(AASTORE)); -// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "log", "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V", false)); -// nu.add(new TypeInsnNode(NEW, "java/io/StringWriter")); -// nu.add(new InsnNode(DUP)); -// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/io/StringWriter", "<init>", "()V", false)); -// nu.add(new VarInsnNode(ASTORE, 4)); -// nu.add(new TypeInsnNode(NEW, "java/io/PrintWriter")); -// nu.add(new InsnNode(DUP)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/io/PrintWriter", "<init>", "(Ljava/io/Writer;)V", false)); -// nu.add(new VarInsnNode(ASTORE, 5)); -// nu.add(new TypeInsnNode(NEW, "java/lang/Exception")); -// nu.add(new InsnNode(DUP)); -// nu.add(new TypeInsnNode(LDC,"FINDME!")); -// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/lang/Exception", "<init>", "(Ljava/lang/String;)V", false)); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Exception", "printStackTrace", "(Ljava/io/PrintWriter;)V", false)); -// nu.add(new FieldInsnNode(GETSTATIC,"org/apache/logging/log4j/Level","DEBUG","Lorg/apache/logging/log4j/Level;")); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Object", "toString", "()Ljava/lang/String;", false)); -// nu.add(new InsnNode(ICONST_0)); -// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Object")); -// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "log", "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V", false)); -// nu.add(new InsnNode(ICONST_0)); -// nu.add(new IntInsnNode(NEWARRAY,T_INT)); -// nu.add(new InsnNode(ARETURN)); -// nu.add(LabelNodes[2]); //L5 -// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/registry/GameData", "getItemRegistry", "()Lcpw/mods/fml/common/registry/FMLControlledNamespacedRegistry;", false)); -// nu.add(new VarInsnNode(ALOAD, 2)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry", "getId", "(Ljava/lang/String;)I", false)); -// nu.add(new VarInsnNode(ISTORE, 3)); -// nu.add(new FieldInsnNode(GETSTATIC,"net/minecraftforge/oredict/OreDictionary","stackToId","Ljava/util/Map;")); -// nu.add(new VarInsnNode(ILOAD, 3)); -// nu.add(new MethodInsnNode(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", false)); -// nu.add(new TypeInsnNode(CHECKCAST,"java/util/List")); -// nu.add(new VarInsnNode(ASTORE, 4)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new JumpInsnNode(IFNULL, LabelNodes[3])); //L14 -// nu.add(new VarInsnNode(ALOAD, 1)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "addAll", "(Ljava/util/Collection;)Z", true)); -// nu.add(new InsnNode(POP)); -// nu.add(LabelNodes[3]); //L14 -// nu.add(new FieldInsnNode(GETSTATIC,"net/minecraftforge/oredict/OreDictionary","stackToId","Ljava/util/Map;")); -// nu.add(new VarInsnNode(ILOAD, 3)); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItemDamage", "()I", false)); -// nu.add(new InsnNode(ICONST_1)); -// nu.add(new InsnNode(IADD)); -// nu.add(new VarInsnNode(BIPUSH, 16)); -// nu.add(new InsnNode(ISHL)); -// nu.add(new InsnNode(IOR)); -// nu.add(new MethodInsnNode(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true)); -// nu.add(new TypeInsnNode(CHECKCAST,"java/util/List")); -// nu.add(new VarInsnNode(ASTORE, 4)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new JumpInsnNode(IFNULL, LabelNodes[4])); //L16 -// nu.add(new VarInsnNode(ALOAD, 1)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "addAll", "(Ljava/util/Collection;)Z", true)); -// nu.add(new InsnNode(POP)); -// nu.add(LabelNodes[4]); //L16 -// nu.add(new VarInsnNode(ALOAD, 1)); -// nu.add(new VarInsnNode(ALOAD, 1)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "size", "()I", true)); -// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Integer")); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;", true)); -// nu.add(new TypeInsnNode(CHECKCAST,"[java/util/Integer")); -// nu.add(new VarInsnNode(ASTORE, 5)); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new InsnNode(ARRAYLENGTH)); -// nu.add(new IntInsnNode(NEWARRAY,T_INT)); -// nu.add(new VarInsnNode(ASTORE, 6)); -// nu.add(new InsnNode(ICONST_0)); -// nu.add(new VarInsnNode(ISTORE, 7)); -// nu.add(LabelNodes[6]); //L19 -// nu.add(new VarInsnNode(ILOAD, 7)); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new InsnNode(ARRAYLENGTH)); -// nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[5])); //L20 -// nu.add(new VarInsnNode(ALOAD, 6)); -// nu.add(new VarInsnNode(ILOAD, 7)); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new VarInsnNode(ILOAD, 7)); -// nu.add(new InsnNode(AALOAD)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false)); -// nu.add(new InsnNode(IASTORE)); -// nu.add(new IincInsnNode(7,1)); -// nu.add(new JumpInsnNode(GOTO, LabelNodes[6])); //L19 -// nu.add(LabelNodes[5]); //L20 -// nu.add(new VarInsnNode(ALOAD, 6)); -// nu.add(new InsnNode(ARETURN)); -// toPatch.instructions = nu; -// toPatch.maxStack = 6; -// toPatch.maxLocals = 8; -// methods.set(i, toPatch); -// break; -// } + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "getNewNoise"; + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + InsnList nu = new InsnList(); + // if (x < -28675) x %= -28675; + nu.add(new VarInsnNode(ILOAD, 2)); + nu.add(new IntInsnNode(SIPUSH, -28675)); + nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[0])); + nu.add(new VarInsnNode(ILOAD, 2)); + nu.add(new LdcInsnNode(-28675)); + nu.add(new InsnNode(IREM)); + nu.add(new VarInsnNode(ISTORE, 2)); + nu.add(LabelNodes[0]); + // if (y < -28675) y %= -28675; + nu.add(new VarInsnNode(ILOAD, 3)); + nu.add(new IntInsnNode(SIPUSH, -28675)); + nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[1])); + nu.add(new VarInsnNode(ILOAD, 3)); + nu.add(new LdcInsnNode(-28675)); + nu.add(new InsnNode(IREM)); + nu.add(new VarInsnNode(ISTORE, 3)); + nu.add(LabelNodes[1]); + + for (int j = 1; j < toPatch.instructions.size(); j++) { + nu.add(toPatch.instructions.get(j)); + } + + toPatch.instructions = nu; + break scase; + } + } } + case 6: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "findMatchingRecipe"; + String name_Obfs = "a"; + String name_src = "func_82787_a"; + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch,name_deObfs,name_Obfs,name_src)){ + toPatch.instructions = new InsnList(); + toPatch.instructions.add(new VarInsnNode(ALOAD,1)); + toPatch.instructions.add(new VarInsnNode(ALOAD,2)); + toPatch.instructions.add(new MethodInsnNode(INVOKESTATIC,"com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes","findCachedMatchingRecipe","(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;",false)); + toPatch.instructions.add(new InsnNode(ARETURN)); + break scase; + } + } + } + +// case 6: { +// BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); +// ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; +// break scase; +// } default: { BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return basicClass; @@ -416,6 +331,4 @@ public class BWCoreTransformer implements IClassTransformer { } return basicClass; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java index 7c2793f2b1..f9fcd4bd37 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java index 0f181a3559..9c55b47440 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index a3c33ceac9..1035ab7d5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -36,7 +36,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import java.awt.*; - +@SuppressWarnings("ALL") public final class BioObjectAdder { // @Deprecated @@ -156,7 +156,7 @@ public final class BioObjectAdder { * @return the propper Bacteria Tier (at least 0) */ public static int getBacteriaTierFromVoltageTier(int voltageTier) { - return voltageTier - 6 > 0 ? voltageTier - 6 : 0; + return Math.max(voltageTier - 6, 0); } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index edee87f534..b38fc86344 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -32,6 +32,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.Collection; +@SuppressWarnings("ALL") public final class BioObjectGetter { public static BioCulture getBioCulture(String aName) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 0e40363356..30d387399c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -31,6 +31,7 @@ import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; +@SuppressWarnings("ALL") public final class BioRecipeAdder { public static final int STANDART = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index a8fc8dae91..7e17d323e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -31,11 +31,11 @@ import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.Objects; import static cpw.mods.fml.common.registry.GameRegistry.findBlock; +@SuppressWarnings("ALL") public final class BioVatLogicAdder { @@ -64,9 +64,7 @@ public final class BioVatLogicAdder { public static int getMaxSv() { int ret = MaxSV; - Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); - while (it.hasNext()) { - BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); + for (MaterialSvPair pair : RadioHatch.getMaSv()) { if (pair.getSievert() > ret) ret = pair.getSievert(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java index 76612ad404..8d5c0d23ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java index 391593d217..b4fe0923bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java index 002b175bbf..fe92654fd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java index a84f254d8a..5e8663f907 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -27,6 +27,6 @@ import net.minecraft.inventory.ISidedInventory; public interface ITileDropsContent extends ISidedInventory { default int[] getDropSlots(){ return new int[] {0}; - }; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java index a9318ca7f0..9ae176d26f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -38,15 +38,11 @@ public interface ITileHasDifferentTextureSides { return texture[side.ordinal()]; } - ; - @SideOnly(Side.CLIENT) default IIcon getTextureForSide(int side, int meta) { return getTextureForSide(ForgeDirection.values()[side], meta); } - ; - @SideOnly(Side.CLIENT) void registerBlockIcons(IIconRegister par1IconRegister); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java index 636fcb3a31..deec80e80f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index a441e38e35..1dc575bd5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -26,9 +26,10 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; public final class WerkstoffAPI { + @SuppressWarnings("rawtypes") public Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException { Class w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader"); - return (Werkstoff) w.getField(aName).get(w); + return (Werkstoff) w.getField(aName).get(null); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index 6437ad1087..7efe2af842 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -32,11 +32,11 @@ public final class WerkstoffAdderRegistry implements Runnable { private WerkstoffAdderRegistry() { } - public static final WerkstoffAdderRegistry getINSTANCE() { + public static WerkstoffAdderRegistry getINSTANCE() { return INSTANCE; } - public static final void addWerkstoffAdder(Runnable adder) { + public static void addWerkstoffAdder(Runnable adder) { INSTANCE.toRun.add(adder); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 5476c65e72..6e46f1dbab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 9a5e86b39c..cf0c828cc5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -30,6 +30,10 @@ import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEvent import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; +import com.github.bartimaeusnek.bartworks.common.commands.PrintRecipeListToFile; +import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; @@ -38,29 +42,27 @@ import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; +import com.github.bartimaeusnek.bartworks.system.log.STFUGTPPLOG; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; +import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.PlatinumSludgeOverHaul; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; +import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; +import gregtech.api.enums.*; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.*; import net.minecraft.creativetab.CreativeTabs; @@ -71,6 +73,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -78,6 +81,7 @@ import java.io.IOException; import java.lang.reflect.Field; import java.util.*; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.GT_Values.VN; @@ -89,6 +93,7 @@ import static gregtech.api.enums.GT_Values.VN; + "after:berriespp; " + "after:GalacticraftMars; " + "after:GalacticraftCore; " + + "after:Forestry; " ) public final class MainMod { public static final String NAME = "BartWorks"; @@ -106,14 +111,22 @@ public final class MainMod { public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler + @SuppressWarnings("ALL") public void preInit(FMLPreInitializationEvent preinit) { if (!(API_REFERENCE.VERSION.equals(MainMod.APIVERSION))) { MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } - //fixing BorosilicateGlass... -_-' - Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + if (Loader.isModLoaded("miscutils") && ConfigHandler.GTppLogDisabler) { + try { + Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"),"modLogger",true); + FieldUtils.removeFinalModifier(loggerField,true); + loggerField.set(null,(Logger)new STFUGTPPLOG()); + } catch (IllegalAccessException | ClassNotFoundException e) { + e.printStackTrace(); + } + } if (Loader.isModLoaded("dreamcraft")) { ConfigHandler.GTNH = true; @@ -137,6 +150,8 @@ public final class MainMod { INSTANCE.init(); Werkstoff.init(); GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); + if (FMLCommonHandler.instance().getSide().isClient()) + new PrefixTextureLinker(); } } @@ -144,12 +159,11 @@ public final class MainMod { public void init(FMLInitializationEvent init) { if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.tooltips) MinecraftForge.EVENT_BUS.register(new TooltipEventHandler()); + ServerEventHandler serverEventHandler = new ServerEventHandler(); if (FMLCommonHandler.instance().getSide().isServer()) { - ServerEventHandler serverEventHandler = new ServerEventHandler(); MinecraftForge.EVENT_BUS.register(serverEventHandler); -// FMLCommonHandler.instance().bus().register(serverEventHandler); } - new LoaderRegistry().run(); + FMLCommonHandler.instance().bus().register(serverEventHandler); if (ConfigHandler.BioLab) new BioLabLoader().run(); if (ConfigHandler.newStuff) { @@ -158,6 +172,7 @@ public final class MainMod { else INSTANCE.runInit(); } + new LoaderRegistry().run(); } @Mod.EventHandler @@ -178,48 +193,87 @@ public final class MainMod { INSTANCE.run(); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor","Electric Implosions?"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc","Basically a giant Hammer that presses Stuff - No more TNT!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP","Heat from below!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP.desc","Get ALL the thermal energy!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.CircuitAssemblyLine","Cheaper Circuits?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.CircuitAssemblyLine.desc","Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp","Heat from below!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc","Get ALL the thermal energy!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline","Cheaper Circuits?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc","Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen","Can be used as Enriched Naquadah Fuel Substitute"); } } + + @Mod.EventHandler + public void onServerStarting(FMLServerStartingEvent event){ + event.registerServerCommand(new SummonRuin()); + event.registerServerCommand(new ChangeConfig()); + event.registerServerCommand(new PrintRecipeListToFile()); + } + @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { MainMod.runOnPlayerJoined(ConfigHandler.classicMode, ConfigHandler.disableExtraGassesForEBF); } - - public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes){ - OreDictHandler.adaptCacheForWorld(); + @Mod.EventHandler + public void onModLoadingComplete(FMLLoadCompleteEvent event) { removeIC2Recipes(); MainMod.addElectricImplosionCompressorRecipes(); - MainMod.unificationEnforcer(); + PlatinumSludgeOverHaul.replacePureElements(); + + runOnServerStarted(); + fixEnergyRequirements(); + MainMod.unificationRecipeEnforcer(); + } + + private static boolean recipesAdded; + + public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes) { + OreDictHandler.adaptCacheForWorld(); + + CircuitImprintLoader.run(); - if (!extraGasRecipes) { - ArrayListMultimap<SubTag, GT_Recipe> toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); - HashSet<ItemStack> noGas = MainMod.getNoGasItems(toChange); - MainMod.editRecipes(toChange, noGas); + if (!recipesAdded) { + if (!extraGasRecipes) { + ArrayListMultimap<SubTag, GT_Recipe> toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); + HashSet<ItemStack> noGas = MainMod.getNoGasItems(toChange); + MainMod.editRecipes(toChange, noGas); + } + if (classicMode) + new DownTierLoader().run(); +// removeDuplicateRecipes(); + recipesAdded = true; } - new CircuitImprintLoader().run(); - if (classicMode) - new DownTierLoader().run(); } - private static void unificationEnforcer() { - for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { + private static void fixEnergyRequirements() { + maploop: + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings){ + for (GT_Recipe recipe : map.mRecipeList){ + if (recipe.mFakeRecipe) + continue maploop; + for (int i = 0; i < (VN.length-1); i++) { + if (recipe.mEUt == BW_Util.getTierVoltage(i)){ + recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); + } + } + } + } + } + + private static void unificationRecipeEnforcer() { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().enforceUnification) { - if (werkstoff.contains(NOBLE_GAS)){ - String name = werkstoff.getFluidOrGas(1).getFluid().getName(); - String wrongname ="molten."+name; - FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname,1); + if (werkstoff.contains(NOBLE_GAS)) { + String name = werkstoff.getFluidOrGas(1).getFluid().getName(); + String wrongname = "molten." + name; + FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname, 1); + if (wrongNamedFluid != null) { for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { for (GT_Recipe recipe : map.mRecipeList) { for (int i = 0; i < recipe.mFluidInputs.length; i++) { if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { Collection<GT_Recipe> col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); - map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(),col); + map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); } @@ -231,13 +285,18 @@ public final class MainMod { } } } - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false,null,null,null,null,new FluidStack[]{wrongNamedFluid},new FluidStack[]{werkstoff.getFluidOrGas(1)},1,1,0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0)); + } } + HashSet<String> oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT()); + oreDictNames.add(werkstoff.getVarName()); MainMod.runMoltenUnificationEnfocement(werkstoff); + MainMod.runUnficationDeleter(werkstoff); + for (String s : oreDictNames) for (OrePrefixes prefixes : OrePrefixes.values()) { - if (OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size() > 1) { - for (int j = 0; j < OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size(); j++) { - ItemStack toReplace = OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).get(j); + if (OreDictionary.getOres(prefixes + s).size() > 1) { + for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) { + ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j); ItemStack replacement = werkstoff.get(prefixes); if (GT_Utility.areStacksEqual(toReplace,replacement) || replacement == null || replacement.getItem() == null) continue; @@ -250,24 +309,30 @@ public final class MainMod { if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { if (removal) toRem.add(recipe); - else - recipe.mInputs[i] = replacement; + else { + int amount = recipe.mInputs[i].stackSize; + recipe.mInputs[i] = replacement.splitStack(amount); + } } } for (int i = 0; i < recipe.mOutputs.length; i++) { if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { if (removal) toRem.add(recipe); - else - recipe.mOutputs[i] = replacement; + else { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = replacement.splitStack(amount); + } } } if (recipe.mSpecialItems instanceof ItemStack) { if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { if (removal) toRem.add(recipe); - else - recipe.mSpecialItems = replacement; + else { + int amount = ((ItemStack) recipe.mSpecialItems).stackSize; + recipe.mSpecialItems = replacement.splitStack(amount); + } } } } @@ -281,16 +346,20 @@ public final class MainMod { } } + @SuppressWarnings("ALL") private static void runMoltenUnificationEnfocement(Werkstoff werkstoff){ if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) { try { - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(molten.get(werkstoff), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData> sFilledContainerToData = (Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData>) f.get(null); HashSet torem = new HashSet<>(); ItemStack toReplace = null; for (Map.Entry<GT_ItemStack, FluidContainerRegistry.FluidContainerData> entry : sFilledContainerToData.entrySet()) { + final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; + if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) + continue; if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { toReplace = entry.getValue().filledContainer; torem.add(entry); @@ -335,6 +404,25 @@ public final class MainMod { } } + private static void runUnficationDeleter(Werkstoff werkstoff) { + if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { + if (werkstoff.getBridgeMaterial() != null) { + werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); + Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); + Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); + } + } + + for (OrePrefixes prefixes : OrePrefixes.values()) + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0)) { + GT_OreDictUnificator.set(prefixes,werkstoff.getBridgeMaterial(),werkstoff.get(prefixes),true,true); + for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) { + GT_OreDictUnificator.addAssociation(prefixes,werkstoff.getBridgeMaterial(),stack,false); + GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes); + } + } + } + private static ArrayListMultimap<SubTag,GT_Recipe> getRecipesToChange(SubTag... GasTags){ Iterator<GT_Recipe> it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); ArrayListMultimap<SubTag,GT_Recipe> toAdd = ArrayListMultimap.create(); @@ -380,7 +468,7 @@ public final class MainMod { } private static void editRecipes(ArrayListMultimap<SubTag,GT_Recipe> base, HashSet<ItemStack> noGas) { - if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(fluids.get(Oganesson).getName())) + if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) return; HashSet<GT_Recipe> toAdd = new HashSet<>(); for (SubTag GasTag : base.keySet()) { @@ -393,7 +481,7 @@ public final class MainMod { if (!werkstoff.contains(GasTag)) continue; int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons()*2.75D - (double) werkstoff.getStats().getProtons()))); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(fluids.get(werkstoff), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } for (Materials materials : Materials.values()) { if (!materials.contains(GasTag)) @@ -440,22 +528,14 @@ public final class MainMod { } } toAdd.removeAll(duplicates); - for (GT_Recipe recipe : toAdd) - GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(recipe); + toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add); } + @SuppressWarnings("ALL") private static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<GT_Recipe>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { - if (recipe == null || recipe.mInputs == null) - continue; - HashSet<ItemStack> inputs = new HashSet<>(); - for (ItemStack is : recipe.mInputs) - if (!MainMod.checkForExplosives(is)) - inputs.add(is); - eicMap.addRecipe(true, inputs.toArray(new ItemStack[0]), recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); - } + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !MainMod.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0)); } } @@ -463,4 +543,21 @@ public final class MainMod { return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); } +// private static void removeDuplicateRecipes(){ +// GT_Recipe.GT_Recipe_Map.sMappings.forEach( +// gt_recipe_map -> { +// HashSet<Integer> mappings = new HashSet<>(); +// HashSet<GT_Recipe> dupes = new HashSet<>(); +// gt_recipe_map.mRecipeList.forEach( +// recipe -> { +// if (mappings.contains(BW_Util.getRecipeHash(recipe))) +// dupes.add(recipe); +// mappings.add(BW_Util.getRecipeHash(recipe)); +// } +// ); +// gt_recipe_map.mRecipeList.removeAll(dupes); +// } +// ); +// } + }
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index f3590b4e90..14a146e01a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -41,8 +41,8 @@ class TooltipCache { if (!tooltip.isEmpty()) { StringBuilder sb = new StringBuilder(); - for (int i = 0; i < tooltip.size(); i++) { - sb.append(tooltip.get(i)); + for (String s : tooltip) { + sb.append(s); sb.append(System.lineSeparator()); } char[] rettype = sb.toString().toCharArray(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 2532357218..1f28933622 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java index 2057052be3..628b4acb96 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java index 8f45b3d48d..03ecf155e3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index c49fdb0aae..41ce06cc81 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java index 44dc931a23..610aeb14f7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -49,7 +49,7 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { if (this.container.fuel > 0) { this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); - int ik = this.container.maxfuel > 200 ? this.container.maxfuel : 200; + int ik = Math.max(this.container.maxfuel, 200); int i1 = ((this.container.fuel * 13) / ik); this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index 788bcb379a..5ede1e09f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 597fb1cb0b..94731e1833 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index df4d721b02..69ec8349b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index 8f31fc31db..ba0bc69c3b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index e672eebe94..2f45e3c7c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 8686cee0be..ae1187c3d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 86779b71d0..9bd331c59c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index a59fb87635..4de38a0e55 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -76,10 +76,8 @@ public class BW_GT_ItemRenderer implements IItemRenderer { if (RenderItem.renderInFrame) { GL11.glScalef(0.85F, 0.85F, 0.85F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslated(-0.5D, -0.42D, 0.0D); - } else { - GL11.glTranslated(-0.5D, -0.42D, 0.0D); } + GL11.glTranslated(-0.5D, -0.42D, 0.0D); } GL11.glColor3f(1.0F, 1.0F, 1.0F); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java index 879274d114..4dd9bc3860 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 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 index bb5078ebff..5418587508 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,7 +22,8 @@ package com.github.bartimaeusnek.bartworks.client.renderer; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import net.minecraft.block.Block; @@ -39,7 +40,7 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { - BW_MetaGeneratedOreTE tTileEntity = new BW_MetaGeneratedOreTE(); + BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = (short) aMeta; aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 82150c7913..74bc3e2712 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 0a2bf2d99c..cb0f78ffa5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -170,27 +170,27 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler dInterpolatedV4 = dInterpolatedV; } else { float xFlow = MathHelper.sin(flowDir) * 0.25f, zFlow = MathHelper.cos(flowDir) * 0.25f; - dInterpolatedU = iconStill.getInterpolatedU((double) (8.0f + (-zFlow - xFlow) * 16.0f)); - dInterpolatedV = iconStill.getInterpolatedV((double) (8.0f + (-zFlow + xFlow) * 16.0f)); - dInterpolatedU2 = iconStill.getInterpolatedU((double) (8.0f + (-zFlow + xFlow) * 16.0f)); - dInterpolatedV2 = iconStill.getInterpolatedV((double) (8.0f + (zFlow + xFlow) * 16.0f)); - dInterpolatedU3 = iconStill.getInterpolatedU((double) (8.0f + (zFlow + xFlow) * 16.0f)); - dInterpolatedV3 = iconStill.getInterpolatedV((double) (8.0f + (zFlow - xFlow) * 16.0f)); - dInterpolatedU4 = iconStill.getInterpolatedU((double) (8.0f + (zFlow - xFlow) * 16.0f)); - dInterpolatedV4 = iconStill.getInterpolatedV((double) (8.0f + (-zFlow - xFlow) * 16.0f)); + dInterpolatedU = iconStill.getInterpolatedU(8.0f + (-zFlow - xFlow) * 16.0f); + dInterpolatedV = iconStill.getInterpolatedV(8.0f + (-zFlow + xFlow) * 16.0f); + dInterpolatedU2 = iconStill.getInterpolatedU(8.0f + (-zFlow + xFlow) * 16.0f); + dInterpolatedV2 = iconStill.getInterpolatedV(8.0f + (zFlow + xFlow) * 16.0f); + dInterpolatedU3 = iconStill.getInterpolatedU(8.0f + (zFlow + xFlow) * 16.0f); + dInterpolatedV3 = iconStill.getInterpolatedV(8.0f + (zFlow - xFlow) * 16.0f); + dInterpolatedU4 = iconStill.getInterpolatedU(8.0f + (zFlow - xFlow) * 16.0f); + dInterpolatedV4 = iconStill.getInterpolatedV(8.0f + (-zFlow - xFlow) * 16.0f); } tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y, z)); tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * red, RendererSwitchingColorFluid.LIGHT_Y_POS * green, RendererSwitchingColorFluid.LIGHT_Y_POS * blue); - tessellator.addVertexWithUV((double) x, y + heightNW, (double) z, dInterpolatedU, dInterpolatedV); - tessellator.addVertexWithUV((double) x, y + heightSW, (double) (z + 1), dInterpolatedU2, dInterpolatedV2); - tessellator.addVertexWithUV((double) (x + 1), y + heightSE, (double) (z + 1), dInterpolatedU3, dInterpolatedV3); - tessellator.addVertexWithUV((double) (x + 1), y + heightNE, (double) z, dInterpolatedU4, dInterpolatedV4); - tessellator.addVertexWithUV((double) x, y + heightNW, (double) z, dInterpolatedU, dInterpolatedV); - tessellator.addVertexWithUV((double) (x + 1), y + heightNE, (double) z, dInterpolatedU4, dInterpolatedV4); - tessellator.addVertexWithUV((double) (x + 1), y + heightSE, (double) (z + 1), dInterpolatedU3, dInterpolatedV3); - tessellator.addVertexWithUV((double) x, y + heightSW, (double) (z + 1), dInterpolatedU2, dInterpolatedV2); + tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); + tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, dInterpolatedU3, dInterpolatedV3); + tessellator.addVertexWithUV(x + 1, y + heightNE, z, dInterpolatedU4, dInterpolatedV4); + tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); + tessellator.addVertexWithUV(x + 1, y + heightNE, z, dInterpolatedU4, dInterpolatedV4); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, dInterpolatedU3, dInterpolatedV3); + tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); } @@ -198,7 +198,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler rendered = true; tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y - 1, z)); tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_NEG * red, RendererSwitchingColorFluid.LIGHT_Y_NEG * green, RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); - renderer.renderFaceYNeg(block, (double) x, y + RendererSwitchingColorFluid.RENDER_OFFSET, (double) z, this.getNullCheckedIiconOrFallbackTexture()); + renderer.renderFaceYNeg(block, x, y + RendererSwitchingColorFluid.RENDER_OFFSET, z, this.getNullCheckedIiconOrFallbackTexture()); } for (int side = 0; side < 4; ++side) { @@ -269,14 +269,14 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); - tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, (double) u1Flow, (double) v1Flow); - tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, (double) u2Flow, (double) v2Flow); - tessellator.addVertexWithUV(dXcoord2, (double) y, dZcoord2, (double) u2Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord1, (double) y, dZcoord1, (double) u1Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, (double) u1Flow, (double) v1Flow); - tessellator.addVertexWithUV(dXcoord1, (double) y, dZcoord1, (double) u1Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord2, (double) y, dZcoord2, (double) u2Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, (double) u2Flow, (double) v2Flow); + tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); + tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); + tessellator.addVertexWithUV(dXcoord2, y, dZcoord2, u2Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord1, y, dZcoord1, u1Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); + tessellator.addVertexWithUV(dXcoord1, y, dZcoord1, u1Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord2, y, dZcoord2, u2Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); } } renderer.renderMinY = 0.0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java new file mode 100644 index 0000000000..4294e1c89c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018-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.client.textures; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TextureSet; +import gregtech.api.enums.Textures; + +import java.util.Arrays; +import java.util.HashMap; + +@SideOnly(Side.CLIENT) +public class PrefixTextureLinker implements Runnable { + public static HashMap<OrePrefixes,HashMap<TextureSet, Textures.ItemIcons.CustomIcon>> texMap = new HashMap<>(); + + { + GregTech_API.sBeforeGTLoad.add(this); + } + + @Override + public void run() { + + for (OrePrefixes prefixes : OrePrefixes.values()) { + if (prefixes == OrePrefixes.rod) + continue; + HashMap<TextureSet, Textures.ItemIcons.CustomIcon> curr = new HashMap<>(); + if (prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) { + Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")).forEach(SET -> { + try { + curr.put((TextureSet) SET.get(null), new Textures.ItemIcons.CustomIcon("materialicons/" + SET.getName().substring(4) + "/" + prefixes)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + texMap.put(prefixes, curr); + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index cf81a296f3..9a1f342b3c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -79,6 +79,7 @@ public class BW_Blocks extends Block { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 3d6d3e41b0..195d1afb6d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index b6a1ee611d..b1aeb18a54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -53,7 +53,7 @@ import net.minecraftforge.fluids.IFluidContainerItem; public class BW_TileEntityContainer extends BlockContainer implements ITileAddsInformation { - Class<? extends TileEntity> tileEntity; + protected Class<? extends TileEntity> tileEntity; public BW_TileEntityContainer(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_); @@ -123,9 +123,9 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI TileEntity t = world.getTileEntity(x,y,z); if (t instanceof ITileDropsContent){ int[] dropSlots = ((ITileDropsContent)t).getDropSlots(); - for (int i = 0; i < dropSlots.length; i++) { - if (((ITileDropsContent)t).getStackInSlot(dropSlots[i]) != null) - world.spawnEntityInWorld(new EntityItem(world,x,y,z,((BW_TileEntity_HeatedWaterPump)t).getStackInSlot(dropSlots[i]))); + for (int dropSlot : dropSlots) { + if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) + world.spawnEntityInWorld(new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); } } super.breakBlock(world, x, y, z, block, meta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index eac3b5fd28..41525ef6d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -117,6 +117,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index ea1b074c69..61c93217d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java index ec85e7e1d4..d3091afb56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -41,6 +41,7 @@ public class ChangeConfig extends CommandBase { } @Override + @SuppressWarnings("rawtypes") public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { try{ Field f = ConfigHandler.class.getField(p_71515_2_[0]); @@ -53,7 +54,7 @@ public class ChangeConfig extends CommandBase { p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); return; } - f.setInt(null, Integer.parseInt(p_71515_2_[1])); + f.setInt(null, l); } else if (c.equals(long.class)) { long l; @@ -72,7 +73,6 @@ public class ChangeConfig extends CommandBase { f.setBoolean(null,false); else { p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); - return; } } }catch (Exception e){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java new file mode 100644 index 0000000000..b7d6e7f82d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018-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.common.commands; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +public class PrintRecipeListToFile extends CommandBase { + @Override + public String getCommandName() { + return "prltf"; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "prltf <FilePath>"; + } + + @Override + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + File file = new File(p_71515_2_[0]); + try { + + BufferedWriter fw = new BufferedWriter(new FileWriter(file)); + CraftingManager.getInstance().getRecipeList().forEach( e -> { + try { + fw.write(e.toString() + " = " +((IRecipe)e).getRecipeOutput().getDisplayName() +"\n"); + } catch (IOException ex) { + ex.printStackTrace(); + } + }); + fw.flush(); + fw.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index 48f7a6d236..3e410ff2d3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index b5d5d8b972..d71b89b8cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -64,6 +64,7 @@ public class ConfigHandler { //One-Side-Only public static boolean debugLog; + public static boolean GTppLogDisabler; public static boolean tooltips = true; public static boolean[] enabledPatches; @@ -92,6 +93,7 @@ public class ConfigHandler { ConfigHandler.IDOffset = 12600; ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); } + ConfigHandler.GTppLogDisabler = ConfigHandler.c.get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.").getBoolean(false); ConfigHandler.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); ConfigHandler.experimentalThreadedLoader = ConfigHandler.c.get("System", "Enable Experimental Threaded Material Loader", false, "Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false); @@ -105,7 +107,7 @@ public class ConfigHandler { ConfigHandler.ross128btier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3); ConfigHandler.ross128batier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a").getInt(3); ConfigHandler.ross128bRuinChance = ConfigHandler.c.get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.").getInt(512); - ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); + ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION").getBoolean(true); ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); ConfigHandler.disableMagicalForest = ConfigHandler.c.get("CrossMod Interactions", "Disable Magical Forest - Ross128b", false, "True disables the magical Forest Biome on Ross for more performance during World generation.").getBoolean(false); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index db5a66173f..46706f6f08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -40,6 +40,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import java.util.Arrays; import java.util.List; public class BW_ItemBlocks extends ItemBlock { @@ -66,13 +67,12 @@ public class BW_ItemBlocks extends ItemBlock { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); if (this.field_150939_a instanceof ITileAddsInformation) { - for (int i = 0; i < ((ITileAddsInformation) this.field_150939_a).getInfoData().length; i++) { - aList.add(((ITileAddsInformation) this.field_150939_a).getInfoData()[i]); - } + aList.addAll(Arrays.asList(((ITileAddsInformation) this.field_150939_a).getInfoData())); } aList.add(this.mNoMobsToolTip); if (!(this.field_150939_a instanceof ITileEntityProvider)) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index f308420d14..e6c0a5ad90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -54,6 +54,7 @@ public class BW_SimpleWindMeter extends Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 6c11a9be64..fdb263a9f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -68,6 +68,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.itemTex); } + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); IKineticRotor.GearboxType type = null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index 136ccb27b5..a39d75dd97 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -51,6 +51,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) @@ -67,6 +68,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index ea43784383..1376a00bd8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -46,6 +46,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 5d5f8b790c..700b8974c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -51,7 +51,7 @@ import java.util.List; import java.util.Set; public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { - private static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + private static Set<Block> mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); private final int mCharge; private final int mTransfer; public int mTier; @@ -63,7 +63,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { super(2 * aTier, Item.ToolMaterial.EMERALD, GT_Rockcutter_Item.mineableBlocks); this.mTier = aTier; this.multi = (int) Math.pow(10, (this.mTier - 1)); - GT_Rockcutter_Item.mineableBlocks = new HashSet(); + GT_Rockcutter_Item.mineableBlocks = new HashSet<>(); this.maxStackSize = 1; this.mCharge = 10000 * this.multi; this.mTransfer = (int) GT_Values.V[this.mTier]; @@ -73,7 +73,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { this.setNoRepair(); this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]); } - + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); @@ -110,6 +110,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index b45b831bae..458a80e673 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -29,6 +29,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; @@ -45,7 +46,7 @@ import java.util.List; import java.util.Set; public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { - private static final Set effective = Sets.newHashSet(Blocks.web); + private static final Set<Block> effective = Sets.newHashSet(Blocks.web); private final double mCharge; private final double mTransfer; public int mTier; @@ -65,6 +66,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); @@ -73,8 +75,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) { EntityLiving tTarget = (EntityLiving) aTarget; - EntityLivingBase tPlayer = aPlayer; - ElectricItem.manager.use(aStack, 9000000, tPlayer); + ElectricItem.manager.use(aStack, 9000000, aPlayer); for (int i = 1; i < 5; ++i) { if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { tTarget.setCurrentItemOrArmor(i, null); @@ -85,6 +86,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index 640fca0014..a588921145 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -40,6 +40,7 @@ public class LabModule extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { aList.add(StatCollector.translateToLocal("tooltip.labmodule.0.name")); super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index 5aeed95774..b879c94958 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; @@ -73,6 +74,7 @@ public class LabParts extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { if (itemStack == null) return; @@ -101,19 +103,20 @@ public class LabParts extends SimpleSubItemClass { return; } + BioCulture culture = BioCulture.getBioCulture(itemStack.getTagCompound().getString("Name")); switch (itemStack.getItemDamage()) { case 0: - list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); if (!itemStack.getTagCompound().getBoolean("Breedable")) { list.add(StatCollector.translateToLocal("tooltip.labparts.6.name")); } break; case 1: - list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); break; case 2: - list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); break; default: break; @@ -122,13 +125,11 @@ public class LabParts extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (ItemStack stack : getAllPetriDishes()) - list.add(stack); - for (ItemStack stack : getAllDNASampleFlasks()) - list.add(stack); - for (ItemStack stack : getAllPlasmidCells()) - list.add(stack); + list.addAll(getAllPetriDishes()); + list.addAll(getAllDNASampleFlasks()); + list.addAll(getAllPlasmidCells()); super.getSubItems(item, creativeTabs, list); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index ab19b5d967..d8070f4e90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 3d312d6e37..8287c44778 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -57,12 +57,14 @@ public class SimpleSubItemClass extends Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { for (int i = 0; i < this.tex.length; i++) { p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index 2164330a96..5012725e34 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -28,6 +28,8 @@ import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; import ic2.core.Ic2Items; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -45,6 +47,8 @@ public class BeforeGTPreload implements Runnable { public void run() { if (didrun) return; + //fixing BorosilicateGlass... -_-' + Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); Field activeContainer = FieldUtils.getDeclaredField(LoadController.class, "activeContainer", true); ModContainer bartworks = null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 57a9ee9aac..e5591f1150 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -46,14 +46,24 @@ public class BioCultureLoader implements Runnable { public static BioCulture rottenFleshBacteria; public static BioCulture eColi; public static BioCulture anaerobicOil; + public static BioCulture generalPurposeFermentingBacteria; @Override public void run() { BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true); - BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST, true); - BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, true); + BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST,EnumRarity.uncommon, true); + BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, EnumRarity.uncommon,true); BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), false); BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), BioDNA.convertDataToDNA(BioCultureLoader.eColiData), true); BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), true); + BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture(new Color(127, 69, 26), "Saccharomyces escherichia", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), EnumRarity.epic,true); + + BioCultureLoader.CommonYeast.setLocalisedName("Common Yeast"); + BioCultureLoader.WhineYeast.setLocalisedName("Whine Yeast"); + BioCultureLoader.BeerYeast.setLocalisedName("Beer Yeast"); + BioCultureLoader.rottenFleshBacteria.setLocalisedName("Rotten Flesh Bacteria"); + BioCultureLoader.eColi.setLocalisedName("eColi Bacteria"); + BioCultureLoader.anaerobicOil.setLocalisedName("Anaerobic Oil Bacteria"); + BioCultureLoader.generalPurposeFermentingBacteria.setLocalisedName("General Purpose Fermenting Bacteria"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 7968e2996c..93b2ece861 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java index dbb060700a..80a0ff744f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 7d5409bf00..5c2088e606 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -35,6 +35,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -47,6 +48,7 @@ import net.minecraftforge.oredict.OreDictionary; public class BioRecipeLoader extends RecipeLoader { @Override + @SuppressWarnings("deprecation") public void run() { //DNAExtractionModule @@ -380,4 +382,12 @@ public class BioRecipeLoader extends RecipeLoader { GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,new FluidStack(FluidLoader.heatedfulvicAcid,1000),new FluidStack(FluidLoader.Kerogen,1000),null,75, BW_Util.getMachineVoltageFromTier(2)); GT_Values.RA.addPyrolyseRecipe(Materials.Wood.getDust(10),new FluidStack(FluidLoader.Kerogen,1000),10,null,Materials.Oil.getFluid(1000),105, BW_Util.getMachineVoltageFromTier(3)); } + + public static void runOnServerStarted(){ + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList){ + FluidStack[] flInput = new FluidStack[]{new FluidStack(recipe.mFluidInputs[0], recipe.mFluidInputs[0].amount*100)}; + FluidStack[] flOutput = new FluidStack[]{new FluidStack(recipe.mFluidOutputs[0], recipe.mFluidOutputs[0].amount)}; + BWRecipes.instance.addBacterialVatRecipe(new ItemStack[]{null},BioCultureLoader.generalPurposeFermentingBacteria,flInput,flOutput,recipe.mDuration > 10 ? recipe.mDuration/10 : recipe.mDuration,recipe.mEUt,GT_Utility.getTier(recipe.mEUt)); + } + } }
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 5fa6e23213..beba91a18d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -34,6 +34,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import ic2.core.item.ItemFluidCell; import net.minecraft.block.Block; @@ -86,6 +87,7 @@ public class FluidLoader implements Runnable { if (B.isBreedable()) { B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); FluidRegistry.registerFluid(B.getFluid()); + GT_LanguageManager.addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName()+" Fluid"); GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); } } @@ -101,11 +103,13 @@ public class FluidLoader implements Runnable { public static Fluid createAndRegisterFluid(String Name,Color color){ Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); FluidRegistry.registerFluid(f); return f; } public static Fluid createAndRegisterFluid(String Name, Color color, int temperature){ Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); f.setTemperature(temperature); FluidRegistry.registerFluid(f); return f; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 095e679dc6..f602963c8e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 6e55fd509a..2b61f3250f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -37,6 +37,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -130,7 +131,7 @@ public class ItemRegistry { public static ItemStack[] diode16A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; - public static ItemStack[] megaMachines = new ItemStack[2]; + public static ItemStack[] megaMachines = new ItemStack[3]; public static ItemStack dehp; public static ItemStack thtr; public static ItemStack eic; @@ -192,6 +193,7 @@ public class ItemRegistry { ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L); ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L); ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); + ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java index 9ea0f90050..4f7d83bcf6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -26,7 +26,7 @@ public class LoaderRegistry implements Runnable { @Override public void run() { - new ItemRegistry().run(); + ItemRegistry.run(); new RecipeLoader().run(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 5426e20a99..3f703ba688 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -27,10 +27,14 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.*; +import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -51,6 +55,7 @@ public class RecipeLoader implements Runnable { protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; @Override + @SuppressWarnings("deprecation") public void run() { if (ConfigHandler.GTNH) { @@ -251,12 +256,13 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[2], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(7)); for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), null, null, null, 64, 2); @@ -278,7 +284,6 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), null, null, null, 64, 2); } - GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.WINDMETER), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -293,7 +298,7 @@ public class RecipeLoader implements Runnable { ); Materials[] cables = {Materials.Lead, Materials.Tin, Materials.AnnealedCopper, Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - Materials[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; + ISubTagContainer[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, WerkstoffLoader.LuVTierMaterial, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; ItemStack[] bats = {ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L)}; ItemStack[] chreac = {ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L)}; @@ -318,7 +323,7 @@ public class RecipeLoader implements Runnable { for (int i = 0; i < GT_Values.VN.length; i++) { try { Materials cable = cables[i]; - Materials hull = hulls[i]; + ItemStack hull = hulls[i] instanceof Materials ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( @@ -329,7 +334,7 @@ public class RecipeLoader implements Runnable { "WCW", "PWP", 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( @@ -341,7 +346,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -354,7 +359,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -367,7 +372,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -380,7 +385,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -393,7 +398,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -406,7 +411,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -419,7 +424,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -432,7 +437,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -446,7 +451,7 @@ public class RecipeLoader implements Runnable { 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -460,7 +465,7 @@ public class RecipeLoader implements Runnable { 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -479,7 +484,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), + /*Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) :*/ new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), RecipeLoader.BITSD, new Object[]{ "SCS", @@ -754,6 +759,7 @@ public class RecipeLoader implements Runnable { } ); + if (!Loader.isModLoaded("tectech")) GT_Values.RA.addAssemblylineRecipe( ItemList.Machine_Multi_ImplosionCompressor.get(1L),24000, new ItemStack[]{ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index bb32c7aeb4..b22bd115fd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -50,6 +50,7 @@ import java.util.List; /* * Original GT File slightly Modified */ +@SuppressWarnings("ALL") @ChannelHandler.Sharable public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> implements IGT_NetworkHandler { @@ -58,7 +59,7 @@ public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); - this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; + this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List<Object> aOutput) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 0da061e352..be1fb4dea5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 4147087a51..7d083bdaec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.net; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; @@ -33,14 +33,14 @@ import net.minecraft.world.World; import java.nio.ByteBuffer; -public class OrePacket extends GT_Packet { +public class MetaBlockPacket extends GT_Packet { int x; short y; int z; short meta; - public OrePacket(int x, int y, int z, int meta) { + public MetaBlockPacket(int x, int y, int z, int meta) { super(false); this.x = x; this.y = (short) y; @@ -48,7 +48,7 @@ public class OrePacket extends GT_Packet { this.meta = (short) meta; } - public OrePacket() { + public MetaBlockPacket() { super(true); } @@ -72,7 +72,7 @@ public class OrePacket extends GT_Packet { this.z = buff.getInt(); this.y = buff.getShort(); this.meta = buff.getShort(); - OrePacket todecode = new OrePacket(this.x, this.y, this.z, this.meta); + MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta); if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; @@ -84,8 +84,8 @@ public class OrePacket extends GT_Packet { public void process(IBlockAccess iBlockAccess) { if (iBlockAccess != null) { TileEntity tTileEntity = iBlockAccess.getTileEntity(this.x, this.y, this.z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = this.meta; + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData = this.meta; } if (((iBlockAccess instanceof World)) && (((World) iBlockAccess).isRemote)) { ((World) iBlockAccess).markBlockForUpdate(this.x, this.y, this.z); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 793f59c899..9a4ce6cf38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -63,7 +63,7 @@ public class OreDictCachePacket extends GT_Packet { public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { int size = byteArrayDataInput.readInt(); for (int i = 0; i < size; i++) { - this.hashSet.add(new Pair<Integer,Short>(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); + this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); } return new OreDictCachePacket(this.hashSet); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 90a3adc69a..ede9c1df94 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 149db03d5b..4a1367d1dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index 9d492bb87f..e382a138ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index 767e6bd383..78df5d33f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 0e54e9264d..0497a1b5b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -71,7 +71,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem private synchronized void setUpHashSet() { this.check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); Thread t = new Thread(this.check); - t.run(); + t.start(); while (t.isAlive()) { try { this.wait(); @@ -89,7 +89,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem private class recursiveBelowCheck implements Runnable { - private final List<Coords> hashset = new ArrayList<Coords>(); + private final List<Coords> hashset = new ArrayList<>(); int called = -1; public int getCalled() { @@ -138,7 +138,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem if (iterations >= 5000) return -1; - int tail = 0; + int tail; int ret = 0; iterations++; int wID = w.provider.dimensionId; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index ea9bfe6395..fb687ed2a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index f9e7553760..f47be6d45e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -31,11 +31,10 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; import java.util.ArrayList; -import java.util.HashSet; public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler, ITileWithGUI { - final ArrayList<FluidStack> INTERNALTANKS = new ArrayList<FluidStack>(); + final ArrayList<FluidStack> INTERNALTANKS = new ArrayList<>(); int selectedTank; @@ -61,13 +60,15 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - HashSet<Boolean> ret = new HashSet<Boolean>(); + boolean ret = false; for (FluidStack stack : this.INTERNALTANKS) { - ret.add(GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0))); - if (ret.contains(Boolean.TRUE)) + ret = GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0)); + if (ret) { this.selectedTank = this.INTERNALTANKS.indexOf(stack); + break; + } } - return ret.contains(Boolean.TRUE); + return ret; } @Override @@ -94,12 +95,12 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank NBTTagList lInternalTank = new NBTTagList(); - for (int i = 0; i < this.INTERNALTANKS.size(); i++) { - if (this.INTERNALTANKS.get(i) != null) { + for (FluidStack internaltank : this.INTERNALTANKS) { + if (internaltank != null) { NBTTagCompound entry = new NBTTagCompound(); - entry.setString("FluidName", this.INTERNALTANKS.get(i).getFluid().getName()); - entry.setInteger("Ammount", this.INTERNALTANKS.get(i).amount); - entry.setTag("FluidTag", this.INTERNALTANKS.get(i).tag); + entry.setString("FluidName", internaltank.getFluid().getName()); + entry.setInteger("Ammount", internaltank.amount); + entry.setTag("FluidTag", internaltank.tag); lInternalTank.appendTag(entry); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java index 323a009d0a..ac7c929cba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 1a8b555478..d3d8d5f6ab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,12 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.*; @@ -43,8 +41,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -57,12 +53,9 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @@ -71,7 +64,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private static final byte MCASING_INDEX = 49; private static final byte TIMERDIVIDER = 20; - private final HashSet<EntityPlayerMP> playerMPHashSet = new HashSet<EntityPlayerMP>(); + private final HashSet<EntityPlayerMP> playerMPHashSet = new HashSet<>(); private final ArrayList<GT_MetaTileEntity_RadioHatch> mRadHatches = new ArrayList<>(); private int height = 1; private GT_Recipe mLastRecipe; @@ -151,7 +144,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private int calcMod(double x) { int ret = (int) Math.ceil(ConfigHandler.bioVatMaxParallelBonus*(-(((2D*x/(double)this.getOutputCapacity())-1D)*(2D*x/(double)this.getOutputCapacity()-1D))+1D)); - return ret <= 0 ? 1 : ret > 100 ? 100 : ret;//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); + return ret <= 0 ? 1 : Math.min(ret, 100);//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } @Override @@ -177,7 +170,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); ArrayList<FluidStack> tFluidList = this.getStoredFluids(); int tFluidList_sS = tFluidList.size(); @@ -196,7 +189,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluidList.size() > 0) { @@ -262,18 +255,16 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } public ArrayList<FluidStack> getStoredFluidOutputs() { - ArrayList<FluidStack> rList = new ArrayList(); - Iterator var2 = this.mOutputHatches.iterator(); + ArrayList<FluidStack> rList = new ArrayList<>(); - while (var2.hasNext()) { - GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) var2.next(); + for (GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) { if (tHatch.getFluid() != null) rList.add(tHatch.getFluid()); } return rList; } - private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity) { if (aTileEntity == null) { return false; } else { @@ -281,7 +272,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { - ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(GT_TileEntity_BioVat.MCASING_INDEX); return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); } else { return false; @@ -304,7 +295,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { //controller if (y == 0 && xDir + x == 0 && zDir + z == 0) continue; - if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { + if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { ++blockcounter; continue; @@ -318,8 +309,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } else { if (x == -2 && z == -2 && y == 1) - this.mGlassTier = this.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + -2, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (0 == this.mGlassTier || this.mGlassTier != this.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { + this.mGlassTier = BW_Util.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + -2, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (0 == this.mGlassTier || this.mGlassTier != BW_Util.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { return false; } } @@ -336,27 +327,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { return false; } - private byte calculateGlassTier(@Nonnull Block block, @Nonnegative Byte meta) { - - if (block.equals(ItemRegistry.bw_glasses[0])) - return meta == 12 ? 5 : meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; - - if (block.getUnlocalizedName().equals("blockAlloyGlass")) - return 4; - - if (block.equals(Blocks.glass)) - return 3; - - for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) - if (B.getBlock().equals(block) && B.getaByte().equals(meta)) - return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); - - if (block.getMaterial().equals(Material.glass)) - return 3; - - return 0; - } - @Override public int getMaxEfficiency(ItemStack itemStack) { return 10000; @@ -427,10 +397,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private void check_Chunk() { World aWorld = this.getBaseMetaTileEntity().getWorld(); if (!aWorld.isRemote) { - Iterator var5 = aWorld.playerEntities.iterator(); - while (var5.hasNext()) { - Object tObject = var5.next(); + for (Object tObject : aWorld.playerEntities) { if (!(tObject instanceof EntityPlayerMP)) { break; } @@ -501,7 +469,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { for (int x = -1; x < 2; x++) { for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { - if (aStack == null || (aStack != null && aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0)) { + if (aStack == null || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { if (this.mCulture == null || aStack == null || aStack.getTagCompound() == null || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); this.sendPackagesOrRenewRenderer(x, y, z, lCulture); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index ef71506d0e..6d664ed7cd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -37,6 +37,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -60,7 +61,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl super(aID, aName, aNameRegional); } - public GT_TileEntity_CircuitAssemblyLine(String aName) { + private GT_TileEntity_CircuitAssemblyLine(String aName) { super(aName); } @@ -98,11 +99,17 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } @Override - public void saveNBTData(NBTTagCompound aNBT) { + public void setItemNBT(NBTTagCompound aNBT) { if (!this.type.equals(new NBTTagCompound())) aNBT.setTag("Type", this.type); super.saveNBTData(aNBT); + } + @Override + public void saveNBTData(NBTTagCompound aNBT) { + if (!this.type.equals(new NBTTagCompound())) + aNBT.setTag("Type", this.type); + super.saveNBTData(aNBT); } private final Collection<GT_Recipe> GT_RECIPE_COLLECTION = new HashSet<>(); @@ -115,6 +122,10 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) { BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt > 0) + this.mEUt = -this.mEUt; + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; @@ -142,6 +153,10 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl continue; BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt > 0) + this.mEUt = -this.mEUt; + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; @@ -155,79 +170,123 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - int r; - int i; - IGregTechTileEntity tTileEntity; - if (xDir != 0) { - for(r = 0; r <= 7; ++r) { - i = r * xDir; - - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 0, i); - if (!this.addEnergyInputToMachineList(tTileEntity, 16)) - if ((aBaseMetaTileEntity.getBlockOffset(0, 0, i) != GregTech_API.sBlockCasings3 || aBaseMetaTileEntity.getMetaIDOffset(0, 0, i) != 10) && r == 1) - return false; - if (!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) - return false; - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i); - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) - return false; + int xBase = aBaseMetaTileEntity.getXCoord() + xDir; + int yBase = aBaseMetaTileEntity.getYCoord(); + int zBase = aBaseMetaTileEntity.getZCoord() + zDir; - if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(xDir, -1, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, i) != 5)) - return false; + boolean sided = xDir == 0; - if (!aBaseMetaTileEntity.getBlockOffset(xDir * 2, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) - return false; + if (sided) + ++zBase; + else + ++xBase; - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir * 2, -2, i); - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, -2, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, -2, i) != 0) - return false; + int length = 0; + boolean backwards = false; - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i); - if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16)) - return r > 0 && this.mEnergyHatches.size() > 0; + while (true) { + IGregTechTileEntity igtte = aBaseMetaTileEntity.getIGregTechTileEntity(sided ? xBase + length : xBase - 1, yBase - 2, sided ? zBase - 1 : zBase + length); + if (igtte == null){ + backwards = true; + length = 0; + break; } - } else { - for(r = 0; r <= 7; ++r) { - i = r * -zDir; + if (igtte.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OutputBus) + break; - //top with grate and energy hatch - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 0, zDir); - if (!this.addEnergyInputToMachineList(tTileEntity, 16)) - if ((aBaseMetaTileEntity.getBlockOffset(i, 0, 0) != GregTech_API.sBlockCasings3 || aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0) != 10) && r == 1) - return false; + ++length; - if (!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")) + if (length > 7){ + backwards = true; + length = 0; + break; + } + + } + if (backwards) + while (true) { + IGregTechTileEntity igtte = aBaseMetaTileEntity.getIGregTechTileEntity(sided ? xBase + length : xBase - 1, yBase - 2, sided ? zBase - 1 : zBase + length); + if (igtte == null) return false; - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0); - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) - return false; + if (igtte.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OutputBus) + break; - if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(i, -1, zDir) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -1, zDir) != 5)) - return false; + --length; - if (!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir * 2).getUnlocalizedName().equals("blockAlloyGlass")) + if (length < -7){ return false; + } + } - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir * 2); - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir * 2) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir * 2) != 0) - return false; - - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir); - if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16)) - return r > 0 && this.mEnergyHatches.size() == 1; + if (sided) + zBase -= 2; + else + xBase -= 2; + + for (int x = (backwards && sided ? length : 0); x <= (backwards && sided ? 0 : (sided ? length : 2)); x++) { + for (int y = -2; y <= 0; y++) { + for (int z = (backwards && !sided ? length : 0); z <= (backwards && !sided ? 0 : (sided ? 2 : length)); z++) { + if (xBase + x == this.getBaseMetaTileEntity().getXCoord() && yBase + y == this.getBaseMetaTileEntity().getYCoord() && zBase + z == this.getBaseMetaTileEntity().getZCoord()) + continue; + + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntity(xBase + x, yBase + y, zBase + z); + Block block = aBaseMetaTileEntity.getBlock(xBase + x, yBase + y, zBase + z); + byte meta = aBaseMetaTileEntity.getMetaID(xBase + x, yBase + y, zBase + z); + + switch (y) { + case -2: { + switch (sided ? z : x) { + case 0: + case 2: { + if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) + if (block != GregTech_API.sBlockCasings2 || meta != 0) + return false; + break; + } + case 1: { + if (!this.addInputToMachineList(tTileEntity, 16) && !((sided ? x : z) == length && this.addOutputToMachineList(tTileEntity, 16))) + return false; + break; + } + default: + break; + } + break; + } + case -1: { + switch (sided ? z : x) { + case 0: + case 2: { + if (BW_Util.calculateGlassTier(block, meta) < 4) + return false; + break; + } + case 1: { + if (block != GregTech_API.sBlockCasings2 || meta != 5) + return false; + break; + } + default: + break; + } + break; + } + case 0: { + if (!this.addEnergyInputToMachineList(tTileEntity, 16)) + if (block != GregTech_API.sBlockCasings3 || meta != 10) + return false; + break; + } + } + } } } - - return false; + return this.mEnergyHatches.size() > 0 && this.mMaintenanceHatches.size() == 1; } @Override @@ -296,7 +355,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing", - "Middle: Reinforced Glass, Assembling Line Casing, Reinforced Glass", + "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", "Up to 7 repeating slices, last is Output Bus", "Imprint this machine with a Circuit Imprint,", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index 50e2c7e632..1f96a207e3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -49,7 +49,7 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil return false; else { FluidStack[] array = new FluidStack[0]; - ArrayList<FluidStack> fluidInputs = new ArrayList<FluidStack>(); + ArrayList<FluidStack> fluidInputs = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) { if (hatch != null) { fluidInputs.add(hatch.getFluid()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 9b826dc9f4..daadf33416 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -61,6 +61,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } @Override + @SuppressWarnings("rawtypes") public void onConfigLoad(GT_Config aConfig) { try { Class c = TileEntityNuclearReactorElectric.class; @@ -158,7 +159,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { try { Field workState = this.getClass().getField("workState"); workState.setInt(this, 0); - } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException e) { + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) { } return true; } @@ -182,7 +183,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { try { Field workState = this.getClass().getSuperclass().getDeclaredField("workState"); workState.setInt(this, 2); - } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException e) { + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) { } return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 2dff59f0a2..8eac4a7f09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -77,7 +77,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); if (tInputList.size() > 0) { GT_Recipe tRecipe = GT_TileEntity_ElectricImplosionCompressor.eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { @@ -177,6 +177,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } @Override + @SuppressWarnings("ALL") public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 06ecfecd26..1c39d5e07c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -52,6 +52,7 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.ArrayList; +import java.util.Collections; public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @@ -157,14 +158,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public String[] getDescription() { ArrayList<String> e = new ArrayList<>(); String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); - for (int i = 0; i < dsc.length; i++) { - e.add(dsc[i]); - } + Collections.addAll(e, dsc); e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); - for (int i = 0; i < dsc.length; i++) { - e.add(dsc[i]); - } + Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); return e.toArray(new String[0]); @@ -214,6 +211,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override + @SuppressWarnings("ALL") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] ret = new ITexture[0]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 9543643c3c..8c258a96e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -49,7 +49,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase private static final byte MULTI_UPSTEP = 2; private static final byte MULTI_DOWNSTEP = 3; private byte mode; - private final byte texid = 2; + private byte texid = 2; private long mCoilWicks; private boolean upstep = true; @@ -93,9 +93,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase return this.onRunningTickTabbedMode(); } - boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); - - return ret; + return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); } public boolean onRunningTickTabbedMode() { @@ -109,7 +107,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase continue; long vtp = E.getEUVar() + (vtt); - long avt = vtp < E.maxEUStore() ? vtp : E.maxEUStore(); + long avt = Math.min(vtp, E.maxEUStore()); E.setEUVar(avt); I.setEUVar(I.getEUVar() - vtt); ret = true; @@ -121,14 +119,14 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase public long getInputTier() { if (this.mEnergyHatches.size() > 0) - return (long) GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); - else return 0; + return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + else return 0L; } public long getOutputTier() { if (this.mDynamoHatches.size() > 0) - return (long) GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); - else return 0; + return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + else return 0L; } @Override @@ -142,7 +140,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase this.upstep = (this.mode == 0 || this.mode == 2); this.mProgresstime = 0; this.mMaxProgresstime = 1; - this.mEfficiency = this.mEfficiency > 100 ? this.mEfficiency : 100; + this.mEfficiency = Math.max(this.mEfficiency, 100); return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mCoilWicks : this.getInputTier() - this.getOutputTier() == this.mCoilWicks; } @@ -168,7 +166,6 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase ++this.mCoilWicks; if (this.mCoilWicks % 8 == 0) { ++y; - continue; } } else break; @@ -253,7 +250,6 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase ++this.mCoilWicks; if (this.mCoilWicks % 8 == 0) { ++y; - continue; } } else break; @@ -328,7 +324,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase //check tap hull for (int ty = 1; ty <= y; ++ty) { - byte leveltier = 0; + byte leveltier; if (this.mInventory[1].getItemDamage() == 2) leveltier = ((byte) (intier - ty)); else if (this.mInventory[1].getItemDamage() == 3) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index d1b0d2ebce..87e1089e1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -56,15 +56,15 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { private static final int BASECASINGINDEX = 44; private static final int HELIUM_NEEDED = 730000; private int HeliumSupply; - private int BISOPeletSupply; - private int TRISOPeletSupply; + private int BISOPeletSupply, savedBISO; + private int TRISOPeletSupply, savedTRISO; private boolean empty; public GT_TileEntity_THTR(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - public GT_TileEntity_THTR(String aName) { + private GT_TileEntity_THTR(String aName) { super(aName); } @@ -76,10 +76,12 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.HeliumSupply =aNBT.getInteger("HeliumSupply"); - this.BISOPeletSupply =aNBT.getInteger("BISOPeletSupply"); - this.TRISOPeletSupply =aNBT.getInteger("TRISOPeletSupply"); - this.empty =aNBT.getBoolean("EmptyMode"); + this.HeliumSupply = aNBT.getInteger("HeliumSupply"); + this.BISOPeletSupply = aNBT.getInteger("BISOPeletSupply"); + this.TRISOPeletSupply = aNBT.getInteger("TRISOPeletSupply"); + this.savedBISO = aNBT.getInteger("savedBISO"); + this.savedTRISO = aNBT.getInteger("savedTRISO"); + this.empty = aNBT.getBoolean("EmptyMode"); } @Override @@ -88,6 +90,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { aNBT.setInteger("HeliumSupply", this.HeliumSupply); aNBT.setInteger("BISOPeletSupply", this.BISOPeletSupply); aNBT.setInteger("TRISOPeletSupply", this.TRISOPeletSupply); + aNBT.setInteger("savedBISO", this.savedBISO); + aNBT.setInteger("savedTRISO", this.savedTRISO); aNBT.setBoolean("EmptyMode", this.empty); } @@ -134,25 +138,29 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000)) return false; + int toReduce = new XSTR().nextInt((int)Math.floor(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D)); + + this.savedBISO = BISOPeletSupply; + this.savedTRISO = TRISOPeletSupply; + if (new XSTR().nextBoolean()) { if (this.BISOPeletSupply > 0) - --this.BISOPeletSupply; + this.BISOPeletSupply -= toReduce; else - --this.TRISOPeletSupply; + this.TRISOPeletSupply -= toReduce; } else { if (this.TRISOPeletSupply > 0) - --this.TRISOPeletSupply; + this.TRISOPeletSupply -= toReduce; else - --this.BISOPeletSupply; + this.BISOPeletSupply -= toReduce; } this.updateSlots(); - if (this.mOutputFluids == null || this.mOutputFluids[0] == null) - this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; + + this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; this.mEUt=0; this.mMaxProgresstime=648000; - return true; } @@ -166,47 +174,33 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { this.HeliumSupply = 0; this.TRISOPeletSupply = 0; this.BISOPeletSupply = 0; + this.savedTRISO = 0; + this.savedBISO = 0; return true; } long accessibleCoolant = 0; - long toProduce=0; for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))) { - accessibleCoolant+=fluidStack.amount; + accessibleCoolant += fluidStack.amount; } } - - toProduce = (long) ((0.00711111111111111111111111111111D*(double)this.TRISOPeletSupply + 0.00474074074074074074074074074074D*(double)this.BISOPeletSupply)); - - if (toProduce > accessibleCoolant) { -// new ExplosionIC2( -// this.getBaseMetaTileEntity().getWorld(), -// null, -// this.getBaseMetaTileEntity().getXCoord(), -// this.getBaseMetaTileEntity().getYCoord(), -// this.getBaseMetaTileEntity().getZCoord(), -// 50f, -// 0.01f, -// ExplosionIC2.Type.Nuclear -// ).doExplosion(); - toProduce=accessibleCoolant; - } - - accessibleCoolant=toProduce; + + accessibleCoolant = Math.min((long) ((0.00711111111111111111111111111111D*(double)this.savedTRISO + 0.00474074074074074074074074074074D*(double)this.savedBISO)), accessibleCoolant); for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))) { if (accessibleCoolant >= fluidStack.amount) { accessibleCoolant -= fluidStack.amount; - fluidStack.amount=0; + fluidStack.amount = 0; } else if (accessibleCoolant > 0) { - fluidStack.amount-=accessibleCoolant; - accessibleCoolant=0; + fluidStack.amount -= accessibleCoolant; + accessibleCoolant = 0; } } } - this.mOutputFluids[0].amount+=toProduce; + this.mOutputFluids[0].amount += accessibleCoolant; + this.updateSlots(); return true; } @@ -296,7 +290,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { "BISO-Pebbles:", this.BISOPeletSupply + "pcs.", "TRISO-Pebbles:", this.TRISOPeletSupply + "pcs.", "Helium-Level:", this.HeliumSupply+"L / "+ GT_TileEntity_THTR.HELIUM_NEEDED +"L", - "Coolant/t:", this.BISOPeletSupply+this.TRISOPeletSupply >= 100000 ? (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply))+"L/t" : "0L/t", + "Coolant/t:", this.savedBISO+this.savedTRISO >= 100000 ? (long) ((0.00711111111111111111111111111111D * (double) this.savedTRISO + 0.00474074074074074074074074074074D * (double) this.savedBISO))+"L/t" : "0L/t", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @@ -330,6 +324,13 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } public static void registerTHR_Recipes(){ + GT_Values.RA.addCentrifugeRecipe( + Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, + Materials.Thorium.getDustSmall(2),Materials.Thorium.getDustSmall(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),Materials.Lutetium.getDustTiny(1), + new int[]{1600,1500,200,200,50,50}, + 10000, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 625e857401..1e3c2dc45d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -58,6 +58,7 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; +import java.util.Arrays; import static gregtech.api.enums.GT_Values.V; @@ -67,7 +68,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { private static final IIconContainer[] iIconContainers = new IIconContainer[2]; private static final ITexture[] iTextures = new ITexture[3]; - private final ArrayList<TileEntityDispenser> tedList = new ArrayList<TileEntityDispenser>(); + private final ArrayList<TileEntityDispenser> tedList = new ArrayList<>(); private BW_RotorBlock rotorBlock; private byte hasDoor; @@ -102,8 +103,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { public boolean recipe_fallback(ItemStack aStack) { //sight... fallback to the macerator recipes GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; - if (tMap == null) - return false; GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, aStack); if (tRecipe == null) return false; @@ -346,6 +345,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return false; } + @SuppressWarnings("ALL") public boolean addOutput(ItemStack aStack) { if (GT_Utility.isStackInvalid(aStack)) return false; @@ -626,19 +626,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (aFacing == aSide || aSide == 0) { GT_TileEntity_Windmill.iTextures[0] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[0]); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[0]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[0]); } else if (aSide == 1) { GT_TileEntity_Windmill.iTextures[1] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[1]); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[1]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[1]); } else { GT_TileEntity_Windmill.iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[2]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[2]); } } return ret; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 6c90893975..cf38712bc6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -27,23 +27,27 @@ import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; import static gregtech.api.enums.GT_Values.V; @@ -73,6 +77,72 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return fdsc; } + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setByte("glasTier",glasTier); + aNBT.setByte("circuitMode",circuitMode); + aNBT.setLong("lEUt",lEUt); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.circuitMode = aNBT.getByte("circuitMode"); + this.glasTier = aNBT.getByte("glasTier"); + this.lEUt = aNBT.getLong("lEUt"); + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (this.lEUt > 0) { + this.addEnergyOutput(this.lEUt * (long)this.mEfficiency / 10000L); + return true; + } else if (this.lEUt < 0 && !this.drainEnergyInput((-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { + this.stopMachine(); + return false; + } else { + return true; + } + } + + + @Override + public void stopMachine() { + this.mOutputItems = null; + this.mEUt = 0; + this.lEUt = 0; + this.mEfficiency = 0; + this.mProgresstime = 0; + this.mMaxProgresstime = 0; + this.mEfficiencyIncrease = 0; + this.getBaseMetaTileEntity().disableWorking(); + } + + public String[] getInfoData() { + int mPollutionReduction = 0; + + for (GT_MetaTileEntity_Hatch_Muffler e : this.mMufflerHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(e)) { + mPollutionReduction = Math.max(e.calculatePollutionReduction(this.mPollution), mPollutionReduction); + } + } + + long storedEnergy = 0L; + long maxEnergy = 0L; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; + } + + private long lEUt = 0; + public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; @@ -110,19 +180,50 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl // return glasTier != 8 && rVoltage > BW_Util.getTierVoltage(glasTier) ? BW_Util.getTierVoltage(glasTier) : rVoltage ; // } + + private byte circuitMode = 0; + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + --circuitMode; + if (circuitMode < 0) + circuitMode = 24; + } else { + ++circuitMode; + if (circuitMode > 24) + circuitMode = 0; + } + + GT_Utility.sendChatToPlayer(aPlayer,circuitMode > 0 ? "MEBF will prioritise circuit: "+circuitMode : "Circuit prioritisation disabled."); + } + @Override public boolean checkRecipe(ItemStack itemStack) { + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe; + if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e,GT_Utility.getIntegratedCircuit(circuitMode),true))){ + List<ItemStack> modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); + modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); + tInputs = modInputs.toArray(new ItemStack[0]); + } + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) { + if (circuitMode == 0) + return false; + tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) + return false; + } - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) - return false; - - ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>(); - ArrayList<FluidStack> outputFluids = new ArrayList<FluidStack>(); + ArrayList<ItemStack> outputItems = new ArrayList<>(); + ArrayList<FluidStack> outputFluids = new ArrayList<>(); boolean found_Recipe = false; int processed = 0; @@ -149,25 +250,25 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - byte overclockCount = 0; + byte overclockCount; long actualEUT = (long) (tRecipe.mEUt) * processed; - if (actualEUT > Integer.MAX_VALUE) { - byte divider = 0; - while (actualEUT > Integer.MAX_VALUE) { - actualEUT = actualEUT / 2; - divider++; - } - overclockCount = this.calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); - } else +// if (actualEUT > Integer.MAX_VALUE) { +// byte divider = 0; +// while (actualEUT > Integer.MAX_VALUE) { +// actualEUT = actualEUT / 2; +// divider++; +// } +// overclockCount = this.calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); +// } else overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + if (this.lEUt > 0) { + this.lEUt = (-this.lEUt); } if (tHeatCapacityDivTiers > 0) { - this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + this.lEUt = (int) (this.lEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1;//no eu efficiency correction @@ -199,10 +300,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl long xMaxProgresstime = ((long) aDuration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { //make impossible if too long - this.mEUt = Integer.MAX_VALUE - 1; + this.lEUt = Integer.MAX_VALUE - 1; this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - this.mEUt = (int) (aEUt >> 2); + this.lEUt = (int) (aEUt >> 2); this.mMaxProgresstime = (int) xMaxProgresstime; } //return 0; @@ -227,12 +328,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl timesOverclocked--; } if (xEUt > Integer.MAX_VALUE - 1) { - this.mEUt = Integer.MAX_VALUE - 1; + this.lEUt = Integer.MAX_VALUE - 1; this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - this.mEUt = (int) xEUt; - if (this.mEUt == 0) - this.mEUt = 1; + this.lEUt = (int) xEUt; + if (this.lEUt == 0) + this.lEUt = 1; if (this.mMaxProgresstime <= 0) this.mMaxProgresstime = 1;//set time to 1 tick } @@ -243,13 +344,13 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { this.mHeatingCapacity = 0; - HashSet<Boolean> ret = new HashSet<Boolean>(); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11)); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); + boolean ret; + ret = BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11); + ret &= BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11); + ret &= BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11); for (int y = -1; y < 17; y++) { - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11)); - if (!this.getCoilHeat(iGregTechTileEntity, 7, y, 6)) + ret &= BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11); + if (!this.getCoilHeat(iGregTechTileEntity, y)) return false; List<Byte> metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); for (Byte meta : metasFromLayer) { @@ -280,16 +381,16 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; } - return !ret.contains(Boolean.FALSE) && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); + return ret && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); } - private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int offset, int y, int radius) { - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * offset; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * offset; + private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int y) { + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; int internalH = 0; - for (int x = -radius; x <= radius; x++) { - for (int z = -radius; z <= radius; z++) { - if (Math.abs(x) < radius && Math.abs(z) != radius) + for (int x = -6; x <= 6; x++) { + for (int z = -6; z <= 6; z++) { + if (Math.abs(x) < 6 && Math.abs(z) != 6) continue; byte tUsedMeta = iGregTechTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); switch (tUsedMeta) { @@ -320,6 +421,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl case 8: internalH = 10801; break; + case 9: + internalH = 21601; + break; default: break; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java new file mode 100644 index 0000000000..127c38d0c4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2018-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.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.google.common.collect.ArrayListMultimap; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; + +public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_DistillationTower { + + private static final int CASING_INDEX = 49; + + public GT_TileEntity_MegaDistillTower(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + private GT_TileEntity_MegaDistillTower(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_TileEntity_MegaDistillTower(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the Mega Distillation Tower", + "Size(WxHxD): 15xhx15 (Hollow), with h ranging from 16 to 61", + "Controller (Front bottom)", + "1+ Input Hatch (Any bottom layer casing)", + "1+ Output Bus (Any bottom layer casing)", + "An \"Output Layer\" consists of 5 layers!", + "2-11+ Output Hatch (One or more per Output Layer)", + "1x Maintenance Hatch (Any casing)", + "1+ Energy Hatch (Any casing)", + "Fluids are only put out at the correct height", + "The correct height equals the slot number in the NEI recipe", + "Clean Stainless Steel Machine Casings for the rest (15 x h - 5 at least!)", + StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + }; + } + + private short controllerY = 0; + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + LAYERMAP.clear(); + controllerY = aBaseMetaTileEntity.getYCoord(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; + int x, z, y = 0, casingAmount = 0; + boolean reachedTop = false; + + IGregTechTileEntity tileEntity; + Block block; + for (x = xDir - 7; x <= xDir + 7; ++x) { + for (z = zDir - 7; z <= zDir + 7; ++z) { + if (x != 0 || z != 0) { + tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (!this.addInputToMachineList(tileEntity, CASING_INDEX) && !this.addOutputToMachineList(tileEntity, CASING_INDEX) && !this.addMaintenanceToMachineList(tileEntity, CASING_INDEX) && !this.addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 1) { + return false; + } + + ++casingAmount; + } + } + } + } + for (y = y + 1; y <= 60 && !reachedTop; ++y) { + for (x = -7; x <= 7; ++x) { + for (z = -7; z <= 7; ++z) { + tileEntity = aBaseMetaTileEntity.getIGregTechTileEntity(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z); + block = aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z); + final boolean middle = Math.abs(x) < 7 && Math.abs(z) != 7; + if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z)) { + if (!middle) { + //aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z,GregTech_API.sBlockCasings4,1,2); + return false; + } + } else { + if (middle) { + reachedTop = true; + } + if (!this.addOutputToMachineList(tileEntity, CASING_INDEX) && !this.addMaintenanceToMachineList(tileEntity, CASING_INDEX) && !this.addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaID(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z) != 1) { + return false; + } + + ++casingAmount; + } + } + } + } + } + + return casingAmount >= 15 * y - 5 && y >= 16 && y <= 61 && reachedTop; + } + + @Override + public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (super.addOutputToMachineList(aTileEntity, aBaseCasingIndex)) { + if (aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output) { + int layer = aTileEntity.getYCoord() - controllerY; + layer = (int) Math.ceil(((double)layer) /5D)-1; + LAYERMAP.put(layer,(GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity()); + } + return true; + } + return false; + } + + @Override + protected void addFluidOutputs(FluidStack[] mOutputFluids2) { + for (int i = 0; i < mOutputFluids2.length; i++) { + for (int j = 0; j < LAYERMAP.get(i).size(); j++) { + LAYERMAP.get(i).get(j).fill(new FluidStack(mOutputFluids2[i],mOutputFluids2[i].amount/LAYERMAP.get(i).size()), true); + } + } + } + + private final ArrayListMultimap<Integer,GT_MetaTileEntity_Hatch_Output> LAYERMAP = ArrayListMultimap.create(); + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<FluidStack> tFluidList = this.getStoredFluids(); + + for (int i = 0; i < tFluidList.size() - 1; ++i) { + for (int j = i + 1; j < tFluidList.size(); ++j) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { + if (tFluidList.get(i).amount < tFluidList.get(j).amount) { + tFluidList.remove(i--); + break; + } + tFluidList.remove(j--); + } + } + } + + long tVoltage = this.getMaxInputVoltage(); + byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage)); + + long nominalV = BW_Util.getnominalVoltage(this); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); + if (tFluids.length > 0) { + for (FluidStack tFluid : tFluids) { + ArrayList<FluidStack[]> outputFluids = new ArrayList<>(); + int processed = 0; + boolean found_Recipe = false; + FluidStack[] output; + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}); + while (this.getStoredFluids().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null && (tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids)) { + found_Recipe = true; + if (tRecipe.mFluidOutputs.length == 1 && tRecipe.mFluidOutputs[0].amount == 0) + tRecipe.mFluidOutputs[0].amount = tRecipe.mFluidInputs[0].amount; + output = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int i = 0; i < output.length; i++) { + output[i] = new FluidStack(tRecipe.mFluidOutputs[i],tRecipe.mFluidOutputs[i].amount); + } + outputFluids.add(output); + ++processed; + } else + break; + } + if (!found_Recipe) + continue; + for (int j = 1; j < outputFluids.size(); j++) { + for (int k = 0; k < outputFluids.get(j).length; k++) { + outputFluids.get(0)[k].amount += outputFluids.get(j)[k].amount; + } + } + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + long actualEUT = (long) (tRecipe.mEUt) * processed; + if (actualEUT > Integer.MAX_VALUE) { + byte divider = 0; + while (actualEUT > Integer.MAX_VALUE) { + actualEUT = actualEUT / 2; + divider++; + } + BW_Util.calculateOverclockedNessMulti((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), 1, nominalV, this); + } else + BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); + //In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids = outputFluids.get(0).clone(); + if (tRecipe.getOutput(0) != null) { + int stacks = processed / 64; + ItemStack[] outputs = new ItemStack[stacks]; + if (stacks > 0) { + for (int i = 0; i < stacks; i++) + if (i != stacks - 1) + outputs[i] = tRecipe.getOutput(0).splitStack(64); + else + outputs[i] = tRecipe.getOutput(0).splitStack(processed - (64 * i)); + this.mOutputItems = outputs; + } else + this.mOutputItems = null; + } else + this.mOutputItems = null; + this.updateSlots(); + return true; + } + } + return false; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java index 3c7c1db53d..89c68563de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -37,7 +37,7 @@ import java.util.ArrayList; import java.util.List; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; - +@SuppressWarnings("ALL") public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { private GT_Recipe mLastRecipe; private int tTier; @@ -107,11 +107,11 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null; this.mMachine = this.mInventory[1].getUnlocalizedName(); - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); ArrayList<FluidStack> tFluidList = this.getStoredFluids(); - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tInputList.size() > 0 || tFluids.length > 0) { GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs); if (tRecipe != null) { @@ -170,15 +170,13 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process } tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - List<ItemStack> overStacks = new ArrayList<ItemStack>(); - for (int f = 0; f < tOut.length; f++) { - while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { - if (tOut[f] != null) { - ItemStack tmp = tOut[f].copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); - overStacks.add(tmp); - } + List<ItemStack> overStacks = new ArrayList<>(); + for (ItemStack itemStack : tOut) { + while (itemStack.getMaxStackSize() < itemStack.stackSize) { + ItemStack tmp = itemStack.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize(); + overStacks.add(tmp); } } if (overStacks.size() > 0) { @@ -186,11 +184,11 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process tmp = overStacks.toArray(tmp); tOut = ArrayUtils.addAll(tOut, tmp); } - List<ItemStack> tSList = new ArrayList<ItemStack>(); + List<ItemStack> tSList = new ArrayList<>(); for (ItemStack tS : tOut) { if (tS.stackSize > 0) tSList.add(tS); } - tOut = tSList.toArray(new ItemStack[tSList.size()]); + tOut = tSList.toArray(new ItemStack[0]); this.mOutputItems = tOut; this.mOutputFluids = new FluidStack[]{tFOut}; this.updateSlots(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index fd5fec2e16..1a3e1ca7bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -92,7 +92,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>(); + ArrayList<ItemStack> outputItems = new ArrayList<>(); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -142,14 +142,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - HashSet<Boolean> ret = new HashSet<Boolean>(); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, 17)); - return !(ret.contains(Boolean.FALSE) || this.mInputBusses.isEmpty() || this.mOutputBusses.isEmpty() || this.mEnergyHatches.isEmpty() || this.mMaintenanceHatches.isEmpty()); + return ( + BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false,false,true, GregTech_API.sBlockCasings2,1,true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false,false,true, GregTech_API.sBlockCasings2,1,true, 17) + ) && !this.mInputBusses.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mEnergyHatches.isEmpty() && !this.mMaintenanceHatches.isEmpty(); } - -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 2453610894..cc82311a70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -108,7 +108,6 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene return aSide == this.getBaseMetaTileEntity().getFrontFacing(); } - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 5ca5d59a19..e7ded86c91 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -52,9 +52,15 @@ import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final String MGUINAME = "BW.GUI.BioLab.png"; + private static final int DNA_EXTRACTION_MODULE = 0; + private static final int PCR_THERMOCYCLE_MODULE = 1; + private static final int PLASMID_SYNTHESIS_MODULE = 2; + private static final int TRANSFORMATION_MODULE = 3; + private static final int CLONAL_CELLULAR_SYNTHESIS_MODULE = 4; + private static final int INCUBATION_MODULE = 5; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { @@ -62,6 +68,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } @Override + @SuppressWarnings("deprecation") public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); } @@ -85,12 +92,12 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { int damage = this.getSpecialSlot().getItemDamage(); switch (damage) { - case 0: + case DNA_EXTRACTION_MODULE: if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture GT_Utility.isStackValid(this.mInventory[5]) && this.mInventory[5].getItem() instanceof LabParts && this.mInventory[5].getItemDamage() == 1 && this.mInventory[5].getTagCompound() == null && GT_Utility.isStackValid(this.mInventory[6]) && this.mInventory[6].getItem() instanceof LabParts && this.mInventory[6].getItemDamage() == 3 && GT_Utility.areStacksEqual(this.mInventory[7], Materials.Ethanol.getCells(1)) && - this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 + this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 ) { NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound().getCompoundTag("DNA"); @@ -119,12 +126,12 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } break; - case 1: { + case PCR_THERMOCYCLE_MODULE: { if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 1 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L)) && GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], FluidLoader.BioLabFluidCells[0]) && GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[3]) && - this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { + this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound(); if (DNABioDataTag == null) return super.checkRecipe(skipOC); @@ -159,7 +166,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } } break; - case 2: { + case PLASMID_SYNTHESIS_MODULE: { ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); @@ -169,7 +176,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Tool_DataOrb.get(1L), true) && Behaviour_DataOrb.getDataTitle(this.mInventory[6]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[6]).isEmpty())) && GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], inp2) && - this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { + this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[6])); if (cultureDNABioData == null) return super.checkRecipe(skipOC); @@ -190,13 +197,12 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } break; - - case 3: { + case TRANSFORMATION_MODULE: { if ( GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && - this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { + this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[5].getTagCompound()); BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[4].getTagCompound()); if (cultureDNABioData == null || bioCulture == null) @@ -208,9 +214,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mInventory[i].stackSize--; } this.mFluid.amount -= 1000; - bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(this.checkForExisting(bioCulture)); + this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); } this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); @@ -218,7 +224,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } } break; - case 4: { + case CLONAL_CELLULAR_SYNTHESIS_MODULE: { ItemStack Outp = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); @@ -242,7 +248,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 8000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); - out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + if (out == null) + return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; + out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); this.mOutputItems[0] = BioItemList.getPetriDish(out); } this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); @@ -250,6 +258,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } } break; + case INCUBATION_MODULE: default: return super.checkRecipe(skipOC); } @@ -257,17 +266,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return super.checkRecipe(skipOC); } - private BioCulture checkForExisting(BioCulture culture) { - if (culture == null) - return null; - for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) - if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) - return bc; - return culture; - } - @Override - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index d4382eac7a..be916e52ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 8d3d6d1777..fc7a1e6a05 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 8c4c13d171..f454af02d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -69,7 +69,6 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans return 512L + (GT_Values.V[this.mTier] * 320L); } - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java index 8bc01b5554..4f2bebb0d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index c84fbdfd13..eadf67de7a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -76,7 +76,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public static long calcDecayTicks(int x) { - long ret = 0; + long ret; if (x == 43) ret = 5000; else if (x == 61) @@ -107,7 +107,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public void setCoverage(short coverage) { - byte nu = 0; + byte nu; if (coverage > 100) nu = 100; else if (coverage < 0) @@ -245,7 +245,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } //check material for general validity - if (lStack != null && GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { + if (GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { //check orePrefix for general validity if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 5fd9b5b5d7..94b1aedd7e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 0dd86aa030..dec4e11c5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index ddf1da1e15..531c54cfd1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -98,11 +98,8 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } } else { tSpecial = 0; - String[] var6 = recipeDesc; - int var7 = recipeDesc.length; - for (int var8 = 0; var8 < var7; ++var8) { - String descLine = var6[var8]; + for (String descLine : recipeDesc) { GT_NEI_DefaultHandler.drawText(10, 73 + 10 * tSpecial, descLine, -16777216); ++tSpecial; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 4f5f1a8cd2..b23fa6fd0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -28,20 +28,22 @@ import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import java.awt.*; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Objects; public class BW_NEI_OreHandler extends TemplateRecipeHandler { @@ -60,7 +62,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0,40,40,120),"quickanddirtyneihandler")); } @Override @@ -71,172 +73,60 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { - for (int i = 0; i < Werkstoff.werkstoffHashMap.values().size(); i++) { - Werkstoff w = Werkstoff.werkstoffHashMap.get((short)i); - if (w == null || w == Werkstoff.default_null_Werkstoff) - continue; - if (w.getGenerationFeatures().hasOres()) { - ItemStack result = w.get(OrePrefixes.ore); - TemplateRecipeHandler.CachedRecipe tmp = new TemplateRecipeHandler.CachedRecipe() { - - PositionedStack stack = new PositionedStack(result, 0, 0); - - @Override - public PositionedStack getResult() { - return this.stack; - } - - @Override - public List<PositionedStack> getOtherStacks() { - ArrayList<PositionedStack> ret = new ArrayList<>(); - for (int i = 0; i < BW_OreLayer.sList.size(); i++) { - if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128b) { - int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128b worldGen = ((BW_WorldGenRoss128b) BW_OreLayer.sList.get(i)); - if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { - ItemStack other; - other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); - this.stack = new PositionedStack(other, 83, 0); - if (((worldGen.bwOres & 0b1000) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } - if (((worldGen.bwOres & 0b0100) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } - if (((worldGen.bwOres & 0b0010) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } - if (((worldGen.bwOres & 0b0001) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } - break; - } - } - } - return ret; - } - }; - boolean add = true; - for (TemplateRecipeHandler.CachedRecipe recipe: this.arecipes) { - if (recipe == null || recipe.getOtherStacks() == null || recipe.getOtherStacks().get(0) == null || recipe.getOtherStacks().get(0).item == null) - continue; - if (GT_Utility.areStacksEqual(recipe.getOtherStacks().get(0).item,tmp.getOtherStacks().get(0).item)) - add = false; - } - if (add) - this.arecipes.add(tmp); - } - } - } else super.loadCraftingRecipes(outputId, results); + HashSet<ItemStack> result = new HashSet<>(); + Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.ore))); + result.forEach(this::loadCraftingRecipes); + result.clear(); + Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); + result.forEach(this::loadCraftingRecipes); + result.clear(); + HashSet<TemplateRecipeHandler.CachedRecipe> hashSet = new HashSet<>(this.arecipes); + this.arecipes.clear(); + this.arecipes.addAll(hashSet); + } + if (outputId.equals("item")) { + this.loadCraftingRecipes((ItemStack)results[0]); + HashSet<TemplateRecipeHandler.CachedRecipe> hashSet = new HashSet<>(this.arecipes); + this.arecipes.clear(); + this.arecipes.addAll(hashSet); + } } @Override public void drawExtras(int recipe) { - if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe).getOtherStacks().size() >= 4) ) { - GuiDraw.drawString(ChatColorHelper.BOLD + "DIM:" + ChatColorHelper.RESET + " Ross128", 0, 40, 0, false); + if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe) ) { + CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); + + GuiDraw.drawString(ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), 0, 40, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + + if (!cachedOreRecipe.small) { + GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + } else { + GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:",0,70,0,false); + GuiDraw.drawString(((CachedOreRecipe) this.arecipes.get(recipe)).worldGen.mDensity+"",0,80,0, false); + } } super.drawExtras(recipe); } @Override public void loadCraftingRecipes(ItemStack result) { - if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores) { - TemplateRecipeHandler.CachedRecipe tmp = new TemplateRecipeHandler.CachedRecipe() { - - PositionedStack stack = new PositionedStack(result, 0, 0); - - @Override - public PositionedStack getResult() { - return this.stack; - } - - @Override - public List<PositionedStack> getOtherStacks() { - ArrayList<PositionedStack> ret = new ArrayList<>(); - for (int i = 0; i < BW_OreLayer.sList.size(); i++) { - if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128b) { - int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128b worldGen = ((BW_WorldGenRoss128b) BW_OreLayer.sList.get(i)); - if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { - ItemStack other; - other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); - this.stack = new PositionedStack(other, 83, 0); - if (((worldGen.bwOres & 0b1000) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } - if (((worldGen.bwOres & 0b0100) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } - if (((worldGen.bwOres & 0b0010) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } - if (((worldGen.bwOres & 0b0001) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } - break; - } - } - } - return ret; - } - }; - this.arecipes.add(tmp); + Block ore = Block.getBlockFromItem(result.getItem()); + if (ore instanceof BW_MetaGenerated_Ores) { + BW_OreLayer.NEIMAP.get( + (short) result.getItemDamage()) + .stream() + .filter(l -> !(ore instanceof BW_MetaGenerated_SmallOres) || + !(l.getClass().equals(BW_WorldGenRoss128b.class) || + l.getClass().equals(BW_WorldGenRoss128ba.class))) + .forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); } } @@ -249,4 +139,45 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public String getRecipeName() { return "BartWorks Ores"; } + + class CachedOreRecipe extends TemplateRecipeHandler.CachedRecipe{ + + public CachedOreRecipe(BW_OreLayer worldGen, ItemStack result, boolean smallOres) { + this.worldGen = worldGen; + this.stack = new PositionedStack(result, 0, 0); + this.small = smallOres; + } + boolean small; + BW_OreLayer worldGen; + PositionedStack stack; + + @Override + public PositionedStack getResult() { + return this.stack; + } + + @Override + public List<PositionedStack> getOtherStacks() { + List<PositionedStack> ret = new ArrayList<>(); + int x = 0; + for (int i = 0; i < (small ? 1 : 4); i++) { + x += 20; + ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12)); + } + return ret; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof CachedOreRecipe)) return false; + CachedOreRecipe that = (CachedOreRecipe) o; + return Objects.equals(worldGen, that.worldGen); + } + + @Override + public int hashCode() { + return worldGen.hashCode(); + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 284fdc973c..48c1b6e6ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 0b2822dae8..59b8b947b7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -25,15 +25,22 @@ package com.github.bartimaeusnek.bartworks.server.EventHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket; import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.oredict.OreDictionary; public class ServerEventHandler { + //MinecraftForge.EVENT_BUS @SubscribeEvent(priority = EventPriority.LOWEST) public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { if (event == null || !(event.entity instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer()) @@ -42,23 +49,59 @@ public class ServerEventHandler { MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity); } -// @SubscribeEvent(priority = EventPriority.HIGHEST) -// public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { -// if (!BWUnificationEnforcer.isEnabled() || event == null || !(event.player instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer()) -// return; -// -// for (int i = 0; i < event.player.inventory.mainInventory.length; i++) { -// ItemStack stack = event.player.inventory.mainInventory[i]; -// for (int id : OreDictionary.getOreIDs(stack)) -// if (BWUnificationEnforcer.getUnificationTargets().contains(OreDictionary.getOreName(id))){ -// ArrayList<ItemStack> stacks = OreDictionary.getOres(OreDictionary.getOreName(id)); -// for (int j = 0; j < stacks.size(); j++) { -// GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(stacks.get(j).getItem()); -// if (UI.modId.equals(MainMod.MOD_ID)){ -// event.player.inventory.mainInventory[i] = stacks.get(j).copy().splitStack(stack.stackSize); -// } -// } -// } -// } -// } + //FMLCommonHandler.instance().bus() + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { + if (event == null || !(event.player instanceof EntityPlayerMP)) + return; + + if (event.player.worldObj.getTotalWorldTime() % 20 != 0) + return; + + boolean replace = false; + ItemStack toReplace = null; + for (int i = 0; i < event.player.inventory.mainInventory.length; i++) { + ItemStack stack = event.player.inventory.mainInventory[i]; + if (stack == null) + continue; + int[] oreIDs = OreDictionary.getOreIDs(stack); + + if (oreIDs.length > 0){ + loop: for (int oreID : oreIDs) { + String oreDictName = OreDictionary.getOreName(oreID); + for (Werkstoff e : Werkstoff.werkstoffHashSet) { + replace = e.getGenerationFeatures().enforceUnification; + if (replace) { + if (oreDictName.contains(e.getVarName())) { + String prefix = oreDictName.replace(e.getVarName(), ""); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; + } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); + break loop; + } else { + for (String s : e.getADDITIONAL_OREDICT()) { + if (oreDictName.contains(s)) { + String prefix = oreDictName.replace(s, ""); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; + } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); + break loop; + } + } + } + } + replace = false; + } + } + } + if (replace && toReplace != null) { + event.player.inventory.setInventorySlotContents(i, toReplace); + replace = false; + } + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index f18b34c734..4bc7bf3802 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -71,10 +71,24 @@ public class BW_Container_HeatedWaterPump extends Container { @Override public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + Slot slot = this.getSlot(p_82846_2_); + if (p_82846_2_ == 0 && slot.getStack() != null) { + for (int i = 25; i < this.inventorySlots.size(); i++) { + if (((Slot) this.inventorySlots.get(i)).getStack() == null) { + ((Slot) this.inventorySlots.get(i)).putStack(slot.getStack()); + slot.putStack(null); + } + } + } + else if (p_82846_2_ > 1 && slot.getStack() != null && ((Slot) this.inventorySlots.get(0)).getStack() == null && ((Slot) this.inventorySlots.get(0)).isItemValid(slot.getStack())){ + ((Slot) this.inventorySlots.get(0)).putStack(slot.getStack()); + slot.putStack(null); + } return null; } @Override + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); if (this.TILE.getWorldObj().isRemote) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index 42bdc56e3b..8d2d9b0b51 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -126,6 +126,7 @@ public class BW_Container_RadioHatch extends Container { } @Override + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { this.coverage = this.iGregTechTileEntity.getCoverage(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 7545d5225a..f370d07043 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index 6d3b86da1f..2fd79898d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java index 95d09eefa9..7621a17f0a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index a1cd7505fe..1b1b4b240f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -46,6 +46,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { super(aInventoryPlayer, aTileEntity); } + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java index 133bc2dfbb..84f054b4bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -31,6 +31,7 @@ public class BW_DelSlot extends Slot { super(new InventoryPlayer(null), 0, 80, 17); } + @SuppressWarnings("ALL") public void putStack(ItemStack p_75215_1_) { p_75215_1_ = null; this.onSlotChanged(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java index 71ed548559..6e2eafdf13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java index 9e832e0820..286d3faa84 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -36,7 +36,7 @@ import java.util.logging.Logger; public class DebugLog { private static boolean init; - private static FileHandler fh; + static FileHandler fh; private static Logger utilLog; public DebugLog(FMLPreInitializationEvent event) throws IOException { if (DebugLog.init) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java new file mode 100644 index 0000000000..63f27d299f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java @@ -0,0 +1,653 @@ +/* + * Copyright (c) 2018-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.system.log; + + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.message.Message; +import org.apache.logging.log4j.message.MessageFactory; + +public class STFUGTPPLOG implements Logger { + + @Override + public void catching(Level level, Throwable t) { + + } + + @Override + public void catching(Throwable t) { + + } + + @Override + public void debug(Marker marker, Message msg) { + + } + + @Override + public void debug(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void debug(Marker marker, Object message) { + + } + + @Override + public void debug(Marker marker, Object message, Throwable t) { + + } + + @Override + public void debug(Marker marker, String message) { + + } + + @Override + public void debug(Marker marker, String message, Object... params) { + + } + + @Override + public void debug(Marker marker, String message, Throwable t) { + + } + + @Override + public void debug(Message msg) { + + } + + @Override + public void debug(Message msg, Throwable t) { + + } + + @Override + public void debug(Object message) { + + } + + @Override + public void debug(Object message, Throwable t) { + + } + + @Override + public void debug(String message) { + + } + + @Override + public void debug(String message, Object... params) { + + } + + @Override + public void debug(String message, Throwable t) { + + } + + @Override + public void entry() { + + } + + @Override + public void entry(Object... params) { + + } + + @Override + public void error(Marker marker, Message msg) { + + } + + @Override + public void error(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void error(Marker marker, Object message) { + + } + + @Override + public void error(Marker marker, Object message, Throwable t) { + + } + + @Override + public void error(Marker marker, String message) { + + } + + @Override + public void error(Marker marker, String message, Object... params) { + + } + + @Override + public void error(Marker marker, String message, Throwable t) { + + } + + @Override + public void error(Message msg) { + + } + + @Override + public void error(Message msg, Throwable t) { + + } + + @Override + public void error(Object message) { + + } + + @Override + public void error(Object message, Throwable t) { + + } + + @Override + public void error(String message) { + + } + + @Override + public void error(String message, Object... params) { + + } + + @Override + public void error(String message, Throwable t) { + + } + + @Override + public void exit() { + + } + + @Override + public <R> R exit(R result) { + return null; + } + + @Override + public void fatal(Marker marker, Message msg) { + + } + + @Override + public void fatal(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void fatal(Marker marker, Object message) { + + } + + @Override + public void fatal(Marker marker, Object message, Throwable t) { + + } + + @Override + public void fatal(Marker marker, String message) { + + } + + @Override + public void fatal(Marker marker, String message, Object... params) { + + } + + @Override + public void fatal(Marker marker, String message, Throwable t) { + + } + + @Override + public void fatal(Message msg) { + + } + + @Override + public void fatal(Message msg, Throwable t) { + + } + + @Override + public void fatal(Object message) { + + } + + @Override + public void fatal(Object message, Throwable t) { + + } + + @Override + public void fatal(String message) { + + } + + @Override + public void fatal(String message, Object... params) { + + } + + @Override + public void fatal(String message, Throwable t) { + + } + + @Override + public MessageFactory getMessageFactory() { + return null; + } + + @Override + public String getName() { + return null; + } + + @Override + public void info(Marker marker, Message msg) { + + } + + @Override + public void info(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void info(Marker marker, Object message) { + + } + + @Override + public void info(Marker marker, Object message, Throwable t) { + + } + + @Override + public void info(Marker marker, String message) { + + } + + @Override + public void info(Marker marker, String message, Object... params) { + + } + + @Override + public void info(Marker marker, String message, Throwable t) { + + } + + @Override + public void info(Message msg) { + + } + + @Override + public void info(Message msg, Throwable t) { + + } + + @Override + public void info(Object message) { + + } + + @Override + public void info(Object message, Throwable t) { + + } + + @Override + public void info(String message) { + + } + + @Override + public void info(String message, Object... params) { + + } + + @Override + public void info(String message, Throwable t) { + + } + + @Override + public boolean isDebugEnabled() { + return false; + } + + @Override + public boolean isDebugEnabled(Marker marker) { + return false; + } + + @Override + public boolean isEnabled(Level level) { + return false; + } + + @Override + public boolean isEnabled(Level level, Marker marker) { + return false; + } + + @Override + public boolean isErrorEnabled() { + return false; + } + + @Override + public boolean isErrorEnabled(Marker marker) { + return false; + } + + @Override + public boolean isFatalEnabled() { + return false; + } + + @Override + public boolean isFatalEnabled(Marker marker) { + return false; + } + + @Override + public boolean isInfoEnabled() { + return false; + } + + @Override + public boolean isInfoEnabled(Marker marker) { + return false; + } + + @Override + public boolean isTraceEnabled() { + return false; + } + + @Override + public boolean isTraceEnabled(Marker marker) { + return false; + } + + @Override + public boolean isWarnEnabled() { + return false; + } + + @Override + public boolean isWarnEnabled(Marker marker) { + return false; + } + + @Override + public void log(Level level, Marker marker, Message msg) { + + } + + @Override + public void log(Level level, Marker marker, Message msg, Throwable t) { + + } + + @Override + public void log(Level level, Marker marker, Object message) { + + } + + @Override + public void log(Level level, Marker marker, Object message, Throwable t) { + + } + + @Override + public void log(Level level, Marker marker, String message) { + + } + + @Override + public void log(Level level, Marker marker, String message, Object... params) { + + } + + @Override + public void log(Level level, Marker marker, String message, Throwable t) { + + } + + @Override + public void log(Level level, Message msg) { + + } + + @Override + public void log(Level level, Message msg, Throwable t) { + + } + + @Override + public void log(Level level, Object message) { + + } + + @Override + public void log(Level level, Object message, Throwable t) { + + } + + @Override + public void log(Level level, String message) { + + } + + @Override + public void log(Level level, String message, Object... params) { + + } + + @Override + public void log(Level level, String message, Throwable t) { + + } + + @Override + public void printf(Level level, Marker marker, String format, Object... params) { + + } + + @Override + public void printf(Level level, String format, Object... params) { + + } + + @Override + public <T extends Throwable> T throwing(Level level, T t) { + return null; + } + + @Override + public <T extends Throwable> T throwing(T t) { + return null; + } + + @Override + public void trace(Marker marker, Message msg) { + + } + + @Override + public void trace(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void trace(Marker marker, Object message) { + + } + + @Override + public void trace(Marker marker, Object message, Throwable t) { + + } + + @Override + public void trace(Marker marker, String message) { + + } + + @Override + public void trace(Marker marker, String message, Object... params) { + + } + + @Override + public void trace(Marker marker, String message, Throwable t) { + + } + + @Override + public void trace(Message msg) { + + } + + @Override + public void trace(Message msg, Throwable t) { + + } + + @Override + public void trace(Object message) { + + } + + @Override + public void trace(Object message, Throwable t) { + + } + + @Override + public void trace(String message) { + + } + + @Override + public void trace(String message, Object... params) { + + } + + @Override + public void trace(String message, Throwable t) { + + } + + @Override + public void warn(Marker marker, Message msg) { + + } + + @Override + public void warn(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void warn(Marker marker, Object message) { + + } + + @Override + public void warn(Marker marker, Object message, Throwable t) { + + } + + @Override + public void warn(Marker marker, String message) { + + } + + @Override + public void warn(Marker marker, String message, Object... params) { + + } + + @Override + public void warn(Marker marker, String message, Throwable t) { + + } + + @Override + public void warn(Message msg) { + + } + + @Override + public void warn(Message msg, Throwable t) { + + } + + @Override + public void warn(Object message) { + + } + + @Override + public void warn(Object message, Throwable t) { + + } + + @Override + public void warn(String message) { + + } + + @Override + public void warn(String message, Object... params) { + + } + + @Override + public void warn(String message, Throwable t) { + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index f09bb6f33d..d50511337d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -35,9 +35,9 @@ import net.minecraft.world.World; import java.util.ArrayList; import java.util.List; -public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { +public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { - public BW_MetaGeneratedOre_Item(Block par1) { + public BW_MetaGeneratedBlock_Item(Block par1) { super(par1); } @@ -50,11 +50,12 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { } public String getItemStackDisplayName(ItemStack aStack) { - return GT_LanguageManager.getTranslation("bw.blockores.01." + aStack.getItemDamage() + ".name"); + return GT_LanguageManager.getTranslation( getUnlocalizedName(aStack) + ".name"); } @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) return; @@ -69,7 +70,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { return false; } - BW_MetaGeneratedOreTE tTileEntity = (BW_MetaGeneratedOreTE) aWorld.getTileEntity(aX, aY, aZ); + BW_MetaGenerated_Block_TE tTileEntity = (BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ); tTileEntity.mMetaData = tDamage; } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java new file mode 100644 index 0000000000..37c14a6bd0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2018-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.system.material; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaPipeEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_ModHandler.RecipeBits; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import static gregtech.api.enums.GT_Values.RA; + +public class BW_MetaGeneratedFrames extends MetaPipeEntity { + + public final Werkstoff mMaterial; + + public BW_MetaGeneratedFrames(int aID, String aName, String aNameRegional, Werkstoff aMaterial) { + super(aID, aName, aNameRegional, 0); + mMaterial = aMaterial; + + GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1)); + GT_ModHandler.addCraftingRecipe(getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick)}); + RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), ItemList.Circuit_Integrated.getWithDamage(0, 4), getStackForm(1), 64, 8); + } + + private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { + super(aName, 0); + mMaterial = aMaterial; + } + + @Override + public byte getTileEntityBaseType() { + return 4; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new BW_MetaGeneratedFrames(this.mName, this.mMaterial); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { + return new ITexture[]{new GT_RenderedTexture(this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA()))}; + } + + @Override + public String[] getDescription() { + return new String[]{"Just something you can put a Cover or CFoam on."}; + } + + @Override + public final boolean isSimpleMachine() { + return true; + } + + @Override + public final boolean isFacingValid(byte aFacing) { + return false; + } + + @Override + public final boolean isValidSlot(int aIndex) { + return false; + } + + @Override + public final boolean renderInside(byte aSide) { + return true; + } + + @Override + public final float getThickNess() { + return 1.0F; + } + + @Override + public final void saveNBTData(NBTTagCompound aNBT) {/*Do nothing*/} + + @Override + public final void loadNBTData(NBTTagCompound aNBT) {/*Do nothing*/} + + @Override + public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + public int connect(byte aSide) { + return 0; + } + + public void disconnect(byte aSide) { + /* Do nothing*/ + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 1e671a1d29..5a5539b3f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,66 +22,14 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.common.net.OrePacket; -import com.github.bartimaeusnek.bartworks.util.Coords; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; - -public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEntity { - - public short mMetaData; - - public static boolean placeOre(World aWorld, Coords coords, Werkstoff werkstoff) { - short meta = werkstoff.getmID(); - aWorld.setBlock(coords.x, coords.y, coords.z, WerkstoffLoader.BWOres, 0, 0); - TileEntity tTileEntity = aWorld.getTileEntity(coords.x, coords.y, coords.z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = meta; - } - return true; - } - - public boolean canUpdate() { - return false; - } - - public void readFromNBT(NBTTagCompound aNBT) { - super.readFromNBT(aNBT); - this.mMetaData = aNBT.getShort("m"); - } - - public void writeToNBT(NBTTagCompound aNBT) { - super.writeToNBT(aNBT); - aNBT.setShort("m", this.mMetaData); - } - - public ArrayList<ItemStack> getDrops(Block aDroppedOre) { - ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); - if (this.mMetaData < 0) { - rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); - return rList; - } - rList.add(new ItemStack(aDroppedOre, 1, this.mMetaData)); - return rList; - } - - public void sendPacket(){ - if (!this.worldObj.isRemote) - BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new OrePacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); - } +public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { @Override public ITexture[] getTexture(Block aBlock, byte aSide) { @@ -92,4 +40,9 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn } return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; } + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWOres; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java new file mode 100644 index 0000000000..80126f39f4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2018-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.system.material; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.Random; + +public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { + + public ArrayList<ItemStack> getDrops(int aFortune) { + ArrayList<ItemStack> rList = new ArrayList<>(); + Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); + + if (aMaterial != null) { + Random tRandom = new XSTR(this.xCoord ^ this.yCoord ^ this.zCoord); + ArrayList<ItemStack> tSelector = new ArrayList<>(); + + ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 1; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 2; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 12; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 5; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 10; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemChipped, aMaterial, GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 5; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 10; i++) { + tSelector.add(tStack); + } + } + if (tSelector.size() > 0) { + int i = 0; + + for(int j = Math.max(1, (aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0)); i < j; ++i) { + rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); + } + + } + if (tRandom.nextInt(3 + aFortune) > 1) { + rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); + } + } + return rList; + } + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + } + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; + } + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWSmallOres; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java new file mode 100644 index 0000000000..7213816976 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-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.system.material; + +import com.github.bartimaeusnek.bartworks.common.net.MetaBlockPacket; +import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; + +public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements ITexturedTileEntity { + + public short mMetaData; + + public boolean canUpdate() { + return false; + } + + public void readFromNBT(NBTTagCompound aNBT) { + super.readFromNBT(aNBT); + this.mMetaData = aNBT.getShort("m"); + } + + public void writeToNBT(NBTTagCompound aNBT) { + aNBT.setShort("m", this.mMetaData); + super.writeToNBT(aNBT); + } + + @Override + public Packet getDescriptionPacket() { + if (!this.worldObj.isRemote) + BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + return null; + } + + protected abstract Block GetProperBlock(); + + public ArrayList<ItemStack> getDrops(int aFortune) { + ArrayList<ItemStack> rList = new ArrayList<>(); + if (this.mMetaData < 0) { + rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); + return rList; + } + rList.add(new ItemStack(GetProperBlock(), 1, this.mMetaData)); + return rList; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java new file mode 100644 index 0000000000..1b3a645e5c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-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.system.material; + +import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; + +public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { + + public static ThreadLocal<BW_MetaGenerated_Block_TE> mTemporaryTileEntity = new ThreadLocal<>(); + + public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + + this.setHardness(5.0F); + this.setResistance(5.0F); + this.setBlockTextureName("stone"); + this.setCreativeTab(metaTab); + for (Werkstoff w : Werkstoff.werkstoffHashSet) + doRegistrationStuff(w); + } + + @SideOnly(Side.CLIENT) + public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering(){ + return (BW_MetaGenerated_Block_TE) createNewTileEntity(null,0); + } + + protected abstract void doRegistrationStuff(Werkstoff w); + + @Override + public String getHarvestTool(int metadata) { + return "pickaxe"; + } + + protected boolean canSilkHarvest() { + return false; + } + + public int getRenderType() { + if (BW_Renderer_Block_Ores.INSTANCE == null) { + return super.getRenderType(); + } + return BW_Renderer_Block_Ores.INSTANCE.mRenderID; + } + + public int getDamageValue(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof BW_MetaGenerated_Block_TE))) { + return ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData; + } + return 0; + } + + @Override + public TileEntity createTileEntity(World world, int metadata) { + return ((ITileEntityProvider)this).createNewTileEntity(world, metadata); + } + + @Override + public boolean hasTileEntity(int metadata) { + return true; + } + + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + TileEntity tTileEntity = world.getTileEntity(x, y, z); + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + mTemporaryTileEntity.set((BW_MetaGenerated_Block_TE) tTileEntity); + } + super.breakBlock(world, x, y, z, block, meta); + } + + public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + return ((BW_MetaGenerated_Block_TE) tTileEntity).getDrops(aFortune); + } + return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index d3bd73964b..268be7eddf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -23,10 +23,12 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.Pair; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -56,6 +58,7 @@ import net.minecraft.world.World; import java.util.List; import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashSet; public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRadMaterial { @@ -65,30 +68,36 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public Item getTabIconItem() { return new ItemStack(Blocks.iron_ore).getItem(); } + }; + protected final OrePrefixes orePrefixes; - private final short aNumToGen = (short) werkstoffHashMap.size(); + + public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused){ + super("bwMetaGeneratedGTEnhancement" + orePrefixes.name(), (short) 32766, (short) 0); + this.orePrefixes = orePrefixes; + } public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; this.setCreativeTab(BW_MetaGenerated_Items.metaTab); - for (int i = 0; i < this.aNumToGen; i++) { - ItemStack tStack = new ItemStack(this, 1, i); - Werkstoff w = werkstoffHashMap.get((short) i); - if (w == null || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) ) + for (Werkstoff w : werkstoffHashSet) { + ItemStack tStack = new ItemStack(this, 1, w.getmID()); + if (((w.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) ) continue; - if ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0 && orePrefixes.mMaterialGenerationBits != 0) + if ((w.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) continue; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); if (ConfigHandler.experimentalThreadedLoader) - OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.getDefaultName().replaceAll(" ",""), tStack)); + OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.getVarName(), tStack)); else - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getDefaultName().replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack); } } + public boolean onEntityItemUpdate(EntityItem aItemEntity) { if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); @@ -98,17 +107,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa int tX = MathHelper.floor_double(aItemEntity.posX); int tY = MathHelper.floor_double(aItemEntity.posY); int tZ = MathHelper.floor_double(aItemEntity.posZ); + Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); + byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { - Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); - byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } - } else if (this.orePrefixes == OrePrefixes.crushed) { - Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); - byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); + } else { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); @@ -122,6 +129,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); // if (!tooltip.isEmpty()) @@ -131,6 +139,10 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } if (this.orePrefixes == OrePrefixes.crushed) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); + + if (aStack != null && aStack.getItem() instanceof BW_MetaGenerated_Items && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) + aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @@ -144,21 +156,31 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } @Override - public final IIconContainer getIconContainer(int aMetaData) { - return werkstoffHashMap.get((short) aMetaData) == null ? null : this.orePrefixes.mTextureIndex == -1 ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; + public IIconContainer getIconContainer(int aMetaData) { + if (werkstoffHashMap.get((short) aMetaData) == null) + return null; + if (this.orePrefixes.mTextureIndex == -1) + return getIconContainerBartWorks(aMetaData); + return werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; + } + + protected IIconContainer getIconContainerBartWorks(int aMetaData) { + if (FMLCommonHandler.instance().getSide().isClient()) + return PrefixTextureLinker.texMap.get(this.orePrefixes).get(werkstoffHashMap.get((short) aMetaData).getTexSet()); + return null; } @Override @SideOnly(Side.CLIENT) - public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { - for (int i = 0; i < this.aNumToGen; i++) { - Werkstoff werkstoff = werkstoffHashMap.get((short) i); - if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & this.orePrefixes.mMaterialGenerationBits) != 0) && ((werkstoff.getGenerationFeatures().blacklist & this.orePrefixes.mMaterialGenerationBits) == 0)) { - ItemStack tStack = new ItemStack(this, 1, i); + @SuppressWarnings("unchecked") + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + for (Werkstoff werkstoff : werkstoffHashSet) { + if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) { + ItemStack tStack = new ItemStack(this, 1, werkstoff.getmID()); aList.add(tStack); } } - super.getSubItems(var1, aCreativeTab, aList); + //super.getSubItems(var1, aCreativeTab, aList); } @Override @@ -203,7 +225,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getItemStackLimit(ItemStack aStack) { - return 64; + return this.orePrefixes.mDefaultStackSize; } @Override @@ -231,6 +253,11 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getCapacity(ItemStack aStack) { - return this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten ? 144 : 0; + return this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten || this.orePrefixes == WerkstoffLoader.capsuleMolten ? 144 : 0; + } + + @Override + public ItemStack getContainerItem(ItemStack aStack) { + return this.orePrefixes == OrePrefixes.cell ||this.orePrefixes == OrePrefixes.cellPlasma || this.orePrefixes == WerkstoffLoader.cellMolten ? Materials.Empty.getCells(1) : null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 47e676e082..dc4bc47673 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,9 +22,6 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; -import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; @@ -36,37 +33,28 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; - -public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { - - public static ThreadLocal<BW_MetaGeneratedOreTE> mTemporaryTileEntity = new ThreadLocal(); +public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_Ores(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); + } - this.setHardness(5.0F); - this.setResistance(5.0F); - this.setBlockTextureName("stone"); - this.setCreativeTab(metaTab); - for (Werkstoff w : Werkstoff.werkstoffHashSet) { - if (w != null) { - if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) - continue; - GT_ModHandler.addValuableOre(this, w.getmID(), 1); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); - } + protected void doRegistrationStuff(Werkstoff w){ + if (w != null) { + if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) + return; + GT_ModHandler.addValuableOre(this, w.getmID(), 1); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); } } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block) { + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -77,7 +65,11 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { return false; } else { - if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) { + if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { + return false; + } + final int aaY = aY; + if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { return false; } @@ -91,10 +83,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } - public String getLocalizedName() { - return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); - } - @Override public IIcon getIcon(int side, int meta) { return Blocks.stone.getIcon(0, 0); @@ -105,46 +93,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { return Blocks.stone.getIcon(0, 0); } - @Override - public String getHarvestTool(int metadata) { - return "pickaxe"; - } - - protected boolean canSilkHarvest() { - return false; - } - - public int getRenderType() { - if (BW_Renderer_Block_Ores.INSTANCE == null) { - return super.getRenderType(); - } - return BW_Renderer_Block_Ores.INSTANCE.mRenderID; - } - - public int getDamageValue(World aWorld, int aX, int aY, int aZ) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof BW_MetaGeneratedOreTE))) { - return ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData; - } - return 0; - } - - public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - TileEntity tTileEntity = world.getTileEntity(x, y, z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - BW_MetaGenerated_Ores.mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); - } - super.breakBlock(world, x, y, z, block, meta); - } - - public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres); - } - return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres); - } - public int getHarvestLevel(int metadata) { return 3; } @@ -155,27 +103,16 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } @Override + @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { - for (int i = 0; i < Werkstoff.werkstoffHashSet.size(); i++) { - Werkstoff tMaterial = Werkstoff.werkstoffHashMap.get((short) i); + for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { - aList.add(new ItemStack(aItem, 1, i)); + aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); } } } - @Override - public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { - if ((!aWorld.isRemote || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) - ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); - } - - @Override - public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int tileX, int tileY, int tileZ) { - if ((FMLCommonHandler.instance().getEffectiveSide().isServer() || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) - ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); - } - + @SuppressWarnings("unused") private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java new file mode 100644 index 0000000000..24f447c3d8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2018-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.system.material; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.Arrays; + +public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { + public BW_MetaGenerated_SmallOres(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + } + + @Override + protected void doRegistrationStuff(Werkstoff w) { + if (w != null) { + if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) + return; + GT_ModHandler.addValuableOre(this, w.getmID(), 1); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", "Small " + w.getDefaultName() + OrePrefixes.oreSmall.mLocalizedMaterialPost); + } + } + + @Override + public String getUnlocalizedName() { + return "bw.blockores.02"; + } + + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { + if (!air) { + aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + } + + Block tBlock = aWorld.getBlock(aX, aY, aZ); + Block tOreBlock = WerkstoffLoader.BWSmallOres; + if (aMetaData < 0 || tBlock == Blocks.air && !air) { + return false; + } else { + + if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { + return false; + } + final int aaY = aY; + if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { + return false; + } + + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof BW_MetaGeneratedOreTE) { + ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = (short) aMetaData; + } + + return true; + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index 784459f25e..632c3e034f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,27 +22,27 @@ package com.github.bartimaeusnek.bartworks.system.material; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashSet; - -public class BWUnificationEnforcer { - private static boolean enabled; - private static final HashSet<String> UNIFICATION_TARGETS = new HashSet<>(); - public static boolean isEnabled() { - return BWUnificationEnforcer.enabled; - } - - public static HashSet<String> getUnificationTargets() { - return BWUnificationEnforcer.UNIFICATION_TARGETS; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + +public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_TE { + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.block.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + } + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; } - public static void addUnificationTarget(String aOreDictName){ - if (aOreDictName == null || aOreDictName.isEmpty() || !OreDictionary.doesOreNameExist(aOreDictName)) - return; - BWUnificationEnforcer.UNIFICATION_TARGETS.add(aOreDictName); - BWUnificationEnforcer.enabled = true; + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWBlocks; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java new file mode 100644 index 0000000000..382163ae8b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-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.system.material; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import java.util.List; + +public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { + + public BW_MetaGenerated_WerkstoffBlocks(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + } + + @Override + protected void doRegistrationStuff(Werkstoff tMaterial) { + if (tMaterial != null) { + if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0) + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + tMaterial.getmID() + ".name", OrePrefixes.block.mLocalizedMaterialPre + tMaterial.getDefaultName() + OrePrefixes.block.mLocalizedMaterialPost); + } + } + + @Override + public String getUnlocalizedName() { + return "bw.werkstoffblocks.01"; + } + + @Override + public IIcon getIcon(int side, int meta) { + return Blocks.iron_block.getIcon(0, 0); + } + + @Override + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + return Blocks.iron_block.getIcon(0, 0); + } + + @Override + @SuppressWarnings("unchecked") + public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { + if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0) + aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java new file mode 100644 index 0000000000..1cb7d6ea64 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2018-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.system.material; + +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import static gregtech.api.enums.GT_Values.W; + +public enum BW_NonMeta_MaterialItems implements IItemContainer { + Depleted_Tiberium_1,Depleted_Tiberium_2,Depleted_Tiberium_4, + TiberiumCell_1,TiberiumCell_2,TiberiumCell_4, + TheCoreCell,Depleted_TheCoreCell; + private ItemStack mStack; + private boolean mHasNotBeenSet = true; + + @Override + public IItemContainer set(Item aItem) { + mHasNotBeenSet = false; + if (aItem == null) return this; + ItemStack aStack = new ItemStack(aItem, 1, 0); + mStack = GT_Utility.copyAmount(1, aStack); + return this; + } + + @Override + public IItemContainer set(ItemStack aStack) { + mHasNotBeenSet = false; + mStack = GT_Utility.copyAmount(1, aStack); + return this; + } + + @Override + public Item getItem() { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return null; + return mStack.getItem(); + } + + @Override + public Block getBlock() { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + return GT_Utility.getBlockFromItem(getItem()); + } + + @Override + public final boolean hasBeenSet() { + return !mHasNotBeenSet; + } + + @Override + public boolean isStackEqual(Object aStack) { + return isStackEqual(aStack, false, false); + } + + @Override + public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) { + if (GT_Utility.isStackInvalid(aStack)) return false; + return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT); + } + + @Override + public ItemStack get(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getWildcard(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getUndamaged(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) { + ItemStack rStack = get(1, aReplacements); + if (GT_Utility.isStackInvalid(rStack)) return null; + rStack.setStackDisplayName(aDisplayName); + return GT_Utility.copyAmount(aAmount, rStack); + } + + @Override + public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) { + ItemStack rStack = get(1, aReplacements); + if (GT_Utility.isStackInvalid(rStack)) return null; + GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); + return GT_Utility.copyAmount(aAmount, rStack); + } + + @Override + public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack)); + } + + @Override + public IItemContainer registerOre(Object... aOreNames) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1)); + return this; + } + + @Override + public IItemContainer registerWildcardAsOre(Object... aOreNames) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1)); + return this; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 819d9f98bd..1d1cc94863 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index dfb48a7b50..66038d5d85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -50,10 +50,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.BitSet; -import java.util.HashSet; -import java.util.List; +import java.util.*; public class BW_Meta_Items { @@ -73,6 +70,7 @@ public class BW_Meta_Items { GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(2)},new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(3)},null,new int[]{7500},new FluidStack[]{Materials.SolderingAlloy.getMolten(576)},null,300, BW_Util.getMachineVoltageFromTier(4), BW_Util.CLEANROOM)); } + @SuppressWarnings("deprecation") public void addNewCircuit(int aTier, int aID, String aName){ String additionalOreDictData = ""; @@ -132,6 +130,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { if (aCreativeTab == this.getCreativeTab()) for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ @@ -153,7 +152,7 @@ public class BW_Meta_Items { for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2,CircuitImprintLoader.circuitIIconRefs.get(i).get(1).getIconIndex(),this.mIconList); + BW_Util.set2DCoordTo1DArray(i,0,2, Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)).get(1).getIconIndex(),this.mIconList); BW_Util.set2DCoordTo1DArray(i,1,2,aIconRegister.registerIcon(MainMod.MOD_ID+":WrapOverlay"),this.mIconList); //aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)); } @@ -162,6 +161,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { if (aStack.getItemDamage() == 0 ) if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) @@ -210,6 +210,7 @@ public class BW_Meta_Items { return null; } + @SuppressWarnings({"unchecked","rawtypes"}) public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) { if (aToolTip == null) { aToolTip = ""; @@ -242,7 +243,8 @@ public class BW_Meta_Items { boolean tUseOreDict = true; if (tRandomData instanceof IItemBehaviour) { - this.addItemBehavior(aID, (IItemBehaviour) tRandomData); + this.addItemBehavior(aID, + (IItemBehaviour) tRandomData); tUseOreDict = false; } @@ -275,6 +277,7 @@ public class BW_Meta_Items { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { int j = this.mEnabledItems.length(); @@ -289,6 +292,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index 2dfb4ad7c0..22a1caaaf1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 26f774b780..361648f276 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import com.github.bartimaeusnek.ASM.BWCoreStaticReplacementMethodes; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -38,20 +39,44 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; import java.util.HashSet; import java.util.Iterator; -public class CircuitImprintLoader implements Runnable { +public class CircuitImprintLoader { public static final ArrayListMultimap<NBTTagCompound,GT_Recipe> recipeTagMap = ArrayListMultimap.create(); + static final HashBiMap<CircuitData,ItemStack> bwCircuitTagMap = HashBiMap.create(20); - static final HashSet<NBTTagCompound> refs = new HashSet<>(); public static short reverseIDs = Short.MAX_VALUE-1; public static HashBiMap<Short, ItemList> circuitIIconRefs = HashBiMap.create(20); +// /** +// * stack is assumed valid +// **/ +// private static NBTTagCompound getUniqueIdentifierFromStack(ItemStack stack){ +// NBTTagCompound tagCompound = new NBTTagCompound(); +// tagCompound.setString("Name", stack.getUnlocalizedName()); +// tagCompound.setString("ODName", OreDictionary.getOreName(OreDictionary.getOreID(stack))); +// tagCompound.setShort("Damage", (short)stack.getItemDamage()); +// +// return tagCompound; +// } +// +// private static ItemStack getStackFromUniqueIdentifier(NBTTagCompound tagCompound){ +// return OreDictionary.getOres(tagCompound.getString("ODName")).stream().filter( +// e -> +// e.getItemDamage() == tagCompound.getShort("Damage") +// && e.getUnlocalizedName().equals(tagCompound.getString("Name")) +// +// ).findFirst().orElse(null); +// } + public static NBTTagCompound getTagFromStack(ItemStack stack){ if (GT_Utility.isStackValid(stack)) return stack.copy().splitStack(1).writeToNBT(new NBTTagCompound()); @@ -62,57 +87,77 @@ public class CircuitImprintLoader implements Runnable { return ItemStack.loadItemStackFromNBT(tagCompound); } - @Override - public void run() { - if (BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.size() > 0) - return; + public static void run() { + boolean newServer = false; + if (BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.size() > 0){ + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); + recipeTagMap.clear(); + newServer = true; + } + Iterator<GT_Recipe> it = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.iterator(); GT_Recipe circuitRecipe; + HashSet<GT_Recipe> toRem = new HashSet<>(); HashSet<GT_Recipe> toAdd = new HashSet<>(); + while (it.hasNext()) { circuitRecipe = it.next(); + ItemStack[] outputs = circuitRecipe.mOutputs; + if (outputs.length < 1) continue; + int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); + if (oreIDS.length < 1) continue; + String name = OreDictionary.getOreName(oreIDS[0]); + if (name.contains("Circuit") || name.contains("circuit")) { + CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); - for (ItemStack s : circuitRecipe.mInputs) { - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) - CircuitImprintLoader.refs.add(CircuitImprintLoader.getTagFromStack(s.copy().splitStack(1))); - } + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); + if (newRecipe != null) BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); } + } else { - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { + + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); - } - } + } } } - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); - this.makeCircuitImprints(); + + if (!newServer) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); + } + + makeCircuitImprintRecipes(); } + @SuppressWarnings("deprecation") public static GT_Recipe makeMoreExpensive(GT_Recipe original){ GT_Recipe newRecipe = original.copy(); for (ItemStack is : newRecipe.mInputs){ int[] oreIDs = OreDictionary.getOreIDs(is); if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) { - is.stackSize = 64; + is.stackSize = Math.min(is.stackSize * 6, 64); + if (is.stackSize > is.getItem().getItemStackLimit() || is.stackSize > is.getMaxStackSize()) + is.stackSize = is.getMaxStackSize(); } } newRecipe.mFluidInputs[0].amount *= 4; @@ -120,6 +165,7 @@ public class CircuitImprintLoader implements Runnable { return newRecipe; } + @SuppressWarnings("deprecation") public static GT_Recipe reBuildRecipe(GT_Recipe original){ ItemStack out = original.copy().getOutput(0); out.stackSize *= 16; @@ -143,6 +189,8 @@ public class CircuitImprintLoader implements Runnable { else { in[i] = original.mInputs[i].copy(); in[i].stackSize *= 16; + if (in[i].stackSize > in[i].getItem().getItemStackLimit() || in[i].stackSize > in[i].getMaxStackSize()) + in[i].stackSize = in[i].getMaxStackSize(); } // if (in[i].stackSize > 64) // return null; @@ -156,10 +204,9 @@ public class CircuitImprintLoader implements Runnable { if (CircuitImprintLoader.checkForBlacklistedComponents(in)){ return null; } - return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration,original.mEUt,original.mSpecialValue); + return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration * 16,original.mEUt,0); } - public static final HashSet<ItemStack> blacklistSet = new HashSet<>(); private static boolean checkForBlacklistedComponents(ItemStack[] itemStacks){ @@ -172,51 +219,54 @@ public class CircuitImprintLoader implements Runnable { return false; } - private void makeCircuitImprints(){ + private static HashSet<IRecipe> recipeWorldCache = new HashSet<>(); + private static HashSet<GT_Recipe> gtrecipeWorldCache = new HashSet<>(); + + private static void removeOldRecipesFromRegistries(){ + recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove); + BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.clear(); + gtrecipeWorldCache.forEach(GT_Recipe.GT_Recipe_Map.sSlicerRecipes.mRecipeList::remove); + recipeWorldCache.forEach( r -> + { + try { + BW_Util.getGTBufferedRecipeList().remove(r); + } catch (Exception e) { + e.printStackTrace(); + } + } + ); + recipeWorldCache.clear(); + gtrecipeWorldCache.clear(); + } + + private static void makeCircuitImprintRecipes() { + + removeOldRecipesFromRegistries(); + for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ ItemStack stack = CircuitImprintLoader.getStackFromTag(tag); int eut = Integer.MAX_VALUE; + for (GT_Recipe recipe : CircuitImprintLoader.recipeTagMap.get(tag)) { eut = Math.min(eut, recipe.mEUt); } + eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); + gtrecipeWorldCache.add(slicingRecipe); GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); - GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), - " X ", - "GPG", - " X ", - 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), - 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), - 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); - GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{ + + ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{ " X ", "GPG", " X ", 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)}); + recipeWorldCache.add(gtrecipe); + GameRegistry.addRecipe(gtrecipe); + } -// for (ItemStack stack : CircuitImprintLoader.bwCircuitTagMap.values()){ -// NBTTagCompound tag = CircuitImprintLoader.getTagFromStack(stack); -// CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(stack); -// GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial()); -// GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); -// GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), -// " X ", -// "GPG", -// " X ", -// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), -// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), -// 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); -// GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ -// " X ", -// "GPG", -// " X ", -// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), -// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), -// 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) -// }); -// } + } }
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index b6d1e83529..c72c7acebc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java new file mode 100644 index 0000000000..1d1b1a0f35 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2018-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.system.material.GT_Enhancement; + +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; +import com.github.bartimaeusnek.bartworks.util.Pair; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer.NoMetaValue; + +public class BWGTMetaItems extends BW_MetaGenerated_Items { + + private boolean hasList; + + public BWGTMetaItems(OrePrefixes orePrefixes, List<Materials> noSubIDMaterials) { + super(orePrefixes,null); + materialloop: + for (int i = 0; i < Materials.values().length; i++) { + ItemStack tStack = new ItemStack(this, 1, i); + Materials w = Materials.values()[i]; + if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + continue; + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) + continue materialloop; + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); + if (ConfigHandler.experimentalThreadedLoader) + OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack)); + else + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + } + if (noSubIDMaterials != null){ + hasList = true; + materialloop: + for (int i = 0; i < noSubIDMaterials.size(); i++) { + ItemStack tStack = new ItemStack(this, 1, i+1001); + Materials w = noSubIDMaterials.get(i); + if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + continue; + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) + continue materialloop; + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); + if (ConfigHandler.experimentalThreadedLoader) + OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack)); + else + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + } + } + } + + @Override + public IIconContainer getIconContainer(int aMetaData) { + if (this.orePrefixes.mTextureIndex == -1) + return getIconContainerBartWorks(aMetaData); + if (aMetaData > 1000 && hasList) + return NoMetaValue.get(aMetaData-1001).mIconSet.mTextures[this.orePrefixes.mTextureIndex]; + if (aMetaData < 0 || aMetaData > Materials.values().length || Materials.values()[(short) aMetaData] == null) + return null; + return Materials.values()[(short) aMetaData].mIconSet.mTextures[this.orePrefixes.mTextureIndex]; + } + + public String getDefaultLocalization(Materials werkstoff) { + return werkstoff != null ? this.orePrefixes.mLocalizedMaterialPre + werkstoff.mDefaultLocalName + this.orePrefixes.mLocalizedMaterialPost : Materials._NULL.mDefaultLocalName; + } + + protected IIconContainer getIconContainerBartWorks(int aMetaData) { + if (FMLCommonHandler.instance().getSide().isClient()) { + if (aMetaData > 1000 && hasList) + return PrefixTextureLinker.texMap.get(this.orePrefixes).get(NoMetaValue.get(aMetaData-1001).mIconSet); + return PrefixTextureLinker.texMap.get(this.orePrefixes).get(Materials.values()[(short) aMetaData].mIconSet); + } + return null; + } + + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + for (int i = 0; i < Materials.values().length; i++) { + Materials w = Materials.values()[i]; + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + continue; + else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + continue; + aList.add(new ItemStack(this, 1, i)); + } + if (hasList) + for (int i = 0; i < NoMetaValue.size(); i++) { + Materials w = NoMetaValue.get(i); + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + continue; + else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + continue; + aList.add(new ItemStack(this, 1, i + 1001)); + } + } + + @Override + public short[] getColorForGUI(ItemStack aStack) { + if (aStack.getItemDamage() > 1000 && hasList) + return NoMetaValue.get(aStack.getItemDamage()-1001).mRGBa; + return Materials.values()[aStack.getItemDamage()].mRGBa; + } + + @Override + public String getNameForGUI(ItemStack aStack) { + if (aStack.getItemDamage() > 1000 && hasList) + return NoMetaValue.get(aStack.getItemDamage()-1001).mDefaultLocalName; + return Materials.values()[aStack.getItemDamage()].mDefaultLocalName; + } + + @Override + public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { + + } + + @Override + public short[] getRGBa(ItemStack aStack) { + if (aStack.getItemDamage() > 1000 && hasList) + return NoMetaValue.get(aStack.getItemDamage()-1001).mRGBa; + return Materials.values()[aStack.getItemDamage()].mRGBa; + } + + public boolean onEntityItemUpdate(EntityItem aItemEntity) { + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java new file mode 100644 index 0000000000..4beeab09b2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2018-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.system.material.GT_Enhancement; + +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.List; +import java.util.stream.Collectors; + +public class GTMetaItemEnhancer { + static List<Materials> NoMetaValue; + + static{ + if (Loader.isModLoaded("Forestry")) { + NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); + Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); + Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); + //Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); + + Materials[] values = Materials.values(); + for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { + Materials m = values[i]; + if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); + } + if (m.getFluid(1) != null || m.getGas(1) != null) { + addFluidData(m,GT_ModHandler.getModItem("Forestry", "waxCapsule", 1),capsuls,1000,i,true); + // addFluidData(m,new ItemStack(Items.glass_bottle),bottles,250,i,false); + } + } + for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { + Materials m = NoMetaValue.get(i); + if (m.getFluid(1) != null || m.getGas(1) != null) { + addFluidData(m,GT_ModHandler.getModItem("Forestry", "waxCapsule", 1),capsuls,1000,i + 1001,true); + // addFluidData(m,new ItemStack(Items.glass_bottle),bottles,250,i + 1001,false); + } + } + + } + } + + private static void addFluidData(Materials m, ItemStack container, Item filled,int amount, int it, boolean empty){ + Fluid f = m.getFluid(1) != null ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, amount), new ItemStack(filled, 1, it), container); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(filled, 1, it), empty ? GT_Values.NI : container, GT_Values.NF, new FluidStack(f, amount)); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java new file mode 100644 index 0000000000..18651eb7f0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2018-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.system.material.GT_Enhancement; + +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.reflect.MethodUtils; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import static gregtech.api.enums.OrePrefixes.*; + +@SuppressWarnings("ALL") +public class LuVTierEnhancer implements Runnable { + + public void run() { + LuVTierEnhancer.replaceAsslineRecipes(); + List<IRecipe> bufferedRecipeList = null; + try { + bufferedRecipeList = (List<IRecipe>) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + assert bufferedRecipeList != null; + + HashSet<ItemStack> LuVMachines = new HashSet<>(); + OrePrefixes[] LuVMaterialsGenerated = {dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense}; + for (ItemList item : ItemList.values()) { + if (item.toString().contains("LuV") && item.hasBeenSet()) + LuVMachines.add(item.get(1)); + } + if (Loader.isModLoaded("dreamcraft")) { + try { + Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); + Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); + Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); + for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { + if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) + LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); + } + } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { + e.printStackTrace(); + } + } + GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); + for (ItemStack stack : LuVMachines) { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (GT_Recipe recipe : map.mRecipeList) { + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + } + } + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + for (Object obj : CraftingManager.getInstance().getRecipeList()) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { + LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + for (Object obj : bufferedRecipeList) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { + LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + } + } + new AfterLuVTierEnhacement().run(); + } + + private static void replaceAsslineRecipes(){ + for (GT_Recipe.GT_Recipe_AssemblyLine recipe_assemblyLine : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ + if (recipe_assemblyLine.mEUt > 6000) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix,stack.stackSize); + } + } + for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList){ + if (recipe_assemblyLine.mEUt > BW_Util.getTierVoltage(6)) + continue; + if (BW_Util.checkStackAndPrefix(recipe_assemblyLine.mOutputs[0])) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix, stack.stackSize); + } + } + for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ + if (recipe_assemblyLine.mEUt > 6000) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix,stack.stackSize); + } + } + } + + private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (GT_Utility.areFluidsEqual(stack, stacks[i])) + if (!replace) + return true; + else { + int amount = stacks[i].amount; + stacks[i] = new FluidStack(replacement[0], amount); + replaced = true; + } + } + return replaced; + } + + private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (!GT_Utility.isStackValid(stacks[i])) { + if (stacks[i] instanceof ArrayList && ((ArrayList)stacks[i]).size() > 0) { + if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList)stacks[i]).get(0), true)) + if (!replace) + return true; + else { + int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; + stacks[i] = new ArrayList<>(); + ((ArrayList)stacks[i]).add(replacement[0].splitStack(amount)); + replaced = true; + } + + } else + continue; + } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) + if (!replace) + return true; + else { + int amount = ((ItemStack) stacks[i]).stackSize; + stacks[i] = replacement[0].splitStack(amount); + replaced = true; + } + } + return replaced; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java new file mode 100644 index 0000000000..74c60fb27e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -0,0 +1,579 @@ +/* + * Copyright (c) 2018-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.system.material.GT_Enhancement; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.items.GT_Generic_Item; +import gregtech.api.objects.ItemData; +import gregtech.api.objects.MaterialStack; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores_Abstract; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.*; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import org.apache.commons.lang3.reflect.FieldUtils; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.*; + +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.OrePrefixes.*; + +public class PlatinumSludgeOverHaul { + private static final Materials[] BLACKLIST = { + Materials.HSSS, + Materials.EnderiumBase, + Materials.Osmiridium, + Materials.get("Uraniumtriplatinid"), + Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.get("Longasssuperconductornameforuvwire"), + }; + private static final OrePrefixes[] OPBLACKLIST = { + crushedCentrifuged,crushed,crushedPurified,dustPure,dustImpure,dustRefined,dust,dustTiny,dustSmall + }; + + private PlatinumSludgeOverHaul() { + } + + private static void runHelperrecipes() { + //DilutedSulfuricAcid + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(4), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(3000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(3), 30, 30); + //FormicAcid + GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(1), null, null, Sodiumformate.get(cell), null, 15); + GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7), 15); + GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7), 15); + //AquaRegia + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3), null, null, Materials.DilutedSulfuricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); + + //AmmoniumCloride + GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); + GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); + + //base sollution + for (Werkstoff w : Werkstoff.werkstoffHashSet) + if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + } + for (Materials m : Materials.values()) + if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + } + //Pt + GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); + + GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); + GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + }, new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(87), PTMetallicPowder.get(dust), null, 200, 120, 900); + GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 2), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust), 30); + //Pd + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); + GT_Values.RA.addSifterRecipe(PDSalt.get(dust), new ItemStack[]{ + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + }, new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(1), 30); + //K2S2O7 + // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); + //Rh/Os/Ir/Ru + GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(360), RHSulfate.getFluidOrGas(360), LeachResidue.get(dust), null, 200, 120, 775); + + //Ru + GT_Values.RA.addBlastRecipe(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10), Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000), SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6), 200, 120, 775); + GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3), null, RutheniumTetroxideSollution.getFluidOrGas(9000), Materials.Empty.getCells(3), 300); + GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(1), RutheniumTetroxideSollution.getFluidOrGas(800), HotRutheniumTetroxideSollution.getFluidOrGas(800), 300, 480); + GT_Values.RA.addCrackingRecipe(17, RutheniumTetroxideSollution.getFluidOrGas(1000), GT_ModHandler.getSteam(1000), HotRutheniumTetroxideSollution.getFluidOrGas(2000), 150, 480); + GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000), new FluidStack[]{ + Materials.Water.getFluid(1800), + RutheniumTetroxide.getFluidOrGas(7200) + }, Materials.Salt.getDust(6), 1500, 480); + GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Ruthenium.get(dust), Materials.Chlorine.getCells(6), 300); + + //Os + GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust, 2), null, 200, 120, 775); + GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000), new FluidStack[]{OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, null, 150, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7), 300); + + //Ir + GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PGSDResidue.get(dust), IridiumDioxide.get(dust), 200, 120, 775); + GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1), null, AcidicIridiumSolution.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 300); + GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3), null, Materials.Ammonia.getGas(3000), Materials.Empty.getCells(4), IridiumChloride.get(dust), 300); + GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); + + //Rh + GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(2000), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); + + GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust,6), CrudeRhMetall.get(dust), 300); + GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); + GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); + GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(1), 300); + GT_Values.RA.addSifterRecipe(RHNitrate.get(dust), new ItemStack[]{ + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + }, new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust), null, null, null, Materials.Water.getFluid(1000), RHFilterCakeSolution.getFluidOrGas(1000), null, 300, 30); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, RHFilterCakeSolution.getFluidOrGas(1000), null, ReRh.get(dust), null, 300); + GT_Values.RA.addChemicalRecipe(ReRh.get(dust), Materials.Empty.getCells(1), Materials.HydrochloricAcid.getFluid(1000), Materials.Chlorine.getGas(1000), Rhodium.get(dust), Materials.Ammonia.getCells(1), 300); + } + + private static boolean materialsContains(Materials one, ISubTagContainer other) { + if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) + return false; + for (MaterialStack stack : one.mMaterialList) + if (stack.mMaterial.equals(other)) + return true; + return false; + } + + @SuppressWarnings({"unchecked","rawtypes"}) + public static void replacePureElements() { + //furnace + for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { + Map.Entry realEntry = (Map.Entry) entry; + if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) + if ((!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) || !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mMaterial.mMaterial.equals(Materials.Platinum)) + if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())){ + ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); + if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue(PTMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); + else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue(PDMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); + } + } + //vanilla crafting + CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + //gt crafting + try { + ((List<IRecipe>) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)).forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + //gt machines + maploop: + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) + continue; + HashSet<GT_Recipe> toDel = new HashSet<>(); + recipeloop: + for (GT_Recipe recipe : map.mRecipeList) { + if (recipe.mFakeRecipe) + continue maploop; + + for (int i = 0; i < recipe.mFluidOutputs.length; i++) { + if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) + continue maploop; + else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + } else { + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + } + } + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (!GT_Utility.isStackValid(recipe.mOutputs[i])) + continue; + if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { + if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { + for (int j = 0; j < recipe.mInputs.length; j++) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + int amount = recipe.mOutputs[i].stackSize * 2; + recipe.mOutputs[i] = LeachResidue.get(dust, amount); + } + } + if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { + if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { + for (int j = 0; j < recipe.mInputs.length; j++) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + int amount = recipe.mOutputs[i].stackSize * 2; + recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); + } + } + if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) + continue; + //Pt + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Platinum)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 2); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dustSmall).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 2); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrLeachResidue.get(dust).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrLeachResidue.get(dustSmall).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrLeachResidue.get(dustTiny).splitStack(amount); + } + } + } + } + map.mRecipeList.removeAll(toDel); + } + //TODO: remove EnderIO recipes + + //fix HV tier + PlatinumSludgeOverHaul.replaceHVCircuitMaterials(); + //add new recipes + PlatinumSludgeOverHaul.runHelperrecipes(); + } + + @SuppressWarnings("deprecation") + private static void replaceHVCircuitMaterials(){ + GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ + if (recipe.mEUt > 512) + continue; + if (BW_Util.checkStackAndPrefix(recipe.mOutputs[0])) { + for (int i = 0; i < recipe.mInputs.length; i++) { + ItemStack stack = recipe.mInputs[i]; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (BW_Util.checkStackAndPrefix(stack) && ass.mMaterial.mMaterial.equals(Materials.Platinum)) { + recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix,Materials.BlueAlloy,stack.stackSize); + } + } + } + } + } + + private static void setnewMaterialInRecipe(Object obj) { + String inputName = "output"; + String inputItemName = "input"; + if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)){ + if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { + inputName = "recipeOutput"; + inputItemName = "recipeItems"; + } + else if (Loader.isModLoaded("miscutils")) { + try { + if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) + obj = FieldUtils.getField(obj.getClass(),"mRecipe",true).get(obj); + } catch (ClassNotFoundException | IllegalAccessException e) { + e.printStackTrace(); + } + } + } + + IRecipe recipe = (IRecipe) obj; + ItemStack otpt = recipe.getRecipeOutput(); + + Field out = FieldUtils.getDeclaredField(recipe.getClass(), inputName, true); + if (out == null) + out = FieldUtils.getField(recipe.getClass(), inputName, true); + + + Field in = FieldUtils.getDeclaredField(recipe.getClass(), inputItemName, true); + if (in == null) + in = FieldUtils.getField(recipe.getClass(), inputItemName, true); + if (in == null) + return; + + //directly copied from the apache commons collection, cause GTNH had problems with that particular function for some reason? + //this part here is NOT MIT LICENSED BUT LICSENSED UNDER THE Apache License, Version 2.0! + try { + if (Modifier.isFinal(in.getModifiers())) { + // Do all JREs implement Field with a private ivar called "modifiers"? + Field modifiersField = Field.class.getDeclaredField("modifiers"); + boolean doForceAccess = !modifiersField.isAccessible(); + if (doForceAccess) { + modifiersField.setAccessible(true); + } + try { + modifiersField.setInt(in, in.getModifiers() & ~Modifier.FINAL); + } finally { + if (doForceAccess) { + modifiersField.setAccessible(false); + } + } + } + } catch (NoSuchFieldException ignored) { + // The field class contains always a modifiers field + } catch (IllegalAccessException ignored) { + // The modifiers field is made accessible + } + // END OF APACHE COMMONS COLLECTION COPY + + Object input; + try { + input = in.get(obj); + } catch (IllegalAccessException e) { + e.printStackTrace(); + return; + } + + if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Platinum)) + return; + try { + out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Palladium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Palladium)) + return; + try { + out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize * 2)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Iridium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Iridium)) + return; + try { + out.set(recipe, IrLeachResidue.get(dust, otpt.stackSize)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Osmium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Osmium)) + return; + try { + out.set(recipe, IrOsLeachResidue.get(dust, otpt.stackSize)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + + @SuppressWarnings({"rawtypes","unchecked"}) + private static boolean checkRecipe(Object input,Materials mat){ + if (input instanceof List || input instanceof Object[]) { + Set lists = new HashSet(), stacks= new HashSet(); + List ip = input instanceof List ? (List)input : new ArrayList(); + Object[] ip2 = input instanceof Object[] ? (Object[])input : new Object[0]; + + for (Object o : ip){ + if (o instanceof List) + lists.add(o); + else if (o instanceof ItemStack) + stacks.add(o); + } + for (Object o : ip2){ + if (o instanceof List) + lists.add(o); + else if (o instanceof ItemStack) + stacks.add(o); + } + + for (Object o : lists) { + if (!((List) o).isEmpty()) + stacks.add(((List) o).get(0)); + } + + for (Object stack : stacks) { + if (stack instanceof ItemStack) { + if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack)) + return true; + } + } + + boolean allSame = false; + for (Object stack : stacks) { + if (stack instanceof ItemStack) { + allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); + } else { + allSame = false; + break; + } + if (!allSame) + break; + } + return allSame; + } + return false; + } + + private static boolean isInBlackList(ItemStack stack) { + if (stack == null) + return true; + + if (stack.getItem() instanceof BW_MetaGenerated_Items) + return true; + + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) + return true; + + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) + return true; + + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft") && !stack.getUnlocalizedName().contains("dust") && !stack.getUnlocalizedName().contains("Dust") ) + return true; + + if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) + return true; + + if (Arrays.stream(ItemList.values()).filter(ItemList::hasBeenSet).anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) + return true; + + if (stack.getItem() instanceof GT_Generic_Item) { + if (!BW_Util.checkStackAndPrefix(stack)) + return false; + return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + } + + if (Loader.isModLoaded("miscutils")) { + try { + if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) + return true; + if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular").isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) + return true; + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + + if (!BW_Util.checkStackAndPrefix(stack)) + return false; + + return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index e5467ea8c3..8957f2a986 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -31,9 +31,8 @@ import java.util.List; public class ThreadedLoader implements Runnable { - List<Thread> threads = new ArrayList<>(); - List<Thread> threadsInit = new ArrayList<>(); - + private List<Thread> threads = new ArrayList<>(); + private List<Thread> threadsInit = new ArrayList<>(); @Override public synchronized void run() { @@ -66,19 +65,20 @@ public class ThreadedLoader implements Runnable { WerkstoffLoader.INSTANCE.gameRegistryHandler(); } - class AllRecipes extends Thread { + static class AllRecipes extends Thread { public synchronized void run() { WerkstoffLoader.INSTANCE.run(); } + } - class MaterialGen extends Thread { + static class MaterialGen extends Thread { + public synchronized void run() { WerkstoffLoader.INSTANCE.runInit(); } - } - + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 5d73dba279..09810a54cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; @@ -33,22 +34,27 @@ import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.*; +@SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { - static final LinkedHashSet<Werkstoff> werkstoffHashSet = new LinkedHashSet<>(); + public static final LinkedHashSet<Werkstoff> werkstoffHashSet = new LinkedHashSet<>(); public static final LinkedHashMap<Short, Werkstoff> werkstoffHashMap = new LinkedHashMap<>(); + public static final LinkedHashMap<String, Werkstoff> werkstoffNameHashMap = new LinkedHashMap<>(); + private static final HashSet<Short> idHashSet = new HashSet<>(); private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new Werkstoff.GenerationFeatures().disable(); public static Werkstoff default_null_Werkstoff; - private final List<ISubTagContainer> mOreByProducts = new ArrayList<ISubTagContainer>(); - private final LinkedHashSet<Pair<ISubTagContainer, Integer>> contents = new LinkedHashSet<>(); - HashSet<SubTag> subtags = new HashSet<>(); + private final HashSet<String> ADDITIONAL_OREDICT = new HashSet<>(); + private final List<ISubTagContainer> mOreByProducts = new ArrayList<>(); + private final LinkedHashSet<Pair<ISubTagContainer, Integer>> CONTENTS = new LinkedHashSet<>(); + private final HashSet<SubTag> SUBTAGS = new HashSet<>(); private byte[] rgb = new byte[3]; private final String defaultName; private String toolTip; @@ -58,14 +64,29 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private final Werkstoff.GenerationFeatures generationFeatures; private final short mID; private final TextureSet texSet; + private Materials bridgeMaterial; + + public Materials getBridgeMaterial() { + return this.bridgeMaterial; + } + + public void setBridgeMaterial(Materials bridgeMaterial) { + this.bridgeMaterial = bridgeMaterial; + } public static void init(){ Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type,int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) { + this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, contents); + } public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, contents); } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { + this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, oreByProduct, contents); + } public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); } @@ -75,6 +96,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); + this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } @@ -84,6 +106,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { this(rgba, defaultName, toolTip, stats, type, generationFeatures, mID, texSet, contents); + this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } @@ -101,7 +124,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.mID = (short) mID; this.generationFeatures = generationFeatures; this.setRgb(BW_ColorUtil.correctCorlorArray(rgba)); - this.contents.addAll(Arrays.asList(contents)); + this.CONTENTS.addAll(Arrays.asList(contents)); this.toolTip = ""; if (toolTip.isEmpty()) { for (Pair<ISubTagContainer, Integer> p : contents) { @@ -114,7 +137,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } if (p.getKey() instanceof Werkstoff) { - if (((Werkstoff) p.getKey()).contents.size() > 1 && p.getValue() > 1) + if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1) // if (((Werkstoff) p.getKey()).toolTip != null && Character.isDigit(((Werkstoff) p.getKey()).toolTip.toCharArray()[((Werkstoff) p.getKey()).toolTip.length()-1])) this.toolTip += "(" + ((Werkstoff) p.getKey()).toolTip + ")" + (BW_Util.subscriptNumber(p.getValue())); else @@ -129,6 +152,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } } else this.toolTip = toolTip; + +// if (this.toolTip.length() > 25) +// this.toolTip = "The formula is to long..."; + if (this.stats.protons == 0) { long tmpprotons = 0; for (Pair<ISubTagContainer, Integer> p : contents) { @@ -151,16 +178,41 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } this.stats = stats.setMass(tmpmass); } + + if (this.stats.meltingPoint == 0) + this.stats.meltingPoint = 1123; + this.texSet = texSet; - if (this.getGenerationFeatures().enforceUnification) { - for (OrePrefixes prefix : OrePrefixes.values()) - BWUnificationEnforcer.addUnificationTarget(prefix+this.getDefaultName()); + switch(this.mOreByProducts.size()) { + case 0 : + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + break; + case 1: + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + break; + case 2: + this.mOreByProducts.add(this); + break; } + Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); + Werkstoff.werkstoffNameHashMap.put(this.defaultName,this); + } + + + public Werkstoff addAdditionalOreDict(String s){ + ADDITIONAL_OREDICT.add(s); + return this; } + public HashSet<String> getADDITIONAL_OREDICT() { + return ADDITIONAL_OREDICT; + } public void setTCAspects(Pair<Object,Integer>... pAspectsArr){ this.stats.mTC_Aspects=pAspectsArr; @@ -176,7 +228,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (p.getKey() instanceof Werkstoff) set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); } - tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair<Object, Integer>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); + tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); this.stats.mTC_Aspects = set.toArray(new Pair[0]); } Pair<Object,Integer>[] ret = this.stats.mTC_Aspects.clone(); @@ -186,6 +238,16 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return ret; } + public List<TC_Aspects.TC_AspectStack> getGTWrappedTCAspects() { + final List<TC_Aspects.TC_AspectStack> ret = new ArrayList<>(); + Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> { + try { + new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret); + } catch (IllegalAccessException | InvocationTargetException ignored) {} + }); + return ret; + } + public Pair<Object,Integer>[] getTCAspects(){ return this.getTCAspects(1); } @@ -194,13 +256,22 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.type; } + public boolean containsStuff(ISubTagContainer stuff){ + for (Pair<ISubTagContainer, Integer> pair : this.CONTENTS){ + if (pair.getKey().equals(stuff)) + return true; + } + return false; + } + public Pair<Integer, LinkedHashSet<Pair<ISubTagContainer, Integer>>> getContents() { int ret = 0; switch (this.type) { case COMPOUND: + case MIXTURE: case BIOLOGICAL: { - for (int i = 0; i < this.contents.toArray().length; i++) { - ret += ((Pair<ISubTagContainer, Integer>) this.contents.toArray()[i]).getValue(); + for (int i = 0; i < this.CONTENTS.toArray().length; i++) { + ret += ((Pair<ISubTagContainer, Integer>) this.CONTENTS.toArray()[i]).getValue(); } break; } @@ -208,7 +279,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { ret = 1; break; } - return new Pair<>(ret, this.contents); + return new Pair<>(ret, this.CONTENTS); } public int getNoOfByProducts() { @@ -249,6 +320,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.defaultName; } + public String getVarName() { + return this.defaultName.replaceAll(" ",""); + } + public String getToolTip() { return this.toolTip; } @@ -280,22 +355,22 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public boolean contains(SubTag subTag) { - if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS)) - for (Pair<ISubTagContainer, Integer> p : this.contents) + if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) && !subTag.equals(WerkstoffLoader.NO_BLAST)) + for (Pair<ISubTagContainer, Integer> p : this.CONTENTS) if (p.getKey().contains(subTag)) return true; - return this.subtags.contains(subTag); + return this.SUBTAGS.contains(subTag); } @Override public ISubTagContainer add(SubTag... subTags) { - this.subtags.addAll(Arrays.asList(subTags)); + this.SUBTAGS.addAll(Arrays.asList(subTags)); return this; } @Override public boolean remove(SubTag subTag) { - return this.subtags.remove(subTag); + return this.SUBTAGS.remove(subTag); } public void getAndAddToCollection(OrePrefixes prefixes,int amount,Collection<ItemStack> stacks){ @@ -307,17 +382,34 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public FluidStack getFluidOrGas(int fluidAmount) { - return new FluidStack(WerkstoffLoader.fluids.get(this),fluidAmount); + return new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(this)),fluidAmount); } public FluidStack getMolten(int fluidAmount) { - return new FluidStack(WerkstoffLoader.molten.get(this),fluidAmount); + return new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(this)),fluidAmount); } - public ItemStack get(OrePrefixes prefixes, int amount) { return WerkstoffLoader.getCorrespondingItemStack(prefixes, this, amount); } + public byte getToolQuality() { + return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride() : (byte) ( (15f * (((float)this.getStats().getProtons() / 188f) + (float) this.getStats().getMeltingPoint() / 10801f)) / (float) this.getContents().getKey() ); + } + + public float getToolSpeed() { + return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() : Math.max(1f, + 2f*((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() + ); + } + + public int getDurability() { + return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); + } + + public boolean hasItemType(OrePrefixes prefixes){ + return (this.getGenerationFeatures().toGenerate & GenerationFeatures.prefixLogic.get(prefixes)) != 0; + } + public enum Types { MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; @@ -338,14 +430,77 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { //logic gate shit /* dust 1 - metal 10 + metal 10 (ingot, nugget) gem 100 ore 1000 cell 10000 plasma 100000 molten 1000000 + crafting metal 10000000 (sticks, plates) + meta crafting metal 100000000 (gears, screws, bolts, springs) + multiple ingotWorth stuff 1000000000 (double, triple, quadruple, ingot/plates) */ - public byte toGenerate = 0b0001001; + public short toGenerate = 0b0001001; + public static final HashMap<OrePrefixes,Integer> prefixLogic = new HashMap<>(); + + static { + Arrays.stream(OrePrefixes.values()).forEach( e -> prefixLogic.put(e,0)); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,0b1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,0b1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,0b1); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot,0b10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot,0b10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget,0b10); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.lens,0b100); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged,0b1000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,0b10000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule,0b10000); + // Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bottle,0b10000); + + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.capsuleMolten,0b1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadHammer,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadWrench,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadSaw,0b10000000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGt,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGtSmall,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bolt,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.screw,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ring,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.spring,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.springSmall,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rotor,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.wireFine,0b100000000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuadruple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuintuple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDense,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotDouble,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotTriple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple,0b1000000000); + } //public byte toGenerateSecondary = 0b0000000; public byte blacklist; @@ -356,6 +511,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Auto add Chemical Recipes 1 * Auto add mixer Recipes 10 * Auto add Sifter Recipe 100 + * Auto add MetalWorking(sticks, plates) Recipe 1000 + * Auto add MetalWorking(crafting components) Recipe 10000 */ public byte extraRecipes; @@ -460,7 +617,21 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.toGenerate = (byte) (this.toGenerate | 0x4); return this; } - + public Werkstoff.GenerationFeatures addSimpleMetalWorkingItems() { + this.toGenerate = (byte) (this.toGenerate | 0b10000000); + return this; + } + public boolean hasSimpleMetalWorkingItems() { + return (this.toGenerate & 0b10000000) != 0; + } + public Werkstoff.GenerationFeatures addCraftingMetalWorkingItems() { + this.toGenerate = (byte) (this.toGenerate | 0b100000000); + return this; + } + public Werkstoff.GenerationFeatures addMultipleIngotMetalWorkingItems() { + this.toGenerate = (byte) (this.toGenerate | 0b1000000000); + return this; + } } public static class Stats { @@ -495,11 +666,54 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public int getDurOverride() { + return durOverride; + } + + public Werkstoff.Stats setDurOverride(int durOverride) { + this.durOverride = durOverride; + return this; + } + + public float getSpeedOverride() { + return speedOverride; + } + + public Werkstoff.Stats setSpeedOverride(float speedOverride) { + this.speedOverride = speedOverride; + return this; + } + + public byte getQualityOverride() { + return qualityOverride; + } + + public Werkstoff.Stats setQualityOverride(byte qualityOverride) { + this.qualityOverride = qualityOverride; + return this; + } + + byte qualityOverride; + int durOverride; + float speedOverride; + int meltingPoint; + long protons; long neutrons; long electrons; long mass; + + float durMod = 1f; + + public float getDurMod() { + return durMod; + } + + public void setDurMod(float durMod) { + this.durMod = durMod; + } + private Pair<Object,Integer>[] mTC_Aspects; //logic gate shit byte quality = ~0b1111111; @@ -509,7 +723,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } - public Werkstoff.Stats setmTC_AspectsVarArg(Pair<Object, Integer>... mTC_Aspects) { + @SafeVarargs + public final Werkstoff.Stats setmTC_AspectsVarArg(Pair<Object, Integer>... mTC_Aspects) { this.mTC_Aspects = mTC_Aspects; return this; } @@ -573,6 +788,17 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + byte enchantmentlvl = 3; + + public byte getEnchantmentlvl() { + return enchantmentlvl; + } + + public Werkstoff.Stats setEnchantmentlvl(byte enchantmentlvl) { + this.enchantmentlvl = enchantmentlvl; + return this; + } + public boolean isRadioactive() { return (this.quality & 0b100) != 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index bf3ae4bb9e..7f960e8258 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -28,13 +28,16 @@ import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; +import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import com.google.common.collect.HashBiMap; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -42,12 +45,15 @@ import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.GT_Mod; import gregtech.api.GregTech_API; +import gregtech.api.enchants.Enchantment_Radioactivity; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; +import gregtech.common.GT_Proxy; +import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; @@ -55,6 +61,7 @@ import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fluids.Fluid; @@ -62,6 +69,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import org.apache.logging.log4j.Level; import java.lang.reflect.Field; import java.util.*; @@ -70,6 +78,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; import static gregtech.api.enums.OrePrefixes.*; +@SuppressWarnings({"unchecked", "unused", "deprecation"}) public class WerkstoffLoader implements Runnable { private WerkstoffLoader() {} @@ -78,9 +87,22 @@ public class WerkstoffLoader implements Runnable { public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting"); + public static final SubTag NOBLE_GAS_SMELTING = SubTag.getNewSubTag("NobleGasSmelting"); + public static final SubTag NO_BLAST = SubTag.getNewSubTag("NoBlast"); public static OrePrefixes cellMolten; - + public static OrePrefixes capsuleMolten; + public static ItemList rotorMold; + public static ItemList rotorShape; + public static ItemList smallGearShape; + public static ItemList ringMold; + public static ItemList boltMold; + public static boolean gtnhGT = false; static { + try { + gtnhGT = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV") != null; + } catch (NoSuchFieldException ignored) {} + + //GTNH hack for molten cells for (OrePrefixes prefix : OrePrefixes.values()){ if (prefix.toString().equals("cellMolten")) WerkstoffLoader.cellMolten = prefix; @@ -91,9 +113,28 @@ public class WerkstoffLoader implements Runnable { } else { WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000; } + try { + WerkstoffLoader.rotorMold = Enum.valueOf(ItemList.class, "Shape_Mold_Rotor"); + WerkstoffLoader.rotorShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Rotor"); + WerkstoffLoader.smallGearShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Small_Gear"); + WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring"); + WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt"); + } catch (NullPointerException | IllegalArgumentException ignored){} + //add tiberium + Element t = BW_Util.createNewElement("Tr",123L, 203L, 0L, -1L, null, "Tiberium", false); + //add molten & regular capsuls + if (Loader.isModLoaded("Forestry")) { + capsuleMolten = EnumHelper.addEnum(OrePrefixes.class, "capsuleMolten", new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class}, new Object[]{"Capsule of Molten stuff", "Molten ", " Capsule", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, -1}); + capsule.mMaterialGenerationBits = 0b100000; + capsule.mDefaultStackSize = 64; + } + bottle.mDefaultStackSize = 1; } - //TODO: FREE ID RANGE: 19-32766 + //TODO: + //FREE ID RANGE: 95-30000 + //bartimaeusnek reserved 0-10000 + //Tec & basdxz reserved range 30000-32767 public static final Werkstoff Bismutite = new Werkstoff( new short[]{255, 233, 0, 0}, "Bismutite", @@ -101,7 +142,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().addGems(), 1, TextureSet.SET_FLINT, - Arrays.asList(Materials.Bismuth), + Collections.singletonList(Materials.Bismuth), new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Oxygen, 2), new Pair<>(Materials.CarbonDioxide, 2) @@ -121,9 +162,9 @@ public class WerkstoffLoader implements Runnable { new short[]{175, 175, 175, 0}, "Zirconium", "Zr", - new Werkstoff.Stats().setProtons(40), + new Werkstoff.Stats().setProtons(40).setMeltingPoint(2130), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust(), + new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), 3, TextureSet.SET_METALLIC //No Byproducts @@ -132,10 +173,11 @@ public class WerkstoffLoader implements Runnable { new short[]{255, 255, 255, 0}, "Cubic Zirconia", Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust().addGems(), + 3273, + new Werkstoff.GenerationFeatures().onlyDust().addGems().enforceUnification(), 4, TextureSet.SET_DIAMOND, - Arrays.asList(WerkstoffLoader.Zirconium), + Collections.singletonList(WerkstoffLoader.Zirconium), new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Oxygen, 2) ); @@ -160,7 +202,7 @@ public class WerkstoffLoader implements Runnable { new short[]{255,255,255,0}, "Yttrium Oxide", Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust(), //No autoadd here to gate this material by hand + new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), //No autoadd here to gate this material by hand 6, TextureSet.SET_DULL, new Pair<>(Materials.Yttrium, 2), @@ -321,14 +363,14 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures(), 18, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Thorium), + Collections.singletonList(Materials.Thorium), new Pair<>(Materials.Thorium, 1), new Pair<>(Materials.Oxygen, 2) ); public static final Werkstoff RedZircon = new Werkstoff( new short[]{195, 19, 19, 0}, "Red Zircon", - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(true).setMeltingPoint(2130), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 19, @@ -359,7 +401,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), 21, TextureSet.SET_FLINT, - Arrays.asList(Materials.Spodumene), + Collections.singletonList(Materials.Spodumene), new Pair<>(Materials.Spodumene, 1) ); public static final Werkstoff RockSalt = new Werkstoff( @@ -481,7 +523,7 @@ public class WerkstoffLoader implements Runnable { superscriptNumbers("Th232"), new Werkstoff.Stats().setRadioactive(true), Werkstoff.Types.ISOTOPE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures().disable().onlyDust().enforceUnification(), 30, TextureSet.SET_METALLIC //No Byproducts @@ -539,7 +581,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff Prasiolite = new Werkstoff( new short[]{0xD0,0xDD,0x95,0}, "Prasiolite", - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(true).setMeltingPoint(1923), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 35, @@ -659,12 +701,645 @@ public class WerkstoffLoader implements Runnable { new Pair<>(WerkstoffLoader.Neon,1), new Pair<>(Materials.Potassium,1) ); + public static final Werkstoff PTConcentrate = new Werkstoff( + Materials.Platinum.getRGBA(), + "Platinum Concentrate", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 44, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PTSaltCrude = new Werkstoff( + Materials.Platinum.getRGBA(), + "Platinum Salt", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 45, + TextureSet.SET_DULL + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PTSaltRefined = new Werkstoff( + Materials.Platinum.getRGBA(), + "Refined Platinum Salt", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 46, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PTMetallicPowder = new Werkstoff( + Materials.Platinum.getRGBA(), + "Platinum Metallic Powder", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 47, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff AquaRegia = new Werkstoff( + new short[]{0xff,0xb1,0x32}, + "Aqua Regia", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 48, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.DilutedSulfuricAcid,1), + new Pair<>(Materials.NitricAcid,1) + ); + public static final Werkstoff PTResidue = new Werkstoff( + new short[]{0x64,0x63,0x2E}, + "Platinum Residue", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 49, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff AmmoniumChloride = new Werkstoff( + new short[]{0xff,0xff,0xff}, + "Ammonium Chloride", + subscriptNumbers("NH4Cl"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 50, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.Ammonium,1), + new Pair<>(Materials.HydrochloricAcid,1) + ); + public static final Werkstoff PTRawPowder = new Werkstoff( + Materials.Platinum.getRGBA(), + "Reprecipitated Platinum", + "PtCl", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 51, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PDAmmonia = new Werkstoff( + Materials.Palladium.getRGBA(), + "Palladium Enriched Ammonia", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 52, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.Ammonium,1), + new Pair<>(Materials.Palladium,1) + ); + public static final Werkstoff PDMetallicPowder = new Werkstoff( + Materials.Palladium.getRGBA(), + "Palladium Metallic Powder", + "??Pd??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 53, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PDRawPowder = new Werkstoff( + Materials.Palladium.getRGBA(), + "Reprecipitated Palladium", + subscriptNumbers("Pd2NH4"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 54, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PDSalt = new Werkstoff( + Materials.Palladium.getRGBA(), + "Palladium Salt", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 55, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Sodiumformate = new Werkstoff( + new short[]{0xff,0xaa,0xaa}, + "Sodium Formate", + "HCOONa", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 56, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.SodiumHydroxide,1), + new Pair<>(Materials.CarbonMonoxide,1) + ); + public static final Werkstoff Sodiumsulfate = new Werkstoff( + new short[]{0xff,0xff,0xff}, + "Sodium Sulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 57, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.Sodium,2), + new Pair<>(Materials.Sulfur,1), + new Pair<>(Materials.Oxygen,4) + ); + public static final Werkstoff FormicAcid = new Werkstoff( + new short[]{0xff,0xaa,0x77}, + "Formic Acid", + subscriptNumbers("CH2O2"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 58, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.Carbon,1), + new Pair<>(Materials.Hydrogen,2), + new Pair<>(Materials.Oxygen,2) + ); + public static final Werkstoff PotassiumDisulfate = new Werkstoff( + new short[]{0xfb,0xbb,0x66}, + "Potassium Disulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addChemicalRecipes(), + 59, + TextureSet.SET_DULL, + //No Byproducts + new Pair<>(Materials.Potassium,2), + new Pair<>(Materials.Sulfur,2), + new Pair<>(Materials.Oxygen,7) + ); + public static final Werkstoff LeachResidue = new Werkstoff( + new short[]{0x64, 0x46, 0x29}, + "Leach Residue", + "??IrOsRhRu??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 60, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff RHSulfate = new Werkstoff( + new short[]{0xee,0xaa,0x55}, + "Rhodium Sulfate", + new Werkstoff.Stats().setGas(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 61, + TextureSet.SET_FLUID + //No Byproducts + ); + public static final Werkstoff RHSulfateSolution = new Werkstoff( + new short[]{0xff,0xbb,0x66}, + "Rhodium Sulfate Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 62, + TextureSet.SET_FLUID + //No Byproducts + ); + public static final Werkstoff CalciumChloride = new Werkstoff( + new short[]{0xff,0xff,0xff}, + "Calcium Chloride", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), + 63, + TextureSet.SET_DULL, + new Pair<>(Materials.Calcium,1), + new Pair<>(Materials.Chlorine,2) + //No Byproducts + ); + public static final Werkstoff Ruthenium = new Werkstoff( + new short[]{0x64,0x64,0x64}, + "Ruthenium", + "Ru", + new Werkstoff.Stats().setBlastFurnace(true).setMeltingPoint(2607).setMass(Element.Ru.getMass()).setProtons(Element.Ru.mProtons), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().onlyDust().addMolten().addMetalItems().enforceUnification(), + 64, + TextureSet.SET_METALLIC + //No Byproducts + ); + public static final Werkstoff SodiumRuthenate = new Werkstoff( + new short[]{0x3a,0x40,0xcb}, + "Sodium Ruthenate", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 65, + TextureSet.SET_SHINY, + new Pair<>(Materials.Sodium,2), + new Pair<>(Ruthenium,1), + new Pair<>(Materials.Oxygen,3) + //No Byproducts + ); + public static final Werkstoff RutheniumTetroxide = new Werkstoff( + new short[]{0xc7,0xc7,0xc7}, + "Ruthenium Tetroxide", + new Werkstoff.Stats().setMeltingPoint(313), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), + 66, + TextureSet.SET_DULL, + new Pair<>(WerkstoffLoader.Ruthenium,1), + new Pair<>(Materials.Oxygen,4) + //No Byproducts + ); + public static final Werkstoff HotRutheniumTetroxideSollution= new Werkstoff( + new short[]{0xc7,0xc7,0xc7}, + "Hot Ruthenium Tetroxide Solution", + "???", + new Werkstoff.Stats().setGas(true).setMeltingPoint(700), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 67, + TextureSet.SET_FLUID, + new Pair<>(WerkstoffLoader.Ruthenium,1), + new Pair<>(Materials.Oxygen,4), + new Pair<>(Materials.Chlorine,2), + new Pair<>(Materials.Sodium,2), + new Pair<>(Materials.Water,2) + //No Byproducts + ); + public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff( + new short[]{0xc7,0xc7,0xc7}, + "Ruthenium Tetroxide Solution", + "???", + new Werkstoff.Stats().setMeltingPoint(313), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 68, + TextureSet.SET_FLUID, + new Pair<>(Ruthenium,1), + new Pair<>(Materials.Oxygen,4), + new Pair<>(Materials.Chlorine,2), + new Pair<>(Materials.Sodium,2), + new Pair<>(Materials.Water,2) + //No Byproducts + ); + public static final Werkstoff IrOsLeachResidue = new Werkstoff( + new short[]{0x64, 0x46, 0x29}, + "Rarest Metal Residue", + "??OsIr??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 69, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff IrLeachResidue = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Iridium Metal Residue", + "??Ir??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 70, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff PGSDResidue = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Sludge Dust Residue", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 71, + TextureSet.SET_DULL, + new Pair<>(Materials.SiliconDioxide,3), + new Pair<>(Materials.Gold,2) + ); + public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Acidic Osmium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 72, + TextureSet.SET_FLUID, + new Pair<>(Materials.Osmium,1), + new Pair<>(Materials.HydrochloricAcid,1) + ); + public static final Werkstoff IridiumDioxide = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Iridium Dioxide", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 73, + TextureSet.SET_FLUID, + new Pair<>(Materials.Iridium,1), + new Pair<>(Materials.Oxygen,2) + ); + public static final Werkstoff OsmiumSolution = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Osmium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 74, + TextureSet.SET_FLUID, + new Pair<>(Materials.Osmium,1), + new Pair<>(Materials.Hydrogen,1) + ); + public static final Werkstoff AcidicIridiumSolution = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Acidic Iridium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 75, + TextureSet.SET_FLUID, + new Pair<>(Materials.Iridium,1), + new Pair<>(Materials.Hydrogen,1) + ); + public static final Werkstoff IridiumChloride = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Iridium Chloride", + subscriptNumbers("IrCl3"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 76, + TextureSet.SET_LAPIS, + new Pair<>(Materials.Iridium,1), + new Pair<>(Materials.Chlorine,3) + ); + public static final Werkstoff PGSDResidue2 = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Metallic Sludge Dust Residue", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 77, + TextureSet.SET_DULL, + new Pair<>(Materials.Nickel,1), + new Pair<>(Materials.Copper,1) + ); + public static final Werkstoff Rhodium = new Werkstoff( + new short[]{0xF4, 0xF4, 0xF4}, + "Rhodium", + "Rh", + new Werkstoff.Stats().setProtons(Element.Rh.mProtons).setMass(Element.Rh.getMass()).setBlastFurnace(true).setMeltingPoint(2237), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), + 78, + TextureSet.SET_METALLIC + ); + public static final Werkstoff CrudeRhMetall = new Werkstoff( + new short[]{0x66, 0x66, 0x66}, + "Crude Rhodium Metal", + "??Rh??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 79, + TextureSet.SET_DULL + ); + public static final Werkstoff RHSalt = new Werkstoff( + new short[]{0x84, 0x84, 0x84}, + "Rhodium Salt", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 80, + TextureSet.SET_GEM_VERTICAL + ); + public static final Werkstoff RHSaltSolution = new Werkstoff( + new short[]{0x66, 0x77, 0x88}, + "Rhodium Salt Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 81, + TextureSet.SET_FLUID + ); + public static final Werkstoff SodiumNitrate = new Werkstoff( + new short[]{0x84, 0x66, 0x84}, + "Sodium Nitrate", + subscriptNumbers("NaNO3"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), + 82, + TextureSet.SET_ROUGH, + new Pair<>(Materials.Sodium,1), + new Pair<>(Materials.NitricAcid,1) + ); + public static final Werkstoff RHNitrate = new Werkstoff( + new short[]{0x77, 0x66, 0x49}, + "Rhodium Nitrate", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 83, + TextureSet.SET_QUARTZ + ); + public static final Werkstoff ZincSulfate = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Zinc Sulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 84, + TextureSet.SET_QUARTZ, + new Pair<>(Materials.Zinc,1), + new Pair<>(Materials.Sulfur,1), + new Pair<>(Materials.Oxygen,4) + ); + public static final Werkstoff RhFilterCake = new Werkstoff( + new short[]{0x77, 0x66, 0x49}, + "Rhodium Filter Cake", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 85, + TextureSet.SET_QUARTZ + ); + public static final Werkstoff RHFilterCakeSolution = new Werkstoff( + new short[]{0x66, 0x77, 0x88}, + "Rhodium Filter Cake Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 86, + TextureSet.SET_FLUID + ); + public static final Werkstoff ReRh = new Werkstoff( + new short[]{0x77, 0x66, 0x49}, + "Reprecipitated Rhodium", + subscriptNumbers("Rh2NH4"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 87, + TextureSet.SET_QUARTZ + ); + public static final Werkstoff LuVTierMaterial = new Werkstoff( + Materials.Chrome.getRGBA(), + "Rhodium-Plated Palladium", + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + 88, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Palladium,3), + new Pair<>(WerkstoffLoader.Rhodium,1) + ); + public static final Werkstoff Tiberium = new Werkstoff( + new short[]{0x22,0xEE,0x22}, + "Tiberium", + "Tr", + new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800).setRadioactive(true).setToxic(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), + 89, + TextureSet.SET_DIAMOND + ); + public static final Werkstoff Ruridit = new Werkstoff( + new short[]{0xA4,0xA4,0xA4}, + "Ruridit", + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + 90, + TextureSet.SET_METALLIC, + new Pair<>(WerkstoffLoader.Ruthenium,2), + new Pair<>(Materials.Iridium,1) + ); + public static final Werkstoff Fluorspar = new Werkstoff( + new short[]{185,69,251}, + "Fluorspar", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 91, + TextureSet.SET_GEM_VERTICAL, + new Pair<>(Materials.Calcium,1), + new Pair<>(Materials.Fluorine,2) + ); + public static final Werkstoff HDCS = new Werkstoff( + new short[]{0x33,0x44,0x33}, + "High Durability Compound Steel", + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + 92, + TextureSet.SET_SHINY, + new Pair<>(Materials.TungstenSteel,12), + new Pair<>(Materials.HSSE,9), + new Pair<>(Materials.HSSG,6), + new Pair<>(WerkstoffLoader.Ruridit,3), + new Pair<>(WerkstoffLoader.MagnetoResonaticDust,2), + new Pair<>(Materials.Plutonium,1) + ); + public static final Werkstoff Atheneite = new Werkstoff( + new short[]{175,175,175}, + "Atheneite", + subscriptNumbers("(Pd,Hg)3As"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 93, + TextureSet.SET_SHINY, + new Pair<>(WerkstoffLoader.PDMetallicPowder,3), + new Pair<>(Materials.Mercury,3), + new Pair<>(Materials.Arsenic,1) + ); + public static final Werkstoff Temagamite = new Werkstoff( + new short[]{245,245,245}, + "Temagamite", + subscriptNumbers("Pd3HgTe"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 94, + TextureSet.SET_ROUGH, + new Pair<>(WerkstoffLoader.PDMetallicPowder,3), + new Pair<>(Materials.Mercury,1), + new Pair<>(Materials.Tellurium,1) + ); + public static final Werkstoff Terlinguaite = new Werkstoff( + new short[]{245,245,245}, + "Terlinguaite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 95, + TextureSet.SET_GEM_HORIZONTAL, + new Pair<>(Materials.Mercury,2), + new Pair<>(Materials.Chlorine,1), + new Pair<>(Materials.Oxygen,1) + ); + public static final Werkstoff AdemicSteel = new Werkstoff( + new short[]{0xcc,0xcc,0xcc}, + "Ademic Steel", + "The break in the line", + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800).setSpeedOverride(12).setQualityOverride((byte) 4), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten().addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + 96, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Steel ,2), + new Pair<>(Materials.VanadiumSteel,1), + new Pair<>(Materials.DamascusSteel,1), + new Pair<>(Materials.Carbon,4) + ); + public static final Werkstoff RawAdemicSteel = new Werkstoff( + new short[]{0xed,0xed,0xed}, + "Raw Ademic Steel", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(), + 97, + TextureSet.SET_ROUGH, + new Pair<>(Materials.Steel ,2), + new Pair<>(Materials.VanadiumSteel,1), + new Pair<>(Materials.DamascusSteel,1) + ); public static HashMap<OrePrefixes, BW_MetaGenerated_Items> items = new HashMap<>(); - public static HashMap<Werkstoff, Fluid> fluids = new HashMap<>(); - public static HashMap<Werkstoff, Fluid> molten = new HashMap<>(); + public static HashBiMap<Werkstoff, Fluid> fluids = HashBiMap.create(); + public static HashBiMap<Werkstoff, Fluid> molten = HashBiMap.create(); public static Block BWOres; + public static Block BWSmallOres; + public static Block BWBlocks; public boolean registered; + public static final HashSet<OrePrefixes> ENABLED_ORE_PREFIXES = new HashSet<>(); public static Werkstoff getWerkstoff(String Name){ try{ @@ -683,18 +1358,27 @@ public class WerkstoffLoader implements Runnable { public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { if (!werkstoff.getGenerationFeatures().enforceUnification) { - ItemStack ret = OreDictHandler.getItemStack(werkstoff.getDefaultName(), orePrefixes, amount); + ItemStack ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); if (ret != null) return ret; } if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); + else if (orePrefixes == oreSmall) + return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); + else if (orePrefixes == block) + return new ItemStack(WerkstoffLoader.BWBlocks,amount,werkstoff.getmID()); + else if (WerkstoffLoader.items.get(orePrefixes) == null) + MainMod.LOGGER.catching(Level.ERROR,new Exception("NO SUCH ITEM! "+orePrefixes+werkstoff.getVarName() +" If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + + "If you are a Developer, you forgot to enable "+orePrefixes+" OrePrefix for Werkstoff "+werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } public void init() { - if (WerkstoffLoader.INSTANCE == null) + if (WerkstoffLoader.INSTANCE == null) { MainMod.LOGGER.error("INSTANCE IS NULL THIS SHOULD NEVER HAPPEN!"); + FMLCommonHandler.instance().exitJava(1,true); + } GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore"); } @@ -714,11 +1398,10 @@ public class WerkstoffLoader implements Runnable { if (!this.registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); - ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()+1); + ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size()+1); DebugLog.log("Loading Recipes"+(System.nanoTime()-timepre)); - for (short i = 0; i < Werkstoff.werkstoffHashMap.size(); i++) { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { long timepreone = System.nanoTime(); - Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get(i); DebugLog.log("Werkstoff is null or id < 0 ? "+ (werkstoff==null || werkstoff.getmID() < 0) + " " + (System.nanoTime()-timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); @@ -737,6 +1420,16 @@ public class WerkstoffLoader implements Runnable { this.addCellRecipes(werkstoff); DebugLog.log("Loading Meltdown Recipes"+" " +(System.nanoTime()-timepreone)); this.addMoltenRecipes(werkstoff); + DebugLog.log("Loading Simple MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); + this.addSimpleMetalRecipes(werkstoff); + DebugLog.log("Loading Crafting MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); + this.addCraftingMetalRecipes(werkstoff); + DebugLog.log("Loading MultipleIngots MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); + this.addMultipleMetalRecipes(werkstoff); + DebugLog.log("Loading Metal Recipes"+" " +(System.nanoTime()-timepreone)); + this.addMetalRecipes(werkstoff); + DebugLog.log("Loading Tool Recipes"+" " +(System.nanoTime()-timepreone)); + this.addTools(werkstoff); if (Loader.isModLoaded("Thaumcraft")) { DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); @@ -756,6 +1449,10 @@ public class WerkstoffLoader implements Runnable { } private void addSubTags() { + + WerkstoffLoader.CubicZirconia.getStats().setDurOverride(Materials.Diamond.mDurability); + WerkstoffLoader.HDCS.getStats().setSpeedOverride(Materials.HSSS.mToolSpeed); + WerkstoffLoader.HDCS.getStats().setDurMod(10f); Materials.Helium.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); Materials.Argon.add(WerkstoffLoader.NOBLE_GAS); @@ -764,14 +1461,36 @@ public class WerkstoffLoader implements Runnable { Materials.Radon.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS); WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); + WerkstoffLoader.LuVTierMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING); + WerkstoffLoader.Ruridit.add(WerkstoffLoader.NOBLE_GAS_SMELTING); + WerkstoffLoader.AdemicSteel.add(WerkstoffLoader.NOBLE_GAS_SMELTING); + + WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST); + //Calcium Smelting block Materials.Calcium.mBlastFurnaceRequired=true; - for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { + Materials.Salt.mDurability = WerkstoffLoader.Salt.getDurability(); + Materials.Spodumene.mDurability = WerkstoffLoader.Spodumen.getDurability(); + Materials.RockSalt.mDurability = WerkstoffLoader.RockSalt.getDurability(); + Materials.Calcium.mDurability = WerkstoffLoader.Calcium.getDurability(); + + Materials.Salt.mToolSpeed = WerkstoffLoader.Salt.getToolSpeed(); + Materials.Spodumene.mToolSpeed = WerkstoffLoader.Spodumen.getToolSpeed(); + Materials.RockSalt.mToolSpeed = WerkstoffLoader.RockSalt.getToolSpeed(); + Materials.Calcium.mToolSpeed = WerkstoffLoader.Calcium.getToolSpeed(); + + Materials.Salt.mToolQuality = WerkstoffLoader.Salt.getToolQuality(); + Materials.Spodumene.mToolQuality = WerkstoffLoader.Spodumen.getToolQuality(); + Materials.RockSalt.mToolQuality = WerkstoffLoader.RockSalt.getToolQuality(); + Materials.Calcium.mToolQuality = WerkstoffLoader.Calcium.getToolQuality(); + + for (Werkstoff W : Werkstoff.werkstoffHashSet) { for (Pair<ISubTagContainer, Integer> pair : W.getContents().getValue().toArray(new Pair[0])) { if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) { @@ -821,7 +1540,7 @@ public class WerkstoffLoader implements Runnable { } for (OrePrefixes p : values()) if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { - MainMod.LOGGER.info("Found: "+(p+werkstoff.getDefaultName().replaceAll(" ",""))+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); + DebugLog.log("Found: "+(p+werkstoff.getVarName())+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); @@ -835,6 +1554,7 @@ public class WerkstoffLoader implements Runnable { } if ((WerkstoffLoader.toGenerateGlobal & 0b10) != 0) { WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); + WerkstoffLoader.items.put(ingotHot, new BW_MetaGenerated_Items(ingotHot)); //1750 WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100) != 0) { @@ -857,31 +1577,221 @@ public class WerkstoffLoader implements Runnable { if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); //WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - //WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + if (Loader.isModLoaded("Forestry")) + WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { - WerkstoffLoader.items.put(cellMolten, new BW_MetaGenerated_Items(cellMolten)); + WerkstoffLoader.items.put(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); + if (Loader.isModLoaded("Forestry")) + WerkstoffLoader.items.put(capsuleMolten, new BW_MetaGenerated_Items(capsuleMolten)); + } + if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { + WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); + WerkstoffLoader.items.put(stick, new BW_MetaGenerated_Items(stick)); + WerkstoffLoader.items.put(stickLong, new BW_MetaGenerated_Items(stickLong)); + WerkstoffLoader.items.put(toolHeadWrench, new BW_MetaGenerated_Items(toolHeadWrench)); + WerkstoffLoader.items.put(toolHeadHammer, new BW_MetaGenerated_Items(toolHeadHammer)); + WerkstoffLoader.items.put(toolHeadSaw, new BW_MetaGenerated_Items(toolHeadSaw)); + } + if ((WerkstoffLoader.toGenerateGlobal & 0b100000000) != 0) { + WerkstoffLoader.items.put(gearGt, new BW_MetaGenerated_Items(gearGt)); + WerkstoffLoader.items.put(gearGtSmall, new BW_MetaGenerated_Items(gearGtSmall)); + WerkstoffLoader.items.put(bolt, new BW_MetaGenerated_Items(bolt)); + WerkstoffLoader.items.put(screw, new BW_MetaGenerated_Items(screw)); + WerkstoffLoader.items.put(ring, new BW_MetaGenerated_Items(ring)); + WerkstoffLoader.items.put(spring, new BW_MetaGenerated_Items(spring)); + WerkstoffLoader.items.put(springSmall, new BW_MetaGenerated_Items(springSmall)); + WerkstoffLoader.items.put(rotor, new BW_MetaGenerated_Items(rotor)); + WerkstoffLoader.items.put(wireFine, new BW_MetaGenerated_Items(wireFine)); + } + if ((WerkstoffLoader.toGenerateGlobal & 0b1000000000) != 0) { + WerkstoffLoader.items.put(plateDouble, new BW_MetaGenerated_Items(plateDouble)); + WerkstoffLoader.items.put(plateTriple, new BW_MetaGenerated_Items(plateTriple)); + WerkstoffLoader.items.put(plateQuadruple, new BW_MetaGenerated_Items(plateQuadruple)); + WerkstoffLoader.items.put(plateQuintuple, new BW_MetaGenerated_Items(plateQuintuple)); + WerkstoffLoader.items.put(plateDense, new BW_MetaGenerated_Items(plateDense)); + WerkstoffLoader.items.put(ingotDouble, new BW_MetaGenerated_Items(ingotDouble)); + WerkstoffLoader.items.put(ingotTriple, new BW_MetaGenerated_Items(ingotTriple)); + WerkstoffLoader.items.put(ingotQuadruple, new BW_MetaGenerated_Items(ingotQuadruple)); + WerkstoffLoader.items.put(ingotQuintuple, new BW_MetaGenerated_Items(ingotQuintuple)); } + ENABLED_ORE_PREFIXES.addAll(WerkstoffLoader.items.keySet()); + ENABLED_ORE_PREFIXES.add(ore); + ENABLED_ORE_PREFIXES.add(oreSmall); + WerkstoffLoader.runGTItemDataRegistrator(); } - - - public void gameRegistryHandler(){ + void gameRegistryHandler(){ if (FMLCommonHandler.instance().getSide().isClient()) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); + GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); + GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); - GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); - WerkstoffLoader.runGTItemDataRegistrator(); + WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); + WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron,BW_MetaGenerated_WerkstoffBlock_TE.class,"bw.werkstoffblocks"); + GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); + GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); + GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); + new GTMetaItemEnhancer(); } - public static void runGTItemDataRegistrator(){ + private static void runGTItemDataRegistrator() { + // HashSet<Materials> toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - GT_OreDictUnificator.addAssociation(ore,Materials._NULL,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),true); + //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); + for (OrePrefixes prefixes : values()) { + if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { + if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + boolean ElementSet = false; + for (Element e : Element.values()) { + if (e.toString().equals(werkstoff.getToolTip())) { + if (e.mLinkedMaterials.size() > 0) + break; + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials = new ArrayList<>(); + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) { + GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + } + ElementSet = true; + break; + } + } + if (!ElementSet) + continue; +// try { +// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); +// f.setAccessible(true); +// Map<String, Materials> MATERIALS_MAP = (Map<String, Materials>) f.get(null); +// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); +// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { +// e.printStackTrace(); +// } + if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) { + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + } + } + } + + if (werkstoff.getGenerationFeatures().hasCells()) { + werkstoffBridgeMaterial.setHasCorrespondingFluid(true); + werkstoffBridgeMaterial.setHasCorrespondingGas(true); + werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); + werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); + } + if (werkstoff.getGenerationFeatures().hasMolten()) { + werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); + } + werkstoffBridgeMaterial.mName = werkstoff.getVarName(); + werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); + try { + Field f = Materials.class.getField("mLocalizedName"); + f.set(werkstoffBridgeMaterial, werkstoff.getDefaultName()); + } catch (NoSuchFieldException | IllegalAccessException ignored){} + werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); + if (Loader.isModLoaded("Thaumcraft")) + werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); + werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; + werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; + //toRem.add(werkstoffBridgeMaterial); + if (werkstoff.getStats().isRadioactive()){ + werkstoffBridgeMaterial.setEnchantmentForArmors(Enchantment_Radioactivity.INSTANCE,werkstoff.getStats().getEnchantmentlvl()); + werkstoffBridgeMaterial.setEnchantmentForTools(Enchantment_Radioactivity.INSTANCE,werkstoff.getStats().getEnchantmentlvl()); + } + werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); + if (WerkstoffLoader.items.get(prefixes) != null) + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); + } + } } +// try { +// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); +// f.setAccessible(true); +// Map<String, Materials> MATERIALS_MAP = (Map<String, Materials>) f.get(null); +// for (Materials o : toRem) +// MATERIALS_MAP.remove(o.mName); +// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { +// e.printStackTrace(); +// } + } + + private void addTools(Werkstoff werkstoff){ + if (werkstoff.getBridgeMaterial().mDurability == 0) + return; + + if (werkstoff.getGenerationFeatures().hasGems()){ + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', OrePrefixes.gem.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', OrePrefixes.gem.get(werkstoff.getBridgeMaterial())}); + } + + if (!werkstoff.getGenerationFeatures().hasSimpleMetalWorkingItems()) + return; + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'W', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'T', OrePrefixes.screw.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'T', OrePrefixes.screw.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.AnyRubber), 'S', OrePrefixes.stick.get(Materials.Iron), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); + if (gtnhGT) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(162, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.AnyRubber), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(164, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.StyreneButadieneRubber), 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); + } + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{ 800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + if (gtnhGT) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{ 800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + } + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', OrePrefixes.ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', OrePrefixes.screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + + if (!werkstoff.getGenerationFeatures().hasGems()) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); + } + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + + // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(OrePrefixes.ingot)}); } public static void removeIC2Recipes() { @@ -892,6 +1802,10 @@ public class WerkstoffLoader implements Runnable { if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) { remset.add(curr); } + for (ItemStack stack : curr.getValue().items){ + if (stack.getItem() instanceof BW_MetaGenerated_Items) + remset.add(curr); + } } } Recipes.macerator.getRecipes().entrySet().removeAll(remset); @@ -904,18 +1818,39 @@ public class WerkstoffLoader implements Runnable { if (ConfigHandler.experimentalThreadedLoader){ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().hasOres()) - OreDictAdder.addToMap(new Pair<>(ore + werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.get(ore))); + OreDictAdder.addToMap(new Pair<>(ore + werkstoff.getVarName(), werkstoff.get(ore))); if (werkstoff.getGenerationFeatures().hasGems()) OreDictAdder.addToMap(new Pair<>("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens))); + if (werkstoff.getADDITIONAL_OREDICT().size() > 0) + werkstoff.getADDITIONAL_OREDICT() + .forEach(s -> ENABLED_ORE_PREFIXES + .stream() + .filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); } - OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite))); } else { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if (werkstoff.getGenerationFeatures().hasOres()) - GT_OreDictUnificator.registerOre(ore + werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.get(ore)); + if (werkstoff.getGenerationFeatures().hasOres()) { + GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); + GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); + werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(ore+e, werkstoff.get(ore))); + werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(oreSmall+e, werkstoff.get(oreSmall))); + } + if (werkstoff.getGenerationFeatures().hasGems()) OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + + if (werkstoff.getGenerationFeatures().hasGems() || (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ + GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); + werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(block+e, werkstoff.get(block))); + } + + werkstoff.getADDITIONAL_OREDICT() + .forEach(s -> ENABLED_ORE_PREFIXES + .stream() + .filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); } GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); @@ -926,6 +1861,8 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasGems()) { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { + GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block),werkstoff.get(gem, 9), 100, 24); GT_Values.RA.addSifterRecipe( werkstoff.get(crushedPurified), new ItemStack[]{ @@ -961,15 +1898,18 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed), werkstoff.get(gemChipped, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); + } - if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0) { + if (werkstoff.hasItemType(plate)) { GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); + GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate,9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); } GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); @@ -986,6 +1926,121 @@ public class WerkstoffLoader implements Runnable { } } + private void addSimpleMetalRecipes(Werkstoff werkstoff) { + if (werkstoff.hasItemType(plate)) { + if (werkstoff.hasItemType(gem)) { + GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall,2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + return; + } + + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(plate), GT_Proxy.tBits, new Object[]{"h", "X", "X", 'X', werkstoff.get(ingot)}); + + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot),GT_Utility.getIntegratedCircuit(1)},new ItemStack[]{werkstoff.get(plate)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24,0)); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot,3), werkstoff.get(plate,2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + GregTech_API.registerCover(werkstoff.get(plate), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); + + GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall,2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Plate.get(0),werkstoff.get(plate),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Rod.get(0),werkstoff.get(stick,2),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot),new ItemStack[]{werkstoff.get(dust)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate),new ItemStack[]{werkstoff.get(dust)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong),new ItemStack[]{werkstoff.get(dust)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick),new ItemStack[]{werkstoff.get(dustSmall,2)},null,2,8); + } + } + + private void addCraftingMetalRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(screw)) != 0) { + int tVoltageMultiplier = werkstoff.getStats().meltingPoint >= 2800 ? 60 : 15; + + //bolt + GT_Values.RA.addExtruderRecipe(werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt,8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); + GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt,4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); + + //screw + GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw),null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); + GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)}); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); + + if (werkstoff.getGenerationFeatures().hasGems()) + return; + + //ring + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring,4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); + GT_ModHandler.addCraftingRecipe(werkstoff.get(ring), GT_Proxy.tBits, new Object[]{"h ", "fX", 'X', werkstoff.get(stick)}); + + //Gear + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)}); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); + + //wireFine + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine,8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine,8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine,4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); + + //smallGear + if (WerkstoffLoader.smallGearShape != null) + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().mass, 8 * tVoltageMultiplier); + if (ConfigHandler.GTNH) + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx"," S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); + else + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P "," h ", 'P', werkstoff.get(plate)}); + + //Rotor + GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[]{"PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw)}); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24); + + if (WerkstoffLoader.rotorShape != null) + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); + + //molten -> metal + if (werkstoff.getGenerationFeatures().hasMolten()) { + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); + if (WerkstoffLoader.ringMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.ringMold.get(0L), werkstoff.getMolten(36), werkstoff.get(ring), 100, 4 * tVoltageMultiplier); + if (WerkstoffLoader.boltMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.boltMold.get(0L), werkstoff.getMolten(18), werkstoff.get(bolt), 50, 2 * tVoltageMultiplier); + + if (WerkstoffLoader.rotorMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + } + + GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt),new ItemStack[]{werkstoff.get(dust,4)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall),new ItemStack[]{werkstoff.get(dust,1)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor),new ItemStack[]{werkstoff.get(dust,4),werkstoff.get(dustSmall)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring),new ItemStack[]{werkstoff.get(dustSmall,1)},null,2,8); + } + } + + private void addMetalRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(ingot)) != 0) { + GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9),ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().mass, 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().mass/2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + } + } + + private void addMultipleMetalRecipes(Werkstoff werkstoff){ + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(plateDense)) != 0) { + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot,2),GT_Utility.getIntegratedCircuit(2)},new ItemStack[]{werkstoff.get(plateDouble)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60,0)); + GregTech_API.registerCover(werkstoff.get(plateDouble), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble),new ItemStack[]{werkstoff.get(dust,2)},null,2,8); + } + } + private void addDustRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0) { List<FluidStack> flOutputs = new ArrayList<>(); @@ -993,10 +2048,10 @@ public class WerkstoffLoader implements Runnable { HashMap<ISubTagContainer, Pair<Integer, Integer>> tracker = new HashMap<>(); int cells = 0; - if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { for (Pair<ISubTagContainer, Integer> container : werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + if (((Materials) container.getKey()).getGas(0) != null || ((Materials) container.getKey()).getFluid(0) != null || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); @@ -1013,8 +2068,26 @@ public class WerkstoffLoader implements Runnable { cells += container.getValue(); } } else { - if (((Materials) container.getKey()).getDust(container.getValue()) == null ) - continue; + if (((Materials) container.getKey()).getDust(container.getValue()) == null ) { + if (((Materials) container.getKey()).getCells(container.getValue()) != null && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { + FluidStack tmpFl = ((Materials) container.getKey()).getMolten(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Materials) container.getKey()).getSolid(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } else + continue; + } if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); @@ -1056,18 +2129,19 @@ public class WerkstoffLoader implements Runnable { ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); } } @@ -1086,58 +2160,41 @@ public class WerkstoffLoader implements Runnable { "T ", 'T', werkstoff.get(dust) }); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny,9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall,4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny,9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall,4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0){ if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)){ - GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.get(ingot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + } + else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); } else { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); if (werkstoff.getStats().meltingPoint <= 1000) { GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint); GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().meltingPoint); } } } + + if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint > 1750){ + GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot),werkstoff.get(ingot),(int) Math.max(werkstoff.getStats().mass * 3L, 1L)); + } + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); } - - if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { - Materials werkstoffBridgeMaterial = null; - boolean ElementSet = false; - for (Element e : Element.values()){ - if (e.toString().equals(werkstoff.getToolTip())){ - if (e.mLinkedMaterials.size() > 0) - break; - werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); - werkstoffBridgeMaterial.mElement = e; - e.mLinkedMaterials.add(werkstoffBridgeMaterial); - ElementSet = true; - break; - } - } - if (!ElementSet) - return; - - GT_OreDictUnificator.addAssociation(dust,werkstoffBridgeMaterial, werkstoff.get(dust),true); - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map<String, Materials> MATERIALS_MAP = (Map<String, Materials>) f.get(null); - MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(dust)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null,new ItemStack[]{werkstoff.get(dust)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 || werkstoff.getGenerationFeatures().hasGems() ){ + GT_ModHandler.addPulverisationRecipe(werkstoff.get(block),werkstoff.get(dust, 9)); } } } @@ -1220,11 +2277,107 @@ public class WerkstoffLoader implements Runnable { if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) == 0) return; +// if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { +// List<FluidStack> flOutputs = new ArrayList<>(); +// List<ItemStack> stOutputs = new ArrayList<>(); +// HashMap<ISubTagContainer, Pair<Integer, Integer>> tracker = new HashMap<>(); +// int cells = 0; +// for (Pair<ISubTagContainer, Integer> container : werkstoff.getContents().getValue().toArray(new Pair[0])) { +// if (container.getKey() instanceof Materials) { +// if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { +// FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); +// if (tmpFl == null || tmpFl.getFluid() == null) { +// tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); +// } +// flOutputs.add(tmpFl); +// if (flOutputs.size() > 1) { +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// cells += container.getValue(); +// } +// } else { +// if (((Materials) container.getKey()).getDust(container.getValue()) == null) +// continue; +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// } +// } else if (container.getKey() instanceof Werkstoff) { +// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) { +// FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); +// if (tmpFl == null || tmpFl.getFluid() == null) { +// tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); +// } +// flOutputs.add(tmpFl); +// if (flOutputs.size() > 1) { +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// cells += container.getValue(); +// } +// } else { +// if (!((Werkstoff) container.getKey()).getGenerationFeatures().hasDusts()) +// continue; +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// } +// } +// } +// ItemStack input = werkstoff.get(cell); +// input.stackSize = werkstoff.getContents().getKey(); +// cells += werkstoff.getContents().getKey(); +// stOutputs.add(Materials.Empty.getCells(cells)); +// if (werkstoff.getStats().isElektrolysis()) +// GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); +// if (werkstoff.getStats().isCentrifuge()) +// GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); +// if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { +// if (cells > 0) +// stOutputs.add(Materials.Empty.getCells(cells)); +// GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); +// } +// if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { +// if (cells > 0) +// stOutputs.add(Materials.Empty.getCells(cells)); +// GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); +// } +// } + //Tank "Recipe" - GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); + GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); + FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(),werkstoff.get(cell),Materials.Empty.getCells(1)); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000)); + + if (Loader.isModLoaded("Forestry")) { + FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); + GT_Utility.addFluidContainerData(emptyData); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000)); + } - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(fluids.get(werkstoff),1000), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(fluids.get(werkstoff),1000)); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){ + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,(int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30); + } if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { Materials werkstoffBridgeMaterial = null; @@ -1240,21 +2393,21 @@ public class WerkstoffLoader implements Runnable { } if (!ElementSet) return; - - GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map<String, Materials> MATERIALS_MAP = (Map<String, Materials>) f.get(null); - MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } + + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),false); +// try { +// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); +// f.setAccessible(true); +// Map<String, Materials> MATERIALS_MAP = (Map<String, Materials>) f.get(null); +// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); +// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { +// e.printStackTrace(); +// } ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); } } private void addMoltenRecipes(Werkstoff werkstoff) { @@ -1262,21 +2415,37 @@ public class WerkstoffLoader implements Runnable { return; //Tank "Recipe" - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.molten.get(werkstoff), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1)); + final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144),werkstoff.get(cell),Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(molten.get(werkstoff),144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(molten.get(werkstoff),144)); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)),144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)),144)); + + if (Loader.isModLoaded("Forestry")) { + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144)); + } if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick),null,werkstoff.getMolten(72),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0){ + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block),null,werkstoff.getMolten(1296),0,288, 8); } } }
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 0acd99df2d..a585f8291b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -23,11 +23,14 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; +import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.LuVTierEnhancer; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -35,6 +38,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; import java.util.Map; @@ -45,9 +49,12 @@ import static gregtech.api.enums.OrePrefixes.*; public class AdditionalRecipes implements Runnable { @Override + @SuppressWarnings("deprecation") public void run() { + GT_Values.RA.addImplosionRecipe(WerkstoffLoader.RawAdemicSteel.get(dust),4,WerkstoffLoader.AdemicSteel.get(dust),null); + ((BWRecipes.BW_Recipe_Map_LiquidFuel)BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(),40); //Thorium/Yttrium Glas - GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800, BW_Util.getMachineVoltageFromTier(5),3663); + GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall, 2), WerkstoffLoader.Thorianit.get(dustSmall, 2), Materials.Glass.getMolten(144), null, new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, BW_Util.getMachineVoltageFromTier(5), 3663); //Thorianit recipes GT_Values.RA.addSifterRecipe(WerkstoffLoader.Thorianit.get(crushedPurified), new ItemStack[]{ @@ -57,73 +64,110 @@ public class AdditionalRecipes implements Runnable { Materials.Thorium.getDust(1), Materials.Thorium.getDust(1), WerkstoffLoader.Thorium232.get(dust), - }, new int[]{7000,1300,700,600,300,100}, + }, new int[]{7000, 1300, 700, 600, 300, 100}, 400, BW_Util.getMachineVoltageFromTier(5) - ); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Aluminium.getDust(1),Materials.Thorium.getDust(1),1000); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Magnesium.getDust(1),Materials.Thorium.getDust(1),1000); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9),Materials.Water.getFluid(1000),Materials.Thorium.getMolten(144),WerkstoffLoader.Thorianit.get(crushedPurified,4),96,24); + ); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Aluminium.getDust(1), Materials.Thorium.getDust(1), 1000); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Magnesium.getDust(1), Materials.Thorium.getDust(1), 1000); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9), Materials.Water.getFluid(1000), Materials.Thorium.getMolten(144), WerkstoffLoader.Thorianit.get(crushedPurified, 4), 96, 24); //Prasiolite - GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),GT_Values.NF,GT_Values.NF,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800, BW_Util.getMachineVoltageFromTier(2),500); - GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),6,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800); + GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), GT_Values.NF, GT_Values.NF, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, BW_Util.getMachineVoltageFromTier(2), 500); + GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), 6, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800); //Cubic Circonia - GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4)); - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); + GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), null, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1)); + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 57600, BW_Util.getMachineVoltageFromTier(3), 2953); //Tellurium - GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800, BW_Util.getMachineVoltageFromTier(2),722); - GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250,49152, 480000000); - GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500,49152, 600000000); - GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000),new FluidStack[]{Materials.Nitrogen.getGas(78084000),Materials.Oxygen.getGas(20946000),Materials.Argon.getGas(934000),Materials.CarbonDioxide.getGas(40700),WerkstoffLoader.Neon.getFluidOrGas(1818),Materials.Helium.getGas(524),Materials.Methane.getGas(180),WerkstoffLoader.Krypton.getFluidOrGas(114),Materials.Hydrogen.getGas(55),WerkstoffLoader.Xenon.getFluidOrGas(9)},null,7500, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Neon.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gemChipped,9),9000,4500, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Krypton.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gem),10000,4500, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722); + GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250, 49152, 480000000); + GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); + GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000), new FluidStack[]{Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9)}, null, 7500, BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Neon.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), 9000, 4500, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Krypton.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gem), 10000, 4500, BW_Util.getMachineVoltageFromTier(5)); + //Milk + //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphor.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); for (int i = 0; i <= 6; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe(false, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - BW_Meta_Items.getNEWCIRCUITS().getStack(i+3), - ItemList.Circuit_Parts_DiodeSMD.get((i+1)*4), - ItemList.Circuit_Parts_CapacitorSMD.get((i+1)*4), - ItemList.Circuit_Parts_TransistorSMD.get((i+1)*4) - }, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(i+4) - },null,null, - new FluidStack[]{ - Materials.SolderingAlloy.getMolten((i+1)*36) - },null,(i+1)*750, BW_Util.getMachineVoltageFromTier((i+1)),CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe(false, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 1) * 4) + }, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) + }, null, null, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten((i + 1) * 36) + }, null, (i + 1) * 750, BW_Util.getMachineVoltageFromTier((i + 1)), CLEANROOM)); } for (int i = 7; i <= 10; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite,(2)), - BW_Meta_Items.getNEWCIRCUITS().getStack(i+3), - ItemList.Circuit_Parts_DiodeSMD.get((i+6)*4), - ItemList.Circuit_Parts_CapacitorSMD.get((i+6)*4), - ItemList.Circuit_Parts_TransistorSMD.get((i+6)*4) + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) }, new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(i+4) - },null,null, + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) + }, null, null, new FluidStack[]{ - Materials.SolderingAlloy.getMolten((i+1)*144) - },null,(i+1)*1500, BW_Util.getMachineVoltageFromTier(i+1),CLEANROOM)); + Materials.SolderingAlloy.getMolten((i + 1) * 144) + }, null, (i + 1) * 1500, BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); } + GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(bolt)}, new ItemStack[]{}, null, null, null, 0, 0, 12500); + GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 62500); + + try{ + Class<GT_Recipe.GT_Recipe_Map> map = GT_Recipe.GT_Recipe_Map.class; + GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sHugeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sExtremeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sUltraHugeNaquadahReactorFuels").get(null); + sHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); + sExtremeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 31250); + sUltraHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); + }catch (NullPointerException | IllegalAccessException ignored){} + + new LoadItemContainers().run(); + + GT_Values.RA.addCannerRecipe(ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), WerkstoffLoader.Tiberium.get(dust,3), BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), null, 30, 16); + GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), 100, 400); + GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 150, 400); + GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 100, 400); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[]{ItemList.NaquadahCell_1.get(32L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), + WerkstoffLoader.Tiberium.get(dust,64), + WerkstoffLoader.Tiberium.get(dust,64) + },null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6)); + + GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); + AdditionalRecipes.oldGThelperMethod(); + } + @SuppressWarnings("unchecked") + private static void oldGThelperMethod() { //manual override for older GT Werkstoff werkstoff = WerkstoffLoader.Oganesson; Materials werkstoffBridgeMaterial = null; boolean aElementSet = false; - for (Element e : Element.values()){ - if (e.toString().equals("Uuo")){ - werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + for (Element e : Element.values()) { + if (e.toString().equals("Uuo")) { + werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); aElementSet = true; @@ -133,7 +177,7 @@ public class AdditionalRecipes implements Runnable { if (!aElementSet) return; - GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); + GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); try { Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); f.setAccessible(true); @@ -143,9 +187,9 @@ public class AdditionalRecipes implements Runnable { e.printStackTrace(); } ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); - } + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + } }
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java new file mode 100644 index 0000000000..09de02eeb2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2018-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.system.material.processingLoaders; + +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_OreDictUnificator; + +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; + +public class AfterLuVTierEnhacement implements Runnable { + + @Override + public void run() { + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(1), + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Tiberium.get(dustSmall,2), + WerkstoffLoader.Zirconium.get(dust,2), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), + new int[]{10_000,5_000,5_000,2_500,10_000,10_000},250,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(2), + WerkstoffLoader.Zirconium.get(dust,2), + WerkstoffLoader.Zirconium.get(dust,2), + WerkstoffLoader.Tiberium.get(dust), + WerkstoffLoader.Zirconium.get(dust,4), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), + new int[]{10_000,5_000,5_000,2_500,10_000,10_000},500,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(4), + WerkstoffLoader.Zirconium.get(dust,4), + WerkstoffLoader.Zirconium.get(dust,4), + WerkstoffLoader.Tiberium.get(dust,2), + WerkstoffLoader.Zirconium.get(dust,8), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), + new int[]{10_000,5_000,5_000,2_500,10_000,10_000},1000,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), null,null,null, + ItemList.Depleted_Naquadah_4.get(8), + WerkstoffLoader.Zirconium.get(dust,64), + WerkstoffLoader.Zirconium.get(dust,64), + null, + null, + null, + new int[]{10_000,5_000,5_000},2000,8000); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index 1ed1cb0b83..c5295eab6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java new file mode 100644 index 0000000000..f2edb3b32d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-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.system.material.processingLoaders; + +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; +import gregtech.api.items.GT_RadioactiveCellIC_Item; +import gregtech.common.items.GT_DepletetCell_Item; + +public class LoadItemContainers implements Runnable { + + @Override + public void run() { + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.TiberiumCell_1.set(new GT_RadioactiveCellIC_Item("Tiberiumcell", "Fuel Rod (Tiberium)", 1, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), false)); + BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item("Double_Tiberiumcell", "Dual Fuel Rod (Tiberium)", 2, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), false)); + BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item("Quad_Tiberiumcell", "Quad Fuel Rod (Tiberium)", 4, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), false)); + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.set(new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); + BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item("Core_Reactor_Cell", "\"The Core\" Cell", 32, 100000, 8F, 32, 1F, BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), false)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java index a46b3b1067..2aeb8cef35 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -69,7 +69,7 @@ public class AbstractedStack implements Serializable { public AbstractedStack(ItemStack itemStack) { if (itemStack == null) throw new UnsupportedOperationException(); - this.idDamage = new Pair<Integer,Short>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); + this.idDamage = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); this.mTag = itemStack.getTagCompound(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index 61a1d33d08..9269762a22 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -37,6 +37,7 @@ public class OreDictAdder { OreDictAdder.toAddMap.put(element.getKey(),element.getValue()); } + @SafeVarargs public static synchronized void addToMap(Pair<String, ItemStack>... elements){ for (Pair<String, ItemStack> p : elements) OreDictAdder.toAddMap.put(p.getKey(),p.getValue()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 6bc3627e7c..9aa46ae3b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index ebc432d1b5..5d86ecf88e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -23,9 +23,9 @@ package com.github.bartimaeusnek.bartworks.system.oregen; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.*; +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; @@ -33,11 +33,13 @@ import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -47,12 +49,15 @@ import java.util.Random; */ public abstract class BW_OreLayer extends GT_Worldgen { public static final List<BW_OreLayer> sList = new ArrayList<>(); + public static final ArrayListMultimap<Short,BW_OreLayer> NEIMAP = ArrayListMultimap.create(); private static final boolean logOregenRoss128 = false; public static int sWeight; public byte bwOres; public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; public abstract Block getDefaultBlockToReplace(); + public abstract int[] getDefaultDamageToReplace(); + public abstract String getDimName(); public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, BW_OreLayer.sList, aDefault); @@ -98,11 +103,24 @@ public abstract class BW_OreLayer extends GT_Worldgen { this.mSecondaryMeta = aSecondary; this.mBetweenMeta = aBetween; this.mSporadicMeta = aSporadic; + NEIMAP.put((short) this.mPrimaryMeta,this); + NEIMAP.put((short) this.mSecondaryMeta,this); + NEIMAP.put((short) this.mBetweenMeta,this); + NEIMAP.put((short) this.mSporadicMeta,this); + } + public List<ItemStack> getStacks(){ + ArrayList<ItemStack> ret = new ArrayList<>(); + ret.add((this.bwOres & 0b1000) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mPrimaryMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mPrimaryMeta)); + ret.add((this.bwOres & 0b0100) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mSecondaryMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mSecondaryMeta)); + ret.add((this.bwOres & 0b0010) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mBetweenMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mBetweenMeta)); + ret.add((this.bwOres & 0b0001) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mSporadicMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mSporadicMeta)); + return ret; } @Override public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { { + int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); int cX = aChunkX - aRandom.nextInt(this.mSize); int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); @@ -156,7 +174,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { return true; if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { - return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace()); + return isSmallOre ? BW_MetaGenerated_SmallOres.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()) : BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()); } return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace()); @@ -184,4 +202,28 @@ public abstract class BW_OreLayer extends GT_Worldgen { }else return true; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof BW_OreLayer)) return false; + + BW_OreLayer that = (BW_OreLayer) o; + + if (bwOres != that.bwOres) return false; + if (mMinY != that.mMinY) return false; + if (mWeight != that.mWeight) return false; + if (mDensity != that.mDensity) return false; + if (mSize != that.mSize) return false; + if (mMaxY != that.mMaxY) return false; + if (mPrimaryMeta != that.mPrimaryMeta) return false; + if (mSecondaryMeta != that.mSecondaryMeta) return false; + if (mBetweenMeta != that.mBetweenMeta) return false; + return mSporadicMeta == that.mSporadicMeta; + } + + @Override + public int hashCode() { + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(37).put(bwOres).putInt(mMinY).putInt(mWeight).putInt(mDensity).putInt(mSize).putInt(mMaxY).putInt(mPrimaryMeta).putInt(mSecondaryMeta).putInt(mBetweenMeta).putInt(mSporadicMeta).array(),0,37,31); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 2cc26fe8cc..3def3800d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -101,17 +101,19 @@ public class BW_WordGenerator implements IWorldGenerator { for (int i = 0; (i < 256) && (temp); i++) { tRandomWeight = random.nextInt(BW_OreLayer.sWeight); for (BW_OreLayer tWorldGen : BW_OreLayer.sList) { + if (!tWorldGen.isGenerationAllowed(this.mWorld, this.mDimensionType, this.mDimensionType)) + continue; tRandomWeight -= tWorldGen.mWeight; if (tRandomWeight <= 0) { try { boolean placed; int attempts = 0; - do{ + do { placed = tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider); ++attempts; } while ((!placed) && attempts < 25); - temp = false; + temp = false; break; } catch (Throwable e) { e.printStackTrace(GT_Log.err); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 1dc9e080c4..b8fda6a8dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -40,11 +40,21 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { return Blocks.stone; } + @Override + public int[] getDefaultDamageToReplace() { + return new int[]{0}; + } + + @Override + public String getDimName() { + return StatCollector.translateToLocal("planet.Ross128b"); + } + public BW_WorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } - public static void init_OresRoss128() { + public static void initOres() { new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene); new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite); new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite); @@ -54,10 +64,10 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, Forsterit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, Hedenbergit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit,FuchsitAL , RedZircon,FuchsitCR); + new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); } - public static void init_undergroundFluidsRoss128() { + public static void initundergroundFluids() { String ross128b = StatCollector.translateToLocal("planet.Ross128b"); uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 32767, 5, 5); @@ -66,7 +76,7 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { @Override public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - return aWorld.provider.dimensionId == ConfigHandler.ross128BID; + return aDimensionType == ConfigHandler.ross128BID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 87158bf01e..6f32b0007b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,13 +22,15 @@ package com.github.bartimaeusnek.bartworks.system.oregen; -import gregtech.api.enums.Materials; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.util.GT_ModHandler; import net.minecraft.block.Block; import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; +import static gregtech.api.enums.Materials.*; public class BW_WorldGenRoss128ba extends BW_OreLayer { @@ -38,17 +40,43 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { @Override public Block getDefaultBlockToReplace() { - return Block.getBlockFromItem(GT_ModHandler.getModItem("galacticraftCore","tile.moonBlock",1).getItem()); + return Block.getBlockFromName("GalacticraftCore:tile.moonBlock"); + } + @Override + public int[] getDefaultDamageToReplace(){ + int[] ret = new int[12]; + for (int i = 0; i < 12; i++) { + if (i != 5 && i != 3) + ret[i] = i; + } + return ret; + } + + @Override + public String getDimName() { + return StatCollector.translateToLocal("moon.Ross128ba"); } - public static void init_OresRoss128ba() { - //none + public static void init_Ores() { + new BW_WorldGenRoss128ba("ore.mix.ross128ba.tib", true, 30, 60, 6, 1, 16, Tiberium, Tiberium, NaquadahEnriched, NaquadahEnriched); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.Tungstate", true, 5, 40, 60, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.bart", true, 30, 60, 1, 1, 1, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.TurmalinAlkali", true, 5, 80, 60, 4, 48, Olenit, FluorBuergerit, ChromoAluminoPovondrait, VanadioOxyDravit); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.Amethyst", true, 5, 80, 35, 2, 8, Amethyst, Olivine, Prasiolite, Hedenbergit); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.Fluorspar", true, 10, 80, 35, 4, 8, Galena, Sphalerite, Fluorspar, Barite); } - public static void init_undergroundFluidsRoss128ba() { - String ross128b = StatCollector.translateToLocal("planet.Ross128ba"); - uo_dimensionList.SetConfigValues(ross128b, ross128b, Materials.SaltWater.getFluid(1).getUnlocalizedName(), Materials.SaltWater.getFluid(1).getUnlocalizedName(), 0, 625, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, Materials.Helium_3.getGas(1).getUnlocalizedName(), Materials.Helium_3.getGas(1).getUnlocalizedName(), 0, 625, 60, 5); + public static void init_undergroundFluids() { + String ross128b = StatCollector.translateToLocal("moon.Ross128ba"); + uo_dimensionList.SetConfigValues(ross128b, ross128b, SaltWater.getFluid(1).getFluid().getName(), SaltWater.getFluid(1).getFluid().getName(), 0, 1250, 40, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, Helium_3.getGas(1).getFluid().getName(), Helium_3.getGas(1).getFluid().getName(), 0, 1250, 60, 5); + } + @Override + public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { + return aDimensionType == ConfigHandler.ross128BAID; } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 39a1ffa5bb..2471a36b60 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 8c5db993b3..dbeaa9ef3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -41,7 +41,7 @@ import java.security.SecureRandom; import java.util.Random; import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; - +@SuppressWarnings({"ALL"}) public abstract class MapGenRuins extends WorldGenerator { protected Pair<Block,Integer>[][] ToBuildWith = new Pair[4][0]; @@ -132,8 +132,8 @@ public abstract class MapGenRuins extends WorldGenerator { this.setRoofBlocks(new int[]{9},Blocks.log); this.setMiscBlocks(new int[]{1},Blocks.log); this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; - int colored=rand.nextInt(15); - int tier = rand.nextInt(6); + int colored = rand.nextInt(15); + int tier = secureRandom.nextInt(6); boolean useColor = rand.nextBoolean(); byte set = 0; byte toSet = (byte) (rand.nextInt(6-tier)+1); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 16d306d05f..5da71e18b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -65,7 +65,7 @@ public class BWRecipes { public static final byte CIRCUITASSEMBLYLINE = 3; private final GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( - new HashSet<GT_Recipe>(150), + new HashSet<>(150), "bw.recipe.biolab", StatCollector.translateToLocal("tile.biolab.name"), null, @@ -74,7 +74,7 @@ public class BWRecipes { "", 1, "", true, false //special handler ); private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( - new HashSet<GT_Recipe>(50), + new HashSet<>(50), "bw.recipe.BacteriaVat", StatCollector.translateToLocal("tile.biovat.name"), null, @@ -83,7 +83,7 @@ public class BWRecipes { " Sievert: ", 1, " Sv", true, false //special handler ); private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( - new HashSet<GT_Recipe>(10), + new HashSet<>(10), "bw.fuels.acidgens", StatCollector.translateToLocal("tile.acidgenerator.name"), null, @@ -92,7 +92,7 @@ public class BWRecipes { "EU generated: ", 1000, "", false, true ); private final BWRecipes.SpecialObjectSensitiveMap sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( - new HashSet<GT_Recipe>(60), + new HashSet<>(60), "bw.recipe.cal", "Circuit Assembly Line", null, @@ -336,56 +336,40 @@ public class BWRecipes { } public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null; } public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated @@ -395,9 +379,7 @@ public class BWRecipes { aSievert += calculateSv(material); aSievert = aSievert << 6; aSievert = aSievert | glasTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { @@ -411,9 +393,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { @@ -427,9 +407,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } @Deprecated @@ -440,9 +418,7 @@ public class BWRecipes { aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 6; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, int aSpecialValue, boolean exactSv) { @@ -454,9 +430,7 @@ public class BWRecipes { aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } /** @@ -464,20 +438,15 @@ public class BWRecipes { */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { int aSievert = 0; - aSievert = aSievert << 7; aSievert = aSievert | glasTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } /** * Adds a Vat recipe without Rad or Glas requirements */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) { - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null; } @@ -492,9 +461,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } public static class DynamicGTRecipe extends GT_Recipe implements Serializable { @@ -538,7 +505,7 @@ public class BWRecipes { protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; - GT_Recipe isthere = this.findRecipe((IHasWorldObjectAndCoords) null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); + GT_Recipe isthere = this.findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { return null; @@ -562,7 +529,7 @@ public class BWRecipes { nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length); aRecipe.mInputs = nu1; } - if (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { + if (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); int i = 9 + nu.length; do { @@ -574,7 +541,7 @@ public class BWRecipes { if (i == 9 + nu.length) return null; } - while (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); + while (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); } return this.addRecipe(aRecipe, false, false, false); } @@ -621,7 +588,7 @@ public class BWRecipes { } // Unification happens here in case the Input isn't already unificated. - if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); + if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object) aInputs); // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) @@ -665,6 +632,7 @@ public class BWRecipes { Map<Character, ItemStack> charToStackMap = new HashMap<>(9,1); String[] shape; + @SuppressWarnings({"SuspiciousSystemArraycopy"}) public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { this.result = result; this.shape = new String[3]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index f1ae2667ee..a4a2a794d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -25,7 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.enums.Dyes; import java.util.Arrays; - +@SuppressWarnings("unused") public class BW_ColorUtil { private BW_ColorUtil(){} @@ -203,9 +203,12 @@ public class BW_ColorUtil { } public static short[] correctCorlorArray(short[] rgba){ - if (rgba.length<4) { + if (rgba.length > 4) { + rgba = Arrays.copyOfRange(rgba, 0,4); + } + if (rgba.length < 4) { short[] tmp = Arrays.copyOf(rgba, 4); - Arrays.fill(tmp,rgba.length-1,4, (short) 0); + Arrays.fill(tmp,rgba.length,4, (short) 0); rgba = tmp; } if (rgba[0] > 255) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 0ee22cbd7d..89d4eea19a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -23,31 +23,42 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import gregtech.api.enums.Element; import gregtech.api.enums.Materials; +import gregtech.api.enums.OreDictNames; +import gregtech.api.enums.ToolDictNames; +import gregtech.api.interfaces.IItemContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.Enchantment; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import org.apache.commons.lang3.reflect.FieldUtils; import javax.annotation.Nonnegative; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; +import javax.annotation.Nonnull; +import java.lang.reflect.Field; +import java.util.*; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.*; +@SuppressWarnings("unused") public class BW_Util { public static final int STANDART = 0; @@ -200,9 +211,7 @@ public class BW_Util { } public static int calculateSv(Materials materials) { - Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); - while (it.hasNext()) { - BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); + for (BioVatLogicAdder.MaterialSvPair pair : BioVatLogicAdder.RadioHatch.getMaSv()) { if (pair.getMaterials().equals(materials)) return pair.getSievert(); } @@ -213,6 +222,27 @@ public class BW_Util { return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; } +// public static int getRecipeHash(GT_Recipe recipe) { +// int mInputItemsRawHash = Arrays.stream(recipe.mInputs).filter(Objects::nonNull).mapToInt(e -> +// Objects.hash(Item.getIdFromItem(e.getItem()),e.getItemDamage(), e.getTagCompound()) +// ).hashCode(); +// int mInputFluidRawHash = Arrays.stream(recipe.mFluidInputs).filter(Objects::nonNull).mapToInt(e -> +// Objects.hash(e.getFluidID(),e.amount,e.tag) +// ).hashCode(); +// int mOutputItemRawHash = Arrays.stream(recipe.mOutputs).filter(Objects::nonNull).mapToInt(e -> +// Objects.hash(Item.getIdFromItem(e.getItem()),e.getItemDamage(), e.getTagCompound()) +// ).hashCode(); +// int mOutputFluidRawHash = Arrays.stream(recipe.mFluidOutputs).filter(Objects::nonNull).mapToInt(e -> +// Objects.hash(e.getFluidID(),e.amount,e.tag) +// ).hashCode(); +// int mChancesRawHash = Arrays.hashCode(recipe.mChances); +// int others = Objects.hash(recipe.mEUt,recipe.mSpecialValue,recipe.mDuration); +// int specialItem = Objects.hash(recipe.mSpecialItems instanceof ItemStack ? +// ((ItemStack) (recipe.mSpecialItems)).getItem() : recipe.mSpecialItems instanceof Item ? recipe.mSpecialItems : 0 , +// recipe.mSpecialItems instanceof ItemStack ? ((ItemStack) (recipe.mSpecialItems)).getItemDamage() : 0); +// return Objects.hash(mInputItemsRawHash,mInputFluidRawHash,mOutputItemRawHash,mOutputFluidRawHash,mChancesRawHash,others,specialItem); +// } + public static int getMachineVoltageFromTier(int tier) { return (int) (30 * Math.pow(4, (tier - 1))); } @@ -225,6 +255,10 @@ public class BW_Util { return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2); } + public static boolean areStacksEqualOrEachNull(ItemStack aStack1, ItemStack aStack2) { + return aStack1 == null || aStack2 == null || GT_Utility.areStacksEqual(aStack1, aStack2); + } + public static byte getByteFromRarity(EnumRarity rarity) { if (rarity.equals(EnumRarity.uncommon)) return 1; @@ -296,8 +330,8 @@ public class BW_Util { xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power } - if (xEUt > maxInputVoltage){ - //downclock one notch, we have overshot. + while (xEUt > maxInputVoltage){ + //downclock one notch until we are good again, we have overshot. xEUt >>=2; base.mMaxProgresstime <<= 1; } @@ -318,10 +352,8 @@ public class BW_Util { public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { long rVoltage = 0L; long rAmperage = 0L; - Iterator var3 = base.mEnergyHatches.iterator(); - while (var3.hasNext()) { - GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy) var3.next(); + for (GT_MetaTileEntity_Hatch_Energy tHatch : base.mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { if (rVoltage == 0 || rVoltage > tHatch.getBaseMetaTileEntity().getInputVoltage()) rVoltage = tHatch.getBaseMetaTileEntity().getInputVoltage(); @@ -348,6 +380,10 @@ public class BW_Util { } + public static Element createNewElement(String variableName, long aProtons, long aNeutrons, long aAdditionalMass, long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope){ + return EnumHelper.addEnum(Element.class,variableName,new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{aProtons, aNeutrons, aAdditionalMass, aHalfLifeSeconds, aDecayTo, aName, aIsIsotope}); + } + public static EnumRarity getRarityFromByte(byte b) { switch (b) { case 1: @@ -478,4 +514,251 @@ public class BW_Util { default: return -1; } } + + public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { + + if (block.equals(ItemRegistry.bw_glasses[0])) + return meta == 12 ? 5 : meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; + + if (block.getUnlocalizedName().equals("blockAlloyGlass")) + return 4; + + if (block.equals(Blocks.glass)) + return 3; + + for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) + if (B.getBlock().equals(block) && B.getaByte().equals(meta)) + return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); + + if (block.getMaterial().equals(Material.glass)) + return 3; + + return 0; + } + + private static Field sBufferedRecipeList; + public static List<IRecipe> getGTBufferedRecipeList() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException{ + if (sBufferedRecipeList == null) { + sBufferedRecipeList = FieldUtils.getDeclaredField(GT_ModHandler.class,"sBufferRecipeList",true); + } + if (sBufferedRecipeList == null) { + sBufferedRecipeList = FieldUtils.getField(GT_ModHandler.class,"sBufferRecipeList",true); + } + return (List<IRecipe>) sBufferedRecipeList.get(null); + } + + public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { + return createGTCraftingRecipe(aResult, new Enchantment[0], new int[0], (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, aRecipe); + } + + public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { + aResult = GT_OreDictUnificator.get(true, aResult); + if (aOnlyAddIfResultIsNotNull && aResult == null) return null; + if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); + if (aRecipe == null || aRecipe.length <= 0) return null; + + boolean tThereWasARecipe = false; + + for (byte i = 0; i < aRecipe.length; i++) { + if (aRecipe[i] instanceof IItemContainer) + aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); + else if (aRecipe[i] instanceof Enum) + aRecipe[i] = ((Enum) aRecipe[i]).name(); + else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack || aRecipe[i] instanceof ItemData || aRecipe[i] instanceof String || aRecipe[i] instanceof Character)) + aRecipe[i] = aRecipe[i].toString(); + } + + try { + StringBuilder shape = new StringBuilder(E); + int idx = 0; + if (aRecipe[idx] instanceof Boolean) { + throw new IllegalArgumentException(); + } + + ArrayList<Object> tRecipeList = new ArrayList<Object>(Arrays.asList(aRecipe)); + + while (aRecipe[idx] instanceof String) { + StringBuilder s = new StringBuilder((String) aRecipe[idx++]); + shape.append(s); + while (s.length() < 3) s.append(" "); + if (s.length() > 3) throw new IllegalArgumentException(); + + for (char c : s.toString().toCharArray()) { + switch (c) { + case 'b': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolBlade.name()); + break; + case 'c': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolCrowbar.name()); + break; + case 'd': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolScrewdriver.name()); + break; + case 'f': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolFile.name()); + break; + case 'h': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolHardHammer.name()); + break; + case 'i': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolSolderingIron.name()); + break; + case 'j': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolSolderingMetal.name()); + break; + case 'k': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolKnife.name()); + break; + case 'm': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolMortar.name()); + break; + case 'p': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolDrawplate.name()); + break; + case 'r': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolSoftHammer.name()); + break; + case 's': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolSaw.name()); + break; + case 'w': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolWrench.name()); + break; + case 'x': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolWireCutter.name()); + break; + } + } + } + + aRecipe = tRecipeList.toArray(); + + if (aRecipe[idx] instanceof Boolean) { + idx++; + } + Map<Character, ItemStack> tItemStackMap = new HashMap<>(); + Map<Character, ItemData> tItemDataMap = new HashMap<>(); + tItemStackMap.put(' ', null); + + boolean tRemoveRecipe = true; + + for (; idx < aRecipe.length; idx += 2) { + if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { + if (D1) { + GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " + (aResult == null ? "null" : aResult.getDisplayName())); + for (Object tContent : aRecipe) GT_Log.err.println(tContent); + } + return null; + } + Character chr = (Character) aRecipe[idx]; + Object in = aRecipe[idx + 1]; + if (in instanceof ItemStack) { + tItemStackMap.put(chr, GT_Utility.copy(in)); + tItemDataMap.put(chr, GT_OreDictUnificator.getItemData((ItemStack) in)); + } else if (in instanceof ItemData) { + String tString = in.toString(); + switch (tString) { + case "plankWood": + tItemDataMap.put(chr, new ItemData(Materials.Wood, M)); + break; + case "stoneNetherrack": + tItemDataMap.put(chr, new ItemData(Materials.Netherrack, M)); + break; + case "stoneObsidian": + tItemDataMap.put(chr, new ItemData(Materials.Obsidian, M)); + break; + case "stoneEndstone": + tItemDataMap.put(chr, new ItemData(Materials.Endstone, M)); + break; + default: + tItemDataMap.put(chr, (ItemData) in); + break; + } + ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); + if (tStack == null) tRemoveRecipe = false; + else tItemStackMap.put(chr, tStack); + in = aRecipe[idx + 1] = in.toString(); + } else if (in instanceof String) { + if (in.equals(OreDictNames.craftingChest.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Wood, M * 8)); + else if (in.equals(OreDictNames.craftingBook.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Paper, M * 3)); + else if (in.equals(OreDictNames.craftingPiston.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Stone, M * 4, Materials.Wood, M * 3)); + else if (in.equals(OreDictNames.craftingFurnace.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Stone, M * 8)); + else if (in.equals(OreDictNames.craftingIndustrialDiamond.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Diamond, M)); + else if (in.equals(OreDictNames.craftingAnvil.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Iron, M * 10)); + ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); + if (tStack == null) tRemoveRecipe = false; + else tItemStackMap.put(chr, tStack); + } else { + throw new IllegalArgumentException(); + } + } + + if (aReversible && aResult != null) { + ItemData[] tData = new ItemData[9]; + int x = -1; + for (char chr : shape.toString().toCharArray()) tData[++x] = tItemDataMap.get(chr); + if (GT_Utility.arrayContainsNonNull(tData)) + GT_OreDictUnificator.addItemData(aResult, new ItemData(tData)); + } + + if (aCheckForCollisions && tRemoveRecipe) { + ItemStack[] tRecipe = new ItemStack[9]; + int x = -1; + for (char chr : shape.toString().toCharArray()) { + tRecipe[++x] = tItemStackMap.get(chr); + if (tRecipe[x] != null && Items.feather.getDamage(tRecipe[x]) == W) + Items.feather.setDamage(tRecipe[x], 0); + } + tThereWasARecipe = GT_ModHandler.removeRecipe(tRecipe) != null; + } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + + if (aResult == null || aResult.stackSize <= 0) return null; + + if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT || aRemoveAllOtherShapedsWithSameOutput || aRemoveAllOtherNativeRecipes) + tThereWasARecipe = GT_ModHandler.removeRecipeByOutput(aResult, !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, aRemoveAllOtherShapedsWithSameOutput, aRemoveAllOtherNativeRecipes) || tThereWasARecipe; + + if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tThereWasARecipe) { + ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList(); + int tList_sS=tList.size(); + for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) { + IRecipe tRecipe = tList.get(i); + if (GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; + if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { + tList.remove(i--); tList_sS=tList.size(); + tThereWasARecipe = true; + } + } + } + + if (Items.feather.getDamage(aResult) == W || Items.feather.getDamage(aResult) < 0) + Items.feather.setDamage(aResult, 0); + + GT_Utility.updateItemStack(aResult); + + return new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored); + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 001b747be8..ab8eea357d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.util.GT_LanguageManager; import net.minecraft.item.EnumRarity; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.Fluid; @@ -37,9 +38,17 @@ import java.util.Objects; public class BioCulture extends BioData implements IColorModulationContainer { - public static final ArrayList<BioCulture> BIO_CULTURE_ARRAY_LIST = new ArrayList<BioCulture>(); + public static final ArrayList<BioCulture> BIO_CULTURE_ARRAY_LIST = new ArrayList<>(); public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) + public String getLocalisedName() { + return GT_LanguageManager.getTranslation(this.getName()); + } + + public void setLocalisedName(String localisedName) { + GT_LanguageManager.addStringLocalization(this.getName(),localisedName); + } + Color color; BioPlasmid plasmid; BioDNA dDNA; @@ -111,6 +120,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public static BioCulture getBioCulture(String Name) { + if (Name == null || Name.isEmpty()) + return null; for (BioCulture b : BIO_CULTURE_ARRAY_LIST) if (b.name.equals(Name)) return b; @@ -168,16 +179,35 @@ public class BioCulture extends BioData implements IColorModulationContainer { return this.plasmid; } - public void setPlasmid(BioPlasmid plasmid) { + public BioCulture setPlasmid(BioPlasmid plasmid) { + return checkForExisting(new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); + } + + private BioCulture checkForExisting(BioCulture culture) { + if (culture == null) + return null; + for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) + if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) + return bc; + return culture; + } + + public BioCulture setPlasmidUnsafe(BioPlasmid plasmid) { this.plasmid = plasmid; + return this; } public BioDNA getdDNA() { return this.dDNA; } - public void setdDNA(BioDNA dDNA) { + public BioCulture setdDNA(BioDNA dDNA) { + return checkForExisting(new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); + } + + public BioCulture setdDNAUnsafe(BioDNA dDNA) { this.dDNA = dDNA; + return this; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java index 4cdbf1a143..7bb8e427cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index 1421f75c40..b64e508abd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -30,7 +30,7 @@ import java.util.ArrayList; import java.util.Objects; public class BioData { - public static final ArrayList<BioData> BIO_DATA_ARRAY_LIST = new ArrayList<BioData>(); + public static final ArrayList<BioData> BIO_DATA_ARRAY_LIST = new ArrayList<>(); protected String name; protected int ID; @@ -59,6 +59,7 @@ public class BioData { this.name = bioData.name; this.ID = bioData.ID; this.chance = bioData.chance; + this.tier = bioData.tier; } public static BioData convertBioPlasmidToBioData(BioPlasmid bioPlasmid) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java index 1d59edb5ea..9cadce5239 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java index b78e39afe1..38074acc7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 7e35affabf..0e8c18f93c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -32,7 +32,7 @@ import java.util.HashSet; public class ConnectedBlocksChecker { - public final HashSet<Coords> hashset = new HashSet<Coords>(2048); + public final HashSet<Coords> hashset = new HashSet<>(2048); public static byte check_sourroundings(Coords C, Block b) { byte ret = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java index 707b374888..8282b132ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -38,9 +38,9 @@ import java.util.Queue; */ public class ConnectedBlocksCheckerIteration { - public final HashSet<Coords> hashset = new HashSet<Coords>(2048); - public final HashSet<Coords> checked = new HashSet<Coords>(4096); - private final Queue<Coords> kwoe = new LinkedList<Coords>(); + public final HashSet<Coords> hashset = new HashSet<>(2048); + public final HashSet<Coords> checked = new HashSet<>(4096); + private final Queue<Coords> kwoe = new LinkedList<>(); public long get_connected(World w, int x, int y, int z, Block b){ kwoe.add(new Coords(x,y,z,w.provider.dimensionId)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index c27054eb01..4a3ee25235 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -41,10 +41,10 @@ public class Coords { @Override public boolean equals(Object o) { -// if (this == o) -// return true; -// if (o == null || this.getClass() != o.getClass()) -// return false; + if (this == o) + return true; + if (o == null || this.getClass() != o.getClass()) + return false; Coords coords = (Coords) o; return this.x == coords.x && this.y == coords.y && diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index d37f3f0661..2b740e35d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index d568baf22b..4a6b8584dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index e494594bd2..5dcb897da2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -17,11 +17,11 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; */ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D - private static Grad grad3[] = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), + private static Grad[] grad3 = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1), new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)}; - private static Grad grad4[]= {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), + private static Grad[] grad4 = {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), new Grad(0,-1,1,1),new Grad(0,-1,1,-1),new Grad(0,-1,-1,1),new Grad(0,-1,-1,-1), new Grad(1,0,1,1),new Grad(1,0,1,-1),new Grad(1,0,-1,1),new Grad(1,0,-1,-1), new Grad(-1,0,1,1),new Grad(-1,0,1,-1),new Grad(-1,0,-1,1),new Grad(-1,0,-1,-1), @@ -30,7 +30,7 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D new Grad(1,1,1,0),new Grad(1,1,-1,0),new Grad(1,-1,1,0),new Grad(1,-1,-1,0), new Grad(-1,1,1,0),new Grad(-1,1,-1,0),new Grad(-1,-1,1,0),new Grad(-1,-1,-1,0)}; - private static short p[] = {151,160,137,91,90,15, + private static short[] p = {151,160,137,91,90,15, 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, @@ -44,8 +44,8 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180}; // To remove the need for index wrapping, double the permutation table length - private static short perm[] = new short[512]; - private static short permMod12[] = new short[512]; + private static short[] perm = new short[512]; + private static short[] permMod12 = new short[512]; static { for(int i=0; i<512; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index acc6da7b14..a64793676c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -26,7 +26,8 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Map; -public class Pair<A, B> implements Map.Entry { +@SuppressWarnings("unchecked") +public class Pair<A, B> implements Map.Entry<A, B> { Object[] pair = new Object[2]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java new file mode 100644 index 0000000000..a1067b051e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -0,0 +1,378 @@ +/* + * Copyright (c) 2018-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.util.accessprioritylist; + +import org.apache.commons.lang3.NotImplementedException; + +import java.util.*; + +public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { + + transient int size = 0; + transient AccessPriorityListNode<E> head; + transient AccessPriorityListNode<E> tail; + + public static AccessPriorityList create() { + return new AccessPriorityList(); + } + + public AccessPriorityList() {} + + @Override + public void addFirst(E t) { + final AccessPriorityListNode<E> first = head; + final AccessPriorityListNode<E> newNode = new AccessPriorityListNode<>(null, t, first); + head = newNode; + if (first == null) + tail = newNode; + else + first.setBefore(newNode); + size++; + } + + @Override + public void addLast(E t) { + final AccessPriorityListNode<E> last = tail; + final AccessPriorityListNode<E> newNode = new AccessPriorityListNode<>(last, t, null); + tail = newNode; + if (last == null) + head = newNode; + else + last.setNext(newNode); + size++; + } + + @Override + public boolean offerFirst(E e) { + throw new NotImplementedException(""); + } + + @Override + public boolean offerLast(E e) { + throw new NotImplementedException(""); + } + + @Override + public E removeFirst() { + throw new NotImplementedException(""); + } + + @Override + public E removeLast() { + throw new NotImplementedException(""); + } + + @Override + public E pollFirst() { + throw new NotImplementedException(""); + } + + @Override + public E pollLast() { + throw new NotImplementedException(""); + } + + @Override + public E getFirst() { + return peekFirst(); + } + + @Override + public E getLast() { + return peekLast(); + } + + @Override + public E peekFirst() { + return head != null ? head.getELEMENT() : null; + } + + @Override + public E peekLast() { + return tail != null ? tail.getELEMENT() : null; + } + + @Override + public boolean removeFirstOccurrence(Object o) { + throw new NotImplementedException(""); + } + + @Override + public boolean removeLastOccurrence(Object o) { + throw new NotImplementedException(""); + } + + @Override + public int size() { + return size; + } + + @Override + public boolean isEmpty() { + return size == 0; + } + + @Override + public boolean contains(Object o) { + throw new NotImplementedException(""); + } + + @Override + public Iterator<E> iterator() { + return new AccessPriorityListIterators.AccessPriorityListIterator<>(head); + } + + @Override + public Iterator<E> descendingIterator() { + return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(tail); + } + + @Override + public Object[] toArray() { + Object[] ret = new Object[size]; + int index = 0; + for (Iterator<E> it = iterator(); it.hasNext(); index++) + ret[index] = it.next(); + return ret; + } + + @Override + public <T> T[] toArray(T[] a) { + T[] ret = (T[]) new Object[size]; + int index = 0; + for (Iterator<T> it = (Iterator<T>) iterator(); it.hasNext(); index++) + ret[index] = it.next(); + return ret; + } + + @Override + public boolean add(E e) { + addLast(e); + return true; + } + + private void moveNodeUp(AccessPriorityListNode<E> node){ + if (node == head || node.getBefore() == null) + return; + final AccessPriorityListNode<E> before = node.getBefore(); + final AccessPriorityListNode<E> beforeBefore = before.getBefore(); + final AccessPriorityListNode<E> next = node.getNext(); + + // <0,1,2> <1,2,3> N<2,3,4> <3,4,5> + + node.setBefore(beforeBefore); + // <0,1,2> <1,2,3> N<0,3,4> <3,4,5> + + if (beforeBefore != null) + beforeBefore.setNext(node); + else + head = node; + // <0,1,3> <1,2,3> N<0,3,4> <3,4,5> + + before.setBefore(node); + // <0,1,3> <3,2,3> N<0,3,4> <3,4,5> + + before.setNext(next); + // <0,1,3> <3,2,4> N<0,3,4> <3,4,5> + + if (next != null) + next.setBefore(before); + else + tail = before; + // <0,1,3> N<0,3,4> <3,2,4> <2,4,5> + + node.setNext(before); + // <0,1,3> N<0,3,2> <3,2,4> <2,4,5> + } + + AccessPriorityListNode<E> getNode(int index) { + if (index <= (size / 2)) { + AccessPriorityListNode<E> x = head; + for (int i = 0; i < index; i++) + x = x.getNext(); + return x; + } else { + AccessPriorityListNode<E> x = tail; + for (int i = size - 1; i > index; i--) + x = x.getBefore(); + return x; + } + } + + @Override + public boolean offer(E e) { + throw new NotImplementedException(""); + } + + private boolean isValidIndex(int index) { + if (index >= 0 && index < size) + return true; + throw new ArrayIndexOutOfBoundsException("NOT A VAILD INDEX!"); + } + + @Override + public E remove() { + throw new NotImplementedException(""); + } + + @Override + public E poll() { + throw new NotImplementedException(""); + } + + @Override + public E element() { + throw new NotImplementedException(""); + } + + @Override + public E peek() { + return getFirst(); + } + + @Override + public void push(E e) { + addFirst(e); + } + + @Override + public E pop() { + throw new NotImplementedException(""); + } + + @Override + public boolean remove(Object o) { + throw new NotImplementedException(""); + } + + @Override + public boolean containsAll(Collection<?> c) { + throw new NotImplementedException(""); + } + + @Override + public boolean addAll(Collection<? extends E> c) { + for (E e : c) { + this.addLast(e); + } + return true; + } + + @Override + public boolean addAll(int index, Collection<? extends E> c) { + throw new NotImplementedException(""); + } + + @Override + public boolean removeAll(Collection<?> c) { + throw new NotImplementedException(""); + } + + @Override + public boolean retainAll(Collection<?> c) { + throw new NotImplementedException(""); + } + + @Override + public void clear() { + if (tail != null) { + AccessPriorityListNode<E> node = tail; + while (node.getBefore() != null) { + node.setNext(null); + node.setPriority(0L); + node = node.getBefore(); + node.getNext().setBefore(null); + } + this.size = 0; + this.head = null; + this.tail = null; + } + } + + public void addPrioToNode(int index, long prio){ + if (!isValidIndex(index)) + return; + AccessPriorityListNode<E> node = getNode(index); + node.setPriority(node.getPriority()+prio); + while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()){ + moveNodeUp(node); + } + } + + public void addPrioToNode(int index){ + addPrioToNode(index,1L); + } + + @Override + public E get(int index) { + if (!isValidIndex(index)) + return null; + AccessPriorityListNode<E> node = getNode(index); + return node.getELEMENT(); + } + + @Override + public E set(int index, E element) { + throw new NotImplementedException(""); + } + + @Override + public void add(int index, E element) { + throw new NotImplementedException(""); + } + + @Override + public E remove(int index) { + throw new NotImplementedException(""); + } + + @Override + public int indexOf(Object o) { + throw new NotImplementedException(""); + } + + @Override + public int lastIndexOf(Object o) { + throw new NotImplementedException(""); + } + + @Override + public ListIterator<E> listIterator() { + return new AccessPriorityListIterators.AccessPriorityListListIterator<>(head,tail,false); + } + + @Override + public ListIterator<E> listIterator(int index) { + return new AccessPriorityListIterators.AccessPriorityListListIterator<>(this,index); + } + + @Override + public List<E> subList(int fromIndex, int toIndex) { + throw new NotImplementedException(""); + } + + @Override + public Spliterator<E> spliterator() { + throw new NotImplementedException(""); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java new file mode 100644 index 0000000000..3b85030d1e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2018-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.util.accessprioritylist; + +import org.apache.commons.lang3.NotImplementedException; + +import java.util.Iterator; +import java.util.ListIterator; + +public class AccessPriorityListIterators { + + + public static class AccessPriorityListListIterator<E> implements ListIterator<E> { + final AccessPriorityListNode<E> head; + final AccessPriorityListNode<E> tail; + AccessPriorityListNode<E> current; + int counter = 0; + boolean reverse; + public AccessPriorityListListIterator(AccessPriorityListNode<E> head, AccessPriorityListNode<E> tail, boolean reverse) { + this.head = head; + this.tail = tail; + current = reverse ? tail : head; + this.reverse = reverse; + } + + public AccessPriorityListListIterator(AccessPriorityList<E> list, int index) { + this.head = list.head; + this.tail = list.tail; + current = list.getNode(index); + counter = index; + } + + @Override + public boolean hasNext() { + return reverse ? head != current : tail != current; + } + + @Override + public E next() { + counter++; + E ret = current.getELEMENT(); + current = current.getNext(); + return ret; + } + + @Override + public boolean hasPrevious() { + return !reverse ? head != current : tail != current; + } + + @Override + public E previous() { + counter--; + E ret = current.getELEMENT(); + current = current.getBefore(); + return ret; + } + + @Override + public int nextIndex() { + return counter+1; + } + + @Override + public int previousIndex() { + return counter-1; + } + + @Override + public void remove() { + throw new NotImplementedException("Not Implemented"); + } + + @Override + public void set(E e) { + throw new NotImplementedException("Not Implemented"); + } + + @Override + public void add(E e) { + throw new NotImplementedException("Not Implemented"); + } + } + + public static class AccessPriorityListIterator<E> implements Iterator<E> { + final AccessPriorityListNode<E> head; + AccessPriorityListNode<E> current; + public AccessPriorityListIterator(AccessPriorityListNode<E> head) { + this.head = this.current = head; + } + + @Override + public boolean hasNext() { + return current != null; + } + + @Override + public E next() { + E ret = current.getELEMENT(); + current = current.getNext(); + return ret; + } + } + + public static class AccessPriorityListReverseIterator<E> implements Iterator<E> { + final AccessPriorityListNode<E> tail; + AccessPriorityListNode<E> current; + + public AccessPriorityListReverseIterator(AccessPriorityListNode<E> tail) { + this.tail = this.current = tail; + } + + @Override + public boolean hasNext() { + return current != null; + } + + @Override + public E next() { + E ret = current.getELEMENT(); + current = current.getBefore(); + return ret; + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java new file mode 100644 index 0000000000..b8fd357027 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-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.util.accessprioritylist; + +public class AccessPriorityListNode<E> { + + public final static AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode(null); + + private final E ELEMENT; + private long priority = Long.MIN_VALUE; + private AccessPriorityListNode<E> next; + private AccessPriorityListNode<E> before; + + public AccessPriorityListNode(E element) { + ELEMENT = element; + } + + public AccessPriorityListNode(AccessPriorityListNode<E> before, E element, AccessPriorityListNode<E> next) { + this.ELEMENT = element; + connect(next, before); + } + + public void connect(AccessPriorityListNode<E> next, AccessPriorityListNode<E> before){ + this.setNext(next); + this.setBefore(before); + } + + public E getELEMENT() { + return ELEMENT; + } + + public long getPriority() { + return priority; + } + + public void setPriority(long priority) { + this.priority = priority; + } + + public AccessPriorityListNode<E> getNext() { + return next; + } + + public void setNext(AccessPriorityListNode<E> next) { + this.next = next; + } + + public AccessPriorityListNode<E> getBefore() { + return before; + } + + public void setBefore(AccessPriorityListNode<E> before) { + this.before = before; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 49f2b22365..953cfa62ad 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,10 +22,10 @@ package com.github.bartimaeusnek.crossmod; -import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; -import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; +import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; @@ -50,10 +50,11 @@ import java.io.StringReader; + "after:Micdoodlecore; " + "after:miscutils;" + "after:EMT;" + + "after:tectech;" ) public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; - public static final String VERSION = "0.0.1"; + public static final String VERSION = MainMod.VERSION; public static final String MOD_ID = "bartworkscrossmod"; public static final Logger LOGGER = LogManager.getLogger(BartWorksCrossmod.NAME); @@ -62,6 +63,8 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { +// if (Loader.isModLoaded("appliedenergistics2")) +// new ItemSingleItemStorageCell("singleItemStorageCell"); if (Loader.isModLoaded("GalacticraftCore")) GalacticraftProxy.preInit(preinit); if (Loader.isModLoaded("Thaumcraft")) @@ -80,6 +83,8 @@ public class BartWorksCrossmod { GalacticraftProxy.postInit(init); if (Loader.isModLoaded("miscutils")) new RadioHatchCompat().run(); + if (Loader.isModLoaded("tectech")) + TecTechResearchLoader.runResearches(); } // @Mod.EventHandler @@ -98,14 +103,11 @@ public class BartWorksCrossmod { // } catch (IllegalAccessException | InvocationTargetException e) { // e.printStackTrace(); // } -// // } // } @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { - event.registerServerCommand(new SummonRuin()); - event.registerServerCommand(new ChangeConfig()); if (Loader.isModLoaded("miscutils")) for (Object s : RadioHatchCompat.TranslateSet){ StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index e424b693d2..11ae398d54 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -38,7 +38,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.*; - +@SuppressWarnings({"unchecked","rawtypes","unused"}) public class RadioHatchCompat implements Runnable { private static Class intf; @@ -225,7 +225,7 @@ public class RadioHatchCompat implements Runnable { if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter.clampToZero(RadioHatchCompat.protons.getLong(materialObj))); else - ret += ((int) RadioHatchCompat.radlevel.getByte(m)); + ret += RadioHatchCompat.radlevel.getByte(m); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java new file mode 100644 index 0000000000..af653781be --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java @@ -0,0 +1,122 @@ +//package com.github.bartimaeusnek.crossmod.ae2; +// +//import appeng.api.AEApi; +//import appeng.api.config.FuzzyMode; +//import appeng.api.config.IncludeExclude; +//import appeng.api.implementations.items.IStorageCell; +//import appeng.api.storage.*; +//import appeng.api.storage.data.IAEItemStack; +//import appeng.core.localization.GuiText; +//import appeng.items.contents.CellUpgrades; +//import appeng.util.Platform; +//import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; +//import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +//import cpw.mods.fml.common.registry.GameRegistry; +//import cpw.mods.fml.relauncher.Side; +//import cpw.mods.fml.relauncher.SideOnly; +//import net.minecraft.entity.player.EntityPlayer; +//import net.minecraft.inventory.IInventory; +//import net.minecraft.item.Item; +//import net.minecraft.item.ItemStack; +// +//import java.util.List; +// +//public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { +// +// public ItemSingleItemStorageCell(String tex) { +// super(tex); +// Item thizz = this; +// GameRegistry.registerItem(this, BartWorksCrossmod.MOD_ID+this.iconString); +// } +// +// @Override +// @SideOnly(Side.CLIENT) +// public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { +// IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory(stack, (ISaveProvider)null, StorageChannel.ITEMS); +// if (inventory instanceof ICellInventoryHandler) { +// ICellInventoryHandler handler = (ICellInventoryHandler)inventory; +// ICellInventory cellInventory = handler.getCellInv(); +// if (cellInventory != null) { +// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); +// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); +// if (handler.isPreformatted()) { +// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal(); +// if (handler.isFuzzy()) { +// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); +// } else { +// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal()); +// } +// } +// } +// } +// } +// +// @Override +// public int getBytes(ItemStack itemStack) { +// return getTotalTypes(itemStack)*getBytesPerType(itemStack); +// } +// +// @Override +// public int BytePerType(ItemStack itemStack) { +// return 1; +// } +// +// @Override +// public int getBytesPerType(ItemStack itemStack) { +// return 1; +// } +// +// @Override +// public int getTotalTypes(ItemStack itemStack) { +// return 4096; +// } +// +// @Override +// public boolean isBlackListed(ItemStack itemStack, IAEItemStack iaeItemStack) { +// return iaeItemStack == null || iaeItemStack.getItem().getItemStackLimit() != 1; +// } +// +// @Override +// public boolean storableInStorageCell() { +// return true; +// } +// +// @Override +// public boolean isStorageCell(ItemStack itemStack) { +// return true; +// } +// +// @Override +// public double getIdleDrain() { +// return 4D; +// } +// +// @Override +// public boolean isEditable(ItemStack itemStack) { +// return true; +// } +// +// @Override +// public IInventory getUpgradesInventory(ItemStack itemStack) { +// return new CellUpgrades(itemStack, 2); +// } +// +// @Override +// public IInventory getConfigInventory(ItemStack itemStack) { +// return new CellUpgrades(itemStack,2); +// } +// @Override +// public FuzzyMode getFuzzyMode(ItemStack is) { +// String fz = Platform.openNbtData(is).getString("FuzzyMode"); +// +// try { +// return FuzzyMode.valueOf(fz); +// } catch (Throwable var4) { +// return FuzzyMode.IGNORE_ALL; +// } +// } +// @Override +// public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { +// Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); +// } +//} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index e6e500987c..5e1bb3e792 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -47,8 +47,9 @@ import java.util.HashSet; import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; +@SuppressWarnings("ALL") public class TCRecipeHandler { - public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(), + public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(15000), "bwcm.recipe.alchemicalConstruct", "Industrical Alchemical Construct", null, diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index b8192f742e..db9b77ec91 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -35,16 +35,20 @@ import gregtech.api.util.GT_Utility; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import static gregtech.api.enums.GT_Values.V; -public class GT_Industrial_Alchemic_Furnace extends GT_MetaTileEntity_MultiBlockBase { +@SuppressWarnings("ALL") +public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { - List<Object> mEssentiaHatches = new ArrayList<>(); + private List<Object> mEssentiaHatches = new ArrayList<>(); public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) @@ -68,11 +72,11 @@ public class GT_Industrial_Alchemic_Furnace extends GT_MetaTileEntity_MultiBlock } } - public GT_Industrial_Alchemic_Furnace(int aID, String aName, String aNameRegional) { + public GT_Industrial_Alchemic_Construct(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - public GT_Industrial_Alchemic_Furnace(String aName) { + private GT_Industrial_Alchemic_Construct(String aName) { super(aName); } @@ -84,9 +88,10 @@ public class GT_Industrial_Alchemic_Furnace extends GT_MetaTileEntity_MultiBlock @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack stack = new ItemStack(Items.feather); + String owner = this.getBaseMetaTileEntity().getOwnerName(); + Object allAspects = null; try { - String owner = this.getBaseMetaTileEntity().getOwnerName(); - Object allAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); + allAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Object o : this.mEssentiaHatches) { Object aspectList = EMTHandler.aAspectField.get(o); ThaumcraftHandler.AspectAdder.add.invoke(allAspects,aspectList); @@ -98,13 +103,49 @@ public class GT_Industrial_Alchemic_Furnace extends GT_MetaTileEntity_MultiBlock return false; } ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>(); + ItemStack outputItems = null; long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe(this.getBaseMetaTileEntity(),null,false, false, V[tTier], null, stack,tInputs); - - return false; + GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe(this.getBaseMetaTileEntity(),null,false, false, V[tTier], null, stack, tInputs); + ItemStack helper = (ItemStack) tRecipe.mSpecialItems; + NBTTagCompound tagCompound = helper.getTagCompound(); + String research = tagCompound.getCompoundTag("display").getString("Name"); + Object aspectList = null; + try { + aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); + ThaumcraftHandler.AspectAdder.readAspectListFromNBT.invoke(aspectList,tagCompound); + } catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { + e.printStackTrace(); + return false; + } + boolean complete = false; + try { + complete = (boolean) ThaumcraftHandler.AspectAdder.isResearchComplete.invoke(null,owner,research); + } catch (IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + } + if (!complete) + return false; + if (!tRecipe.isRecipeInputEqual(true,new FluidStack[0],tInputs)) + return false; + LinkedHashMap<Object,Integer> list = null; + LinkedHashMap<Object,Integer> needed = null; + try { + list = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(allAspects); + needed = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(aspectList); + } catch (IllegalAccessException e) { + e.printStackTrace(); + return false; + } + assert list != null; + assert needed != null; + for (Map.Entry<Object,Integer> toTake : needed.entrySet()){ + list.replace(toTake.getKey(),list.get(toTake.getKey())-toTake.getValue()); + } + this.addOutput(tRecipe.mOutputs[0]); + this.updateSlots(); + return true; } @Override @@ -134,7 +175,7 @@ public class GT_Industrial_Alchemic_Furnace extends GT_MetaTileEntity_MultiBlock @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_Industrial_Alchemic_Furnace(mName); + return new GT_Industrial_Alchemic_Construct(mName); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java index c720de1f07..b6cc37b451 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -22,14 +22,16 @@ package com.github.bartimaeusnek.crossmod.emt.util; -import java.lang.reflect.Field; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import java.lang.reflect.Field; +@SuppressWarnings("unchecked") public class EMTHandler { - public static Class aEssentiaInputHatch; + public static Class<? extends GT_MetaTileEntity_Hatch_Input> aEssentiaInputHatch; public static Field aAspectField; static { try { - aEssentiaInputHatch = Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); + aEssentiaInputHatch = (Class<? extends GT_MetaTileEntity_Hatch_Input>) Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); aAspectField = aEssentiaInputHatch.getDeclaredField("current"); aAspectField.setAccessible(true); } catch (ClassNotFoundException | NoSuchFieldException e) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index cca1bf94d4..255f83a125 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.crossmod.galacticraft.atmosphere.BWAtmosphereManager; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import cpw.mods.fml.common.FMLCommonHandler; @@ -35,9 +37,6 @@ import net.minecraftforge.common.config.Configuration; import java.io.File; -import static com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b.init_OresRoss128; -import static com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b.init_undergroundFluidsRoss128; - public class GalacticraftProxy { public static GT_UO_DimensionList uo_dimensionList = new GT_UO_DimensionList(); static Configuration gtConf; @@ -72,10 +71,12 @@ public class GalacticraftProxy { private static void commonpreInit(FMLPreInitializationEvent e) { GalacticraftProxy.gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); GalacticraftProxy.uo_dimensionList.getConfig(GalacticraftProxy.gtConf, "undergroundfluid"); - init_undergroundFluidsRoss128(); + BW_WorldGenRoss128b.initundergroundFluids(); + BW_WorldGenRoss128ba.init_undergroundFluids(); if (GalacticraftProxy.gtConf.hasChanged()) GalacticraftProxy.gtConf.save(); - init_OresRoss128(); + BW_WorldGenRoss128b.initOres(); + BW_WorldGenRoss128ba.init_Ores(); MinecraftForge.EVENT_BUS.register(BWAtmosphereManager.INSTANCE); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index 8eddf5eb04..fb0451d381 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index ddae0648b2..16e4020459 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 0b835e382c..83238c5f07 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -34,8 +34,12 @@ import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +@SuppressWarnings("unused") public final class BWAtmosphereManager { private static final Map<Integer,Integer[]> COEFFICIENT_MAP = new HashMap<>(); @@ -61,7 +65,6 @@ public final class BWAtmosphereManager { } public static void removeGasFromWorld(int worldID, ISubTagContainer gas){ - HashSet toRemSet = new HashSet(); for (Pair<ISubTagContainer,Integer> pair : BWAtmosphereManager.gasConcentration.get(worldID)){ if (pair.getKey().equals(gas)){ BWAtmosphereManager.gasConcentration.get(worldID).remove(pair); @@ -71,7 +74,7 @@ public final class BWAtmosphereManager { } public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount){ - Pair<ISubTagContainer,Integer> toadd = new Pair<ISubTagContainer,Integer>(gas,amount); + Pair<ISubTagContainer,Integer> toadd = new Pair<>(gas,amount); BWAtmosphereManager.gasConcentration.put(worldID,toadd); } @@ -79,6 +82,7 @@ public final class BWAtmosphereManager { BWAtmosphereManager.gasConcentration.put(worldID,toPut); } + @SafeVarargs public static void addGasToWorld(int worldID, Pair<ISubTagContainer,Integer>... toPut){ for (Pair<ISubTagContainer,Integer> toadd : toPut) BWAtmosphereManager.gasConcentration.put(worldID,toadd); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java index a404c30e34..3a7e92f186 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java index d30d72bacd..7e082ba695 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index 988920cae6..47be16ce21 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 34e96e6111..bc33a08855 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -53,7 +53,7 @@ import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.Ev public class ChunkProviderRoss128b extends ChunkProviderGenerate { XSTR rand = new XSTR(); private BiomeGenBase[] biomesForGeneration; - private final BW_WordGenerator BWOreGen = new BW_WordGenerator(); + public static final BW_WordGenerator BWOreGen = new BW_WordGenerator(); private final World worldObj; private final MapGenBase caveGenerator = new MapGenCaves(); private final MapGenBase ravineGenerator = new MapGenRavine(); @@ -65,6 +65,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } @Override + @SuppressWarnings("rawtypes") public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { return null; } @@ -159,7 +160,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } } - this.BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); + BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); BlockFalling.fallInstantly = false; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index d575bd7dd8..d096ba4962 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index 40cfbbbca4..f6a5cfc3f3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -57,7 +57,7 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace { float blue = 0.0F; red *= angle * 0.94F + 0.06F; green *= angle * 0.94F + 0.06F; - return Vec3.createVectorHelper((double) red, (double) green, (double) blue); + return Vec3.createVectorHelper(red, green, blue); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 044737ac9c..69e7c3d525 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.ChunkProviderRoss128b; import gregtech.api.objects.XSTR; import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; @@ -30,10 +31,12 @@ import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon; import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon; import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; import java.util.Arrays; @@ -66,6 +69,14 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { return Chunk; } + @Override + public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { + super.populate(par1IChunkProvider, par2, par3); + BlockFalling.fallInstantly = true; + ChunkProviderRoss128b.BWOreGen.generate(this.rand, par2, par3, this.worldObj, this, this); + BlockFalling.fallInstantly = false; + } + private int getIndex(int x, int y, int z) { return (x * 16 + z) * 256 + y; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java index eeb306018c..f445290136 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 359450c7f9..cc3f2a0744 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -69,17 +69,15 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class); - Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? Math.min(ConfigHandler.ross128btier + 1, 8) : 3); - - //Ross128SolarSystem.Ross128ba.setUnreachable(); + Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("GalaxySpace") ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); -// GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); + GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); GalacticraftRegistry.registerRocketGui(WorldProviderRoss128b.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); -// GalacticraftRegistry.registerRocketGui(WorldProviderRoss128Ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); + GalacticraftRegistry.registerRocketGui(WorldProviderRoss128Ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); -// GalacticraftRegistry.registerTeleportType(WorldProviderRoss128Ba.class, new UniversalTeleportType()); + GalacticraftRegistry.registerTeleportType(WorldProviderRoss128Ba.class, new UniversalTeleportType()); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java new file mode 100644 index 0000000000..cce24d22db --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2018-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.crossmod.galaxySpace.tileEntity; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import micdoodle8.mods.galacticraft.core.GalacticraftCore; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; + +public class DysonSwarmSunReplacement extends MetaTileEntity { + private static boolean wasBuild; + private static long dysonObjs; + private static long swarmControllers; + + + public DysonSwarmSunReplacement(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { + super(aID, aBasicName, aRegionalName, aInvSlotCount); + } + + private DysonSwarmSunReplacement(String aName, int aInvSlotCount) { + super(aName, aInvSlotCount); + } + + + public void toggle(){ + if (!wasBuild) { + GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); + wasBuild = !wasBuild; + } else { + GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); + wasBuild = !wasBuild; + } + } + + @Override + public byte getTileEntityBaseType() { + return 2; + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + ++swarmControllers; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + toggle(); + return super.onRightclick(aBaseMetaTileEntity, aPlayer); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new DysonSwarmSunReplacement(this.mName,this.mInventory.length); + } + + @Override + public void saveNBTData(NBTTagCompound nbtTagCompound) { + nbtTagCompound.setLong("dysonObjs", dysonObjs); + } + + @Override + public void loadNBTData(NBTTagCompound nbtTagCompound) { + dysonObjs = Math.max(dysonObjs, nbtTagCompound.getLong("dysonObjs")); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + aBaseMetaTileEntity.increaseStoredEnergyUnits((DysonSwarmSunReplacement.dysonObjs*10000)/ swarmControllers, true); + } + + public boolean isEnetOutput() { + return true; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public String[] getDescription() { + return new String[0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + return new ITexture[0]; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java new file mode 100644 index 0000000000..609a718be2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2018-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.crossmod.galaxySpace.tileEntity; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class GalaxySpaceProxy { + + private GalaxySpaceProxy() { + } + + public static void postInit(FMLPostInitializationEvent e){ + + } + + public static void preInit(FMLPreInitializationEvent e) { + + } + + private static void serverpreInit(FMLPreInitializationEvent e) { + + } + + private static void clientpreInit(FMLPreInitializationEvent e) { + } + + private static void commonpreInit(FMLPreInitializationEvent e) { + + } + + public static void init(FMLInitializationEvent e) { + + } + + private static void serverInit(FMLInitializationEvent e) { + + } + + private static void clientInit(FMLInitializationEvent e) { + + } + + private static void commonInit(FMLInitializationEvent e) { + + } + private static void serverPostInit(FMLPostInitializationEvent e) { + + } + + private static void clientPostInit(FMLPostInitializationEvent e) { + + } + + private static void commonPostInit(FMLPostInitializationEvent e) { + + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 7db0ab7bb5..954364034a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 78251dac89..1cfdcf32d6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java new file mode 100644 index 0000000000..8bfa8024d5 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2018-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.crossmod.tectech; + +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; + +import java.util.ArrayList; +import java.util.Iterator; + +@SuppressWarnings({"unused"}) +public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { + + ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> mTTEnergyHatches = new ArrayList<>(); + ArrayList<GT_MetaTileEntity_Hatch_DynamoMulti> mTTDynamos = new ArrayList<>(); + public TT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public TT_TileEntity_ManualTrafo(String aName) { + super(aName); + } + + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_TileEntity_ManualTrafo(this.mName); + } + + + public boolean addEnergyOutput(long aEU) { + if (aEU <= 0L) { + return true; + } else { + return mTTDynamos.size() > 0 || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); + } + } + + + public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { + int injected = 0; + long totalOutput = 0L; + long aFirstVoltageFound = -1L; + boolean aFoundMixedDynamos = false; + Iterator<GT_MetaTileEntity_Hatch_Dynamo> var10 = this.mDynamoHatches.iterator(); + + long aVoltage; + while(var10.hasNext()) { + GT_MetaTileEntity_Hatch_Dynamo aDynamo = var10.next(); + if (aDynamo == null) { + return false; + } + + if (isValidMetaTileEntity(aDynamo)) { + aVoltage = aDynamo.maxEUOutput(); + long aTotal = aDynamo.maxAmperesOut() * aVoltage; + if (aFirstVoltageFound == -1L) { + aFirstVoltageFound = aVoltage; + } else if (aFirstVoltageFound != aVoltage) { + aFoundMixedDynamos = true; + } + + totalOutput += aTotal; + } + } + + if (totalOutput < aEU || aFoundMixedDynamos && !aAllowMixedVoltageDynamos) { + this.explodeMultiblock(); + return false; + } else { + Iterator<GT_MetaTileEntity_Hatch_Dynamo> var17 = this.mDynamoHatches.iterator(); + + while(true) { + GT_MetaTileEntity_Hatch_Dynamo aDynamo; + do { + if (!var17.hasNext()) { + return injected > 0; + } + + aDynamo = var17.next(); + } while(!isValidMetaTileEntity(aDynamo)); + + long leftToInject = aEU - (long)injected; + aVoltage = aDynamo.maxEUOutput(); + int aAmpsToInject = (int)(leftToInject / aVoltage); + int aRemainder = (int)(leftToInject - (long)aAmpsToInject * aVoltage); + int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); + + for(int i = 0; i < ampsOnCurrentHatch; ++i) { + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); + } + + injected = (int)((long)injected + aVoltage * (long)ampsOnCurrentHatch); + if (aRemainder > 0 && (long)ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); + injected += aRemainder; + } + } + } + } + + + + public boolean drainEnergyInput(long aEU) { + if (aEU > 0L) { + { + Iterator<GT_MetaTileEntity_Hatch_EnergyMulti> var3 = this.mTTEnergyHatches.iterator(); + + GT_MetaTileEntity_Hatch_EnergyMulti tHatch; + do { + if (!var3.hasNext()) { + return false; + } + + tHatch = var3.next(); + } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + } + { + Iterator<GT_MetaTileEntity_Hatch_Energy> var3 = this.mEnergyHatches.iterator(); + + GT_MetaTileEntity_Hatch_Energy tHatch; + do { + if (!var3.hasNext()) { + return false; + } + + tHatch = var3.next(); + } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + } + + } + return true; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java new file mode 100644 index 0000000000..855c5011a1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2018-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.crossmod.tectech; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.technus.tectech.recipe.TT_recipeAdder; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraftforge.fluids.FluidStack; + +public class TecTechResearchLoader { + + @SuppressWarnings("deprecation") + public static void runResearches(){ + + TT_recipeAdder.addResearchableAssemblylineRecipe( + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + 64000, + 48, + BW_Util.getMachineVoltageFromTier(8), + 8, + new Object[]{ + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Osmium,64), + GT_OreDictUnificator.get(OrePrefixes.ring,Materials.Osmium,64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01,Materials.Superconductor,64), + ItemList.Electric_Piston_UV.get(64), + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) + }, + ItemRegistry.eic.copy(), + 240000, + BW_Util.getMachineVoltageFromTier(8) + ); + +// BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); +// HashSet<GT_Recipe.GT_Recipe_AssemblyLine> toRem = new HashSet<>(); +// for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ +// if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, CustomItemList.UnusedStuff.get(1L))){ +// String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; +// if (!modId.equalsIgnoreCase("tectech")) +// if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && (recipe.mOutput.getItemDamage() < 15000 || recipe.mOutput.getItemDamage() > 16999)) +// toRem.add(recipe); +// } +// } +// HashSet<GT_Recipe> toRemVisualScanner = new HashSet<>(); +// HashSet<GT_Recipe> toRemVisualAssLine = new HashSet<>(); +// GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); +// +// for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ +// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualAssLine::add); +// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualScanner::add); +// TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); +// } +// +// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); +// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index 267945116f..c6f9003d9d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index 3700e89287..67c0dfb15d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 7911b0c9af..991b7ad1b5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -51,11 +51,8 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; this.mBatteryCount = 0; this.mChargeableCount = 0; - ItemStack[] var4 = this.mInventory; - int var5 = var4.length; - for(int var6 = 0; var6 < var5; ++var6) { - ItemStack tStack = var4[var6]; + for (ItemStack tStack : this.mInventory) { if (ThaumcraftHandler.isWand(tStack)) { ++this.mBatteryCount; ++this.mChargeableCount; @@ -82,23 +79,20 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { boolean storedOverflow = false; long tScale = this.getBaseMetaTileEntity().getEUCapacity(); long tStored = this.getBaseMetaTileEntity().getStoredEU(); - long tStep = 0L; + long tStep; if (this.mInventory != null) { - ItemStack[] var9 = this.mInventory; - int var10 = var9.length; - for(int var11 = 0; var11 < var10; ++var11) { - ItemStack aStack = var9[var11]; + for (ItemStack aStack : this.mInventory) { if (GT_ModHandler.isElectricItem(aStack)) { if (aStack.getItem() instanceof GT_MetaBase_Item) { - Long[] stats = ((GT_MetaBase_Item)aStack.getItem()).getElectricStats(aStack); + Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack); if (stats != null) { if (stats[0] > 4611686018427387903L) { scaleOverflow = true; } tScale += stats[0]; - tStep = ((GT_MetaBase_Item)aStack.getItem()).getRealCharge(aStack); + tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack); if (tStep > 4611686018427387903L) { storedOverflow = true; } @@ -106,8 +100,8 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { tStored += tStep; } } else if (aStack.getItem() instanceof IElectricItem) { - tStored += (long)ElectricItem.manager.getCharge(aStack); - tScale += (long)((IElectricItem)aStack.getItem()).getMaxCharge(aStack); + tStored += (long) ElectricItem.manager.getCharge(aStack); + tScale += (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index b753f61a4c..8789ee60d3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-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 @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.crossmod.thaumcraft.util; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TC_Aspects; @@ -32,9 +33,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.biome.BiomeGenBase; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.Objects; +@SuppressWarnings({"rawtypes","unchecked","unused"}) public class ThaumcraftHandler { private ThaumcraftHandler(){} @@ -95,6 +99,8 @@ public class ThaumcraftHandler { public static Method add; public static Method getAmount; public static Method getAspects; + public static Method isResearchComplete; + public static Field linkedAspektList; static { try { @@ -108,7 +114,9 @@ public class ThaumcraftHandler { ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); ThaumcraftHandler.AspectAdder.getAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAspects"); ThaumcraftHandler.AspectAdder.readAspectListFromNBT = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("readFromNBT", NBTTagCompound.class); - } catch (ClassNotFoundException | NoSuchMethodException e) { + ThaumcraftHandler.AspectAdder.isResearchComplete = Class.forName("thaumcraft.common.lib.research.ResearchManager").getMethod("isResearchComplete",String.class,String.class); + ThaumcraftHandler.AspectAdder.linkedAspektList = ThaumcraftHandler.AspectAdder.mAspectListClass.getField("aspects"); + } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException e) { e.printStackTrace(); } } @@ -141,14 +149,16 @@ public class ThaumcraftHandler { } public static void addAspectToAll(Werkstoff werkstoff){ - for (OrePrefixes element : OrePrefixes.values()) { - if ((werkstoff.getGenerationFeatures().toGenerate & element.mMaterialGenerationBits) != 0 && (werkstoff.getGenerationFeatures().blacklist & element.mMaterialGenerationBits) == 0) { + for (OrePrefixes element : WerkstoffLoader.ENABLED_ORE_PREFIXES) { + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(element)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(element)) == 0) { if (element.mMaterialAmount >= 3628800L || element == OrePrefixes.ore) { - DebugLog.log("OrePrefix: "+element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L))); + DebugLog.log("OrePrefix: " + element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); + if (Objects.nonNull(WerkstoffLoader.items.get(element))) + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L))); } else if (element.mMaterialAmount >= 0L) { - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair<Object, Integer>(TC_Aspects.PERDITIO.mAspect, 1)); + if (Objects.nonNull(WerkstoffLoader.items.get(element))) + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); } } } diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index df76b57277..6dc22e440e 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -1,88 +1,96 @@ -itemGroup.GT2C=Gregtech 2 Compat -item.GT_Rockcutter_Item_LV.name=Steinschneider LV -item.GT_Rockcutter_Item_MV.name=Steinschneider MV -item.GT_Rockcutter_Item_HV.name=Steinschneider HV -item.GT_Teslastaff_Item.name=Teslastab +BW_GlasBlocks.0.name=Borosilicat Glass Block +BW_GlasBlocks.1.name=Nickel Verstärkter Borosilicate Glass Block +BW_GlasBlocks.10.name=Farbiger Borosilicate Glass Block (Hell Grün) +BW_GlasBlocks.11.name=Farbiger Borosilicate Glass Block (Braun) +BW_GlasBlocks.12.name=Thorium Yttrium Glass Block +BW_GlasBlocks.2.name=Tungsten Verstärkter Borosilicate Glass Block +BW_GlasBlocks.3.name=Chrome Verstärkter Borosilicate Glass Block +BW_GlasBlocks.4.name=Iridium Verstärkter Borosilicate Glass Block +BW_GlasBlocks.5.name=Osmium Verstärkter Borosilicate Glass Block +BW_GlasBlocks.6.name=Farbiger Borosilicate Glass Block (Rot) +BW_GlasBlocks.7.name=Farbiger Borosilicate Glass Block (Grün) +BW_GlasBlocks.8.name=Farbiger Borosilicate Glass Block (Lila) +BW_GlasBlocks.9.name=Farbiger Borosilicate Glass Block (Gelb) BW_ItemBlocks.0.name=Geätzte Lapis Zelle BW_ItemBlocks.1.name=Plattierte Lapis Zelle -GT_LESU_CASING.0.name=LESU Hülle - -itemGroup.bartworks=BartWorks Inter Temporal BW_Machinery_Casings.0.name=Nickel-Zinc Ferrite Block BW_Machinery_Casings.1.name=Transformer-Wicklungs Block -item.BW_PaperRotor.name=Primitiver Papier Rotor (nur Wind) -item.BW_LeatherRotor.name=Primitiver Leder Rotor (nur Wind) -item.BW_WoolRotor.name=Primitiver Wolle Rotor (nur Wind) +GT_LESU_CASING.0.name=LESU Hülle +filled.item.petriDish.name=Petri Schale mit einer Kultur +item.Agarose.name=Agarose +item.BISOPellet.name=BISO Kügelchen +item.BISOPelletBall.name=BISO Kügelchen Ball +item.BISOPelletCompound.name=BISO Kügelchen Material item.BW_CombinedRotor.name=Primitiver Multi-Material Rotor (nur Wind) -tile.BWRotorBlock.0.name=Primitive Kinetische Achsen Box -item.grindstone_top.name=Oberes Teil des Mahlsteins -item.grindstone_bottom.name=Unteres Teil des Mahlsteins -item.completed_grindstone.name=Mahlsteins -item.rotors.leatherParts.name=Leder umspannter Holzrahmen -item.rotors.woolParts.name=Wolle umspannter Holzrahmen -item.rotors.paperParts.name=Papier umspannter Holzrahmen -item.rotors.combinedParts.name=Multi-Material umspannter Holzrahmen +item.BW_LeatherRotor.name=Primitiver Leder Rotor (nur Wind) +item.BW_PaperRotor.name=Primitiver Papier Rotor (nur Wind) item.BW_SimpleWindMeter.name=Einfaches Wind Meter -tile.BWHeatedWaterPump.0.name=Einfache Stirling Wasser Pumpe -item.BWrawtube.name=Verlängerte Glass Röhre +item.BW_WoolRotor.name=Primitiver Wolle Rotor (nur Wind) item.BWmotor.name=Einfache Wärmekraftmaschine - -itemGroup.BioTab=BartWorks BioEngineering -filled.item.petriDish.name=Petri Schale mit einer Kultur -item.petriDish.name=Sterilisierte Petri Schale +item.BWrawtube.name=Verlängerte Glass Röhre +item.BWstove.name=Einfacher Beheizter Ofen +item.Cells.name=Bakterien Zellen item.DNASampleFlask.name=DNA-Proben Flasche -item.PlasmidCell.name=Plasmid-Proben Flasche item.DetergentPowder.name=Waschmittel -item.Agarose.name=Agarose +item.GT_Rockcutter_Item_HV.name=Steinschneider HV +item.GT_Rockcutter_Item_LV.name=Steinschneider LV +item.GT_Rockcutter_Item_MV.name=Steinschneider MV +item.GT_Teslastaff_Item.name=Teslastab item.IncubationModule.name=Incubations Modul -item.Cells.name=Bakterien Zellen item.PlasmaMembrane.name=Plasma Membran +item.PlasmidCell.name=Plasmid-Proben Flasche +item.TRISOPellet.name=TRISO Kügelchen +item.TRISOPelletBall.name=TRISO Kügelchen Ball +item.TRISOPelletCompound.name=TRISO Kügelchen Material +item.completed_grindstone.name=Mahlstein +item.grindstone_bottom.name=Unteres Teil des Mahlsteins +item.grindstone_top.name=Oberes Teil des Mahlsteins +item.petriDish.name=Sterilisierte Petri Schale +item.rotors.combinedParts.name=Multi-Material umspannter Holzrahmen +item.rotors.leatherParts.name=Leder umspannter Holzrahmen +item.rotors.paperParts.name=Papier umspannter Holzrahmen +item.rotors.woolParts.name=Wolle umspannter Holzrahmen +itemGroup.BioTab=BartWorks BioEngineering +itemGroup.GT2C=Gregtech 2 Compat +itemGroup.bartworks=BartWorks Inter Temporal +itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials +itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items +labModule.item.ClonalCellularSynthesisModule.name=Zelluläres Clone Modul labModule.item.DNAExtractionModule.name=DNA Extractions Modul labModule.item.PCRThermoclyclingModule.name=PCR Thermozykler labModule.item.PlasmidSynthesisModule.name=Plasmid Synthese Modul labModule.item.TransformationModule.name=Transformations Modul -labModule.item.ClonalCellularSynthesisModule.name=Zelluläres Clone Modul -BW_GlasBlocks.0.name=Borosilicat Glass Block -BW_GlasBlocks.1.name=Nickel Verstärkter Borosilicate Glass Block -BW_GlasBlocks.2.name=Tungsten Verstärkter Borosilicate Glass Block -BW_GlasBlocks.3.name=Chrome Verstärkter Borosilicate Glass Block -BW_GlasBlocks.4.name=Iridium Verstärkter Borosilicate Glass Block -BW_GlasBlocks.5.name=Osmium Verstärkter Borosilicate Glass Block -BW_GlasBlocks.6.name=Farbiger Borosilicate Glass Block (Rot) -BW_GlasBlocks.7.name=Farbiger Borosilicate Glass Block (Grün) -BW_GlasBlocks.8.name=Farbiger Borosilicate Glass Block (Lila) -BW_GlasBlocks.9.name=Farbiger Borosilicate Glass Block (Gelb) -BW_GlasBlocks.10.name=Farbiger Borosilicate Glass Block (Hell Grün) -BW_GlasBlocks.11.name=Farbiger Borosilicate Glass Block (Braun) - -tooltip.glas.0.name=Glass-Tier: +moon.Ross128ba=Ross128ba +nei.biovat.0.name=Braucht Glass Tier: +nei.biovat.1.name=Braucht genau +nei.biovat.2.name=Braucht mindestens +planet.Ross128b=Ross128b +solarsystem.Ross128System=Ross128-System +star.Ross128=Ross128 +tile.BWHeatedWaterPump.0.name=Einfache Stirling Wasser Pumpe +tile.BWRotorBlock.0.name=Primitive Kinetische Achsen Box +tile.acidgenerator.name=Säure Generator +tile.biolab.name=Bio Labor +tile.biovat.name=Bacterien Tank +tile.bw.mbf.name=Mega Brennofen +tile.bw.mvf.name=Mega Vacuum Gefrierer +tile.bw.windmill.name=Windmühle +tile.diode.name=Kabel Diode +tile.energydistributor.name=Energie Distributor +tile.manutrafo.name=Manualeller Trafo +tile.radiohatch.name=Radio Hülle tooltip.LESU.0.name=Maximale Kapazität! tooltip.LESU.1.name=Mehrere Kontroller! - -tooltip.windmeter.0.name=Ein einfaches Windmeter, um einen Platz für die Windmühle zu finden. -tooltip.windmeter.1.name=Benutzungen: -tooltip.windmeter.2.name=nicht da zu sein. -tooltip.windmeter.3.name=sehr niedrig zu sein. -tooltip.windmeter.4.name=normal zu sein. -tooltip.windmeter.5.name=eher stark zu sein. -tooltip.windmeter.6.name=sehr stark zu sein. -tooltip.windmeter.7.name=zu stark zu sein. -tooltip.windmeter.8.name=Der Wind hier scheint -tooltip.rotor.0.name=Durchmesser: -tooltip.rotor.1.name=Haltbarkeit: -tooltip.rotor.2.name=Effizienz: -tooltip.cp.0.name=Ist ein Chip drinnen? - tooltip.bw.0.name=Hinzugefügt von tooltip.bw.1.name=Hinzugefügt von bartimaeusnek durch -tooltip.bw.yes.name=Ja -tooltip.bw.no.name=Nein -tooltip.bw.tier.name=Tier: +tooltip.bw.empty.name=Leer tooltip.bw.kg.0.name=kg tooltip.bw.kg.1.name=kgs -tooltip.bw.empty.name=Leer - -tooltip.teslastaff.0.name=Keine Garantie! +tooltip.bw.no.name=Nein +tooltip.bw.tier.name=Tier: +tooltip.bw.yes.name=Ja +tooltip.cp.0.name=Ist ein Chip drinnen? +tooltip.glas.0.name=Glass-Tier: tooltip.labmodule.0.name=A Module used to change the BioLab's working Mode tooltip.labparts.0.name=An empty Sterilized Petri Dish. tooltip.labparts.1.name=An empty DNA Flask. @@ -93,28 +101,26 @@ tooltip.labparts.5.name=A Petri Dish containing: tooltip.labparts.6.name=This is a weak culture, it can not be bred in the Bacterial Vat! tooltip.labparts.7.name=A DNA Flask containing: tooltip.labparts.8.name=A Plasmid Cell containing: - -tooltip.tile.waterpump.0.name=Produces -tooltip.tile.waterpump.1.name=L/s Water when fueled. -tooltip.tile.waterpump.2.name=Must be placed on the Ground. - -tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum -tooltip.tile.mbf.1.name=Pollution per second -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest +tooltip.rotor.0.name=Durchmesser: +tooltip.rotor.1.name=Haltbarkeit: +tooltip.rotor.2.name=Effizienz: +tooltip.teslastaff.0.name=Keine Garantie! +tooltip.tile.acidgen.0.name=An Acid Generator +tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. +tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! -tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) +tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. +tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! +tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. +tooltip.tile.htr.0.name=Controller Block für den Thorium Hoch Temperatur Reaktor;Größe(BxHxL): 11x12x11 (Innen Leer);Controller: Vorne Mitte, Unterste Schicht;Ecken und die 2 beührenden Blöcke sind Luft (Zylinder);Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. tooltip.tile.lesu.3.name=Only one Controller allowed, no Wallsharing! tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. -tooltip.tile.tiereddsc.0.name=Voltage: -tooltip.tile.tiereddsc.1.name=Amperage IN: -tooltip.tile.tiereddsc.2.name=Amperage OUT: -tooltip.tile.tiereddsc.3.name=Capacity: -tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. -tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. -tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station +tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum +tooltip.tile.mbf.1.name=Pollution per second +tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks tooltip.tile.radhatch.1.name=Use a screwdriver to set the containment level tooltip.tile.radhatch.2.name=Material: @@ -125,19 +131,20 @@ tooltip.tile.radhatch.6.name=t tooltip.tile.radhatch.7.name=s tooltip.tile.radhatch.8.name=m tooltip.tile.radhatch.9.name=h -tooltip.tile.acidgen.0.name=An Acid Generator -tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. -nei.biovat.0.name=Braucht Glass Tier: -nei.biovat.1.name=Braucht genau -nei.biovat.2.name=Braucht mindestens - -tile.diode.name=Kabel Diode -tile.energydistributor.name=Energie Distributor -tile.acidgenerator.name=Säure Generator -tile.bw.mbf.name=Mega Brennofen -tile.bw.mvf.name=Mega Vacuum Gefrierer -tile.biolab.name=Bio Labor -tile.biovat.name=Bacterien Tank -tile.radiohatch.name=Radio Hülle -tile.bw.windmill.name=Windmühle -tile.manutrafo.name=Manualeller Trafo
\ No newline at end of file +tooltip.tile.tiereddsc.0.name=Voltage: +tooltip.tile.tiereddsc.1.name=Amperage IN: +tooltip.tile.tiereddsc.2.name=Amperage OUT: +tooltip.tile.tiereddsc.3.name=Kapazität: +tooltip.tile.waterpump.0.name=Produziert +tooltip.tile.waterpump.1.name=L/s Wasser wenn laufend. +tooltip.tile.waterpump.2.name=Muss auf dem Boden stehen. +tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) +tooltip.windmeter.0.name=Ein einfaches Windmeter, um einen Platz für die Windmühle zu finden. +tooltip.windmeter.1.name=Benutzungen: +tooltip.windmeter.2.name=nicht da zu sein. +tooltip.windmeter.3.name=sehr niedrig zu sein. +tooltip.windmeter.4.name=normal zu sein. +tooltip.windmeter.5.name=eher stark zu sein. +tooltip.windmeter.6.name=sehr stark zu sein. +tooltip.windmeter.7.name=zu stark zu sein. +tooltip.windmeter.8.name=Der Wind hier scheint
\ No newline at end of file diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index b0b3c9b7b6..43830aa4bb 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo -tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (Cylindric);Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes up to 0.5% of total Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days item.TRISOPellet.name=TRISO pebble item.TRISOPelletBall.name=TRISO pebble ball item.BISOPelletBall.name=BISO pebble ball @@ -161,4 +161,6 @@ moon.Ross128ba=Ross128ba star.Ross128=Ross128 solarsystem.Ross128System=Ross128-System -itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items
\ No newline at end of file +itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items + +#Liquids diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index 847d021e59..4cb840b7ff 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -55,6 +55,7 @@ BW_GlasBlocks.8.name=Bloc de Verre Boronsilicate coloré (Violet) BW_GlasBlocks.9.name=Bloc de Verre Boronsilicate coloré (Jaune) BW_GlasBlocks.10.name=Bloc de Verre Boronsilicate coloré (Vert Clair) BW_GlasBlocks.11.name=Bloc de Verre Boronsilicate coloré (Marron) +BW_GlasBlocks.12.name=Thorium Yttrium Glass Block tooltip.glas.0.name=Tier de verre: tooltip.LESU.0.name=Capacité maximum! @@ -141,4 +142,22 @@ tile.biolab.name=Bio Lab tile.biovat.name=Bio Cuve tile.radiohatch.name=Trappe Radio tile.bw.windmill.name=Eolienne -tile.manutrafo.name=Transformateur Manuel
\ No newline at end of file +tile.manutrafo.name=Transformateur Manuel + +item.TRISOPellet.name=TRISO pebble +item.TRISOPelletBall.name=TRISO pebble ball +item.BISOPelletBall.name=BISO pebble ball +item.BISOPellet.name=BISO pebble +item.TRISOPelletCompound.name=TRISO pebble compund +item.BISOPelletCompound.name=BISO pebble compund +itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials + +tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! + + +planet.Ross128b=Ross128b +moon.Ross128ba=Ross128ba +star.Ross128=Ross128 +solarsystem.Ross128System=Ross128-System + +itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 35818c0e8b..419c845f96 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -162,4 +162,4 @@ star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128星系 itemGroup.bw.MetaItems.0=BartWorks电路更新物品 -//This zh_CN.lang is translated by huajijam for bartworks (19/7/19)
\ No newline at end of file +#This zh_CN.lang is translated by huajijam for bartworks (19/7/19)
\ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_Cell.png b/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_Cell.png Binary files differnew file mode 100644 index 0000000000..e372f01092 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_Cell.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_CellDep.png b/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_CellDep.png Binary files differnew file mode 100644 index 0000000000..b0836b8d41 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_CellDep.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Double_Tiberiumcell.png b/src/main/resources/assets/gregtech/textures/items/gt.Double_Tiberiumcell.png Binary files differnew file mode 100644 index 0000000000..bfe6e2288b --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.Double_Tiberiumcell.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Double_TiberiumcellDep.png b/src/main/resources/assets/gregtech/textures/items/gt.Double_TiberiumcellDep.png Binary files differnew file mode 100644 index 0000000000..a7d2c341a2 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.Double_TiberiumcellDep.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Quad_Tiberiumcell.png b/src/main/resources/assets/gregtech/textures/items/gt.Quad_Tiberiumcell.png Binary files differnew file mode 100644 index 0000000000..85aa8c19a1 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.Quad_Tiberiumcell.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Quad_TiberiumcellDep.png b/src/main/resources/assets/gregtech/textures/items/gt.Quad_TiberiumcellDep.png Binary files differnew file mode 100644 index 0000000000..0a71854e05 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.Quad_TiberiumcellDep.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Tiberiumcell.png b/src/main/resources/assets/gregtech/textures/items/gt.Tiberiumcell.png Binary files differnew file mode 100644 index 0000000000..4071c6062d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.Tiberiumcell.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.TiberiumcellDep.png b/src/main/resources/assets/gregtech/textures/items/gt.TiberiumcellDep.png Binary files differnew file mode 100644 index 0000000000..bafc8a4c8c --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.TiberiumcellDep.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule.png Binary files differnew file mode 100644 index 0000000000..9e388650d9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten.png Binary files differnew file mode 100644 index 0000000000..3e9106f277 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..b2bd85bf44 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..7c6797718d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/bottle.png Binary files differnew file mode 100644 index 0000000000..dbf735f4fb --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/bottle.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/bottle_OVERLAY.png Binary files differnew file mode 100644 index 0000000000..66bd26dc46 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/bottle_OVERLAY.png diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/copy.bat b/src/main/resources/assets/gregtech/textures/items/materialicons/copy.bat new file mode 100644 index 0000000000..9713953aac --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/copy.bat @@ -0,0 +1 @@ +for /r /d %%I in (*) do xcopy %1 "%%~fsI" /H /K /Y
\ No newline at end of file |