Split up Proxies.common code

This commit is contained in:
mezz committed 2015-10-17 12:25:13 -07:00
1 parent 0ea878d7bc
commit 9899687786
69 files changed
+460 -612

No files matched your search

@@ -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;
}
/**
@@ -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;
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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);
@@ -172,7 +172,7 @@ public class GuiHabitatLocator extends GuiForestry<ContainerHabitatLocator, Habi
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}
Proxies.common.bindTexture(SpriteSheet.ITEMS);
Proxies.render.bindTexture(SpriteSheet.ITEMS);
manager.gui.drawTexturedModelRectFromIcon(startX + xPos, startY + yPos, getIcon(), 16, 16);
GL11.glEnable(GL11.GL_LIGHTING);
}
@@ -120,7 +120,7 @@ public class ItemHabitatLocator extends ItemInventoried {
removeInvalidBiomes(currentBiome, targetBiomes);
// reset the locator coordinates
Proxies.common.setHabitatLocatorTexture(null, null);
Proxies.render.setHabitatLocatorTexture(null, null);
}
@Override
@@ -304,10 +304,10 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
fxY += upSpread;
// display fx on all 4 sides
Proxies.common.addEntitySwarmFX(worldObj, (fxX - distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter));
Proxies.common.addEntitySwarmFX(worldObj, (fxX + distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter));
Proxies.common.addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ - distanceFromCenter));
Proxies.common.addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ + distanceFromCenter));
Proxies.render.addEntitySwarmFX(worldObj, (fxX - distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter));
Proxies.render.addEntitySwarmFX(worldObj, (fxX + distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter));
Proxies.render.addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ - distanceFromCenter));
Proxies.render.addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ + distanceFromCenter));
}
}
}
@@ -32,6 +32,6 @@ public class PacketHabitatBiomePointer extends PacketCoordinates implements IFor
@Override
public void onPacketData(DataInputStreamForestry data, EntityPlayer player) throws IOException {
Proxies.common.setHabitatLocatorTexture(player, getCoordinates());
Proxies.render.setHabitatLocatorTexture(player, getCoordinates());
}
}
@@ -10,17 +10,9 @@
******************************************************************************/
package forestry.apiculture.proxy;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import forestry.core.render.IBlockRenderer;
public class ProxyApiculture {
public void addBeeHiveFX(String texture, World world, ChunkCoordinates coordinates, int color) {
}
public void addBeeSwarmFX(String texture, World world, double xCoord, double yCoord, double zCoord, int color) {
}
public IBlockRenderer getRendererAnalyzer(String string) {
return null;
@@ -10,24 +10,16 @@
******************************************************************************/
package forestry.apiculture.proxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.RenderingRegistry;
import forestry.apiculture.entities.EntityBee;
import forestry.apiculture.entities.EntityFXBee;
import forestry.apiculture.render.ParticleRenderer;
import forestry.apiculture.render.RenderBeeEntity;
import forestry.apiculture.render.RenderBeeItem;
import forestry.core.config.ForestryItem;
import forestry.core.proxy.ProxyRenderClient;
import forestry.core.render.IBlockRenderer;
import forestry.core.render.RenderAnalyzer;
import forestry.core.render.TextureManager;
import forestry.plugins.PluginApiculture;
public class ProxyApicultureClient extends ProxyApiculture {
@@ -43,40 +35,6 @@ public class ProxyApicultureClient extends ProxyApiculture {
}
}
@Override
public void addBeeHiveFX(String icon, World world, ChunkCoordinates coordinates, int color) {
if (!ProxyRenderClient.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 void addBeeSwarmFX(String icon, World world, double xCoord, double yCoord, double zCoord, int color) {
if (!ProxyRenderClient.shouldSpawnParticle(world)) {
return;
}
EntityFX fx;
if (world.rand.nextBoolean()) {
fx = new EntityFXBee(world, xCoord, yCoord, zCoord, color);
} else {
double spawnX = xCoord + world.rand.nextInt(4) - 2;
double spawnY = yCoord + world.rand.nextInt(4) - 2;
double spawnZ = zCoord + world.rand.nextInt(4) - 2;
fx = new EntityFXBee(world, spawnX, spawnY, spawnZ, color);
}
fx.setParticleIcon(TextureManager.getInstance().getDefault(icon));
ParticleRenderer.getInstance().addEffect(fx);
}
@Override
public IBlockRenderer getRendererAnalyzer(String gfxBase) {
return new RenderAnalyzer(gfxBase);
@@ -83,7 +83,7 @@ public class ModelAnalyzer extends ModelBase {
float factor = (float) (1.0 / 16.0);
Proxies.common.bindTexture(textures[0]);
Proxies.render.bindTexture(textures[0]);
pedestal.rotateAngleX = angle[0];
pedestal.rotateAngleY = angle[1];
@@ -98,13 +98,13 @@ public class ModelAnalyzer extends ModelBase {
tower1.rotateAngleX = angle[0];
tower1.rotateAngleY = angle[1];
tower1.rotateAngleZ = angle[2];
Proxies.common.bindTexture(textures[1]);
Proxies.render.bindTexture(textures[1]);
tower1.render(factor);
tower2.rotateAngleX = angle[0];
tower2.rotateAngleY = angle[1];
tower2.rotateAngleZ = angle[2];
Proxies.common.bindTexture(textures[2]);
Proxies.render.bindTexture(textures[2]);
tower2.render(factor);
GL11.glPopMatrix();
@@ -92,7 +92,7 @@ public class RenderBeeItem implements IItemRenderer {
float xPos = 1.0f; float yPos = 1.0f;
float width = 1f; float height = 1f;
Proxies.common.bindTexture(SpriteSheet.ITEMS);
Proxies.render.bindTexture(SpriteSheet.ITEMS);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)(xPos + 0), (double)(yPos + height), 0f, (double)background.getMinU(), (double)background.getMaxV());
@@ -102,10 +102,10 @@ public abstract class TileAbstractBeeHousing extends TileBase implements IBeeHou
float upSpread = (worldObj.rand.nextFloat() * 6F) / 16F;
fxY += upSpread;
Proxies.common.addEntitySwarmFX(worldObj, (fxX - distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter));
Proxies.common.addEntitySwarmFX(worldObj, (fxX + distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter));
Proxies.common.addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ - distanceFromCenter));
Proxies.common.addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ + distanceFromCenter));
Proxies.render.addEntitySwarmFX(worldObj, (fxX - distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter));
Proxies.render.addEntitySwarmFX(worldObj, (fxX + distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter));
Proxies.render.addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ - distanceFromCenter));
Proxies.render.addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ + distanceFromCenter));
}
}
}
@@ -20,7 +20,9 @@ import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import forestry.core.proxy.Proxies;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.core.utils.StringUtil;
import forestry.plugins.PluginManager;
import forestry.plugins.PluginManager.Stage;
@@ -85,7 +87,7 @@ public enum ForestryBlock {
}
this.block = block;
block.setBlockName("for." + name);
Proxies.common.registerBlock(block, itemClass);
GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block));
}
public boolean isItemEqual(ItemStack stack) {
@@ -17,7 +17,9 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import forestry.core.proxy.Proxies;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.core.utils.StringUtil;
import forestry.plugins.PluginManager;
import forestry.plugins.PluginManager.Stage;
@@ -203,7 +205,7 @@ public enum ForestryItem {
}
this.item = item;
item.setUnlocalizedName("for." + name);
Proxies.common.registerItem(item);
GameRegistry.registerItem(item, StringUtil.cleanItemName(item));
}
public boolean isItemEqual(ItemStack stack) {
@@ -5,7 +5,6 @@ import net.minecraft.item.ItemStack;
import forestry.core.gui.slots.SlotFiltered;
import forestry.core.items.ItemAlyzer;
import forestry.core.proxy.Proxies;
public class ContainerAlyzer extends ContainerItemInventory<ItemAlyzer.AlyzerInventory> {
@@ -45,7 +44,7 @@ public class ContainerAlyzer extends ContainerItemInventory<ItemAlyzer.AlyzerInv
continue;
}
Proxies.common.dropItemPlayer(entityplayer, stack);
entityplayer.dropPlayerItemWithRandomChoice(stack, true);
inventory.setInventorySlotContents(i, null);
}
}
@@ -309,7 +309,7 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
}
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<ContainerAlyzer, IInventory>
}
// 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<ContainerAlyzer, IInventory>
}
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<ContainerAlyzer, IInventory>
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);
@@ -108,7 +108,7 @@ public class GuiEscritoire extends GuiForestry<ContainerEscritoire, TileEscritoi
manager.gui.setZLevel(150f);
for (String ident : getToken().getOverlayIcons()) {
RenderHelper.enableGUIStandardItemLighting();
Proxies.common.bindTexture(SpriteSheet.ITEMS);
Proxies.render.bindTexture(SpriteSheet.ITEMS);
manager.gui.drawTexturedModelRectFromIcon(startX + xPos + 3, startY + yPos + 3, TextureManager.getInstance().getDefault(ident), 16, 16);
RenderHelper.disableStandardItemLighting();
}
@@ -82,7 +82,7 @@ public abstract class GuiForestry<C extends Container, I extends IInventory> 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<C extends Container, I extends IInventory> 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) {
@@ -219,7 +219,7 @@ public class GuiNaturalistInventory extends GuiForestry<Container, IPagedInvento
column = 196;
}
Proxies.common.bindTexture(textureFile);
Proxies.render.bindTexture(textureFile);
drawTexturedModalRect(guiLeft + x, guiTop + getLineY(), column, line, 16, 16);
}
@@ -250,7 +250,7 @@ public class GuiNaturalistInventory extends GuiForestry<Container, IPagedInvento
column = 196;
}
Proxies.common.bindTexture(textureFile);
Proxies.render.bindTexture(textureFile);
drawTexturedModalRect(guiLeft + x, guiTop + getLineY(), column, line, 16, 16);
}
@@ -172,7 +172,7 @@ public abstract class Ledger {
GL11.glColor4f(colorR, colorG, colorB, 1.0F);
Proxies.common.bindTexture(texture);
Proxies.render.bindTexture(texture);
int height = getHeight();
int width = getWidth();
@@ -191,7 +191,7 @@ public abstract class Ledger {
if (icon != null) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F);
Proxies.common.bindTexture(SpriteSheet.ITEMS);
Proxies.render.bindTexture(SpriteSheet.ITEMS);
manager.gui.drawTexturedModelRectFromIcon(x, y, icon, 16, 16);
GL11.glEnable(GL11.GL_LIGHTING);
}
@@ -43,7 +43,7 @@ public class ReservoirWidget extends TankWidget {
squaled = height;
}
Proxies.common.bindTexture(SpriteSheet.BLOCKS);
Proxies.render.bindTexture(SpriteSheet.BLOCKS);
int start = 0;
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F);
@@ -76,7 +76,7 @@ public class TankWidget extends Widget {
}
int squaled = (contents.amount * height) / getTank().getCapacity();
Proxies.common.bindTexture(SpriteSheet.BLOCKS);
Proxies.render.bindTexture(SpriteSheet.BLOCKS);
int start = 0;
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
@@ -101,7 +101,7 @@ public class TankWidget extends Widget {
}
}
Proxies.common.bindTexture(manager.gui.textureFile);
Proxies.render.bindTexture(manager.gui.textureFile);
manager.gui.drawTexturedModalRect(startX + xPos, startY + yPos, overlayTexX, overlayTexY, 16, 60);
GL11.glPopAttrib();
}
@@ -11,22 +11,12 @@
package forestry.core.proxy;
import java.io.File;
import java.util.EnumSet;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
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.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.potion.Potion;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
@@ -34,31 +24,15 @@ import com.mojang.authlib.GameProfile;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.FakePlayerFactory;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.API;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.registry.GameRegistry;
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;
import forestry.core.TickHandlerCoreServer;
import forestry.core.config.Constants;
import forestry.core.config.ForestryBlock;
import forestry.core.config.ForestryItem;
import forestry.core.multiblock.MultiblockServerTickHandler;
import forestry.core.network.PacketFXSignal;
import forestry.core.render.SpriteSheet;
import forestry.core.utils.Log;
import forestry.core.utils.StringUtil;
import forestry.core.worldgen.WorldGenerator;
import forestry.plugins.PluginManager;
public class ProxyCommon {
@@ -74,105 +48,6 @@ public class ProxyCommon {
FMLCommonHandler.instance().bus().register(new MultiblockServerTickHandler());
}
public void registerBlock(Block block, Class<? extends ItemBlock> 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;
}
@@ -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) {
@@ -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) {
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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();
@@ -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();
@@ -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);
@@ -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;
}
}
@@ -59,7 +59,7 @@ public class GuiEngineBronze extends GuiEngine<ContainerEngineBronze, TileEngine
squaled = height;
}
Proxies.common.bindTexture(SpriteSheet.BLOCKS);
Proxies.render.bindTexture(SpriteSheet.BLOCKS);
int start = 0;
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F);
@@ -83,7 +83,7 @@ public class GuiEngineBronze extends GuiEngine<ContainerEngineBronze, TileEngine
}
}
Proxies.common.bindTexture(textureFile);
Proxies.render.bindTexture(textureFile);
}
@Override
@@ -163,10 +163,10 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IBlockRen
float factor = (float) (1.0 / 16.0);
Proxies.common.bindTexture(textures[Textures.BASE.ordinal()]);
Proxies.render.bindTexture(textures[Textures.BASE.ordinal()]);
boiler.render(factor);
Proxies.common.bindTexture(textures[Textures.PISTON.ordinal()]);
Proxies.render.bindTexture(textures[Textures.PISTON.ordinal()]);
GL11.glTranslatef(translate[0] * tfactor, translate[1] * tfactor, translate[2] * tfactor);
piston.render(factor);
GL11.glTranslatef(-translate[0] * tfactor, -translate[1] * tfactor, -translate[2] * tfactor);
@@ -192,10 +192,10 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IBlockRen
break;
}
Proxies.common.bindTexture(texture);
Proxies.render.bindTexture(texture);
trunk.render(factor);
Proxies.common.bindTexture(textures[Textures.EXTENSION.ordinal()]);
Proxies.render.bindTexture(textures[Textures.EXTENSION.ordinal()]);
float chamberf = 2F / 16F;
if (step > 0) {
@@ -56,7 +56,7 @@ public class GuiWorktable extends GuiForestryTitled<ContainerWorktable, TileWork
if (inventory.getMemory().isLocked(slotNumber)) {
manager.gui.setZLevel(110f);
Proxies.common.bindTexture(SpriteSheet.ITEMS);
Proxies.render.bindTexture(SpriteSheet.ITEMS);
manager.gui.drawTexturedModelRectFromIcon(startX + xPos, startY + yPos, TextureManager.getInstance().getDefault("slots/locked"), 16, 16);
manager.gui.setZLevel(0f);
}
@@ -92,10 +92,10 @@ public class TileMillRainmaker extends TileMill {
float f3 = 0.52F;
float f4 = worldObj.rand.nextFloat() * 0.6F - 0.3F;
Proxies.common.addEntityExplodeFX(worldObj, (f - f3), f1, (f2 + f4));
Proxies.common.addEntityExplodeFX(worldObj, (f + f3), f1, (f2 + f4));
Proxies.common.addEntityExplodeFX(worldObj, (f + f4), f1, (f2 - f3));
Proxies.common.addEntityExplodeFX(worldObj, (f + f4), f1, (f2 + f3));
Proxies.render.addEntityExplodeFX(worldObj, (f - f3), f1, (f2 + f4));
Proxies.render.addEntityExplodeFX(worldObj, (f + f3), f1, (f2 + f4));
Proxies.render.addEntityExplodeFX(worldObj, (f + f4), f1, (f2 - f3));
Proxies.render.addEntityExplodeFX(worldObj, (f + f4), f1, (f2 + f3));
}
if (!worldObj.isRemote) {
@@ -104,7 +104,7 @@ public class GuiFarm extends GuiForestry<ContainerFarm, TileFarm> {
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);
}
@@ -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
@@ -264,7 +264,7 @@ public class GuiLetter extends GuiForestry<ContainerLetter, LetterInventory> {
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);
}
}
@@ -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);
@@ -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
@@ -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
@@ -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",
" # ",
"# ",
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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.");
}
@@ -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
+37 -36
View File
@@ -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<ItemStack> 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
@@ -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
@@ -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
@@ -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
@@ -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.");
@@ -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 {
@@ -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");
@@ -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
@@ -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);
}
}
@@ -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");
}
}
@@ -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
@@ -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
@@ -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
@@ -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));
}
@@ -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
@@ -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()) {
@@ -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
@@ -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);
}