Fixed messing recipes

Closes #111
This commit is contained in:
TheDarkDnKTv 2021-04-24 06:26:13 +03:00
parent c46af91594
commit 11e11a6515
2 changed files with 36 additions and 195 deletions

View file

@ -535,9 +535,10 @@ public class GT_Mod implements IGT_Mod {
new GT_NetworkHandler().run(); new GT_NetworkHandler().run();
new GT_ConnectionHandler().run(); new GT_ConnectionHandler().run();
RecipeSorter.register("gregtechmod:shaped" , GT_Shaped_Recipe.class , RecipeSorter.Category.SHAPED , "after:minecraft:shaped"); RecipeSorter.register("gregtech_addon:shaped" , GT_Shaped_Recipe.class , RecipeSorter.Category.SHAPED , "after:forge:shapedore before:minecraft:shapeless");
RecipeSorter.register("gregtechmod:shapeless" , GT_Shapeless_Recipe.class , RecipeSorter.Category.SHAPELESS , "after:minecraft:shapeless"); RecipeSorter.register("gregtech_addon:shaped_nbt_keeping" , GT_Shapeless_NBT_Keeping_Recipe.class , RecipeSorter.Category.SHAPED , "after:gregtech_addon:shaped before:minecraft:shapeless");
RecipeSorter.register("gregtechmod:shapeless_nbt_keeping" , GT_Shapeless_NBT_Keeping_Recipe.class , RecipeSorter.Category.SHAPELESS , "after:minecraft:shapeless"); RecipeSorter.register("gregtech_addon:shapeless" , GT_Shapeless_Recipe.class , RecipeSorter.Category.SHAPELESS , "after:minecraft:shapeless");
RecipeSorter.register("gregtech_addon:shapeless_nbt_keeping" , GT_Shapeless_NBT_Keeping_Recipe.class , RecipeSorter.Category.SHAPELESS , "after:gregtech_addon:shapeless");
GregTech_API.sPreloadFinished = true; GregTech_API.sPreloadFinished = true;
GT_Log.log.info("Preload-Phase finished!"); GT_Log.log.info("Preload-Phase finished!");
@ -896,9 +897,9 @@ public class GT_Mod implements IGT_Mod {
});} catch(Throwable e) {} });} catch(Throwable e) {}
*/ */
@EventHandler @EventHandler
public void start(FMLServerStartingEvent aEvent) { public void start(FMLServerStartingEvent aEvent) {
if(!mDoNotInit) { if (!mDoNotInit) {
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstart) { for (Runnable tRunnable : GregTech_API.sBeforeGTServerstart) {
try { try {
tRunnable.run(); tRunnable.run();
@ -907,29 +908,10 @@ public class GT_Mod implements IGT_Mod {
} }
} }
mUniverse = null; GT_Log.log.info("ServerStart-Phase started!");
GT_TickHandler.isFirstTick = true; mUniverse = null;
NetworkRegistry.INSTANCE.registerGuiHandler(GregTech_API.gregtechmod, new GT_GUIHandler()); GT_TickHandler.isFirstTick = true;
NetworkRegistry.INSTANCE.registerGuiHandler(GregTech_API.gregtechmod, new GT_GUIHandler());
try {
for (IMetaTileEntity tMetaTileEntity : GregTech_API.mMetaTileList) {
if (tMetaTileEntity != null) tMetaTileEntity.onServerStart();
}
} catch(Throwable e) {
GT_Log.log.catching(e);
}
for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
if (data.filledContainer.getItem() == Items.potionitem) {
data.fluid.amount = 0;
break;
}
}
GT_Log.log.info("ServerStart-Phase started!");
mUniverse = null;
GT_TickHandler.isFirstTick = true;
NetworkRegistry.INSTANCE.registerGuiHandler(GregTech_API.gregtechmod, new GT_GUIHandler());
for (IMetaTileEntity mte : GregTech_API.mMetaTileList) { for (IMetaTileEntity mte : GregTech_API.mMetaTileList) {
try { try {
@ -940,143 +922,11 @@ public class GT_Mod implements IGT_Mod {
} }
} }
// GT_Log.log.info("Unificating outputs of all known Recipe Types."); for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
// ArrayList<ItemStack> items = new ArrayList<ItemStack>(); if (data.filledContainer.getItem() == Items.potionitem) {
// GT_Log.log.info("IC2 Machines"); data.fluid.amount = 0;
// }
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.cannerBottle.getRecipes().values()) { }
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.centrifuge.getRecipes().values()) {
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.compressor.getRecipes().values()) {
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.extractor.getRecipes().values()) {
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.macerator.getRecipes().values()) {
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.metalformerCutting.getRecipes().values()) {
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.metalformerRolling.getRecipes().values()) {
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.matterAmplifier.getRecipes().values()) {
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// for (ic2.api.recipe.RecipeOutput recipeOut : ic2.api.recipe.Recipes.oreWashing.getRecipes().values()) {
// for (ItemStack recipeItem : recipeOut.items) {
// items.add(recipeItem);
// }
// }
//
// GT_Log.log.info("Dungeon Loot");
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("dungeonChest").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("bonusChest").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("villageBlacksmith").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("strongholdCrossing").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("strongholdLibrary").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("strongholdCorridor").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("pyramidJungleDispenser").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("pyramidJungleChest").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("pyramidDesertyChest").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// for (WeightedRandomChestContent chestContent : ChestGenHooks.getInfo("mineshaftCorridor").getItems(new Random())) {
// items.add(chestContent.theItemId);
// }
//
// GT_Log.log.info("Smelting");
// @SuppressWarnings("unchecked")
// List<ItemStack> furnItems = new ArrayList<>(FurnaceRecipes.smelting().getSmeltingList().values());
// for (ItemStack item : furnItems) {
// items.add(item);
// }
//
// if(sCraftingUnification) {
// GT_Log.log.info("Crafting Recipes");
// @SuppressWarnings("unchecked")
// List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
// for (IRecipe recipe : recipes) {
// items.add(recipe.getRecipeOutput());
// }
// }
//
// items.removeIf(item -> item == null);
// for (ItemStack item : items) {
// if (GT_OreDictHandler.instance.mRegisteredStacks.contains(item)) {
// GT_Log.log.error("GT-ERR-01: @ " + item.getUnlocalizedName() + " " + item.getDisplayName());
// GT_Log.log.error("A Recipe used an OreDict Item as Output directly, without copying it before!!! This is a typical CallByReference/CallByValue Error");
// GT_Log.log.error("Said Item will be renamed to make the invalid Recipe visible, so that you can report it properly.");
// GT_Log.log.error("Please check all Recipes outputting this Item, and report the Recipes to their Owner.");
// GT_Log.log.error("The Owner of the ==>RECIPE<==, NOT the Owner of the Item, which has been mentioned above!!!");
// GT_Log.log.error("And ONLY Recipes which are ==>OUTPUTTING<== the Item, sorry but I don\'t want failed Bug Reports.");
// GT_Log.log.error("GregTech just reports this Error to you, so you can report it to the Mod causing the Problem.");
// GT_Log.log.error("Even though I make that Bug visible, I can not and will not fix that for you, that\'s for the causing Mod to fix.");
// GT_Log.log.error("And speaking of failed Reports:");
// GT_Log.log.error("Both IC2 and GregTech CANNOT be the CAUSE of this Problem, so don\'t report it to either of them.");
// GT_Log.log.error("I REPEAT, BOTH, IC2 and GregTech CANNOT be the source of THIS BUG. NO MATTER WHAT.");
// GT_Log.log.error("Asking in the IC2 Forums, which Mod is causing that won\'t help anyone, since it is not possible to determine, which Mod it is.");
// GT_Log.log.error("If it would be possible, then I would have had added the Mod which is causing it to the Message already. But it is not possible.");
// GT_Log.log.error("Sorry, but this Error is serious enough to justify this Wall-O-Text and the partially Allcapsed Language.");
// item.setStackDisplayName("ERROR! PLEASE CHECK YOUR LOG FOR \'GT-ERR-01\'!");
// } else {
//// GT_OreDictUnificator.setStack(item);
// }
// }
GT_Log.log.info("ServerStart-Phase finished!"); GT_Log.log.info("ServerStart-Phase finished!");
for (Runnable toRun : GregTech_API.sAfterGTServerstart) { for (Runnable toRun : GregTech_API.sAfterGTServerstart) {
@ -1086,8 +936,8 @@ public class GT_Mod implements IGT_Mod {
GT_Log.log.catching(e); GT_Log.log.catching(e);
} }
} }
} }
} }
@EventHandler @EventHandler
public void start(FMLServerStartedEvent aEvent) { public void start(FMLServerStartedEvent aEvent) {
@ -1228,16 +1078,10 @@ public class GT_Mod implements IGT_Mod {
@SubscribeEvent @SubscribeEvent
public void onFluidContainerRegistration(FluidContainerRegisterEvent aFluidEvent) { public void onFluidContainerRegistration(FluidContainerRegisterEvent aFluidEvent) {
if (this.tNothingRegistered) { if (this.tNothingRegistered) {
FluidContainerData[] arr$ = FluidContainerRegistry.getRegisteredFluidContainerData(); for (FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
int len$ = arr$.length;
for (int i$ = 0; i$ < len$; ++i$) {
FluidContainerData tData = arr$[i$];
if (tData.filledContainer.getItem() == Items.potionitem) { if (tData.filledContainer.getItem() == Items.potionitem) {
tData.fluid.amount = 0; tData.fluid.amount = 0;
} }
GT_OreDictUnificator.addToBlacklist(tData.filledContainer);
} }
this.tNothingRegistered = false; this.tNothingRegistered = false;

View file

@ -43,7 +43,6 @@ public class GT_OreDictHandler {
private final List<String> mIgnoredNames = Arrays.asList(new String[]{"whiteStone", "stoneSlab", "clayBowl", "clayPlate", "ceramicBowl", "ceramicPlate", "ovenRack", "clayCup", "ceramicCup", "batteryBox", "transmutationStone", "torchRedstoneActive", "coal", "charcoal", "cloth", "cobblestoneSlab", "stoneBrickSlab", "cobblestoneWall", "stoneBrickWall", "cobblestoneStair", "stoneBrickStair", "blockCloud", "blockDirt", "blockTyrian", "blockCarpet", "blockFft", "blockLavastone", "blockHolystone", "blockConcrete", "sunnariumPart", "brSmallMachineCyaniteProcessor", "meteoriteCoal", "blockCobble", "pressOreProcessor", "crusherOreProcessor", "grinderOreProcessor", "blockRubber", "blockHoney", "blockHoneydew", "blockPeat", "blockRadioactive", "blockSlime", "blockCocoa", "blockSugarCane", "blockLeather", "blockClayBrick", "solarPanelHV", "cableRedNet", "stoneBowl", "crafterWood", "taintedSoil", "brickXyEngineering", "breederUranium", "wireMill", "chunkLazurite", "aluminumNatural", "aluminiumNatural", "naturalAluminum", "naturalAluminium", "antimatterMilligram", "antimatterGram", "strangeMatter", "coalGenerator", "electricFurnace", "unfinishedTank", "valvePart", "aquaRegia", "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "enrichedUranium", "camoPaste"}); private final List<String> mIgnoredNames = Arrays.asList(new String[]{"whiteStone", "stoneSlab", "clayBowl", "clayPlate", "ceramicBowl", "ceramicPlate", "ovenRack", "clayCup", "ceramicCup", "batteryBox", "transmutationStone", "torchRedstoneActive", "coal", "charcoal", "cloth", "cobblestoneSlab", "stoneBrickSlab", "cobblestoneWall", "stoneBrickWall", "cobblestoneStair", "stoneBrickStair", "blockCloud", "blockDirt", "blockTyrian", "blockCarpet", "blockFft", "blockLavastone", "blockHolystone", "blockConcrete", "sunnariumPart", "brSmallMachineCyaniteProcessor", "meteoriteCoal", "blockCobble", "pressOreProcessor", "crusherOreProcessor", "grinderOreProcessor", "blockRubber", "blockHoney", "blockHoneydew", "blockPeat", "blockRadioactive", "blockSlime", "blockCocoa", "blockSugarCane", "blockLeather", "blockClayBrick", "solarPanelHV", "cableRedNet", "stoneBowl", "crafterWood", "taintedSoil", "brickXyEngineering", "breederUranium", "wireMill", "chunkLazurite", "aluminumNatural", "aluminiumNatural", "naturalAluminum", "naturalAluminium", "antimatterMilligram", "antimatterGram", "strangeMatter", "coalGenerator", "electricFurnace", "unfinishedTank", "valvePart", "aquaRegia", "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "enrichedUranium", "camoPaste"});
private final List<String> mInvalidNames = Arrays.asList(new String[]{"bloodstoneOre", "universalCable", "bronzeTube", "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery", "10kEUStore", "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot", "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem", "osmoniumIngot", "tapaziteGem", "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem", "copperIngot", "ironStick", "goldStick", "diamondStick", "reinforcedStick", "draconicStick", "emeraldStick", "copperStick", "tinStick", "silverStick", "bronzeStick", "steelStick", "leadStick", "manyullynStick", "arditeStick", "cobaltStick", "aluminiumStick", "alumiteStick", "oilsandsOre", "copperWire", "superconductorWire", "sulfuricAcid", "conveyorBelt", "ironWire", "aluminumWire", "aluminiumWire", "silverWire", "tinWire", "dustSiliconSmall", "AluminumOre", "plateHeavyT2", "blockWool", "alloyPlateEnergizedHardened", "gasWood", "alloyPlateEnergized", "SilverOre", "LeadOre", "TinOre", "CopperOre", "silverOre", "leadOre", "tinOre", "copperOre", "bauxiteOre", "HSLivingmetalIngot", "oilMoving", "oilStill", "oilBucket", "petroleumOre", "dieselFuel", "diamondNugget", "planks", "wood", "stick", "sticks", "naquadah", "obsidianRod", "stoneRod", "thaumiumRod", "steelRod", "netherrackRod", "woodRod", "ironRod", "cactusRod", "flintRod", "copperRod", "cobaltRod", "alumiteRod", "blueslimeRod", "arditeRod", "manyullynRod", "bronzeRod", "boneRod", "slimeRod"}); private final List<String> mInvalidNames = Arrays.asList(new String[]{"bloodstoneOre", "universalCable", "bronzeTube", "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery", "10kEUStore", "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot", "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem", "osmoniumIngot", "tapaziteGem", "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem", "copperIngot", "ironStick", "goldStick", "diamondStick", "reinforcedStick", "draconicStick", "emeraldStick", "copperStick", "tinStick", "silverStick", "bronzeStick", "steelStick", "leadStick", "manyullynStick", "arditeStick", "cobaltStick", "aluminiumStick", "alumiteStick", "oilsandsOre", "copperWire", "superconductorWire", "sulfuricAcid", "conveyorBelt", "ironWire", "aluminumWire", "aluminiumWire", "silverWire", "tinWire", "dustSiliconSmall", "AluminumOre", "plateHeavyT2", "blockWool", "alloyPlateEnergizedHardened", "gasWood", "alloyPlateEnergized", "SilverOre", "LeadOre", "TinOre", "CopperOre", "silverOre", "leadOre", "tinOre", "copperOre", "bauxiteOre", "HSLivingmetalIngot", "oilMoving", "oilStill", "oilBucket", "petroleumOre", "dieselFuel", "diamondNugget", "planks", "wood", "stick", "sticks", "naquadah", "obsidianRod", "stoneRod", "thaumiumRod", "steelRod", "netherrackRod", "woodRod", "ironRod", "cactusRod", "flintRod", "copperRod", "cobaltRod", "alumiteRod", "blueslimeRod", "arditeRod", "manyullynRod", "bronzeRod", "boneRod", "slimeRod"});
private final List<String> mIgnoredPrefixes = Arrays.asList(new String[]{"reactor", "mffs", "projred", "ganys"}); private final List<String> mIgnoredPrefixes = Arrays.asList(new String[]{"reactor", "mffs", "projred", "ganys"});
public final List<ItemStack> mRegisteredStacks = new ArrayList<>();
private boolean mActivated = false; private boolean mActivated = false;
@SubscribeEvent @SubscribeEvent
@ -72,7 +71,6 @@ public class GT_OreDictHandler {
GT_Log.ore.println(e + " is ambiguous, this is an Error."); GT_Log.ore.println(e + " is ambiguous, this is an Error.");
GT_Log.log.warn("WARNING: The OreDict-Registration of " + aEvent.Name + " by " + aMod + " is ambiguous. Please check if the Item hasn\'t already been registered under that Name, before registering it a second time!"); GT_Log.log.warn("WARNING: The OreDict-Registration of " + aEvent.Name + " by " + aMod + " is ambiguous. Please check if the Item hasn\'t already been registered under that Name, before registering it a second time!");
} else { } else {
this.mRegisteredStacks.add(aEvent.Ore);
if (aEvent.Name.startsWith("item") && this.mIgnoredItems.contains(aEvent.Name)) { if (aEvent.Name.startsWith("item") && this.mIgnoredItems.contains(aEvent.Name)) {
GT_Log.ore.println(e); GT_Log.ore.println(e);
if (aEvent.Name.equals("itemCopperWire")) { if (aEvent.Name.equals("itemCopperWire")) {
@ -104,7 +102,6 @@ public class GT_OreDictHandler {
GT_Log.ore.println(e + " is getting re-registered because the OreDict Name containing invalid spaces."); GT_Log.ore.println(e + " is getting re-registered because the OreDict Name containing invalid spaces.");
GT_Log.log.warn("WARNING: \'" + aEvent.Name + "\' is an invalid OreDictionary Name, as it contains spaces! Register it without spaces to fix that."); GT_Log.log.warn("WARNING: \'" + aEvent.Name + "\' is an invalid OreDictionary Name, as it contains spaces! Register it without spaces to fix that.");
GT_OreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, aEvent.Ore)); GT_OreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, aEvent.Ore));
aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
} else if(this.mInvalidNames.contains(aEvent.Name)) { } else if(this.mInvalidNames.contains(aEvent.Name)) {
GT_Log.ore.println(e + " is wrongly registered and therefor getting ignored."); GT_Log.ore.println(e + " is wrongly registered and therefor getting ignored.");
GT_Log.log.error("WARNING: \'" + aEvent.Name + "\' is an invalid OreDictionary Name. The Name doesn\'t fit to the Type of Item and/or doesn\'t follow a proper OreDictionary Convention. If you are the Owner of the Mod who adds this Item, please do the following: "); GT_Log.log.error("WARNING: \'" + aEvent.Name + "\' is an invalid OreDictionary Name. The Name doesn\'t fit to the Type of Item and/or doesn\'t follow a proper OreDictionary Convention. If you are the Owner of the Mod who adds this Item, please do the following: ");
@ -161,7 +158,7 @@ public class GT_OreDictHandler {
OrePrefixes aPrefix = OrePrefixes.getOrePrefix(aEvent.Name); OrePrefixes aPrefix = OrePrefixes.getOrePrefix(aEvent.Name);
String tName = ""; String tName = "";
if(aPrefix == null) { if(aPrefix == null) {
if(aEvent.Name.toLowerCase().equals(aEvent.Name)) { if(aEvent.Name.toLowerCase().equals(aEvent.Name) && !aEvent.Name.equals("glowstone")) {
GT_Log.log.error("Improperly registered Ore: " + aEvent.Name + " !!!Improperly registered Ore detected!!! This Object does not follow any OreDictionary Convention, as it is 100% lowercased!!! Please report this to its Modauthor for a fix. If nothing proper is found, a good suggestion for its Name would be \'" + aMod + ":" + aEvent.Name + "\' don\'t forget to insert the \':\' inbetween the Mod ID and OreDict Name, that is the most important part."); GT_Log.log.error("Improperly registered Ore: " + aEvent.Name + " !!!Improperly registered Ore detected!!! This Object does not follow any OreDictionary Convention, as it is 100% lowercased!!! Please report this to its Modauthor for a fix. If nothing proper is found, a good suggestion for its Name would be \'" + aMod + ":" + aEvent.Name + "\' don\'t forget to insert the \':\' inbetween the Mod ID and OreDict Name, that is the most important part.");
GT_Log.ore.println(e + " is invalid due to being solely lowercased."); GT_Log.ore.println(e + " is invalid due to being solely lowercased.");
return; return;
@ -396,12 +393,15 @@ public class GT_OreDictHandler {
} }
} }
} else { } else {
if(!aPrefix.mIsSelfReferencing) { if (aEvent.Name.equals("sand")) {
GT_Log.log.error("WARNING: \'" + aEvent.Name + "\' is an OreDictionary Name which may cause Problems, due to being a Prefix, please use another one."); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.Sand, aEvent.Ore);
GT_Log.log.error("Private Prefixes are a solution. Please use \'" + aMod + ":" + aEvent.Name + "\' don\'t forget to insert the \':\' inbetween the Mod ID and OreDict Name, that is the most important part."); } else if (aEvent.Name.equals("dye")) {
GT_Log.ore.println(e + " uses a Prefix as full OreDict Name, and is therefor invalid."); GT_OreDictUnificator.registerOre(Dyes.dyeWhite, aEvent.Ore);
aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag"); } else if (!aPrefix.mIsSelfReferencing) {
return; GT_Log.log.error("WARNING: \'" + aEvent.Name + "\' is an OreDictionary Name which may cause Problems, due to being a Prefix, please use another one.");
GT_Log.log.error("Private Prefixes are a solution. Please use \'" + aMod + ":" + aEvent.Name + "\' don\'t forget to insert the \':\' inbetween the Mod ID and OreDict Name, that is the most important part.");
GT_Log.ore.println(e + " uses a Prefix as full OreDict Name, and is therefor invalid.");
return;
} }
aPrefix.add(GT_Utility.copyAmount(1L, aEvent.Ore)); aPrefix.add(GT_Utility.copyAmount(1L, aEvent.Ore));
@ -476,25 +476,22 @@ public class GT_OreDictHandler {
GT_Log.ore.println(e); GT_Log.ore.println(e);
List<OreDictEntry> list = mEvents.get(aPrefix); List<OreDictEntry> list = mEvents.get(aPrefix);
OreDictEntry entry = OreDictEntry.create(aEvent.Name); OreDictEntry entry = OreDictEntry.create(aEvent.Name);
ItemStack copy = aEvent.Ore.copy();
if (list != null) { if (list != null) {
int idx = list.indexOf(entry); int idx = list.indexOf(entry);
if (idx >= 0) { if (idx >= 0) {
list.get(idx).add(aMod, aEvent.Ore); list.get(idx).add(aMod, copy);
} else { } else {
entry.add(aMod, aEvent.Ore); entry.add(aMod, copy);
list.add(entry); list.add(entry);
} }
} else { } else {
list = new ArrayList<>(); list = new ArrayList<>();
entry.add(aMod, aEvent.Ore); entry.add(aMod, copy);
list.add(entry); list.add(entry);
} }
this.mEvents.put(aPrefix, list); this.mEvents.put(aPrefix, list);
// if(this.mActivated) {
// this.registerRecipes(aEvent, aMod);
// }
} }
} else { } else {
GT_Log.ore.println(e + " is using a private Prefix and is therefor getting ignored properly."); GT_Log.ore.println(e + " is using a private Prefix and is therefor getting ignored properly.");