aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-09-21 13:09:08 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-09-21 13:09:08 +0200
commit3d3427e5720aca81d4559290b077bc6b33dff4ec (patch)
tree99935a994051638d1680e7313f72727f013026c6 /src/main/java
parent4af4e216d11883788a16dd513c8a2a1b38204a4d (diff)
downloadGT5-Unofficial-3d3427e5720aca81d4559290b077bc6b33dff4ec.tar.gz
GT5-Unofficial-3d3427e5720aca81d4559290b077bc6b33dff4ec.tar.bz2
GT5-Unofficial-3d3427e5720aca81d4559290b077bc6b33dff4ec.zip
security patches
+moved some commands, +fixed a typo +removed null items +rebalanced TheCore +added forestry compat (possible due to their LGPL license!) +fixed langfiles Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: cf1373fd88ba341662144023f989bc45fef3c48d
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java39
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java30
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java144
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java63
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java51
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java9
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java9
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java7
17 files changed, 359 insertions, 37 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index 1d452f0505..6182738f04 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -30,6 +30,7 @@ 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.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader;
import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader;
@@ -48,6 +49,7 @@ import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.Plat
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;
@@ -58,6 +60,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartedEvent;
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.*;
import gregtech.api.objects.GT_ItemStack;
@@ -89,6 +92,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";
@@ -122,9 +126,6 @@ public final class MainMod {
}
}
- //fixing BorosilicateGlass... -_-'
- Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID);
-
if (Loader.isModLoaded("dreamcraft")) {
ConfigHandler.GTNH = true;
}
@@ -147,6 +148,8 @@ public final class MainMod {
INSTANCE.init();
Werkstoff.init();
GregTech_API.sAfterGTPostload.add(new CircuitPartLoader());
+ if (FMLCommonHandler.instance().getSide().isClient())
+ new PrefixTextureLinker();
}
}
@@ -219,7 +222,7 @@ public final class MainMod {
}
private static void unificationEnforcer() {
- for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) {
+ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
if (werkstoff.getGenerationFeatures().enforceUnification) {
if (werkstoff.contains(NOBLE_GAS)){
String name = werkstoff.getFluidOrGas(1).getFluid().getName();
@@ -310,6 +313,9 @@ public final class MainMod {
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);
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..96e69f4cf3
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java
@@ -0,0 +1,39 @@
+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()) {
+ HashMap 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(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/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java
index 2164330a96..ed84c5a98f 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
@@ -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/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java
index 5ca5d59a19..154b2a1355 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
@@ -54,7 +54,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine {
private static final String MGUINAME = "BW.GUI.BioLab.png";
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) {
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 e7a4c3aa02..c25dbd6bf1 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
@@ -23,14 +23,18 @@
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;
import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.items.GT_MetaGenerated_Item;
import gregtech.api.util.GT_LanguageManager;
@@ -53,6 +57,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
+import java.util.HashMap;
import java.util.List;
import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap;
@@ -69,6 +74,11 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
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;
@@ -148,13 +158,23 @@ 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) {
+ public 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 & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) {
@@ -207,7 +227,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
@@ -235,6 +255,6 @@ 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;
}
}
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..8cd06481d3
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java
@@ -0,0 +1,144 @@
+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 {
+
+ boolean hasList;
+
+ public BWGTMetaItems(OrePrefixes orePrefixes, List 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)))
+ 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 = (Materials) noSubIDMaterials.get(i);
+ if (!((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule)))
+ 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)
+ 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;
+ if ((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule))
+ aList.add(new ItemStack(this, 1, i));
+ }
+ 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;
+ if (hasList && ((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule)))
+ 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..35214f636c
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java
@@ -0,0 +1,63 @@
+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);
+
+ 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.hasCorrespondingFluid() || m.hasCorrespondingGas()) {
+ Fluid f = m.hasCorrespondingFluid() ? m.getFluid(1).getFluid() : m.getGas(1).getFluid();
+ final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, 1000), new ItemStack(capsuls, 1, i), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1));
+ FluidContainerRegistry.registerFluidContainer(emptyData);
+ GT_Utility.addFluidContainerData(emptyData);
+ GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), new ItemStack(capsuls, 1, i), new FluidStack(f, 1000), GT_Values.NF);
+ GT_Values.RA.addFluidCannerRecipe(new ItemStack(capsuls, 1, i), GT_Values.NI, GT_Values.NF, new FluidStack(f, 1000));
+ }
+ }
+ for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) {
+ Materials m = NoMetaValue.get(i);
+ if (m.getFluid(1) != null || m.getGas(1) != null) {
+ Fluid f = m.hasCorrespondingFluid() ? m.getFluid(1).getFluid() : m.getGas(1).getFluid();
+ final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, 1000), new ItemStack(capsuls, 1, i + 1001), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1));
+ FluidContainerRegistry.registerFluidContainer(emptyData);
+ GT_Utility.addFluidContainerData(emptyData);
+ GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), new ItemStack(capsuls, 1, i + 1001), new FluidStack(f, 1000), GT_Values.NF);
+ GT_Values.RA.addFluidCannerRecipe(new ItemStack(capsuls, 1, i + 1001), GT_Values.NI, GT_Values.NF, new FluidStack(f, 1000));
+ }
+ }
+ }
+ }
+
+}
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 0cfc13e342..7be1117d4c 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
@@ -36,6 +36,8 @@ import net.minecraftforge.fluids.FluidStack;
import java.nio.ByteBuffer;
import java.util.*;
+import static gregtech.api.enums.OrePrefixes.capsule;
+
public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
public static final LinkedHashSet<Werkstoff> werkstoffHashSet = new LinkedHashSet<>();
@@ -402,7 +404,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
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(WerkstoffLoader.capsuleMolten,0b1000000);
Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000);
Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000);
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 95337e0a7b..4e1011eb29 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
@@ -28,6 +28,7 @@ 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;
@@ -83,13 +84,13 @@ public class WerkstoffLoader implements Runnable {
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;
-
static {
for (OrePrefixes prefix : OrePrefixes.values()){
if (prefix.toString().equals("cellMolten"))
@@ -108,7 +109,14 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring");
WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt");
} catch (NullPointerException | IllegalArgumentException e){}
+ //add tiberium
Element t = EnumHelper.addEnum(Element.class,"Tr",new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{123L, 203L, 0L, -1L, (String) 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;
+ }
}
//TODO: FREE ID RANGE: 91-32766
@@ -1272,6 +1280,8 @@ public class WerkstoffLoader implements Runnable {
}
if (orePrefixes == ore)
return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID());
+ if (WerkstoffLoader.items.get(orePrefixes) == null)
+ new Exception("NO SUCH ITEM!"+orePrefixes+werkstoff.getDefaultName()).printStackTrace();
return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy();
}
@@ -1358,6 +1368,7 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING);
WerkstoffLoader.LuVTierMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING);
+ WerkstoffLoader.LuVFineWireMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING);
WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST);
@@ -1451,13 +1462,16 @@ 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(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));
@@ -1486,19 +1500,19 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.items.put(ingotQuadruple, new BW_MetaGenerated_Items(ingotQuadruple));
WerkstoffLoader.items.put(ingotQuintuple, new BW_MetaGenerated_Items(ingotQuintuple));
}
-
+ 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");
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();
+ new GTMetaItemEnhancer();
}
- public static void runGTItemDataRegistrator(){
+ private static void runGTItemDataRegistrator() {
HashSet<Materials> toRem = new HashSet<>();
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getDefaultName()) != Materials._NULL ? Materials.get(werkstoff.getDefaultName()) : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName());
@@ -1555,8 +1569,9 @@ public class WerkstoffLoader implements Runnable {
werkstoffBridgeMaterial.mName = werkstoff.getDefaultName();
toRem.add(werkstoffBridgeMaterial);
werkstoff.setBridgeMaterial(werkstoffBridgeMaterial);
- 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);
+ 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);
}
}
}
@@ -2090,6 +2105,13 @@ public class WerkstoffLoader implements Runnable {
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 (Loader.isModLoaded("Forestry")) {
+ FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(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(fluids.get(werkstoff), 1000));
+ }
+
if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){
GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
@@ -2131,11 +2153,18 @@ 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);
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 8071b9b423..353493bb70 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
@@ -142,7 +142,14 @@ public class AdditionalRecipes implements Runnable {
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)},null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6));
+ 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();
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
index 95ee440ddb..c7c1ed2585 100644
--- 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
@@ -62,11 +62,11 @@ public class AfterLuVTierEnhacement implements Runnable {
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,
- null,
- null,
- null,2000,8000);
+ new int[]{10_000,5_000,5_000},2000,8000);
}
}
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
index bcc0917b9a..289d76c4f8 100644
--- 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
@@ -37,6 +37,6 @@ public class LoadItemContainers implements Runnable {
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, 102400000, 8F, 32, 1F, BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), false));
+ 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/material/processingLoaders/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java
index 50c9e0d311..85f800d77c 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java
@@ -131,7 +131,8 @@ public class LuVTierEnhancer implements Runnable {
continue;
ItemData ass = GT_OreDictUnificator.getAssociation(stack);
if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium))
- recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize);
+ if (WerkstoffLoader.items.get(ass.mPrefix) != null)
+ recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize);
}
}
for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList){
@@ -145,7 +146,8 @@ public class LuVTierEnhancer implements Runnable {
continue;
ItemData ass = GT_OreDictUnificator.getAssociation(stack);
if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium))
- recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize);
+ if (WerkstoffLoader.items.get(ass.mPrefix) != null)
+ recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix, stack.stackSize);
}
}
for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){
@@ -157,7 +159,8 @@ public class LuVTierEnhancer implements Runnable {
continue;
ItemData ass = GT_OreDictUnificator.getAssociation(stack);
if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium))
- recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize);
+ if (WerkstoffLoader.items.get(ass.mPrefix) != null)
+ recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize);
}
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java
index b04e2e6db0..98d0438056 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java
@@ -520,15 +520,15 @@ public class PlatinumSludgeOverHaul {
if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract))
return true;
+ if (GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_1.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_2.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_4.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 (GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_1.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_2.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_4.get(1),stack,true))
- return true;
-
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")))
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..ead000b328 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
@@ -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/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java
index a4410102a7..b548597e08 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
@@ -69,7 +69,7 @@ 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.setTierRequired(Loader.isModLoaded("GalaxySpace") ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3);
GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System);
GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b);
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 353f656e4e..4d382a6c07 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
@@ -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;
@@ -150,10 +151,12 @@ public class ThaumcraftHandler {
if ((werkstoff.getGenerationFeatures().toGenerate & element.mMaterialGenerationBits) != 0 && (werkstoff.getGenerationFeatures().blacklist & element.mMaterialGenerationBits) == 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)));
+ if (WerkstoffLoader.items.get(element) != null)
+ 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 (WerkstoffLoader.items.get(element) != null)
+ ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair<Object, Integer>(TC_Aspects.PERDITIO.mAspect, 1));
}
}
}