diff options
| author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-09-19 06:07:33 +0200 |
|---|---|---|
| committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-09-19 06:07:33 +0200 |
| commit | 4af4e216d11883788a16dd513c8a2a1b38204a4d (patch) | |
| tree | 61a3d6b9c6d4ab87e2fb4e40bf3a9449172e9973 | |
| parent | 05be80efe3d7a1a302d75f3d07e19f9133cf8584 (diff) | |
| download | GT5-Unofficial-4af4e216d11883788a16dd513c8a2a1b38204a4d.tar.gz GT5-Unofficial-4af4e216d11883788a16dd513c8a2a1b38204a4d.tar.bz2 GT5-Unofficial-4af4e216d11883788a16dd513c8a2a1b38204a4d.zip | |
added Ross128ba into the game
+fixed ore decolorisation
+added "TheCore" Nq cell
+rewrote NEI Ore Handler
+limited oregen to the propper planets
+added Fluorspar ore
+further improved werkstoff recipe generation
+a lot of smaller fixes and balance
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Former-commit-id: aaed052c041488605313bd133e66a575451a2a9e
23 files changed, 275 insertions, 214 deletions
diff --git a/.gitignore b/.gitignore index 4d4c2b25eb..3db8b9657c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ hs_err_pid* /eclipse /build /out +/run /.gradle /venv /libs
\ No newline at end of file diff --git a/build.properties b/build.properties index 32b78ad9eb..cf61024f4f 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre9 +buildNumber=2_pre11 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 06261bea9f..51ee9867a9 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -175,7 +175,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;")); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 126a1263f4..1d452f0505 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -76,9 +76,7 @@ import org.apache.logging.log4j.Logger; import java.io.IOException; import java.lang.reflect.Field; -import java.lang.reflect.Modifier; import java.util.*; -import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; 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..cbd5706d16 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 @@ -30,18 +30,17 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; 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.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 +59,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,93 +70,27 @@ 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); + 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); @@ -173,70 +106,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @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); + BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result))); } } @@ -249,4 +119,44 @@ 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) { + this.worldGen = worldGen; + this.stack = new PositionedStack(result, 0, 0); + } + + 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 < 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/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 1e671a1d29..55714c38ec 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 @@ -33,6 +33,7 @@ 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 net.minecraft.world.World; @@ -78,9 +79,11 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn return rList; } - public void sendPacket(){ + @Override + public Packet getDescriptionPacket() { 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); + return null; } @Override 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..4d1a5a4a9e 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 @@ -24,7 +24,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; @@ -41,6 +40,7 @@ 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; @@ -66,7 +66,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } - 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 +77,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; } @@ -164,17 +168,17 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } - @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(); - } +// @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(); +// } private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ for (int x = -1; x <= 1; x++) { 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 index 7f36e43193..1c3455147f 100644 --- 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 @@ -34,8 +34,8 @@ 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 - ; + TiberiumCell_1,TiberiumCell_2,TiberiumCell_4, + TheCoreCell,Depleted_TheCoreCell; private ItemStack mStack; private boolean mHasNotBeenSet = true; 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 4d138e21db..0cfc13e342 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 @@ -86,6 +86,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); } @@ -95,6 +96,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); } @@ -164,6 +166,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } this.texSet = texSet; + if (this.mOreByProducts.isEmpty()) { + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + } + Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); Werkstoff.werkstoffNameHashMap.put(this.defaultName,this); @@ -323,10 +331,10 @@ 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); } 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 d821007533..95337e0a7b 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 @@ -48,7 +48,6 @@ 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.objects.ItemData; import gregtech.api.util.*; import gregtech.common.GT_Proxy; import gregtech.common.items.behaviors.Behaviour_DataOrb; @@ -111,7 +110,8 @@ public class WerkstoffLoader implements Runnable { } catch (NullPointerException | IllegalArgumentException e){} 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}); } - //TODO: FREE ID RANGE: 19-32766 + + //TODO: FREE ID RANGE: 91-32766 public static final Werkstoff Bismutite = new Werkstoff( new short[]{255, 233, 0, 0}, @@ -1202,7 +1202,7 @@ public class WerkstoffLoader implements Runnable { "Tr", new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800).setRadioactive(true).setToxic(true), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), + new Werkstoff.GenerationFeatures().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), 89, TextureSet.SET_DIAMOND ); @@ -1217,6 +1217,31 @@ public class WerkstoffLoader implements Runnable { 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 Baryte = new Werkstoff( +// new short[]{0xB9,0x45,0xFB}, +// "Baryte", +// new Werkstoff.Stats().setElektrolysis(true), +// Werkstoff.Types.COMPOUND, +// new Werkstoff.GenerationFeatures().addGems(), +// 92, +// TextureSet.SET_GEM_VERTICAL, +// new Pair<>(Materials.Barium,1), +// new Pair<>(Materials.Sulfur,1), +// new Pair<>(Materials.Oxygen,3) +// ); + + public static HashMap<OrePrefixes, BW_MetaGenerated_Items> items = new HashMap<>(); public static HashBiMap<Werkstoff, Fluid> fluids = HashBiMap.create(); @@ -1476,7 +1501,7 @@ public class WerkstoffLoader implements Runnable { public static void runGTItemDataRegistrator(){ HashSet<Materials> toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); + 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()); for (OrePrefixes prefixes : values()) { if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -1486,7 +1511,7 @@ public class WerkstoffLoader implements Runnable { if (e.toString().equals(werkstoff.getToolTip())) { if (e.mLinkedMaterials.size() > 0) break; - werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, true, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); + 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()); |
