aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java15
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java203
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java9
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java4
10 files changed, 62 insertions, 220 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java
index 6399a5119b..47705042a9 100644
--- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java
+++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java
@@ -32,14 +32,18 @@ import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
-import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
public class BWCoreStaticReplacementMethodes {
+ private static ThreadLocal<AccessPriorityList<IRecipe>> RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new);
- public static final AccessPriorityList<IRecipe> RECENTLYUSEDRECIPES = new AccessPriorityList<>();
+ public static void clearRecentlyUsedRecipes() {
+ // the easiest way to ensure the cache is flushed without causing synchronization overhead
+ // is to just replace the whole ThreadLocal instance.
+ RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new);
+ }
@SuppressWarnings("ALL")
public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) {
@@ -79,7 +83,8 @@ public class BWCoreStaticReplacementMethodes {
} else {
IRecipe iPossibleRecipe = null;
- Iterator<AccessPriorityListNode<IRecipe>> it = RECENTLYUSEDRECIPES.nodeIterator();
+ AccessPriorityList<IRecipe> cache = RECENTLYUSEDRECIPES.get();
+ Iterator<AccessPriorityListNode<IRecipe>> it = cache.nodeIterator();
while (it.hasNext()) {
AccessPriorityListNode<IRecipe> recipeNode = it.next();
@@ -88,7 +93,7 @@ public class BWCoreStaticReplacementMethodes {
if (!iPossibleRecipe.matches(inventoryCrafting, world))
continue;
- RECENTLYUSEDRECIPES.addPrioToNode(recipeNode);
+ cache.addPrioToNode(recipeNode);
return iPossibleRecipe.getCraftingResult(inventoryCrafting);
}
@@ -115,7 +120,7 @@ public class BWCoreStaticReplacementMethodes {
return stack;
if (stack != null)
- RECENTLYUSEDRECIPES.addLast(recipe);
+ cache.addLast(recipe);
return stack;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java
index 42385c60f1..f9aba701a6 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java
@@ -40,7 +40,7 @@ public class ClearCraftingCache extends CommandBase {
@Override
public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
- BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.clear();
- p_71515_1_.addChatMessage(new ChatComponentText("Recipe Cache cleared? "+(BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.size() == 0)));
+ BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes();
+ p_71515_1_.addChatMessage(new ChatComponentText("Recipe Cache cleared "));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java
index 8bb604dd36..f761543f56 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java
@@ -30,6 +30,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCompressor;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -93,7 +94,16 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity
return false;
}
-
+
+ @Override
+ public boolean drainEnergyInput(long aEU) {
+ if (aEU <= 0) return true;
+ GT_MetaTileEntity_Hatch_Energy h1 = this.mEnergyHatches.get(0), h2 = this.mEnergyHatches.get(1);
+ if(!isValidMetaTileEntity(h1) || !isValidMetaTileEntity(h2)) return false;
+ if(!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false) || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false)) return false;
+ return true;
+ }
+
@Override
public boolean onRunningTick(ItemStack aStack) {
if (this.mRuntime % 10 == 0)
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java
deleted file mode 100644
index cd630ef2c3..0000000000
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 2018-2020 bartimaeusnek
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega;
-
-import com.github.bartimaeusnek.bartworks.util.BW_Util;
-import gregtech.GT_Mod;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ProcessingArray;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-import org.apache.commons.lang3.ArrayUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity;
-@SuppressWarnings("ALL")
-public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray {
- private GT_Recipe mLastRecipe;
- private int tTier;
- private int mMult;
- private String mMachine = "";
- private GT_MetaTileEntity_Hatch_InputBus machineBus;
- public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_TileEntity_MegaProcessingArray(String aName) {
- super(aName);
- }
-
- public boolean checkRecipe(ItemStack aStack) {
- if (!this.isCorrectMachinePart(this.machineBus.mInventory[0])) {
- return false;
- }
-
- GT_Recipe.GT_Recipe_Map map = this.getRecipeMap();
- if (map == null) return false;
- ArrayList<ItemStack> tInputList = this.getStoredInputs();
-
- if (this.mInventory[1].getUnlocalizedName().endsWith("10")) {
- this.tTier = 9;
- this.mMult = 2;//u need 4x less machines and they will use 4x less power
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("11")) {
- this.tTier = 9;
- this.mMult = 4;//u need 16x less machines and they will use 16x less power
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("12") ||
- this.mInventory[1].getUnlocalizedName().endsWith("13") ||
- this.mInventory[1].getUnlocalizedName().endsWith("14") ||
- this.mInventory[1].getUnlocalizedName().endsWith("15")) {
- this.tTier = 9;
- this.mMult = 6;//u need 64x less machines and they will use 64x less power
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("1")) {
- this.tTier = 1;
- this.mMult = 0;//*1
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("2")) {
- this.tTier = 2;
- this.mMult = 0;//*1
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("3")) {
- this.tTier = 3;
- this.mMult = 0;//*1
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("4")) {
- this.tTier = 4;
- this.mMult = 0;//*1
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("5")) {
- this.tTier = 5;
- this.mMult = 0;//*1
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("6")) {
- this.tTier = 6;
- this.mMult = 0;//*1
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("7")) {
- this.tTier = 7;
- this.mMult = 0;//*1
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("8")) {
- this.tTier = 8;
- this.mMult = 0;//*1
- } else if (this.mInventory[1].getUnlocalizedName().endsWith("9")) {
- this.tTier = 9;
- this.mMult = 0;//*1
- } else {
- this.tTier = 0;
- this.mMult = 0;//*1
- }
-
- if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null;
- this.mMachine = this.mInventory[1].getUnlocalizedName();
- ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]);
-
- ArrayList<FluidStack> tFluidList = this.getStoredFluids();
-
- FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]);
- if (tInputList.size() > 0 || tFluids.length > 0) {
- GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs);
- if (tRecipe != null) {
- if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 &&
- !isValidForLowGravity(tRecipe, this.getBaseMetaTileEntity().getWorld().provider.dimensionId))
- return false;
-
- this.mLastRecipe = tRecipe;
- this.mEUt = 0;
- this.mOutputItems = null;
- this.mOutputFluids = null;
- int machines = Math.min(64, this.mInventory[1].stackSize << this.mMult); //Upped max Cap to 64
- int i = 0;
- for (; i < machines; i++) {
- if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
- if (i == 0) {
- return false;
- }
- break;
- }
- }
- this.mMaxProgresstime = tRecipe.mDuration;
- this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[this.tTier], this);
- //In case recipe is too OP for that machine
- if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1)
- return false;
- this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> this.mMult, 1);
- if (this.mEUt == Integer.MAX_VALUE - 1)
- return false;
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOut[h] = tRecipe.getOutput(h).copy();
- tOut[h].stackSize = 0;
- }
- }
- FluidStack tFOut = null;
- if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy();
- for (int f = 0; f < tOut.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOut[f] != null) {
- for (int g = 0; g < i; g++) {
- if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
- tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
- if (tFOut != null) {
- int tSize = tFOut.amount;
- tFOut.amount = tSize * i;
- }
- tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut);
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- List<ItemStack> overStacks = new ArrayList<>();
- for (ItemStack itemStack : tOut) {
- while (itemStack.getMaxStackSize() < itemStack.stackSize) {
- ItemStack tmp = itemStack.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize();
- overStacks.add(tmp);
- }
- }
- if (overStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[overStacks.size()];
- tmp = overStacks.toArray(tmp);
- tOut = ArrayUtils.addAll(tOut, tmp);
- }
- List<ItemStack> tSList = new ArrayList<>();
- for (ItemStack tS : tOut) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOut = tSList.toArray(new ItemStack[0]);
- this.mOutputItems = tOut;
- this.mOutputFluids = new FluidStack[]{tFOut};
- this.updateSlots();
- return true;
- }/* else{
- ...remoteRecipeCheck()
- }*/
- }
- return false;
- }
-
-}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java
index 74a40e6a28..c892ead1d9 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java
@@ -22,7 +22,6 @@
package com.github.bartimaeusnek.bartworks.system.material;
-import com.github.technus.tectech.mechanics.structure.ICustomBlockSetting;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
@@ -41,8 +40,9 @@ import net.minecraft.world.World;
import java.util.List;
import java.util.Optional;
-@cpw.mods.fml.common.Optional.Interface(modid = "tectech", striprefs = true, iface = "com.github.technus.tectech.mechanics.structure.ICustomBlockSetting")
-public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements ICustomBlockSetting {
+public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements com.github.technus.tectech.mechanics.structure.ICustomBlockSetting,
+ com.gtnewhorizon.structurelib.structure.ICustomBlockSetting
+{
public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName, OrePrefixes prefixes) {
super(p_i45386_1_, tileEntity, blockName, prefixes);
@@ -128,9 +128,8 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple
}
/**
- * DEBUG Method for TT-Blueprints!
+ * ICustomBlockSetting setBlock override
*/
- @cpw.mods.fml.common.Optional.Method(modid = "tectech")
public void setBlock(World world, int x, int y, int z, int meta) {
world.setBlock(x, y, z,this, meta,2);
try {
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 bad997cb1e..3c4cb02013 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
@@ -219,7 +219,7 @@ public class CircuitImprintLoader {
private static void removeOldRecipesFromRegistries() {
recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove);
- BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.clear();
+ BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes();
gtrecipeWorldCache.forEach(GT_Recipe.GT_Recipe_Map.sSlicerRecipes.mRecipeList::remove);
recipeWorldCache.forEach( r ->
{
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java
index dc1d1f7ade..65c677dc55 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java
@@ -195,15 +195,23 @@ public class LuVTierEnhancer implements Runnable {
GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream()
.filter(gt_recipe ->
gt_recipe.mEUt < BW_Util.getTierVoltage(6) &&
- !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0])
+ !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) &&
+ !isOutputBlackListed(gt_recipe.mOutputs[0])
)
.forEach(replace);
GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream()
- .filter(gt_recipe -> gt_recipe.mEUt <= 6000)
+ .filter(gt_recipe -> gt_recipe.mEUt <= 6000 &&
+ !isOutputBlackListed(gt_recipe.mOutputs[0])
+ )
.forEach(replace);
}
+ private static boolean isOutputBlackListed(ItemStack output) {
+ if (output.isItemEqual(ItemList.Casing_MiningOsmiridium.get(1))) return true;
+ return false;
+ }
+
private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target) {
for (int i = 0; i < stackArray.length; i++) {
ItemStack stack = stackArray[i];
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 16cbee2d2f..f66b598788 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
@@ -211,14 +211,18 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
if (this.stats.mass == 0) {
long tmpmass = 0;
+ int count = 0;
for (Pair<ISubTagContainer, Integer> p : contents) {
if (p.getKey() instanceof Materials) {
tmpmass += ((Materials) p.getKey()).getMass() * p.getValue();
+ count += p.getValue();
} else if (p.getKey() instanceof Werkstoff) {
tmpmass += ((Werkstoff) p.getKey()).getStats().mass * p.getValue();
+ count += p.getValue();
}
}
- this.stats = stats.setMass(tmpmass);
+ if(count > 0)
+ this.stats = stats.setMass(tmpmass/count);
}
if (this.stats.meltingPoint == 0)
@@ -386,6 +390,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return this.mID;
}
+ public short getMixCircuit() {
+ return this.getGenerationFeatures().mixCircuit;
+ }
+
public Werkstoff.GenerationFeatures getGenerationFeatures() {
return this.generationFeatures;
}
@@ -609,6 +617,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
* Auto add MetalWorking(crafting components) Recipe 10000
*/
public byte extraRecipes;
+ public short mixCircuit = -1;
public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p) {
this.blacklist |= getPrefixDataRaw(p);
@@ -670,6 +679,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return this;
}
+ public Werkstoff.GenerationFeatures addMixerRecipes(short aCircuit) {
+ this.extraRecipes = (byte) (this.extraRecipes | 10);
+ if (aCircuit >= 1 && aCircuit <=24)
+ this.mixCircuit = aCircuit;
+ return this;
+ }
+
public boolean hasMixerRecipes() {
return (this.extraRecipes & 10) != 0;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java
index 8f79fc85bc..b8b1d7a75e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java
@@ -148,6 +148,9 @@ public class DustLoader implements IWerkstoffRunnable {
if (werkstoff.getGenerationFeatures().hasMixerRecipes()) {
if (cells > 0)
stOutputs.add(Materials.Empty.getCells(cells));
+ short circuitID = werkstoff.getMixCircuit();
+ ItemStack circuit = circuitID == -1 ? null : GT_Utility.getIntegratedCircuit(circuitID);
+ if (circuit != null) stOutputs.add(circuit);
GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java
index d3a5d79729..afae6ab0b8 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java
@@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWer
import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import gregtech.api.enchants.Enchantment_Radioactivity;
import gregtech.api.enums.*;
+import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
@@ -101,6 +102,9 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable {
werkstoffBridgeMaterial.mName = werkstoff.getVarName();
werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName();
werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip();
+ if ("null".equals(werkstoffBridgeMaterial.mLocalizedName))
+ // only reload from lang file if not localized already
+ werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization("Material." + werkstoffBridgeMaterial.mName.toLowerCase(), werkstoffBridgeMaterial.mDefaultLocalName);
if (LoaderReference.Thaumcraft)
werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects();
werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial;