diff options
| author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-08-28 21:49:22 +0200 |
|---|---|---|
| committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-08-28 21:49:22 +0200 |
| commit | 973c0e8e98807d368b6c0126864927c9c432f7ae (patch) | |
| tree | 95c41d337e0c927cb0d4dd8b6468342cf732a518 /src/main/java | |
| parent | 23da1fbc8e9567a2e94551f660913c3cfcc19b51 (diff) | |
| download | GT5-Unofficial-973c0e8e98807d368b6c0126864927c9c432f7ae.tar.gz GT5-Unofficial-973c0e8e98807d368b6c0126864927c9c432f7ae.tar.bz2 GT5-Unofficial-973c0e8e98807d368b6c0126864927c9c432f7ae.zip | |
Several fixes, last planned pre 0.5 release
+worked on Ross128bA
+added config option for magical forrests on Ross128b
+fixed non working Werkstoff recipes
+added config options for CAL
+added config option for new EBF Gas recipes
+added pictures for circuits (thanks EmeraldsEmerald)
-fixed CAL recipe
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Former-commit-id: 70c7fc511c2ddacd908831e9d4501708bc23c332
Diffstat (limited to 'src/main/java')
18 files changed, 965 insertions, 62 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java new file mode 100644 index 0000000000..76612ad404 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +public interface INoiseGen { + + double getNoise(int x, int z); + double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd); + void setOctaves(int octaves); + void setFrequency(double freq); + void setSeed(long seed); + void setAmplitude(double amplitude); +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index bc7bfe2bed..ba65d2198a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -41,7 +41,6 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -61,7 +60,6 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; -import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.*; import net.minecraft.creativetab.CreativeTabs; @@ -74,6 +72,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.ArrayList; import java.io.IOException; import java.lang.reflect.Field; @@ -183,18 +182,20 @@ public final class MainMod { } @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { - MainMod.runOnPlayerJoined(ConfigHandler.classicMode); + MainMod.runOnPlayerJoined(ConfigHandler.classicMode, ConfigHandler.disableExtraGassesForEBF); } - public static void runOnPlayerJoined(boolean classicMode){ + public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes){ OreDictHandler.adaptCacheForWorld(); removeIC2Recipes(); MainMod.addElectricImplosionCompressorRecipes(); MainMod.unificationEnforcer(); - ArrayListMultimap tochange = MainMod.getRecipesToChange(NOBLE_GAS,ANAEROBE_GAS); - HashSet noGas = MainMod.getNoGasItems(tochange); - MainMod.editRecipes(tochange,noGas); + if (!extraGasRecipes) { + ArrayListMultimap<SubTag, GT_Recipe> toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); + HashSet<ItemStack> noGas = MainMod.getNoGasItems(toChange); + MainMod.editRecipes(toChange, noGas); + } new CircuitImprintLoader().run(); if (classicMode) @@ -389,7 +390,12 @@ public final class MainMod { } for (ItemStack is : noGas) if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons())), recipe.mEUt, recipe.mSpecialValue)); + ArrayList<ItemStack> inputs = new ArrayList<>(recipe.mInputs.length); + for (ItemStack stack : recipe.mInputs) + if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11),stack)) + inputs.add(stack); + inputs.add(GT_Utility.getIntegratedCircuit(0)); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons()*2.5D))), recipe.mEUt, recipe.mSpecialValue)); break; } } @@ -397,6 +403,25 @@ public final class MainMod { } GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag)); } + HashSet<GT_Recipe> duplicates = new HashSet<GT_Recipe>(); + for (GT_Recipe recipe : toAdd){ + for (GT_Recipe recipe2 : toAdd){ + if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) + continue; + boolean isSame = true; + for (int i = 0; i < recipe.mInputs.length; i++) { + if (!GT_Utility.areStacksEqual(recipe.mInputs[i],recipe2.mInputs[i])) + isSame = false; + } + for (int i = 0; i < recipe.mFluidInputs.length; i++) { + if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i],recipe2.mFluidInputs[i])) + isSame = false; + } + if (isSame) + duplicates.add(recipe2); + } + } + toAdd.removeAll(duplicates); for (GT_Recipe recipe : toAdd) GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(recipe); } 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 10fe70816f..b5d5d8b972 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 @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.configs; import com.github.bartimaeusnek.ASM.BWCoreTransformer; +import gregtech.api.enums.GT_Values; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; @@ -44,6 +45,7 @@ public class ConfigHandler { public static int ross128bRuinChance = 512; public static int creativeScannerID; public static int bioVatMaxParallelBonus = 1000; + public static int cutoffTier = 5; public static long energyPerCell = 1000000L; @@ -51,6 +53,8 @@ public class ConfigHandler { public static boolean BioLab = true; public static boolean Ross128Enabled = true; + public static boolean disableExtraGassesForEBF; + public static boolean disableMagicalForest; public static boolean DEHPDirectSteam; public static boolean teslastaff; public static boolean classicMode; @@ -74,6 +78,9 @@ public class ConfigHandler { ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); + ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.").getInt(5); + ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? GT_Values.VN.length : ConfigHandler.cutoffTier); + ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c.get("System", "Disable Extra Gases for EBF", false, "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen").getBoolean(false); ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); @@ -100,6 +107,8 @@ public class ConfigHandler { 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.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); + ConfigHandler.setUpComments(); if (ConfigHandler.c.hasChanged()) 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 5a85445f39..d6b1293cbf 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 @@ -791,7 +791,7 @@ public class RecipeLoader implements Runnable { Materials.SolderingAlloy.getMolten(1440) }, ItemRegistry.cal.copy(), - 240000, + 24000, BW_Util.getMachineVoltageFromTier(6) ); } 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 a9b37065e4..149db03d5b 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 @@ -30,7 +30,7 @@ import net.minecraft.world.IBlockAccess; public class ServerJoinedPackage extends GT_Packet { - private boolean config; + private byte config; ServerJoinedPackage() { super(true); @@ -38,7 +38,8 @@ public class ServerJoinedPackage extends GT_Packet { public ServerJoinedPackage(Object obj) { super(false); - this.config = ConfigHandler.classicMode; + this.config =(byte) (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF ? 3 : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); + } @Override @@ -48,17 +49,19 @@ public class ServerJoinedPackage extends GT_Packet { @Override public byte[] encode() { - return new byte[]{(byte) (this.config ? 1 : 0)}; + return new byte[]{this.config}; } @Override public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { - this.config = byteArrayDataInput.readBoolean(); + this.config = byteArrayDataInput.readByte(); return this; } @Override public void process(IBlockAccess iBlockAccess) { - MainMod.runOnPlayerJoined(this.config); + boolean gas = (this.config & 1) != 0; + boolean classic = (this.config & 0b10) != 0; + MainMod.runOnPlayerJoined(classic,gas); } } 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 3fe6337b7d..45db6ce632 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 @@ -79,10 +79,9 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn return rList; } - public Packet getDescriptionPacket() { + 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); - 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 f09c5f7442..47e676e082 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,6 +24,7 @@ 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; @@ -165,11 +166,27 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { @Override public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { - aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); + 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) { - aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); + 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++) { + for (int y = -1; y <= 1; y++) { + for (int z = -1; z <= 1; z++) { + if (x == 0 && y == 0 && z == 0) + continue; + if (aWorld.getBlock(aX+x,aY+y,aZ+z).isAir(aWorld,aX+x,aY+y,aZ+z)) + return true; + } + } + } + return false; } -} +}
\ No newline at end of file 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 7f6cbe008e..005f89cc88 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 @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -89,12 +90,12 @@ public class CircuitImprintLoader implements Runnable { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) { + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); } } else { - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) { + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); } } @@ -193,26 +194,26 @@ public class CircuitImprintLoader implements Runnable { 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)}); } - 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) - }); - } +// 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/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 64822f25fe..cc4841cad7 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 @@ -282,9 +282,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public boolean contains(SubTag subTag) { - for (Pair<ISubTagContainer, Integer> p : this.contents) - if (p.getKey().contains(subTag)) - return true; + if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS)) + for (Pair<ISubTagContainer, Integer> p : this.contents) + if (p.getKey().contains(subTag)) + return true; return this.subtags.contains(subTag); } @@ -444,6 +445,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public boolean hasCells() { + return (this.toGenerate & 0b10000) != 0; + } + public boolean hasMolten() { return (this.toGenerate & 0b1000000) != 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 2b19c6a4c4..e8ae5f64ae 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 @@ -78,8 +78,8 @@ 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 OrePrefixes cellMolten; + static { for (OrePrefixes prefix : OrePrefixes.values()){ if (prefix.toString().equals("cellMolten")) @@ -636,7 +636,29 @@ public class WerkstoffLoader implements Runnable { //No Byproducts //No Ingredients ); - + public static final Werkstoff BArTiMaEuSNeK = new Werkstoff( + new short[]{0x00,0xff,0x00}, + "BArTiMaEuSNeK", + "Are you serious?", + new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems().addMetalItems().addMolten(), + 43, + TextureSet.SET_DIAMOND, + Arrays.asList( + Materials.Boron, + Materials.Titanium, + Materials.Europium + ), + new Pair<>(Materials.Boron,1), + new Pair<>(Materials.Argon,1), + new Pair<>(Materials.Titanium,1), + new Pair<>(Materials.Magic,1), + new Pair<>(Materials.Europium,1), + new Pair<>(Materials.Sulfur,1), + new Pair<>(WerkstoffLoader.Neon,1), + new Pair<>(Materials.Potassium,1) + ); public static HashMap<OrePrefixes, BW_MetaGenerated_Items> items = new HashMap<>(); public static HashMap<Werkstoff, Fluid> fluids = new HashMap<>(); @@ -644,6 +666,17 @@ public class WerkstoffLoader implements Runnable { public static Block BWOres; public boolean registered; + public static Werkstoff getWerkstoff(String Name){ + try{ + Field f = WerkstoffLoader.class.getField(Name); + if (f != null) + return (Werkstoff) f.get(null); + } catch (IllegalAccessException | NoSuchFieldException | ClassCastException e) { + e.printStackTrace(); + } + return Werkstoff.default_null_Werkstoff; + } + public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff) { return WerkstoffLoader.getCorrespondingItemStack(orePrefixes, werkstoff, 1); } @@ -723,21 +756,21 @@ public class WerkstoffLoader implements Runnable { } private void addSubTags() { - - WerkstoffLoader.Krypton.add(WerkstoffLoader.NOBLE_GAS); - WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS); - WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); Materials.Helium.add(WerkstoffLoader.NOBLE_GAS); - + WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); Materials.Argon.add(WerkstoffLoader.NOBLE_GAS); - + WerkstoffLoader.Krypton.add(WerkstoffLoader.NOBLE_GAS); + WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + Materials.Radon.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); - Materials.Radon.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS); WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); + //Calcium Smelting block + Materials.Calcium.mBlastFurnaceRequired=true; + for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { for (Pair<ISubTagContainer, Integer> pair : W.getContents().getValue().toArray(new Pair[0])) { @@ -980,6 +1013,8 @@ public class WerkstoffLoader implements Runnable { 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)); @@ -989,9 +1024,25 @@ public class WerkstoffLoader implements Runnable { } } } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getTexSet() == TextureSet.SET_FLUID) { - //not yet implemented no fluids from me... + 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)); 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 new file mode 100644 index 0000000000..7b62f34e2c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.NoiseUtil; + +import com.github.bartimaeusnek.bartworks.API.INoiseGen; +import gregtech.api.objects.XSTR; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.Random; + +public class BartsNoise implements INoiseGen { + public void setUsePhase(boolean usePhase) { + this.usePhase = usePhase; + } + + public void setRandom(Random random) { + this.random = random; |
