diff --git a/src/main/java/forestry/apiculture/entities/EntityFXBee.java b/src/main/java/forestry/apiculture/entities/EntityFXBee.java index c62f2e6ec..5f6ef45ef 100644 --- a/src/main/java/forestry/apiculture/entities/EntityFXBee.java +++ b/src/main/java/forestry/apiculture/entities/EntityFXBee.java @@ -27,9 +27,9 @@ public class EntityFXBee extends EntityFX { this.particleMaxAge = (int) (20.0D / (Math.random() * 0.8D + 0.2D)); this.noClip = true; - this.motionX *= 0.2D; + this.motionX *= 0.1D; this.motionY *= 0.015D; - this.motionZ *= 0.2D; + this.motionZ *= 0.1D; } /** diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectGlacial.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectGlacial.java index b183629d1..dda24b591 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectGlacial.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectGlacial.java @@ -18,7 +18,7 @@ import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.core.EnumTemperature; import forestry.api.genetics.IEffectData; -import forestry.core.proxy.Proxies; +import forestry.core.config.Constants; import forestry.core.utils.vect.Vect; public class AlleleEffectGlacial extends AlleleEffectThrottled { @@ -61,7 +61,7 @@ public class AlleleEffectGlacial extends AlleleEffectThrottled { continue; } - Proxies.common.setBlockWithNotify(world, posBlock.x, posBlock.y, posBlock.z, Blocks.ice); + world.setBlock(posBlock.x, posBlock.y, posBlock.z, Blocks.ice, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); } return storedData; diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectIgnition.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectIgnition.java index dd3ba2322..6101008df 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectIgnition.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectIgnition.java @@ -80,7 +80,7 @@ public class AlleleEffectIgnition extends AlleleEffectThrottled { if (housing.getWorld().rand.nextInt(2) != 0) { super.doFX(genome, storedData, housing); } else { - Proxies.common.addEntityIgnitionFX(housing.getWorld(), housing.getCoordinates().posX + 0.5, housing.getCoordinates().posY + 1, housing.getCoordinates().posZ + 0.5); + Proxies.render.addEntityIgnitionFX(housing.getWorld(), housing.getCoordinates().posX + 0.5, housing.getCoordinates().posY + 1, housing.getCoordinates().posZ + 0.5); } return storedData; } diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectNone.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectNone.java index b2d905aa7..2be84f20b 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectNone.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectNone.java @@ -19,9 +19,9 @@ import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeModifier; import forestry.api.genetics.IEffectData; import forestry.core.genetics.alleles.AlleleCategorized; +import forestry.core.proxy.Proxies; import forestry.core.utils.vect.MutableVect; import forestry.core.utils.vect.Vect; -import forestry.plugins.PluginApiculture; public class AlleleEffectNone extends AlleleCategorized implements IAlleleBeeEffect { @@ -46,7 +46,7 @@ public class AlleleEffectNone extends AlleleCategorized implements IAlleleBeeEff @Override public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - PluginApiculture.proxy.addBeeHiveFX("particles/swarm_bee", housing.getWorld(), housing.getCoordinates(), genome.getPrimary().getIconColour(0)); + Proxies.render.addBeeHiveFX("particles/swarm_bee", housing.getWorld(), housing.getCoordinates(), genome.getPrimary().getIconColour(0)); return storedData; } diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java index f6de2b805..7d56cfe5e 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java @@ -109,7 +109,7 @@ public class AlleleEffectPotion extends AlleleEffectThrottled { super.doFX(genome, storedData, housing); } else { ChunkCoordinates coords = housing.getCoordinates(); - Proxies.common.addEntityPotionFX(housing.getWorld(), coords.posX + 0.5, coords.posY + 1, coords.posZ + 0.5, potionFXColor); + Proxies.render.addEntityPotionFX(housing.getWorld(), coords.posX + 0.5, coords.posY + 1, coords.posZ + 0.5, potionFXColor); } return storedData; } diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectSnowing.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectSnowing.java index e097ff10b..5c1b37381 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectSnowing.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectSnowing.java @@ -69,7 +69,7 @@ public class AlleleEffectSnowing extends AlleleEffectThrottled { world.setBlockMetadataWithNotify(posBlock.x, posBlock.y, posBlock.z, meta + 1, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); } } else if (block.isReplaceable(world, posBlock.x, posBlock.y, posBlock.z)) { - Proxies.common.setBlockWithNotify(world, posBlock.x, posBlock.y, posBlock.z, Blocks.snow_layer); + world.setBlock(posBlock.x, posBlock.y, posBlock.z, Blocks.snow_layer, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); } } @@ -86,7 +86,7 @@ public class AlleleEffectSnowing extends AlleleEffectThrottled { World world = housing.getWorld(); Vect spawn = Vect.getRandomPositionInArea(world.rand, area).add(coordinates).add(offset); - Proxies.common.addEntitySnowFX(world, spawn.x, spawn.y, spawn.z); + Proxies.render.addEntitySnowFX(world, spawn.x, spawn.y, spawn.z); return storedData; } else { return super.doFX(genome, storedData, housing); diff --git a/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java b/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java index 4375c1901..b8b82301f 100755 --- a/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java +++ b/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java @@ -172,7 +172,7 @@ public class GuiHabitatLocator extends GuiForestry { @@ -45,7 +44,7 @@ public class ContainerAlyzer extends ContainerItemInventory } private void drawQuestionMark(int x, int y) { - Proxies.common.bindTexture(textureFile); + Proxies.render.bindTexture(textureFile); drawTexturedModalRect(x, y, 78, 240, 16, 16); } @@ -339,7 +339,7 @@ public abstract class GuiAlyzer extends GuiForestry } // Probability arrow - Proxies.common.bindTexture(textureFile); + Proxies.render.bindTexture(textureFile); drawTexturedModalRect(x, y, column, line, 15, 9); } @@ -384,22 +384,22 @@ public abstract class GuiAlyzer extends GuiForestry } private void drawDownSymbol(int x, int y) { - Proxies.common.bindTexture(textureFile); + Proxies.render.bindTexture(textureFile); drawTexturedModalRect(guiLeft + x, guiTop + y, 0, 247, 15, 9); } private void drawUpSymbol(int x, int y) { - Proxies.common.bindTexture(textureFile); + Proxies.render.bindTexture(textureFile); drawTexturedModalRect(guiLeft + x, guiTop + y, 15, 247, 15, 9); } private void drawBothSymbol(int x, int y) { - Proxies.common.bindTexture(textureFile); + Proxies.render.bindTexture(textureFile); drawTexturedModalRect(guiLeft + x, guiTop + y, 30, 247, 15, 9); } private void drawNoneSymbol(int x, int y) { - Proxies.common.bindTexture(textureFile); + Proxies.render.bindTexture(textureFile); drawTexturedModalRect(guiLeft + x, guiTop + y, 45, 247, 15, 9); } @@ -411,7 +411,7 @@ public abstract class GuiAlyzer extends GuiForestry int stringWidth = fontRendererObj.getStringWidth(fertilityString); - Proxies.common.bindTexture(textureFile); + Proxies.render.bindTexture(textureFile); drawTexturedModalRect(guiLeft + x + stringWidth + 2, guiTop + getLineY() - 1, 60, 240 + texOffset, 12, 8); drawLine(fertilityString, x, textColor); diff --git a/src/main/java/forestry/core/gui/GuiEscritoire.java b/src/main/java/forestry/core/gui/GuiEscritoire.java index e98bad6b2..6b7641d97 100755 --- a/src/main/java/forestry/core/gui/GuiEscritoire.java +++ b/src/main/java/forestry/core/gui/GuiEscritoire.java @@ -108,7 +108,7 @@ public class GuiEscritoire extends GuiForestry ext this.inventory = inventory; this.container = container; - fontColor = new FontColour(Proxies.common.getSelectedTexturePack(Proxies.common.getClientInstance())); + fontColor = new FontColour(Proxies.render.getSelectedTexturePack()); initLedgers(); } @@ -387,7 +387,7 @@ public abstract class GuiForestry ext protected void bindTexture(ResourceLocation texturePath) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - Proxies.common.bindTexture(texturePath); + Proxies.render.bindTexture(texturePath); } public void setZLevel(float level) { diff --git a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java index 1995d6ffa..5049cee14 100755 --- a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java +++ b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java @@ -219,7 +219,7 @@ public class GuiNaturalistInventory extends GuiForestry itemClass) { - if (!EnumSet.of(PluginManager.Stage.PRE_INIT).contains(PluginManager.getStage())) { - throw new RuntimeException("Tried to register Block outside of Pre-Init"); - } - GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block)); - } - - public void registerItem(Item item) { - GameRegistry.registerItem(item, StringUtil.cleanItemName(item)); - } - - - /** - * As addRecipe, except that the recipe is injected into the front of the - * crafting manager to avoid certain generic collisions. Notably, all - * Forestry wood crafting into oak stairs & slabs. - */ - @SuppressWarnings("unchecked") - public void addPriorityRecipe(IRecipe recipe) { - CraftingManager.getInstance().getRecipeList().add(0, recipe); - } - - /** - * As addRecipe, except that the recipe is injected into the front of the - * crafting manager to avoid certain generic collisions. Notably, all - * Forestry wood crafting into oak stairs & slabs. - */ - @SuppressWarnings("unchecked") - public void addPriorityRecipe(ItemStack itemstack, Object... obj) { - cleanRecipe(obj); - addPriorityRecipe(new ShapedOreRecipe(itemstack, obj)); - } - - /** - * As addShapelessRecipe, except that the recipe is injected into the front - * of the crafting manager to avoid certain generic collisions. Notably, all - * Forestry wood crafting into oak stairs & slabs. - */ - @SuppressWarnings("unchecked") - public void addPriorityShapelessRecipe(ItemStack itemstack, Object... obj) { - cleanRecipe(obj); - addPriorityRecipe(new ShapelessOreRecipe(itemstack, obj)); - } - - @SuppressWarnings("unchecked") - public void addRecipe(ItemStack itemstack, Object... obj) { - cleanRecipe(obj); - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(itemstack, obj)); - } - - @SuppressWarnings("unchecked") - public void addShapelessRecipe(ItemStack itemstack, Object... obj) { - cleanRecipe(obj); - CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(itemstack, obj)); - } - - private void cleanRecipe(Object... obj) { - for (int i = 0; i < obj.length; i++) { - if (obj[i] instanceof ForestryItem) { - obj[i] = ((ForestryItem) obj[i]).item(); - } else if (obj[i] instanceof ForestryBlock) { - obj[i] = ((ForestryBlock) obj[i]).block(); - } - } - } - - public void addSmelting(ItemStack res, ItemStack prod) { - addSmelting(res, prod, 0.0f); - } - - public void addSmelting(ItemStack res, ItemStack prod, float xp) { - if (res == null || res.getItem() == null) { - throw new IllegalArgumentException("Tried to register smelting recipe with null input"); - } - if (prod == null || prod.getItem() == null) { - throw new IllegalArgumentException("Tried to register smelting recipe with null output"); - } - GameRegistry.addSmelting(res, prod, xp); - } - - public void dropItemPlayer(EntityPlayer player, ItemStack stack) { - player.dropPlayerItemWithRandomChoice(stack, true); - } - - public void setHabitatLocatorTexture(Entity player, ChunkCoordinates coordinates) { - } - - public void removePotionEffect(EntityPlayer player, Potion effect) { - player.clearActivePotions(); - } - - public String getCurrentLanguage() { - return null; - } - - public String getItemStackDisplayName(Item item) { - return null; - } - public String getDisplayName(ItemStack itemstack) { return null; } @@ -198,18 +73,6 @@ public class ProxyCommon { return false; } - public boolean isItemStackTagEqual(ItemStack stack1, ItemStack stack2) { - return ItemStack.areItemStackTagsEqual(stack1, stack2); - } - - public String getItemStackDisplayName(ItemStack stack) { - return null; - } - - public boolean setBlockWithNotify(World world, int x, int y, int z, Block block) { - return world.setBlock(x, y, z, block, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); - } - public void playSoundFX(World world, int x, int y, int z, Block block) { Proxies.net.sendNetworkPacket(new PacketFXSignal(PacketFXSignal.SoundFXType.LEAF, x, y, z, block, 0), world); } @@ -217,21 +80,6 @@ public class ProxyCommon { public void playSoundFX(World world, int x, int y, int z, String sound, float volume, float pitch) { } - public void addEntitySwarmFX(World world, double d1, double d2, double d3) { - } - - public void addEntityExplodeFX(World world, double d1, double d2, double d3) { - } - - public void addEntitySnowFX(World world, double d1, double d2, double d3) { - } - - public void addEntityIgnitionFX(World world, double d1, double d2, double d3) { - } - - public void addEntityPotionFX(World world, double d1, double d2, double d3, int color) { - } - public void addBlockDestroyEffects(World world, int xCoord, int yCoord, int zCoord, Block block, int i) { sendFXSignal(PacketFXSignal.VisualFXType.BLOCK_DESTROY, PacketFXSignal.SoundFXType.BLOCK_DESTROY, world, xCoord, yCoord, zCoord, block, i); } @@ -253,10 +101,6 @@ public class ProxyCommon { } } - public IResourceManager getSelectedTexturePack(Minecraft minecraft) { - return null; - } - public World getRenderWorld() { return null; } @@ -265,91 +109,6 @@ public class ProxyCommon { return FMLClientHandler.instance().getClient(); } - /* DEPENDENCY HANDLING */ - public boolean isModLoaded(String modname) { - return Loader.isModLoaded(modname); - } - - public boolean isModLoaded(String modname, String versionRangeString) { - if (!isModLoaded(modname)) { - return false; - } - - if (versionRangeString != null) { - ModContainer mod = Loader.instance().getIndexedModList().get(modname); - ArtifactVersion modVersion = mod.getProcessedVersion(); - - VersionRange versionRange = VersionParser.parseRange(versionRangeString); - DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion(modname, versionRange); - - if (!requiredVersion.containsVersion(modVersion)) { - return false; - } - } - - return true; - } - - public boolean isAPILoaded(String apiName) { - return isAPILoaded(apiName, null); - } - - public boolean isAPILoaded(String apiName, String versionRangeString) { - Package apiPackage = Package.getPackage(apiName); - if (apiPackage == null) { - return false; - } - - API apiAnnotation = apiPackage.getAnnotation(API.class); - if (apiAnnotation == null) { - return false; - } - - if (versionRangeString != null) { - String apiVersionString = apiAnnotation.apiVersion(); - if (apiVersionString == null) { - return false; - } - - VersionRange versionRange = VersionParser.parseRange(versionRangeString); - - DefaultArtifactVersion givenVersion = new DefaultArtifactVersion(apiName, apiVersionString); - DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion(apiName, versionRange); - - if (!requiredVersion.containsVersion(givenVersion)) { - return false; - } - } - - return true; - } - - public Object instantiateIfModLoaded(String modname, String className) { - return instantiateIfModLoaded(modname, null, className); - } - - public Object instantiateIfModLoaded(String modname, String versionRangeString, String className) { - - if (isModLoaded(modname, versionRangeString)) { - try { - Class clas = Class.forName(className, true, Loader.instance().getModClassLoader()); - return clas.newInstance(); - } catch (Exception ex) { - Log.severe("Failed to load " + className + " even though mod " + modname + " was available."); - return null; - } - } else { - return null; - } - - } - - public void bindTexture(ResourceLocation location) { - } - - public void bindTexture(SpriteSheet spriteSheet) { - } - public EntityPlayer getPlayer() { return null; } diff --git a/src/main/java/forestry/core/proxy/ProxyCommonClient.java b/src/main/java/forestry/core/proxy/ProxyCommonClient.java index 2e7474ba1..7561da44a 100644 --- a/src/main/java/forestry/core/proxy/ProxyCommonClient.java +++ b/src/main/java/forestry/core/proxy/ProxyCommonClient.java @@ -15,16 +15,8 @@ import java.io.File; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.particle.EntityExplodeFX; -import net.minecraft.client.particle.EntityFX; -import net.minecraft.client.particle.EntitySpellParticleFX; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import com.mojang.authlib.GameProfile; @@ -33,28 +25,13 @@ import cpw.mods.fml.common.FMLCommonHandler; import org.lwjgl.input.Keyboard; -import forestry.apiculture.render.TextureHabitatLocator; import forestry.core.ForestryClient; import forestry.core.TickHandlerCoreClient; -import forestry.core.entities.EntityFXHoneydust; -import forestry.core.entities.EntityFXIgnition; -import forestry.core.entities.EntityFXSnow; import forestry.core.multiblock.MultiblockClientTickHandler; -import forestry.core.render.SpriteSheet; import forestry.core.worldgen.WorldGenerator; public class ProxyCommonClient extends ProxyCommon { - @Override - public void bindTexture(ResourceLocation location) { - getClientInstance().getTextureManager().bindTexture(location); - } - - @Override - public void bindTexture(SpriteSheet spriteSheet) { - bindTexture(spriteSheet.getLocation()); - } - @Override public void registerTickHandlers(WorldGenerator worldGenerator) { super.registerTickHandlers(worldGenerator); @@ -63,16 +40,6 @@ public class ProxyCommonClient extends ProxyCommon { FMLCommonHandler.instance().bus().register(new MultiblockClientTickHandler()); } - @Override - public IResourceManager getSelectedTexturePack(Minecraft minecraft) { - return minecraft.getResourceManager(); - } - - @Override - public void setHabitatLocatorTexture(Entity player, ChunkCoordinates coordinates) { - TextureHabitatLocator.getInstance().setTargetCoordinates(coordinates); - } - @Override public File getForestryRoot() { return Minecraft.getMinecraft().mcDataDir; @@ -107,21 +74,6 @@ public class ProxyCommonClient extends ProxyCommon { return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); } - @Override - public String getItemStackDisplayName(Item item) { - return item.getItemStackDisplayName(null); - } - - @Override - public String getItemStackDisplayName(ItemStack stack) { - return stack.getItem().getItemStackDisplayName(stack); - } - - @Override - public String getCurrentLanguage() { - return Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode(); - } - @Override public String getDisplayName(ItemStack itemstack) { return itemstack.getItem().getItemStackDisplayName(itemstack); @@ -159,58 +111,6 @@ public class ProxyCommonClient extends ProxyCommon { world.playSound(x + 0.5, y + 0.5, z + 0.5, sound, volume, (1.0f + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2f) * 0.7f, false); } - @Override - public void addEntitySwarmFX(World world, double d1, double d2, double d3) { - if (!ProxyRenderClient.shouldSpawnParticle(world)) { - return; - } - - getClientInstance().effectRenderer.addEffect(new EntityFXHoneydust(world, d1, d2, d3, 0, 0, 0)); - } - - @Override - public void addEntityExplodeFX(World world, double d1, double d2, double d3) { - if (!ProxyRenderClient.shouldSpawnParticle(world)) { - return; - } - - getClientInstance().effectRenderer.addEffect(new EntityExplodeFX(world, d1, d2, d3, 0, 0, 0)); - } - - @Override - public void addEntitySnowFX(World world, double d1, double d2, double d3) { - if (!ProxyRenderClient.shouldSpawnParticle(world)) { - return; - } - - getClientInstance().effectRenderer.addEffect(new EntityFXSnow(world, d1 + world.rand.nextGaussian(), d2, d3 + world.rand.nextGaussian())); - } - - @Override - public void addEntityIgnitionFX(World world, double d1, double d2, double d3) { - if (!ProxyRenderClient.shouldSpawnParticle(world)) { - return; - } - - getClientInstance().effectRenderer.addEffect(new EntityFXIgnition(world, d1, d2, d3)); - } - - @Override - public void addEntityPotionFX(World world, double d1, double d2, double d3, int color) { - if (!ProxyRenderClient.shouldSpawnParticle(world)) { - return; - } - - float red = (color >> 16 & 255) / 255.0F; - float green = (color >> 8 & 255) / 255.0F; - float blue = (color & 255) / 255.0F; - - EntityFX entityfx = new EntitySpellParticleFX(world, d1, d2, d3, 0, 0, 0); - entityfx.setRBGColorF(red, green, blue); - - getClientInstance().effectRenderer.addEffect(entityfx); - } - @Override public void addBlockDestroyEffects(World world, int xCoord, int yCoord, int zCoord, Block block, int i) { if (world.isRemote) { diff --git a/src/main/java/forestry/core/proxy/ProxyRender.java b/src/main/java/forestry/core/proxy/ProxyRender.java index bd07c4346..44d1f923b 100755 --- a/src/main/java/forestry/core/proxy/ProxyRender.java +++ b/src/main/java/forestry/core/proxy/ProxyRender.java @@ -10,9 +10,14 @@ ******************************************************************************/ package forestry.core.proxy; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import forestry.core.render.IBlockRenderer; +import forestry.core.render.SpriteSheet; import forestry.core.tiles.MachineDefinition; public class ProxyRender { @@ -52,14 +57,39 @@ public class ProxyRender { return null; } - public short registerItemTexUID(IIconRegister register, short uid, String ident) { - return uid; - } - - public short registerTerrainTexUID(IIconRegister register, short uid, String ident) { - return uid; - } - public void registerVillagerSkin(int villagerId, String texturePath) { } + + public void setHabitatLocatorTexture(Entity player, ChunkCoordinates coordinates) { + } + + public IResourceManager getSelectedTexturePack() { + return null; + } + + public void bindTexture(ResourceLocation location) { + } + + public void bindTexture(SpriteSheet spriteSheet) { + } + + /* FX */ + + public void addBeeHiveFX(String texture, World world, ChunkCoordinates coordinates, int color) { + } + + public void addEntitySwarmFX(World world, double d1, double d2, double d3) { + } + + public void addEntityExplodeFX(World world, double d1, double d2, double d3) { + } + + public void addEntitySnowFX(World world, double d1, double d2, double d3) { + } + + public void addEntityIgnitionFX(World world, double d1, double d2, double d3) { + } + + public void addEntityPotionFX(World world, double d1, double d2, double d3, int color) { + } } diff --git a/src/main/java/forestry/core/proxy/ProxyRenderClient.java b/src/main/java/forestry/core/proxy/ProxyRenderClient.java index 726189edf..ecb4d48ed 100644 --- a/src/main/java/forestry/core/proxy/ProxyRenderClient.java +++ b/src/main/java/forestry/core/proxy/ProxyRenderClient.java @@ -11,8 +11,14 @@ package forestry.core.proxy; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.particle.EntityExplodeFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.EntitySpellParticleFX; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import cpw.mods.fml.client.FMLClientHandler; @@ -20,7 +26,13 @@ import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.registry.VillagerRegistry; +import forestry.apiculture.entities.EntityFXBee; +import forestry.apiculture.render.ParticleRenderer; +import forestry.apiculture.render.TextureHabitatLocator; import forestry.core.config.Config; +import forestry.core.entities.EntityFXHoneydust; +import forestry.core.entities.EntityFXIgnition; +import forestry.core.entities.EntityFXSnow; import forestry.core.render.ForestryResource; import forestry.core.render.IBlockRenderer; import forestry.core.render.RenderBlock; @@ -28,6 +40,7 @@ import forestry.core.render.RenderEscritoire; import forestry.core.render.RenderMachine; import forestry.core.render.RenderMill; import forestry.core.render.RenderNaturalistChest; +import forestry.core.render.SpriteSheet; import forestry.core.render.TextureManager; import forestry.core.render.TileRendererIndex; import forestry.core.tiles.MachineDefinition; @@ -80,6 +93,31 @@ public class ProxyRenderClient extends ProxyRender { return new RenderNaturalistChest(textureName); } + @Override + public void registerVillagerSkin(int villagerId, String texturePath) { + VillagerRegistry.instance().registerVillagerSkin(villagerId, new ForestryResource(texturePath)); + } + + @Override + public void setHabitatLocatorTexture(Entity player, ChunkCoordinates coordinates) { + TextureHabitatLocator.getInstance().setTargetCoordinates(coordinates); + } + + @Override + public IResourceManager getSelectedTexturePack() { + return Proxies.common.getClientInstance().getResourceManager(); + } + + @Override + public void bindTexture(ResourceLocation location) { + Proxies.common.getClientInstance().getTextureManager().bindTexture(location); + } + + @Override + public void bindTexture(SpriteSheet spriteSheet) { + bindTexture(spriteSheet.getLocation()); + } + public static boolean shouldSpawnParticle(World world) { if (!Config.enableParticleFX) { return false; @@ -103,19 +141,65 @@ public class ProxyRenderClient extends ProxyRender { } @Override - public short registerItemTexUID(IIconRegister register, short uid, String ident) { - TextureManager.getInstance().registerTexUID(register, uid, ident); - return uid; + public void addBeeHiveFX(String icon, World world, ChunkCoordinates coordinates, int color) { + if (!shouldSpawnParticle(world)) { + return; + } + + EntityFX fx = new EntityFXBee(world, coordinates.posX + 0.5D, coordinates.posY + 0.5D, coordinates.posZ + 0.5D, color); + fx.setParticleIcon(TextureManager.getInstance().getDefault(icon)); + ParticleRenderer.getInstance().addEffect(fx); } @Override - public short registerTerrainTexUID(IIconRegister register, short uid, String ident) { - TextureManager.getInstance().registerTexUID(register, uid, ident); - return uid; + public void addEntitySwarmFX(World world, double d1, double d2, double d3) { + if (!shouldSpawnParticle(world)) { + return; + } + + Proxies.common.getClientInstance().effectRenderer.addEffect(new EntityFXHoneydust(world, d1, d2, d3, 0, 0, 0)); } @Override - public void registerVillagerSkin(int villagerId, String texturePath) { - VillagerRegistry.instance().registerVillagerSkin(villagerId, new ForestryResource(texturePath)); + public void addEntityExplodeFX(World world, double d1, double d2, double d3) { + if (!shouldSpawnParticle(world)) { + return; + } + + Proxies.common.getClientInstance().effectRenderer.addEffect(new EntityExplodeFX(world, d1, d2, d3, 0, 0, 0)); + } + + @Override + public void addEntitySnowFX(World world, double d1, double d2, double d3) { + if (!shouldSpawnParticle(world)) { + return; + } + + Proxies.common.getClientInstance().effectRenderer.addEffect(new EntityFXSnow(world, d1 + world.rand.nextGaussian(), d2, d3 + world.rand.nextGaussian())); + } + + @Override + public void addEntityIgnitionFX(World world, double d1, double d2, double d3) { + if (!shouldSpawnParticle(world)) { + return; + } + + Proxies.common.getClientInstance().effectRenderer.addEffect(new EntityFXIgnition(world, d1, d2, d3)); + } + + @Override + public void addEntityPotionFX(World world, double d1, double d2, double d3, int color) { + if (!shouldSpawnParticle(world)) { + return; + } + + float red = (color >> 16 & 255) / 255.0F; + float green = (color >> 8 & 255) / 255.0F; + float blue = (color & 255) / 255.0F; + + EntityFX entityfx = new EntitySpellParticleFX(world, d1, d2, d3, 0, 0, 0); + entityfx.setRBGColorF(red, green, blue); + + Proxies.common.getClientInstance().effectRenderer.addEffect(entityfx); } } diff --git a/src/main/java/forestry/core/recipes/RecipeUtil.java b/src/main/java/forestry/core/recipes/RecipeUtil.java index d227ff37d..4242bc1e2 100644 --- a/src/main/java/forestry/core/recipes/RecipeUtil.java +++ b/src/main/java/forestry/core/recipes/RecipeUtil.java @@ -26,8 +26,14 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.recipes.RecipeManagers; +import forestry.core.config.ForestryBlock; +import forestry.core.config.ForestryItem; import forestry.core.fluids.Fluids; import forestry.core.gui.ContainerDummy; import forestry.core.utils.ItemStackUtil; @@ -229,4 +235,36 @@ public abstract class RecipeUtil { return null; } + + private static void cleanRecipe(Object... obj) { + for (int i = 0; i < obj.length; i++) { + if (obj[i] instanceof ForestryItem) { + obj[i] = ((ForestryItem) obj[i]).item(); + } else if (obj[i] instanceof ForestryBlock) { + obj[i] = ((ForestryBlock) obj[i]).block(); + } + } + } + + @SuppressWarnings("unchecked") + public static void addRecipe(ItemStack itemstack, Object... obj) { + cleanRecipe(obj); + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(itemstack, obj)); + } + + @SuppressWarnings("unchecked") + public static void addShapelessRecipe(ItemStack itemstack, Object... obj) { + cleanRecipe(obj); + CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(itemstack, obj)); + } + + public static void addSmelting(ItemStack res, ItemStack prod, float xp) { + if (res == null || res.getItem() == null) { + throw new IllegalArgumentException("Tried to register smelting recipe with null input"); + } + if (prod == null || prod.getItem() == null) { + throw new IllegalArgumentException("Tried to register smelting recipe with null output"); + } + GameRegistry.addSmelting(res, prod, xp); + } } diff --git a/src/main/java/forestry/core/render/RenderEscritoire.java b/src/main/java/forestry/core/render/RenderEscritoire.java index 76df4dbb1..f88a45cec 100755 --- a/src/main/java/forestry/core/render/RenderEscritoire.java +++ b/src/main/java/forestry/core/render/RenderEscritoire.java @@ -85,7 +85,7 @@ public class RenderEscritoire extends TileEntitySpecialRenderer implements IBloc break; } - Proxies.common.bindTexture(texture); + Proxies.render.bindTexture(texture); modelEscritoire.render(null, angle[0], angle[1], angle[2], 0f, 0f, factor); GL11.glPopMatrix(); diff --git a/src/main/java/forestry/core/render/RenderMachine.java b/src/main/java/forestry/core/render/RenderMachine.java index be678ec1a..a1c215458 100755 --- a/src/main/java/forestry/core/render/RenderMachine.java +++ b/src/main/java/forestry/core/render/RenderMachine.java @@ -161,10 +161,10 @@ public class RenderMachine extends TileEntitySpecialRenderer implements IBlockRe float factor = (float) (1.0 / 16.0); - Proxies.common.bindTexture(textures[Textures.BASE.ordinal()]); + Proxies.render.bindTexture(textures[Textures.BASE.ordinal()]); basefront.render(factor); - Proxies.common.bindTexture(textures[Textures.BASE.ordinal()]); + Proxies.render.bindTexture(textures[Textures.BASE.ordinal()]); baseback.render(factor); ResourceLocation texture; @@ -187,7 +187,7 @@ public class RenderMachine extends TileEntitySpecialRenderer implements IBlockRe texture = textures[Textures.TANK_R_EMPTY.ordinal()]; break; } - Proxies.common.bindTexture(texture); + Proxies.render.bindTexture(texture); resourceTank.render(factor); switch (melangeLevel) { @@ -208,7 +208,7 @@ public class RenderMachine extends TileEntitySpecialRenderer implements IBlockRe texture = textures[Textures.TANK_P_EMPTY.ordinal()]; break; } - Proxies.common.bindTexture(texture); + Proxies.render.bindTexture(texture); productTank.render(factor); GL11.glPopMatrix(); diff --git a/src/main/java/forestry/core/render/RenderMill.java b/src/main/java/forestry/core/render/RenderMill.java index 7f564d1d7..2018f7d31 100755 --- a/src/main/java/forestry/core/render/RenderMill.java +++ b/src/main/java/forestry/core/render/RenderMill.java @@ -173,23 +173,23 @@ public class RenderMill extends TileEntitySpecialRenderer implements IBlockRende float factor = (float) (1.0 / 16.0); - Proxies.common.bindTexture(textures[Textures.PEDESTAL.ordinal()]); + Proxies.render.bindTexture(textures[Textures.PEDESTAL.ordinal()]); pedestal.render(factor); - Proxies.common.bindTexture(textures[Textures.CHARGE.ordinal() + charge]); + Proxies.render.bindTexture(textures[Textures.CHARGE.ordinal() + charge]); column.render(factor); - Proxies.common.bindTexture(textures[Textures.EXTENSION.ordinal()]); + Proxies.render.bindTexture(textures[Textures.EXTENSION.ordinal()]); extension.render(factor); - Proxies.common.bindTexture(textures[Textures.BLADE_1.ordinal()]); + Proxies.render.bindTexture(textures[Textures.BLADE_1.ordinal()]); GL11.glTranslatef(translate[0] * tfactor, translate[1] * tfactor, translate[2] * tfactor); blade1.render(factor); // Reset GL11.glTranslatef(-translate[0] * tfactor, -translate[1] * tfactor, -translate[2] * tfactor); - Proxies.common.bindTexture(textures[Textures.BLADE_2.ordinal()]); + Proxies.render.bindTexture(textures[Textures.BLADE_2.ordinal()]); GL11.glTranslatef(-translate[0] * tfactor, translate[1] * tfactor, -translate[2] * tfactor); blade2.render(factor); diff --git a/src/main/java/forestry/core/utils/ModUtil.java b/src/main/java/forestry/core/utils/ModUtil.java new file mode 100644 index 000000000..5a8525306 --- /dev/null +++ b/src/main/java/forestry/core/utils/ModUtil.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (c) 2011-2014 SirSengir. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Various Contributors including, but not limited to: + * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges + ******************************************************************************/ +package forestry.core.utils; + +import cpw.mods.fml.common.API; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import cpw.mods.fml.common.versioning.VersionParser; +import cpw.mods.fml.common.versioning.VersionRange; + +public abstract class ModUtil { + public static boolean isModLoaded(String modname) { + return Loader.isModLoaded(modname); + } + + public static boolean isModLoaded(String modname, String versionRangeString) { + if (!isModLoaded(modname)) { + return false; + } + + if (versionRangeString != null) { + ModContainer mod = Loader.instance().getIndexedModList().get(modname); + ArtifactVersion modVersion = mod.getProcessedVersion(); + + VersionRange versionRange = VersionParser.parseRange(versionRangeString); + DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion(modname, versionRange); + + if (!requiredVersion.containsVersion(modVersion)) { + return false; + } + } + + return true; + } + + public static boolean isAPILoaded(String apiName) { + return isAPILoaded(apiName, null); + } + + public static boolean isAPILoaded(String apiName, String versionRangeString) { + Package apiPackage = Package.getPackage(apiName); + if (apiPackage == null) { + return false; + } + + API apiAnnotation = apiPackage.getAnnotation(API.class); + if (apiAnnotation == null) { + return false; + } + + if (versionRangeString != null) { + String apiVersionString = apiAnnotation.apiVersion(); + if (apiVersionString == null) { + return false; + } + + VersionRange versionRange = VersionParser.parseRange(versionRangeString); + + DefaultArtifactVersion givenVersion = new DefaultArtifactVersion(apiName, apiVersionString); + DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion(apiName, versionRange); + + if (!requiredVersion.containsVersion(givenVersion)) { + return false; + } + } + + return true; + } +} diff --git a/src/main/java/forestry/energy/gui/GuiEngineBronze.java b/src/main/java/forestry/energy/gui/GuiEngineBronze.java index ee5ca02af..4c5349e7e 100755 --- a/src/main/java/forestry/energy/gui/GuiEngineBronze.java +++ b/src/main/java/forestry/energy/gui/GuiEngineBronze.java @@ -59,7 +59,7 @@ public class GuiEngineBronze extends GuiEngine 0) { diff --git a/src/main/java/forestry/factory/gui/GuiWorktable.java b/src/main/java/forestry/factory/gui/GuiWorktable.java index f3f1d965f..a319de001 100755 --- a/src/main/java/forestry/factory/gui/GuiWorktable.java +++ b/src/main/java/forestry/factory/gui/GuiWorktable.java @@ -56,7 +56,7 @@ public class GuiWorktable extends GuiForestryTitled { if (getIconIndex() != null) { GL11.glDisable(GL11.GL_LIGHTING); - Proxies.common.bindTexture(getLogic().getSpriteSheet()); + Proxies.render.bindTexture(getLogic().getSpriteSheet()); manager.gui.drawTexturedModelRectFromIcon(startX + xPos, startY + yPos, getIconIndex(), 16, 16); GL11.glEnable(GL11.GL_LIGHTING); } diff --git a/src/main/java/forestry/food/BeverageEffectAntidote.java b/src/main/java/forestry/food/BeverageEffectAntidote.java index 1f07836e0..8f1dd870b 100755 --- a/src/main/java/forestry/food/BeverageEffectAntidote.java +++ b/src/main/java/forestry/food/BeverageEffectAntidote.java @@ -14,8 +14,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.Potion; import net.minecraft.world.World; -import forestry.core.proxy.Proxies; - public class BeverageEffectAntidote extends BeverageEffect { private float chance = 0.2f; @@ -33,7 +31,7 @@ public class BeverageEffectAntidote extends BeverageEffect { return; } - Proxies.common.removePotionEffect(player, Potion.poison); + player.removePotionEffect(Potion.poison.getId()); } @Override diff --git a/src/main/java/forestry/mail/gui/GuiLetter.java b/src/main/java/forestry/mail/gui/GuiLetter.java index 9741a628a..c821c0bcf 100755 --- a/src/main/java/forestry/mail/gui/GuiLetter.java +++ b/src/main/java/forestry/mail/gui/GuiLetter.java @@ -264,7 +264,7 @@ public class GuiLetter extends GuiForestry { IPostalCarrier carrier = PostManager.postRegistry.getCarrier(container.getCarrierType()); if (carrier != null) { GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); - Proxies.common.bindTexture(SpriteSheet.ITEMS); + Proxies.render.bindTexture(SpriteSheet.ITEMS); drawTexturedModelRectFromIcon(startX + xPos, startY + yPos - 5, carrier.getIcon(), 26, 26); } } diff --git a/src/main/java/forestry/mail/gui/GuiMailboxInfo.java b/src/main/java/forestry/mail/gui/GuiMailboxInfo.java index b43619aa7..0c9aca1ba 100755 --- a/src/main/java/forestry/mail/gui/GuiMailboxInfo.java +++ b/src/main/java/forestry/mail/gui/GuiMailboxInfo.java @@ -49,7 +49,7 @@ public class GuiMailboxInfo extends Gui { } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - Proxies.common.bindTexture(textureAlert); + Proxies.render.bindTexture(textureAlert); this.drawTexturedModalRect(x, y, 0, 0, 98, 17); diff --git a/src/main/java/forestry/plugins/PluginAgriCraft.java b/src/main/java/forestry/plugins/PluginAgriCraft.java index 57c460a2c..f87366cde 100644 --- a/src/main/java/forestry/plugins/PluginAgriCraft.java +++ b/src/main/java/forestry/plugins/PluginAgriCraft.java @@ -22,7 +22,7 @@ import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableBasicAgricraft; @Plugin(pluginID = "AgriCraft", name = "AgriCraft", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.agricraft.description") @@ -32,7 +32,7 @@ public class PluginAgriCraft extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(AgriCraft); + return ModUtil.isModLoaded(AgriCraft); } @Override diff --git a/src/main/java/forestry/plugins/PluginApiculture.java b/src/main/java/forestry/plugins/PluginApiculture.java index 8f398ca3d..1a1dca7b6 100644 --- a/src/main/java/forestry/plugins/PluginApiculture.java +++ b/src/main/java/forestry/plugins/PluginApiculture.java @@ -150,6 +150,7 @@ import forestry.core.items.ItemOverlay.OverlayInfo; import forestry.core.items.ItemScoop; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; +import forestry.core.recipes.RecipeUtil; import forestry.core.recipes.ShapedRecipeCustom; import forestry.core.tiles.MachineDefinition; import forestry.core.tiles.TileAnalyzer; @@ -597,64 +598,64 @@ public class PluginApiculture extends ForestryPlugin { protected void registerRecipes() { // / APIARIST'S ARMOR - Proxies.common.addRecipe(ForestryItem.apiaristHat.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.apiaristHat.getItemStack(), "###", "# #", '#', ForestryItem.craftingMaterial.getItemStack(1, 3)); - Proxies.common.addRecipe(ForestryItem.apiaristChest.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.apiaristChest.getItemStack(), "# #", "###", "###", '#', ForestryItem.craftingMaterial.getItemStack(1, 3)); - Proxies.common.addRecipe(ForestryItem.apiaristLegs.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.apiaristLegs.getItemStack(), "###", "# #", "# #", '#', ForestryItem.craftingMaterial.getItemStack(1, 3)); - Proxies.common.addRecipe(ForestryItem.apiaristBoots.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.apiaristBoots.getItemStack(), "# #", "# #", '#', ForestryItem.craftingMaterial.getItemStack(1, 3)); // / HABITAT LOCATOR - Proxies.common.addRecipe(ForestryItem.habitatLocator.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.habitatLocator.getItemStack(), " X ", "X#X", " X ", '#', "dustRedstone", 'X', "ingotBronze"); // Bees - Proxies.common.addRecipe(ForestryItem.scoop.getItemStack(1), + RecipeUtil.addRecipe(ForestryItem.scoop.getItemStack(1), "#X#", "###", " # ", '#', "stickWood", 'X', Blocks.wool); - Proxies.common.addRecipe(new ItemStack(Items.slime_ball), + RecipeUtil.addRecipe(new ItemStack(Items.slime_ball), "#X#", "#X#", "#X#", '#', ForestryItem.propolis, 'X', ForestryItem.pollenCluster); - Proxies.common.addRecipe(new ItemStack(Items.speckled_melon), + RecipeUtil.addRecipe(new ItemStack(Items.speckled_melon), "#X#", "#Y#", "#X#", '#', ForestryItem.honeyDrop, 'X', ForestryItem.honeydew, 'Y', Items.melon); - Proxies.common.addRecipe(ForestryItem.frameUntreated.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.frameUntreated.getItemStack(), "###", "#S#", "###", '#', "stickWood", 'S', Items.string); - Proxies.common.addRecipe(ForestryItem.frameImpregnated.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.frameImpregnated.getItemStack(), "###", "#S#", "###", '#', ForestryItem.stickImpregnated, 'S', Items.string); // FOOD STUFF if (ForestryItem.honeyedSlice.item() != null) { - Proxies.common.addRecipe(ForestryItem.honeyedSlice.getItemStack(4), + RecipeUtil.addRecipe(ForestryItem.honeyedSlice.getItemStack(4), "###", "#X#", "###", '#', ForestryItem.honeyDrop, 'X', Items.bread); } if (ForestryItem.honeyPot.item() != null) { - Proxies.common.addRecipe(ForestryItem.honeyPot.getItemStack(1), + RecipeUtil.addRecipe(ForestryItem.honeyPot.getItemStack(1), "# #", " X ", "# #", '#', ForestryItem.honeyDrop, 'X', ForestryItem.waxCapsule); } if (ForestryItem.ambrosia.item() != null) { - Proxies.common.addRecipe(ForestryItem.ambrosia.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.ambrosia.getItemStack(), "#Y#", "XXX", "###", '#', ForestryItem.honeydew, 'X', ForestryItem.royalJelly, @@ -662,41 +663,41 @@ public class PluginApiculture extends ForestryPlugin { } // / CAPSULES - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.capsule"), "###", '#', ForestryItem.beeswax); - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.refractory"), "###", '#', ForestryItem.refractoryWax); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.capsule"), "###", '#', ForestryItem.beeswax); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.refractory"), "###", '#', ForestryItem.refractoryWax); // / BITUMINOUS PEAT - Proxies.common.addRecipe(ForestryItem.bituminousPeat.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.bituminousPeat.getItemStack(), " # ", "XYX", " # ", '#', "dustAsh", 'X', ForestryItem.peat, 'Y', ForestryItem.propolis); // / TORCHES - Proxies.common.addRecipe(new ItemStack(Blocks.torch, 3), + RecipeUtil.addRecipe(new ItemStack(Blocks.torch, 3), " # ", " # ", " Y ", '#', ForestryItem.beeswax, 'Y', "stickWood"); - Proxies.common.addRecipe(ForestryItem.craftingMaterial.getItemStack(1, 1), + RecipeUtil.addRecipe(ForestryItem.craftingMaterial.getItemStack(1, 1), "# #", " # ", "# #", '#', ForestryItem.propolis.getItemStack(1, 2)); // / WAX CAST - Proxies.common.addRecipe(ForestryItem.waxCast.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.waxCast.getItemStack(), "###", "# #", "###", '#', ForestryItem.beeswax); // / ALVEARY - Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.PLAIN_META), + RecipeUtil.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.PLAIN_META), "###", "#X#", "###", 'X', ForestryItem.impregnatedCasing, '#', ForestryItem.craftingMaterial.getItemStack(1, 6)); // SWARMER - Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.SWARMER_META), + RecipeUtil.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.SWARMER_META), "#G#", " X ", "#G#", @@ -704,7 +705,7 @@ public class PluginApiculture extends ForestryPlugin { 'X', ForestryBlock.alveary, 'G', "ingotGold"); // FAN - Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.FAN_META), + RecipeUtil.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.FAN_META), "I I", " X ", "I#I", @@ -712,7 +713,7 @@ public class PluginApiculture extends ForestryPlugin { 'X', ForestryBlock.alveary, 'I', "ingotIron"); // HEATER - Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.HEATER_META), + RecipeUtil.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.HEATER_META), "#I#", " X ", "YYY", @@ -720,7 +721,7 @@ public class PluginApiculture extends ForestryPlugin { 'X', ForestryBlock.alveary, 'I', "ingotIron", 'Y', "stone"); // HYGROREGULATOR - Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.HYGRO_META), + RecipeUtil.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.HYGRO_META), "GIG", "GXG", "GIG", @@ -728,14 +729,14 @@ public class PluginApiculture extends ForestryPlugin { 'I', "ingotIron", 'G', "blockGlass"); // STABILISER - Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.STABILIZER_META), + RecipeUtil.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.STABILIZER_META), "G G", "GXG", "G G", 'X', ForestryBlock.alveary, 'G', "gemQuartz"); // SIEVE - Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.SIEVE_META), + RecipeUtil.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.SIEVE_META), "III", " X ", "WWW", @@ -776,8 +777,8 @@ public class PluginApiculture extends ForestryPlugin { "#X#", '#', ForestryItem.beeswax, 'X', ForestryItem.craftingMaterial.getItemStack(1, 2)); - Proxies.common.addShapelessRecipe(ForestryBlock.candle.getItemStack(), ForestryBlock.candle.getItemStack()); - Proxies.common.addShapelessRecipe(ForestryBlock.candle.getItemStack(1, 1), ForestryBlock.candle.getItemStack(1, 1)); + RecipeUtil.addShapelessRecipe(ForestryBlock.candle.getItemStack(), ForestryBlock.candle.getItemStack()); + RecipeUtil.addShapelessRecipe(ForestryBlock.candle.getItemStack(1, 1), ForestryBlock.candle.getItemStack(1, 1)); // / CENTRIFUGE // Honey combs diff --git a/src/main/java/forestry/plugins/PluginArboriculture.java b/src/main/java/forestry/plugins/PluginArboriculture.java index 1ace527ff..f644b942b 100644 --- a/src/main/java/forestry/plugins/PluginArboriculture.java +++ b/src/main/java/forestry/plugins/PluginArboriculture.java @@ -273,7 +273,7 @@ public class PluginArboriculture extends ForestryPlugin { @Override protected void registerRecipes() { - Proxies.common.addSmelting(ForestryBlock.logs.getWildcard(), new ItemStack(Items.coal, 1, 1), 0.15F); + RecipeUtil.addSmelting(ForestryBlock.logs.getWildcard(), new ItemStack(Items.coal, 1, 1), 0.15F); ShapelessRecipeCustom.buildRecipe(ForestryBlock.planks.getItemStack(4), ForestryBlock.logs.getWildcard()).setPreserveNBT(); ShapelessRecipeCustom.buildRecipe(ForestryBlock.planksFireproof.getItemStack(4), ForestryBlock.logsFireproof.getWildcard()).setPreserveNBT(); @@ -341,7 +341,7 @@ public class PluginArboriculture extends ForestryPlugin { '#', ForestryBlock.planksFireproof.getWildcard()).setPreserveNBT(); // Grafter - Proxies.common.addRecipe(ForestryItem.grafter.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.grafter.getItemStack(), " B", " # ", "# ", diff --git a/src/main/java/forestry/plugins/PluginBiomesOPlenty.java b/src/main/java/forestry/plugins/PluginBiomesOPlenty.java index 1e7e8c590..e81f4647b 100644 --- a/src/main/java/forestry/plugins/PluginBiomesOPlenty.java +++ b/src/main/java/forestry/plugins/PluginBiomesOPlenty.java @@ -31,9 +31,9 @@ import forestry.core.config.Constants; import forestry.core.config.ForestryItem; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; import forestry.core.recipes.RecipeUtil; import forestry.core.utils.Log; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableBasicFruit; import forestry.farming.logic.FarmableGenericCrop; import forestry.farming.logic.FarmableGenericSapling; @@ -50,7 +50,7 @@ public class PluginBiomesOPlenty extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(BoP); + return ModUtil.isModLoaded(BoP); } @Override diff --git a/src/main/java/forestry/plugins/PluginBuildCraftFuels.java b/src/main/java/forestry/plugins/PluginBuildCraftFuels.java index b1662bed1..5e668d017 100644 --- a/src/main/java/forestry/plugins/PluginBuildCraftFuels.java +++ b/src/main/java/forestry/plugins/PluginBuildCraftFuels.java @@ -17,7 +17,7 @@ import cpw.mods.fml.common.Optional; import forestry.core.config.Constants; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; import buildcraft.api.fuels.BuildcraftFuelRegistry; @@ -26,7 +26,7 @@ public class PluginBuildCraftFuels extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isAPILoaded("buildcraft.api.fuels", "[2.0, 3.0)"); + return ModUtil.isAPILoaded("buildcraft.api.fuels", "[2.0, 3.0)"); } @Override diff --git a/src/main/java/forestry/plugins/PluginBuildCraftRecipes.java b/src/main/java/forestry/plugins/PluginBuildCraftRecipes.java index 0574c182a..c55e9bc64 100644 --- a/src/main/java/forestry/plugins/PluginBuildCraftRecipes.java +++ b/src/main/java/forestry/plugins/PluginBuildCraftRecipes.java @@ -14,7 +14,7 @@ import cpw.mods.fml.common.Optional; import forestry.core.config.Constants; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; import buildcraft.api.recipes.BuildcraftRecipeRegistry; @@ -23,7 +23,7 @@ public class PluginBuildCraftRecipes extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isAPILoaded("buildcraft.api.recipes", "[2.0, 4.0)"); + return ModUtil.isAPILoaded("buildcraft.api.recipes", "[2.0, 4.0)"); } @Override diff --git a/src/main/java/forestry/plugins/PluginBuildCraftStatements.java b/src/main/java/forestry/plugins/PluginBuildCraftStatements.java index b722fbb91..a9b6041d4 100644 --- a/src/main/java/forestry/plugins/PluginBuildCraftStatements.java +++ b/src/main/java/forestry/plugins/PluginBuildCraftStatements.java @@ -19,7 +19,7 @@ import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.common.Optional; import forestry.core.config.Constants; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.ITriggerExternal; @@ -33,7 +33,7 @@ public class PluginBuildCraftStatements extends ForestryPlugin implements ITrigg @Override public boolean isAvailable() { - return Proxies.common.isAPILoaded("buildcraft.api.statements", "[1.0, 2.0)"); + return ModUtil.isAPILoaded("buildcraft.api.statements", "[1.0, 2.0)"); } @Override diff --git a/src/main/java/forestry/plugins/PluginBuildCraftTransport.java b/src/main/java/forestry/plugins/PluginBuildCraftTransport.java index 27e912bf2..6de5057a2 100644 --- a/src/main/java/forestry/plugins/PluginBuildCraftTransport.java +++ b/src/main/java/forestry/plugins/PluginBuildCraftTransport.java @@ -17,8 +17,9 @@ import cpw.mods.fml.common.registry.GameRegistry; import forestry.core.config.Constants; import forestry.core.config.ForestryItem; -import forestry.core.proxy.Proxies; +import forestry.core.recipes.RecipeUtil; import forestry.core.utils.Log; +import forestry.core.utils.ModUtil; @Plugin(pluginID = "BC6|Transport", name = "BuildCraft 6 Transport", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.buildcraft6.description") public class PluginBuildCraftTransport extends ForestryPlugin { @@ -27,7 +28,7 @@ public class PluginBuildCraftTransport extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(BCT); + return ModUtil.isModLoaded(BCT); } @Override @@ -41,7 +42,7 @@ public class PluginBuildCraftTransport extends ForestryPlugin { if (beeswax != null) { Item pipeWaterproof = GameRegistry.findItem(BCT, "pipeWaterproof"); if (pipeWaterproof != null) { - Proxies.common.addShapelessRecipe(new ItemStack(pipeWaterproof), beeswax); + RecipeUtil.addShapelessRecipe(new ItemStack(pipeWaterproof), beeswax); } else { Log.fine("No BuildCraft pipe waterproof found."); } diff --git a/src/main/java/forestry/plugins/PluginChisel.java b/src/main/java/forestry/plugins/PluginChisel.java index 1c5b259f1..ef9ca372c 100644 --- a/src/main/java/forestry/plugins/PluginChisel.java +++ b/src/main/java/forestry/plugins/PluginChisel.java @@ -15,7 +15,7 @@ import com.google.common.collect.ImmutableList; import cpw.mods.fml.common.event.FMLInterModComms; import forestry.core.config.Constants; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; @Plugin(pluginID = "Chisel", name = "Chisel", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.chisel.description") public class PluginChisel extends ForestryPlugin { @@ -24,7 +24,7 @@ public class PluginChisel extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(Chisel); + return ModUtil.isModLoaded(Chisel); } @Override diff --git a/src/main/java/forestry/plugins/PluginCore.java b/src/main/java/forestry/plugins/PluginCore.java index 716b12f7d..4818e116c 100644 --- a/src/main/java/forestry/plugins/PluginCore.java +++ b/src/main/java/forestry/plugins/PluginCore.java @@ -70,6 +70,7 @@ import forestry.core.items.ItemOverlay.OverlayInfo; import forestry.core.items.ItemPipette; import forestry.core.items.ItemWrench; import forestry.core.proxy.Proxies; +import forestry.core.recipes.RecipeUtil; import forestry.core.recipes.ShapedRecipeCustom; import forestry.core.recipes.ShapelessRecipeCustom; import forestry.core.tiles.MachineDefinition; @@ -207,7 +208,7 @@ public class PluginCore extends ForestryPlugin { ForestryItem.ash.registerItem((new ItemForestry()), "ash"); OreDictionary.registerOre("dustAsh", ForestryItem.ash.getItemStack()); - Proxies.common.addSmelting(ForestryItem.peat.getItemStack(), ForestryItem.ash.getItemStack()); + RecipeUtil.addSmelting(ForestryItem.peat.getItemStack(), ForestryItem.ash.getItemStack(), 0.0f); ForestryItem.bituminousPeat.registerItem(new ItemForestry(), "bituminousPeat"); // / GEARS @@ -348,20 +349,20 @@ public class PluginCore extends ForestryPlugin { protected void registerRecipes() { /* SMELTING RECIPES */ - Proxies.common.addSmelting(ForestryBlock.resources.getItemStack(1, 0), ForestryItem.apatite.getItemStack(), 0.5f); - Proxies.common.addSmelting(ForestryBlock.resources.getItemStack(1, 1), ForestryItem.ingotCopper.getItemStack(), 0.5f); - Proxies.common.addSmelting(ForestryBlock.resources.getItemStack(1, 2), ForestryItem.ingotTin.getItemStack(), 0.5f); + RecipeUtil.addSmelting(ForestryBlock.resources.getItemStack(1, 0), ForestryItem.apatite.getItemStack(), 0.5f); + RecipeUtil.addSmelting(ForestryBlock.resources.getItemStack(1, 1), ForestryItem.ingotCopper.getItemStack(), 0.5f); + RecipeUtil.addSmelting(ForestryBlock.resources.getItemStack(1, 2), ForestryItem.ingotTin.getItemStack(), 0.5f); /* BRONZE INGOTS */ if (Config.isCraftingBronzeEnabled()) { - Proxies.common.addShapelessRecipe(ForestryItem.ingotBronze.getItemStack(4), "ingotTin", "ingotCopper", "ingotCopper", "ingotCopper"); + RecipeUtil.addShapelessRecipe(ForestryItem.ingotBronze.getItemStack(4), "ingotTin", "ingotCopper", "ingotCopper", "ingotCopper"); } /* STURDY MACHINE */ - Proxies.common.addRecipe(ForestryItem.sturdyCasing.getItemStack(), "###", "# #", "###", '#', "ingotBronze"); + RecipeUtil.addRecipe(ForestryItem.sturdyCasing.getItemStack(), "###", "# #", "###", '#', "ingotBronze"); // / EMPTY CANS - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.can"), " # ", "# #", '#', "ingotTin"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.can"), " # ", "# #", '#', "ingotTin"); // / GEARS ArrayList stoneGear = OreDictionary.getOres("gearStone"); @@ -371,73 +372,73 @@ public class PluginCore extends ForestryPlugin { } else { gearCenter = "ingotCopper"; } - Proxies.common.addRecipe(ForestryItem.gearBronze.getItemStack(), " # ", "#X#", " # ", '#', "ingotBronze", 'X', gearCenter); - Proxies.common.addRecipe(ForestryItem.gearCopper.getItemStack(), " # ", "#X#", " # ", '#', "ingotCopper", 'X', gearCenter); - Proxies.common.addRecipe(ForestryItem.gearTin.getItemStack(), " # ", "#X#", " # ", '#', "ingotTin", 'X', gearCenter); + RecipeUtil.addRecipe(ForestryItem.gearBronze.getItemStack(), " # ", "#X#", " # ", '#', "ingotBronze", 'X', gearCenter); + RecipeUtil.addRecipe(ForestryItem.gearCopper.getItemStack(), " # ", "#X#", " # ", '#', "ingotCopper", 'X', gearCenter); + RecipeUtil.addRecipe(ForestryItem.gearTin.getItemStack(), " # ", "#X#", " # ", '#', "ingotTin", 'X', gearCenter); // / SURVIVALIST TOOLS - Proxies.common.addRecipe(ForestryItem.bronzePickaxe.getItemStack(), " X ", " X ", "###", '#', "ingotBronze", 'X', "stickWood"); - Proxies.common.addRecipe(ForestryItem.bronzeShovel.getItemStack(), " X ", " X ", " # ", '#', "ingotBronze", 'X', "stickWood"); - Proxies.common.addShapelessRecipe(ForestryItem.kitPickaxe.getItemStack(), ForestryItem.bronzePickaxe, ForestryItem.carton); - Proxies.common.addShapelessRecipe(ForestryItem.kitShovel.getItemStack(), ForestryItem.bronzeShovel, ForestryItem.carton); + RecipeUtil.addRecipe(ForestryItem.bronzePickaxe.getItemStack(), " X ", " X ", "###", '#', "ingotBronze", 'X', "stickWood"); + RecipeUtil.addRecipe(ForestryItem.bronzeShovel.getItemStack(), " X ", " X ", " # ", '#', "ingotBronze", 'X', "stickWood"); + RecipeUtil.addShapelessRecipe(ForestryItem.kitPickaxe.getItemStack(), ForestryItem.bronzePickaxe, ForestryItem.carton); + RecipeUtil.addShapelessRecipe(ForestryItem.kitShovel.getItemStack(), ForestryItem.bronzeShovel, ForestryItem.carton); /* NATURALIST'S ARMOR */ - Proxies.common.addRecipe(ForestryItem.naturalistHat.getItemStack(), " X ", "Y Y", 'X', "ingotBronze", 'Y', "paneGlass"); + RecipeUtil.addRecipe(ForestryItem.naturalistHat.getItemStack(), " X ", "Y Y", 'X', "ingotBronze", 'Y', "paneGlass"); // / WRENCH - Proxies.common.addRecipe(ForestryItem.wrench.getItemStack(), "# #", " # ", " # ", '#', "ingotBronze"); + RecipeUtil.addRecipe(ForestryItem.wrench.getItemStack(), "# #", " # ", " # ", '#', "ingotBronze"); // Manure and Fertilizer if (GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat").stackSize > 0) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat"), " X ", "X#X", " X ", '#', Blocks.dirt, 'X', "cropWheat"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat"), " X ", "X#X", " X ", '#', Blocks.dirt, 'X', "cropWheat"); } if (GameMode.getGameMode().getStackSetting("recipe.output.compost.ash").stackSize > 0) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.compost.ash"), " X ", "X#X", " X ", '#', Blocks.dirt, 'X', "dustAsh"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.compost.ash"), " X ", "X#X", " X ", '#', Blocks.dirt, 'X', "dustAsh"); } if (GameMode.getGameMode().getStackSetting("recipe.output.fertilizer.apatite").stackSize > 0) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.fertilizer.apatite"), " # ", " X ", " # ", '#', "sand", 'X', "gemApatite"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.fertilizer.apatite"), " # ", " X ", " # ", '#', "sand", 'X', "gemApatite"); } if (GameMode.getGameMode().getStackSetting("recipe.output.fertilizer.ash").stackSize > 0) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.fertilizer.ash"), "###", "#X#", "###", '#', "dustAsh", 'X', "gemApatite"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.fertilizer.ash"), "###", "#X#", "###", '#', "dustAsh", 'X', "gemApatite"); } // Humus if (GameMode.getGameMode().getStackSetting("recipe.output.humus.compost").stackSize > 0) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.humus.compost"), "###", "#X#", "###", '#', Blocks.dirt, 'X', ForestryItem.fertilizerBio); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.humus.compost"), "###", "#X#", "###", '#', Blocks.dirt, 'X', ForestryItem.fertilizerBio); } if (GameMode.getGameMode().getStackSetting("recipe.output.humus.fertilizer").stackSize > 0) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.humus.fertilizer"), "###", "#X#", "###", '#', Blocks.dirt, 'X', ForestryItem.fertilizerCompound); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.humus.fertilizer"), "###", "#X#", "###", '#', Blocks.dirt, 'X', ForestryItem.fertilizerCompound); } // Bog earth if (GameMode.getGameMode().getStackSetting("recipe.output.bogearth.bucket").stackSize > 0) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.bogearth.bucket"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', Items.water_bucket, 'Y', "sand"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.bogearth.bucket"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', Items.water_bucket, 'Y', "sand"); } if (GameMode.getGameMode().getStackSetting("recipe.output.bogearth.can").stackSize > 0) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', ForestryItem.canWater, 'Y', "sand"); - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', ForestryItem.waxCapsuleWater, 'Y', "sand"); - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', ForestryItem.refractoryWater, 'Y', "sand"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', ForestryItem.canWater, 'Y', "sand"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', ForestryItem.waxCapsuleWater, 'Y', "sand"); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', ForestryItem.refractoryWater, 'Y', "sand"); } // Crafting Material - Proxies.common.addRecipe(new ItemStack(Items.string), "#", "#", "#", '#', ForestryItem.craftingMaterial.getItemStack(1, 2)); + RecipeUtil.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, OreDictionary.WILDCARD_VALUE)); + RecipeUtil.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"); - Proxies.common.addShapelessRecipe(ForestryItem.apatite.getItemStack(9), "blockApatite"); + RecipeUtil.addRecipe(ForestryBlock.resourceStorage.getItemStack(1, 0), "###", "###", "###", '#', "gemApatite"); + RecipeUtil.addShapelessRecipe(ForestryItem.apatite.getItemStack(9), "blockApatite"); - Proxies.common.addRecipe(ForestryBlock.resourceStorage.getItemStack(1, 1), "###", "###", "###", '#', "ingotCopper"); - Proxies.common.addShapelessRecipe(ForestryItem.ingotCopper.getItemStack(9), "blockCopper"); + RecipeUtil.addRecipe(ForestryBlock.resourceStorage.getItemStack(1, 1), "###", "###", "###", '#', "ingotCopper"); + RecipeUtil.addShapelessRecipe(ForestryItem.ingotCopper.getItemStack(9), "blockCopper"); - Proxies.common.addRecipe(ForestryBlock.resourceStorage.getItemStack(1, 2), "###", "###", "###", '#', "ingotTin"); - Proxies.common.addShapelessRecipe(ForestryItem.ingotTin.getItemStack(9), "blockTin"); + RecipeUtil.addRecipe(ForestryBlock.resourceStorage.getItemStack(1, 2), "###", "###", "###", '#', "ingotTin"); + RecipeUtil.addShapelessRecipe(ForestryItem.ingotTin.getItemStack(9), "blockTin"); - Proxies.common.addRecipe(ForestryBlock.resourceStorage.getItemStack(1, 3), "###", "###", "###", '#', "ingotBronze"); - Proxies.common.addShapelessRecipe(ForestryItem.ingotBronze.getItemStack(9), "blockBronze"); + RecipeUtil.addRecipe(ForestryBlock.resourceStorage.getItemStack(1, 3), "###", "###", "###", '#', "ingotBronze"); + RecipeUtil.addShapelessRecipe(ForestryItem.ingotBronze.getItemStack(9), "blockBronze"); } @Override diff --git a/src/main/java/forestry/plugins/PluginEnderIO.java b/src/main/java/forestry/plugins/PluginEnderIO.java index 081e86fb7..05c6ac0d2 100644 --- a/src/main/java/forestry/plugins/PluginEnderIO.java +++ b/src/main/java/forestry/plugins/PluginEnderIO.java @@ -9,7 +9,7 @@ import cpw.mods.fml.common.event.FMLInterModComms; import forestry.core.config.Constants; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; @Plugin(pluginID = "EnderIO", name = "EnderIO", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.enderIO.description") public class PluginEnderIO extends ForestryPlugin { @@ -26,7 +26,7 @@ public class PluginEnderIO extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(EnderIO); + return ModUtil.isModLoaded(EnderIO); } @Override diff --git a/src/main/java/forestry/plugins/PluginErebus.java b/src/main/java/forestry/plugins/PluginErebus.java index 31b781480..89280239c 100644 --- a/src/main/java/forestry/plugins/PluginErebus.java +++ b/src/main/java/forestry/plugins/PluginErebus.java @@ -19,7 +19,7 @@ import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.config.ForestryItem; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; @Plugin(pluginID = "Erebus", name = "Erebus", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.erebus.description") public class PluginErebus extends ForestryPlugin { @@ -28,7 +28,7 @@ public class PluginErebus extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(EREBUS); + return ModUtil.isModLoaded(EREBUS); } @Override diff --git a/src/main/java/forestry/plugins/PluginExtraUtilities.java b/src/main/java/forestry/plugins/PluginExtraUtilities.java index 44a594cfc..432883d7b 100644 --- a/src/main/java/forestry/plugins/PluginExtraUtilities.java +++ b/src/main/java/forestry/plugins/PluginExtraUtilities.java @@ -25,7 +25,7 @@ import forestry.core.circuits.Circuit; import forestry.core.config.Config; import forestry.core.config.Constants; import forestry.core.config.ForestryItem; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; import forestry.farming.circuits.CircuitFarmLogic; import forestry.farming.logic.FarmLogicEnder; import forestry.farming.logic.FarmableGenericCrop; @@ -37,7 +37,7 @@ public class PluginExtraUtilities extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(ExU); + return ModUtil.isModLoaded(ExU); } @Override diff --git a/src/main/java/forestry/plugins/PluginFactory.java b/src/main/java/forestry/plugins/PluginFactory.java index 3b87b5e59..bbc067099 100644 --- a/src/main/java/forestry/plugins/PluginFactory.java +++ b/src/main/java/forestry/plugins/PluginFactory.java @@ -45,6 +45,7 @@ import forestry.core.recipes.craftguide.CraftGuideIntegration; import forestry.core.recipes.nei.PacketWorktableNEISelect; import forestry.core.tiles.MachineDefinition; import forestry.core.utils.Log; +import forestry.core.utils.ModUtil; import forestry.factory.DummyManagers; import forestry.factory.GuiHandlerFactory; import forestry.factory.circuits.CircuitSpeedUpgrade; @@ -274,7 +275,7 @@ public class PluginFactory extends ForestryPlugin { public void postInit() { super.postInit(); - if (Proxies.common.isModLoaded("craftguide")) { + if (ModUtil.isModLoaded("craftguide")) { CraftGuideIntegration.register(); } else { Log.info("Skipping CraftGuide integration."); diff --git a/src/main/java/forestry/plugins/PluginFluids.java b/src/main/java/forestry/plugins/PluginFluids.java index b8607b4fd..5291734ac 100644 --- a/src/main/java/forestry/plugins/PluginFluids.java +++ b/src/main/java/forestry/plugins/PluginFluids.java @@ -44,8 +44,8 @@ import forestry.core.fluids.BlockForestryFluid; import forestry.core.fluids.Fluids; import forestry.core.fluids.LiquidRegistryHelper; import forestry.core.items.ItemLiquidContainer; -import forestry.core.proxy.Proxies; import forestry.core.utils.Log; +import forestry.core.utils.StringUtil; import static forestry.core.items.ItemLiquidContainer.EnumContainerType; @@ -74,7 +74,7 @@ public class PluginFluids extends ForestryPlugin { fluidBlock = forestryFluid.makeBlock(); if (fluidBlock != null) { fluidBlock.setBlockName("forestry.fluid." + forestryFluid.getTag()); - Proxies.common.registerBlock(fluidBlock, ItemBlock.class); + GameRegistry.registerBlock(fluidBlock, ItemBlock.class, StringUtil.cleanBlockName(fluidBlock)); forestryFluidsWithBlocks.add(forestryFluid); } } else { diff --git a/src/main/java/forestry/plugins/PluginFood.java b/src/main/java/forestry/plugins/PluginFood.java index f0732a9dc..50fecf027 100755 --- a/src/main/java/forestry/plugins/PluginFood.java +++ b/src/main/java/forestry/plugins/PluginFood.java @@ -23,7 +23,7 @@ import forestry.core.config.ForestryItem; import forestry.core.fluids.Fluids; import forestry.core.fluids.LiquidRegistryHelper; import forestry.core.items.ItemForestryFood; -import forestry.core.proxy.Proxies; +import forestry.core.recipes.RecipeUtil; import forestry.food.BeverageEffect; import forestry.food.GuiHandlerFood; import forestry.food.items.ItemAmbrosia; @@ -74,7 +74,7 @@ public class PluginFood extends ForestryPlugin { @Override protected void registerRecipes() { // INFUSER - Proxies.common.addRecipe(ForestryItem.infuser.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.infuser.getItemStack(), "X", "#", "X", '#', "ingotIron", 'X', "ingotBronze"); diff --git a/src/main/java/forestry/plugins/PluginGrowthCraft.java b/src/main/java/forestry/plugins/PluginGrowthCraft.java index 4abfe6aab..3d5190d71 100644 --- a/src/main/java/forestry/plugins/PluginGrowthCraft.java +++ b/src/main/java/forestry/plugins/PluginGrowthCraft.java @@ -24,8 +24,8 @@ import forestry.core.config.Constants; import forestry.core.config.ForestryItem; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; import forestry.core.recipes.RecipeUtil; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableBasicGrowthCraft; @Plugin(pluginID = "Growthcraft", name = "Growthcraft", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.growthcraft.description") @@ -35,7 +35,7 @@ public class PluginGrowthCraft extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(GC); + return ModUtil.isModLoaded(GC); } @Override diff --git a/src/main/java/forestry/plugins/PluginHarvestCraft.java b/src/main/java/forestry/plugins/PluginHarvestCraft.java index ca68a043d..1d9df692e 100644 --- a/src/main/java/forestry/plugins/PluginHarvestCraft.java +++ b/src/main/java/forestry/plugins/PluginHarvestCraft.java @@ -26,8 +26,8 @@ import forestry.core.config.Constants; import forestry.core.config.ForestryItem; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; import forestry.core.recipes.RecipeUtil; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableBasicFruit; import forestry.farming.logic.FarmableGenericCrop; @@ -38,7 +38,7 @@ public class PluginHarvestCraft extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(HC); + return ModUtil.isModLoaded(HC); } @Override @@ -248,7 +248,7 @@ public class PluginHarvestCraft extends ForestryPlugin { ItemStack grainSeed = GameRegistry.findItemStack(HC, grainName + "seedItem", 1); Block grainBlock = GameRegistry.findBlock(HC, "pam" + grainName + "Crop"); if (grain != null && wheatamount.stackSize > 0) { - Proxies.common.addRecipe(wheatamount, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', grain); + RecipeUtil.addRecipe(wheatamount, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', grain); FuelManager.moistenerResource.put(grain, new MoistenerFuel(grain, ForestryItem.mouldyWheat.getItemStack(), 0, 300)); } if (grainSeed != null) { @@ -356,7 +356,7 @@ public class PluginHarvestCraft extends ForestryPlugin { ItemStack hcBeeswaxItem = GameRegistry.findItemStack(HC, "beeswaxItem", 1); if (hcBeeswaxItem != null) { - Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.capsule"), "XXX ", 'X', hcBeeswaxItem); + RecipeUtil.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.capsule"), "XXX ", 'X', hcBeeswaxItem); } } diff --git a/src/main/java/forestry/plugins/PluginIC2.java b/src/main/java/forestry/plugins/PluginIC2.java index 7bc7eb822..18c1f3d96 100644 --- a/src/main/java/forestry/plugins/PluginIC2.java +++ b/src/main/java/forestry/plugins/PluginIC2.java @@ -48,6 +48,7 @@ import forestry.core.recipes.ShapedRecipeCustom; import forestry.core.tiles.MachineDefinition; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.Log; +import forestry.core.utils.ModUtil; import forestry.energy.circuits.CircuitElectricBoost; import forestry.energy.circuits.CircuitElectricChoke; import forestry.energy.circuits.CircuitElectricEfficiency; @@ -98,7 +99,7 @@ public class PluginIC2 extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded("IC2"); + return ModUtil.isModLoaded("IC2"); } @Override @@ -299,7 +300,7 @@ public class PluginIC2 extends ForestryPlugin { if (waterCell != null) { ItemStack bogEarthCan = GameMode.getGameMode().getStackSetting("recipe.output.bogearth.can"); if (bogEarthCan.stackSize > 0) { - Proxies.common.addRecipe(bogEarthCan, "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', waterCell, 'Y', "sand"); + RecipeUtil.addRecipe(bogEarthCan, "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', waterCell, 'Y', "sand"); } } diff --git a/src/main/java/forestry/plugins/PluginImmersiveEngineering.java b/src/main/java/forestry/plugins/PluginImmersiveEngineering.java index a8f10473f..58d1a1dd1 100644 --- a/src/main/java/forestry/plugins/PluginImmersiveEngineering.java +++ b/src/main/java/forestry/plugins/PluginImmersiveEngineering.java @@ -20,7 +20,7 @@ import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableGenericCrop; @Plugin(pluginID = "ImmersiveEngineering", name = "ImmersiveEngineering", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.immersiveengineering.description") @@ -30,7 +30,7 @@ public class PluginImmersiveEngineering extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(ImEng); + return ModUtil.isModLoaded(ImEng); } @Override diff --git a/src/main/java/forestry/plugins/PluginMagicalCrops.java b/src/main/java/forestry/plugins/PluginMagicalCrops.java index dc9509de6..d01546e9c 100644 --- a/src/main/java/forestry/plugins/PluginMagicalCrops.java +++ b/src/main/java/forestry/plugins/PluginMagicalCrops.java @@ -26,8 +26,8 @@ import forestry.core.config.Config; import forestry.core.config.Constants; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; import forestry.core.recipes.RecipeUtil; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableGenericCrop; @Plugin(pluginID = "MagicalCrops", name = "MagicalCrops", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.magicalcrops.description") @@ -37,7 +37,7 @@ public class PluginMagicalCrops extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(MagCrop); + return ModUtil.isModLoaded(MagCrop); } @Override diff --git a/src/main/java/forestry/plugins/PluginMail.java b/src/main/java/forestry/plugins/PluginMail.java index 52d2857c4..a15950a0a 100755 --- a/src/main/java/forestry/plugins/PluginMail.java +++ b/src/main/java/forestry/plugins/PluginMail.java @@ -33,7 +33,7 @@ import forestry.core.fluids.Fluids; import forestry.core.items.ItemBlockForestry; import forestry.core.network.PacketIdClient; import forestry.core.network.PacketIdServer; -import forestry.core.proxy.Proxies; +import forestry.core.recipes.RecipeUtil; import forestry.core.recipes.ShapedRecipeCustom; import forestry.core.tiles.MachineDefinition; import forestry.mail.GuiHandlerMail; @@ -170,10 +170,10 @@ public class PluginMail extends ForestryPlugin { Item stampGlue; if (PluginManager.Module.APICULTURE.isEnabled()) { - Proxies.common.addShapelessRecipe(ForestryItem.letters.getItemStack(), Items.paper, ForestryItem.propolis.getItemStack(1, OreDictionary.WILDCARD_VALUE)); + RecipeUtil.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); + RecipeUtil.addShapelessRecipe(ForestryItem.letters.getItemStack(), Items.paper, Items.slime_ball); stampGlue = Items.slime_ball; } @@ -183,7 +183,7 @@ public class PluginMail extends ForestryPlugin { continue; } - Proxies.common.addRecipe(ForestryItem.stamps.getItemStack(9, i), + RecipeUtil.addRecipe(ForestryItem.stamps.getItemStack(9, i), "XXX", "###", "ZZZ", 'X', stampDefinitions[i].getCraftingIngredient(), '#', Items.paper, @@ -196,12 +196,12 @@ public class PluginMail extends ForestryPlugin { } // Recycling - Proxies.common.addRecipe(new ItemStack(Items.paper), "###", '#', ForestryItem.letters.getItemStack(1, OreDictionary.WILDCARD_VALUE)); + RecipeUtil.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, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.book)); + RecipeUtil.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 a3d23b716..262ba99d2 100755 --- a/src/main/java/forestry/plugins/PluginNatura.java +++ b/src/main/java/forestry/plugins/PluginNatura.java @@ -34,8 +34,8 @@ import forestry.core.config.Constants; import forestry.core.config.ForestryItem; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; import forestry.core.recipes.RecipeUtil; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableGenericCrop; @Plugin(pluginID = "Natura", name = "Natura", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.natura.description") @@ -61,7 +61,7 @@ public class PluginNatura extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(NATURA); + return ModUtil.isModLoaded(NATURA); } @Override @@ -260,7 +260,7 @@ public class PluginNatura extends ForestryPlugin { RecipeUtil.addFermenterRecipes(itemBarley, GameMode.getGameMode().getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); if (GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat").stackSize > 0) { ItemStack compostWheat = GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat"); - Proxies.common.addRecipe(compostWheat, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', itemBarley); + RecipeUtil.addRecipe(compostWheat, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', itemBarley); } FuelManager.moistenerResource.put(itemBarley, new MoistenerFuel(itemBarley, ForestryItem.mouldyWheat.getItemStack(), 0, 300)); } diff --git a/src/main/java/forestry/plugins/PluginPlantMegaPack.java b/src/main/java/forestry/plugins/PluginPlantMegaPack.java index 905a371d4..7d1998f7e 100644 --- a/src/main/java/forestry/plugins/PluginPlantMegaPack.java +++ b/src/main/java/forestry/plugins/PluginPlantMegaPack.java @@ -26,8 +26,8 @@ import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; import forestry.core.recipes.RecipeUtil; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableBasicFruit; import forestry.farming.logic.FarmableGenericCrop; import forestry.farming.logic.FarmableStacked; @@ -39,7 +39,7 @@ public class PluginPlantMegaPack extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(PlantMP); + return ModUtil.isModLoaded(PlantMP); } @Override diff --git a/src/main/java/forestry/plugins/PluginStorage.java b/src/main/java/forestry/plugins/PluginStorage.java index ef9f1a1c0..754d9a9ca 100755 --- a/src/main/java/forestry/plugins/PluginStorage.java +++ b/src/main/java/forestry/plugins/PluginStorage.java @@ -66,7 +66,7 @@ import forestry.core.config.LocalizedConfiguration; import forestry.core.fluids.Fluids; import forestry.core.items.ItemCrated; import forestry.core.network.GuiId; -import forestry.core.proxy.Proxies; +import forestry.core.recipes.RecipeUtil; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.Log; import forestry.core.utils.StringUtil; @@ -565,7 +565,7 @@ public class PluginStorage extends ForestryPlugin { if (PluginManager.Module.APICULTURE.isEnabled()) { // Apiarist's Backpack - Proxies.common.addRecipe(ForestryItem.apiaristBackpack.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.apiaristBackpack.getItemStack(), "X#X", "VYV", "X#X", @@ -577,7 +577,7 @@ public class PluginStorage extends ForestryPlugin { if (PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) { // Lepidopterist's Backpack - Proxies.common.addRecipe(ForestryItem.lepidopteristBackpack.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.lepidopteristBackpack.getItemStack(), "X#X", "VYV", "X#X", @@ -588,25 +588,25 @@ public class PluginStorage extends ForestryPlugin { } // Miner's Backpack - Proxies.common.addRecipe(ForestryItem.minerBackpack.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.minerBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, 'X', Items.string, 'V', "ingotIron", 'Y', "chestWood"); // Digger's Backpack - Proxies.common.addRecipe(ForestryItem.diggerBackpack.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.diggerBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, 'X', Items.string, 'V', "stone", 'Y', "chestWood"); // Forester's Backpack - Proxies.common.addRecipe(ForestryItem.foresterBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, + RecipeUtil.addRecipe(ForestryItem.foresterBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, 'X', Items.string, 'V', "logWood", 'Y', "chestWood"); // Hunter's Backpack - Proxies.common.addRecipe(ForestryItem.hunterBackpack.getItemStack(), + RecipeUtil.addRecipe(ForestryItem.hunterBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, 'X', Items.string, 'V', Items.feather, 'Y', "chestWood"); // Adventurer's Backpack - Proxies.common.addRecipe(ForestryItem.adventurerBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, + RecipeUtil.addRecipe(ForestryItem.adventurerBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, 'X', Items.string, 'V', Items.bone, 'Y', "chestWood"); // Builder's Backpack - Proxies.common.addRecipe(ForestryItem.builderBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, + RecipeUtil.addRecipe(ForestryItem.builderBackpack.getItemStack(), "X#X", "VYV", "X#X", '#', Blocks.wool, 'X', Items.string, 'V', Items.clay_ball, 'Y', "chestWood"); if (PluginManager.Module.FACTORY.isEnabled()) { diff --git a/src/main/java/forestry/plugins/PluginWitchery.java b/src/main/java/forestry/plugins/PluginWitchery.java index f65e95ea2..1b33adb53 100644 --- a/src/main/java/forestry/plugins/PluginWitchery.java +++ b/src/main/java/forestry/plugins/PluginWitchery.java @@ -31,8 +31,8 @@ import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.config.GameMode; import forestry.core.fluids.Fluids; -import forestry.core.proxy.Proxies; import forestry.core.recipes.RecipeUtil; +import forestry.core.utils.ModUtil; import forestry.farming.logic.FarmableBasicFruit; import forestry.farming.logic.FarmableGenericCrop; @@ -43,7 +43,7 @@ public class PluginWitchery extends ForestryPlugin { @Override public boolean isAvailable() { - return Proxies.common.isModLoaded(Witch); + return ModUtil.isModLoaded(Witch); } @Override diff --git a/src/main/java/forestry/storage/CrateRegistry.java b/src/main/java/forestry/storage/CrateRegistry.java index e0f388ff7..ba3bdf43d 100644 --- a/src/main/java/forestry/storage/CrateRegistry.java +++ b/src/main/java/forestry/storage/CrateRegistry.java @@ -14,10 +14,12 @@ import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.registry.GameRegistry; + import forestry.api.storage.ICrateRegistry; import forestry.core.items.ItemCrated; -import forestry.core.proxy.Proxies; import forestry.core.utils.Log; +import forestry.core.utils.StringUtil; import forestry.plugins.PluginStorage; public class CrateRegistry implements ICrateRegistry { @@ -35,7 +37,7 @@ public class CrateRegistry implements ICrateRegistry { ItemCrated crate = new ItemCrated(stack, useOreDict); crate.setUnlocalizedName(uid); - Proxies.common.registerItem(crate); + GameRegistry.registerItem(crate, StringUtil.cleanItemName(crate)); PluginStorage.registerCrate(crate); }