diff options
-rw-r--r-- | build.properties | 2 | ||||
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java | 2 | ||||
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java | 13 | ||||
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java | 77 | ||||
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java | 21 | ||||
-rw-r--r-- | src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png | bin | 0 -> 606 bytes | |||
-rw-r--r-- | src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png | bin | 0 -> 375 bytes | |||
-rw-r--r-- | src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png | bin | 0 -> 396 bytes | |||
-rw-r--r-- | src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png | bin | 0 -> 245 bytes |
9 files changed, 107 insertions, 8 deletions
diff --git a/build.properties b/build.properties index dc75c235a5..e046d77987 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre5 +buildNumber=0_pre6 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 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 Binary files differnew file mode 100644 index 0000000000..c597cc08ae --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png 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 Binary files differnew file mode 100644 index 0000000000..f2ec0dcb97 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png 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 Binary files differnew file mode 100644 index 0000000000..43291b873a --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png 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 Binary files differnew file mode 100644 index 0000000000..7987d1fff6 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png |