From 8b7d3e5d15575adce85577ada6f5a3fe4196ff84 Mon Sep 17 00:00:00 2001 From: mezz Date: Sat, 26 Sep 2015 16:05:05 -0700 Subject: [PATCH] Replace Constants.WILDCARD with OreDictionary.WILDCARD_VALUE --- .../apiculture/VillageHandlerApiculture.java | 8 +++++--- .../arboriculture/genetics/TreeHelper.java | 4 +++- src/main/java/forestry/core/config/Constants.java | 2 -- .../forestry/core/recipes/ShapedRecipeCustom.java | 5 ++--- .../java/forestry/core/utils/ItemStackUtil.java | 6 ++---- .../forestry/farming/logic/FarmLogicCrops.java | 5 +++-- src/main/java/forestry/plugins/PluginCore.java | 2 +- src/main/java/forestry/plugins/PluginFactory.java | 5 +++-- .../forestry/plugins/PluginLepidopterology.java | 3 ++- .../java/forestry/plugins/PluginMagicalCrops.java | 4 +++- src/main/java/forestry/plugins/PluginMail.java | 8 +++++--- src/main/java/forestry/plugins/PluginNatura.java | 4 +++- src/main/java/forestry/plugins/PluginStorage.java | 14 +++++++------- src/main/java/forestry/plugins/PluginWitchery.java | 4 +++- 14 files changed, 42 insertions(+), 32 deletions(-) diff --git a/src/main/java/forestry/apiculture/VillageHandlerApiculture.java b/src/main/java/forestry/apiculture/VillageHandlerApiculture.java index b24b50d23..15609f647 100755 --- a/src/main/java/forestry/apiculture/VillageHandlerApiculture.java +++ b/src/main/java/forestry/apiculture/VillageHandlerApiculture.java @@ -23,6 +23,8 @@ import net.minecraft.village.MerchantRecipeList; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler; import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; @@ -48,11 +50,11 @@ public class VillageHandlerApiculture implements IVillageCreationHandler, IVilla @SuppressWarnings("unchecked") @Override public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) { - recipeList.add(new MerchantRecipe(ForestryItem.beePrincessGE.getItemStack(1, Constants.WILDCARD), new ItemStack(Items.emerald, 1))); + recipeList.add(new MerchantRecipe(ForestryItem.beePrincessGE.getItemStack(1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.emerald, 1))); recipeList.add(new MerchantRecipe(new ItemStack(Items.wheat, 2), ItemHoneycomb.getRandomComb(1, random, false))); - recipeList.add(new MerchantRecipe(new ItemStack(Blocks.log, 24, Constants.WILDCARD), ForestryBlock.apiculture.getItemStack(1, Constants.DEFINITION_APIARY_META))); + recipeList.add(new MerchantRecipe(new ItemStack(Blocks.log, 24, OreDictionary.WILDCARD_VALUE), ForestryBlock.apiculture.getItemStack(1, Constants.DEFINITION_APIARY_META))); recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 1), ForestryItem.frameProven.getItemStack(6))); - recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 12), ForestryItem.beePrincessGE.getItemStack(1, Constants.WILDCARD), BeeDefinition.MONASTIC.getMemberStack(EnumBeeType.DRONE))); + recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 12), ForestryItem.beePrincessGE.getItemStack(1, OreDictionary.WILDCARD_VALUE), BeeDefinition.MONASTIC.getMemberStack(EnumBeeType.DRONE))); } @Override diff --git a/src/main/java/forestry/arboriculture/genetics/TreeHelper.java b/src/main/java/forestry/arboriculture/genetics/TreeHelper.java index 337fb7717..4b00f7b92 100755 --- a/src/main/java/forestry/arboriculture/genetics/TreeHelper.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeHelper.java @@ -27,6 +27,8 @@ import net.minecraft.world.World; import com.mojang.authlib.GameProfile; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.FMLCommonHandler; import forestry.api.arboriculture.EnumGermlingType; @@ -66,7 +68,7 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot { private final ArrayList treekeepingModes = new ArrayList(); public TreeHelper() { - setResearchSuitability(new ItemStack(Blocks.sapling, 1, Constants.WILDCARD), 1.0f); + setResearchSuitability(new ItemStack(Blocks.sapling, 1, OreDictionary.WILDCARD_VALUE), 1.0f); } @Override diff --git a/src/main/java/forestry/core/config/Constants.java b/src/main/java/forestry/core/config/Constants.java index 52b60fad9..0c2dd6487 100644 --- a/src/main/java/forestry/core/config/Constants.java +++ b/src/main/java/forestry/core/config/Constants.java @@ -22,8 +22,6 @@ public class Constants implements IForestryConstants { public static final String ID = MOD.toLowerCase(Locale.ENGLISH); public static final String URL = "http://forestry.sengir.net/"; - public static final int WILDCARD = OreDictionary.WILDCARD_VALUE; - public static final int WORLD_HEIGHT = 256; public static final int FLAG_BLOCK_UPDATE = 1; diff --git a/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java b/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java index 8c4617388..d6c3d309b 100644 --- a/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java +++ b/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java @@ -24,7 +24,6 @@ import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -import forestry.core.config.Constants; import forestry.core.config.ForestryBlock; import forestry.core.config.ForestryItem; @@ -175,7 +174,7 @@ public class ShapedRecipeCustom implements IDescriptiveRecipe { return false; } - if (compare.getItemDamage() != Constants.WILDCARD && compare.getItemDamage() != resource.getItemDamage()) { + if (compare.getItemDamage() != OreDictionary.WILDCARD_VALUE && compare.getItemDamage() != resource.getItemDamage()) { return false; } @@ -268,7 +267,7 @@ public class ShapedRecipeCustom implements IDescriptiveRecipe { } else if (materials[index + 1] instanceof ForestryBlock) { hashmap.put(character, ((ForestryBlock) materials[index + 1]).getItemStack()); } else if (materials[index + 1] instanceof Block) { - hashmap.put(character, new ItemStack((Block) materials[index + 1], 1, Constants.WILDCARD)); + hashmap.put(character, new ItemStack((Block) materials[index + 1], 1, OreDictionary.WILDCARD_VALUE)); } else if (materials[index + 1] instanceof ItemStack) { hashmap.put(character, materials[index + 1]); } else if (materials[index + 1] instanceof String) { diff --git a/src/main/java/forestry/core/utils/ItemStackUtil.java b/src/main/java/forestry/core/utils/ItemStackUtil.java index c51a98c6f..9f787f077 100644 --- a/src/main/java/forestry/core/utils/ItemStackUtil.java +++ b/src/main/java/forestry/core/utils/ItemStackUtil.java @@ -25,8 +25,6 @@ import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -import forestry.core.config.Constants; - public abstract class ItemStackUtil { public static final ItemStack[] EMPTY_STACK_ARRAY = new ItemStack[0]; @@ -43,7 +41,7 @@ public abstract class ItemStackUtil { return false; } - if (lhs.getItemDamage() != Constants.WILDCARD) { + if (lhs.getItemDamage() != OreDictionary.WILDCARD_VALUE) { if (lhs.getItemDamage() != rhs.getItemDamage()) { return false; } @@ -178,7 +176,7 @@ public abstract class ItemStackUtil { return false; } - if (base.getItemDamage() != Constants.WILDCARD) { + if (base.getItemDamage() != OreDictionary.WILDCARD_VALUE) { if (base.getItemDamage() != comparison.getItemDamage()) { return false; } diff --git a/src/main/java/forestry/farming/logic/FarmLogicCrops.java b/src/main/java/forestry/farming/logic/FarmLogicCrops.java index 1643025a4..58c5c5d5a 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicCrops.java +++ b/src/main/java/forestry/farming/logic/FarmLogicCrops.java @@ -22,11 +22,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + import forestry.api.farming.FarmDirection; import forestry.api.farming.ICrop; import forestry.api.farming.IFarmHousing; import forestry.api.farming.IFarmable; -import forestry.core.config.Constants; import forestry.core.utils.BlockUtil; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.IVect; @@ -36,7 +37,7 @@ import forestry.core.utils.vect.VectUtil; public abstract class FarmLogicCrops extends FarmLogicWatered { private final Iterable seeds; - private static final ItemStack farmland = new ItemStack(Blocks.farmland, 1, Constants.WILDCARD); + private static final ItemStack farmland = new ItemStack(Blocks.farmland, 1, OreDictionary.WILDCARD_VALUE); protected FarmLogicCrops(IFarmHousing housing, Iterable seeds) { super(housing, new ItemStack(Blocks.dirt), new ItemStack(Blocks.farmland)); diff --git a/src/main/java/forestry/plugins/PluginCore.java b/src/main/java/forestry/plugins/PluginCore.java index 1d118f9ab..716b12f7d 100644 --- a/src/main/java/forestry/plugins/PluginCore.java +++ b/src/main/java/forestry/plugins/PluginCore.java @@ -424,7 +424,7 @@ public class PluginCore extends ForestryPlugin { Proxies.common.addRecipe(new ItemStack(Items.string), "#", "#", "#", '#', ForestryItem.craftingMaterial.getItemStack(1, 2)); // / Pipette - Proxies.common.addRecipe(ForestryItem.pipette.getItemStack(), " #", " X ", "X ", 'X', "paneGlass", '#', new ItemStack(Blocks.wool, 1, Constants.WILDCARD)); + Proxies.common.addRecipe(ForestryItem.pipette.getItemStack(), " #", " X ", "X ", 'X', "paneGlass", '#', new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE)); // Storage Blocks Proxies.common.addRecipe(ForestryBlock.resourceStorage.getItemStack(1, 0), "###", "###", "###", '#', "gemApatite"); diff --git a/src/main/java/forestry/plugins/PluginFactory.java b/src/main/java/forestry/plugins/PluginFactory.java index f77d74636..bcc867f0b 100644 --- a/src/main/java/forestry/plugins/PluginFactory.java +++ b/src/main/java/forestry/plugins/PluginFactory.java @@ -18,6 +18,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; import cpw.mods.fml.common.network.IGuiHandler; @@ -311,8 +312,8 @@ public class PluginFactory extends ForestryPlugin { if (PluginManager.Module.APICULTURE.isEnabled()) { FluidStack liquidGlass = Fluids.GLASS.getFluid(Constants.BUCKET_VOLUME); for (int i = 0; i < 16; i++) { - RecipeManagers.fabricatorManager.addRecipe(ForestryItem.waxCast.getItemStack(1, Constants.WILDCARD), liquidGlass, new ItemStack(Blocks.stained_glass, 4, 15 - i), new Object[]{"#", "X", '#', dyes[i], - 'X', ForestryItem.propolis.getItemStack(1, Constants.WILDCARD)}); + RecipeManagers.fabricatorManager.addRecipe(ForestryItem.waxCast.getItemStack(1, OreDictionary.WILDCARD_VALUE), liquidGlass, new ItemStack(Blocks.stained_glass, 4, 15 - i), new Object[]{"#", "X", '#', dyes[i], + 'X', ForestryItem.propolis.getItemStack(1, OreDictionary.WILDCARD_VALUE)}); } } diff --git a/src/main/java/forestry/plugins/PluginLepidopterology.java b/src/main/java/forestry/plugins/PluginLepidopterology.java index 4d758eee0..96048b4ad 100755 --- a/src/main/java/forestry/plugins/PluginLepidopterology.java +++ b/src/main/java/forestry/plugins/PluginLepidopterology.java @@ -17,6 +17,7 @@ import java.util.Locale; import net.minecraft.block.material.Material; import net.minecraft.item.crafting.CraftingManager; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.RecipeSorter; import cpw.mods.fml.common.SidedProxy; @@ -131,7 +132,7 @@ public class PluginLepidopterology extends ForestryPlugin { "XYX", "XXX", '#', "blockGlass", - 'X', ForestryItem.butterflyGE.getItemStack(1, Constants.WILDCARD), + 'X', ForestryItem.butterflyGE.getItemStack(1, OreDictionary.WILDCARD_VALUE), 'Y', "chestWood")) .setBoundingBox(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F)); definitionChest.register(); diff --git a/src/main/java/forestry/plugins/PluginMagicalCrops.java b/src/main/java/forestry/plugins/PluginMagicalCrops.java index 839974685..a87e10f93 100644 --- a/src/main/java/forestry/plugins/PluginMagicalCrops.java +++ b/src/main/java/forestry/plugins/PluginMagicalCrops.java @@ -16,6 +16,8 @@ import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.farming.Farmables; @@ -233,7 +235,7 @@ public class PluginMagicalCrops extends ForestryPlugin { Item cropProduce = GameRegistry.findItem(MagCrop, MagCrop + "_CropProduce"); if (cropProduce != null) { int juiceAmount = GameMode.getGameMode().getIntegerSetting("squeezer.liquid.apple"); - ItemStack produce = new ItemStack(GameRegistry.findItem(MagCrop, MagCrop + "_CropProduce"), 1, Constants.WILDCARD); + ItemStack produce = new ItemStack(GameRegistry.findItem(MagCrop, MagCrop + "_CropProduce"), 1, OreDictionary.WILDCARD_VALUE); RecipeUtil.addFermenterRecipes(produce, GameMode.getGameMode().getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{produce}, Fluids.JUICE.getFluid(juiceAmount)); } diff --git a/src/main/java/forestry/plugins/PluginMail.java b/src/main/java/forestry/plugins/PluginMail.java index 46a74d17d..15c02c807 100755 --- a/src/main/java/forestry/plugins/PluginMail.java +++ b/src/main/java/forestry/plugins/PluginMail.java @@ -15,6 +15,8 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.network.IGuiHandler; import forestry.api.mail.EnumAddressee; @@ -154,7 +156,7 @@ public class PluginMail extends ForestryPlugin { Item stampGlue; if (PluginManager.Module.APICULTURE.isEnabled()) { - Proxies.common.addShapelessRecipe(ForestryItem.letters.getItemStack(), Items.paper, ForestryItem.propolis.getItemStack(1, Constants.WILDCARD)); + Proxies.common.addShapelessRecipe(ForestryItem.letters.getItemStack(), Items.paper, ForestryItem.propolis.getItemStack(1, OreDictionary.WILDCARD_VALUE)); stampGlue = ForestryItem.honeyDrop.item(); } else { Proxies.common.addShapelessRecipe(ForestryItem.letters.getItemStack(), Items.paper, Items.slime_ball); @@ -180,12 +182,12 @@ public class PluginMail extends ForestryPlugin { } // Recycling - Proxies.common.addRecipe(new ItemStack(Items.paper), "###", '#', ForestryItem.letters.getItemStack(1, Constants.WILDCARD)); + Proxies.common.addRecipe(new ItemStack(Items.paper), "###", '#', ForestryItem.letters.getItemStack(1, OreDictionary.WILDCARD_VALUE)); // Carpenter RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(250), null, ForestryItem.letters.getItemStack(), "###", "###", '#', ForestryItem.woodPulp); - Proxies.common.addShapelessRecipe(ForestryItem.catalogue.getItemStack(), ForestryItem.stamps.getItemStack(1, Constants.WILDCARD), new ItemStack(Items.book)); + Proxies.common.addShapelessRecipe(ForestryItem.catalogue.getItemStack(), ForestryItem.stamps.getItemStack(1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.book)); } @Override diff --git a/src/main/java/forestry/plugins/PluginNatura.java b/src/main/java/forestry/plugins/PluginNatura.java index 1766c98a8..cc86534d6 100755 --- a/src/main/java/forestry/plugins/PluginNatura.java +++ b/src/main/java/forestry/plugins/PluginNatura.java @@ -18,6 +18,8 @@ import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; @@ -89,7 +91,7 @@ public class PluginNatura extends ForestryPlugin { for (String key : saplingItemKeys) { Item saplingItem = GameRegistry.findItem(NATURA, key); - ItemStack saplingWild = new ItemStack(saplingItem, 1, Constants.WILDCARD); + ItemStack saplingWild = new ItemStack(saplingItem, 1, OreDictionary.WILDCARD_VALUE); RecipeUtil.addFermenterRecipes(saplingWild, GameMode.getGameMode().getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS); String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem); diff --git a/src/main/java/forestry/plugins/PluginStorage.java b/src/main/java/forestry/plugins/PluginStorage.java index 54da41be2..ec47a273e 100755 --- a/src/main/java/forestry/plugins/PluginStorage.java +++ b/src/main/java/forestry/plugins/PluginStorage.java @@ -314,7 +314,7 @@ public class PluginStorage extends ForestryPlugin { digger.addValidOreDictNames(diggerOreDictNames); digger.addValidItems(Arrays.asList( - new ItemStack(Blocks.dirt, 1, Constants.WILDCARD), + new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.flint), new ItemStack(Blocks.netherrack), @@ -333,7 +333,7 @@ public class PluginStorage extends ForestryPlugin { new ItemStack(Blocks.red_flower), new ItemStack(Blocks.yellow_flower), new ItemStack(Blocks.cactus), - new ItemStack(Blocks.tallgrass, 1, Constants.WILDCARD), + new ItemStack(Blocks.tallgrass, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Blocks.vine), new ItemStack(Blocks.pumpkin), new ItemStack(Blocks.melon_block), @@ -368,7 +368,7 @@ public class PluginStorage extends ForestryPlugin { new ItemStack(Items.slime_ball), new ItemStack(Items.dye, 1, 0), new ItemStack(Blocks.hay_block), - new ItemStack(Blocks.wool, 1, Constants.WILDCARD), + new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.ender_eye), new ItemStack(Items.magma_cream), new ItemStack(Items.speckled_melon), @@ -388,13 +388,13 @@ public class PluginStorage extends ForestryPlugin { new ItemStack(Blocks.torch), new ItemStack(Blocks.redstone_torch), new ItemStack(Blocks.redstone_lamp), - new ItemStack(Blocks.stonebrick, 1, Constants.WILDCARD), + new ItemStack(Blocks.stonebrick, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Blocks.sandstone, 1, 1), new ItemStack(Blocks.sandstone, 1, 2), new ItemStack(Blocks.brick_block), new ItemStack(Blocks.clay), - new ItemStack(Blocks.hardened_clay, 1, Constants.WILDCARD), - new ItemStack(Blocks.stained_hardened_clay, 1, Constants.WILDCARD), + new ItemStack(Blocks.hardened_clay, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Blocks.stained_hardened_clay, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Blocks.packed_ice), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.crafting_table), @@ -404,7 +404,7 @@ public class PluginStorage extends ForestryPlugin { new ItemStack(Blocks.dropper), new ItemStack(Blocks.ladder), new ItemStack(Blocks.iron_bars), - new ItemStack(Blocks.quartz_block, 1, Constants.WILDCARD), + new ItemStack(Blocks.quartz_block, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.sign), new ItemStack(Items.item_frame) )); diff --git a/src/main/java/forestry/plugins/PluginWitchery.java b/src/main/java/forestry/plugins/PluginWitchery.java index 411bd6499..f65e95ea2 100644 --- a/src/main/java/forestry/plugins/PluginWitchery.java +++ b/src/main/java/forestry/plugins/PluginWitchery.java @@ -19,6 +19,8 @@ import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; @@ -72,7 +74,7 @@ public class PluginWitchery extends ForestryPlugin { int seedamount = GameMode.getGameMode().getIntegerSetting("squeezer.liquid.seed"); Item saplingItem = GameRegistry.findItem(Witch, "witchsapling"); - ItemStack saplingStack = new ItemStack(saplingItem, 1, Constants.WILDCARD); + ItemStack saplingStack = new ItemStack(saplingItem, 1, OreDictionary.WILDCARD_VALUE); RecipeUtil.addFermenterRecipes(saplingStack, GameMode.getGameMode().getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem); FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));