aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-08-15 06:21:26 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-08-15 06:21:26 +0200
commit11cb4d041b3364bca9ff5e69e265047b9f928fc1 (patch)
tree18d4a741438e433badc69ef5faf40f0214e06af8 /src
parenta3a672f8f5cd7b0dc13ca5db7fa2c46cb849e840 (diff)
downloadGT5-Unofficial-11cb4d041b3364bca9ff5e69e265047b9f928fc1.tar.gz
GT5-Unofficial-11cb4d041b3364bca9ff5e69e265047b9f928fc1.tar.bz2
GT5-Unofficial-11cb4d041b3364bca9ff5e69e265047b9f928fc1.zip
added pngs to circuit assembly line parts
+fixed part recipes +hide trash from nei Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 28aa41372e52886f7f8ce08e8452fabc440ebb14
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java13
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java77
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java21
-rw-r--r--src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.pngbin0 -> 606 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.pngbin0 -> 375 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.pngbin0 -> 396 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.pngbin0 -> 245 bytes
8 files changed, 106 insertions, 7 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index 21ad4d58cc..068a28b906 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -165,11 +165,11 @@ public final class MainMod {
}
@Mod.EventHandler
public void onServerStarted(FMLServerStartedEvent event) {
- OreDictHandler.adaptCacheForWorld();
MainMod.runOnPlayerJoined(ConfigHandler.classicMode);
}
public static void runOnPlayerJoined(boolean classicMode){
+ OreDictHandler.adaptCacheForWorld();
WerkstoffLoader.removeIC2Recipes();
MainMod.addElectricImplosionCompressorRecipes();
new CircuitImprintLoader().run();
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 4a3421a51d..999711e3fe 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
@@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
+import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -175,14 +176,20 @@ public class CircuitImprintLoader implements Runnable {
eut = Math.min(eut,BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0]))));
GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut,BW_Util.CLEANROOM);
GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe);
- GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{
+ 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)
- });
+ 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)));
+ GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{
+ " 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 (NBTTagCompound tag : CircuitImprintLoader.bwCircuitTagMap.values()){
// CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(tag);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
index be9f710991..3d31641d79 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
@@ -40,17 +40,21 @@ import gregtech.api.util.GT_Utility;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
import ic2.core.Ic2Items;
import ic2.core.item.ItemFluidCell;
+import net.minecraft.block.Block;
import net.minecraft.init.Items;
+import net.minecraft.inventory.InventoryCrafting;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.ShapedOreRecipe;
import javax.annotation.Nonnegative;
import java.io.Serializable;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
+import java.util.*;
import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv;
import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte;
@@ -657,4 +661,71 @@ public class BWRecipes {
return null;
}
}
+
+ public static class BWNBTDependantCraftingRecipe implements IRecipe {
+
+ ItemStack result;
+ Map<Character, ItemStack> charToStackMap = new HashMap<>(9,1);
+ String[] shape;
+
+ public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) {
+ this.result = result;
+ this.shape = new String[3];
+ System.arraycopy(recipe,0, this.shape,0,3);
+ this.charToStackMap.put(' ', null);
+ for (int i = 3; i < recipe.length; i+=2) {
+ this.charToStackMap.put((char)recipe[i],((ItemStack)recipe[i+1]).copy());
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof BWRecipes.BWNBTDependantCraftingRecipe)) return false;
+
+ BWRecipes.BWNBTDependantCraftingRecipe that = (BWRecipes.BWNBTDependantCraftingRecipe) o;
+
+ if (!Objects.equals(this.result, that.result)) return false;
+ if (!Objects.equals(this.charToStackMap, that.charToStackMap))
+ return false;
+ // Probably incorrect - comparing Object[] arrays with Arrays.equals
+ return Arrays.equals(this.shape, that.shape);
+ }
+
+ @Override
+ public int hashCode() {
+ int result1 = this.result != null ? this.result.hashCode() : 0;
+ result1 = 31 * result1 + (this.charToStackMap != null ? this.charToStackMap.hashCode() : 0);
+ result1 = 31 * result1 + Arrays.hashCode(this.shape);
+ return result1;
+ }
+
+ @Override
+ public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) {
+ for (int x = 0; x < 3; x++) {
+ for (int y = 0; y < 3; y++) {
+ ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y,x);
+ ItemStack ref = this.charToStackMap.get(this.shape[x].toCharArray()[y]);
+ if (!BW_Util.areStacksEqualOrNull(toCheck,ref))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) {
+ return this.result.copy();
+ }
+
+ @Override
+ public int getRecipeSize() {
+ return 10;
+ }
+
+ @Override
+ public ItemStack getRecipeOutput() {
+ return this.result;
+ }
+ }
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java
index de262fd73d..5a8af015ef 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java
@@ -27,9 +27,12 @@ import codechicken.nei.api.IConfigureNEI;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader;
import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
+import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import cpw.mods.fml.common.Optional;
+import gregtech.api.enums.OrePrefixes;
import net.minecraft.item.ItemStack;
+
@Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems")
public class NEIbartworksConfig implements IConfigureNEI {
@@ -51,5 +54,23 @@ public class NEIbartworksConfig implements IConfigureNEI {
API.hideItem(new ItemStack(ItemRegistry.TAB));
API.hideItem(new ItemStack(FluidLoader.bioFluidBlock));
API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses));
+ ItemStack[] prefixesToHide = {
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(),
+ WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(),
+ };
+ for (ItemStack stack : prefixesToHide) {
+ stack.setItemDamage(Short.MAX_VALUE);
+ API.hideItem(stack);
+ }
}
} \ No newline at end of file
diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png
new file mode 100644
index 0000000000..c597cc08ae
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png
new file mode 100644
index 0000000000..f2ec0dcb97
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png
new file mode 100644
index 0000000000..43291b873a
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png
new file mode 100644
index 0000000000..7987d1fff6
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png
Binary files differ