2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty;
|
|
|
|
|
2013-05-22 20:08:28 +00:00
|
|
|
import net.minecraft.block.Block;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.client.Minecraft;
|
2013-05-17 07:18:08 +00:00
|
|
|
import net.minecraft.client.model.ModelSlime;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.client.particle.EntityBreakingFX;
|
|
|
|
import net.minecraft.client.particle.EntityFX;
|
2013-05-22 20:08:28 +00:00
|
|
|
import net.minecraft.client.renderer.RenderBlocks;
|
|
|
|
import net.minecraft.client.renderer.Tessellator;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.client.renderer.entity.RenderSnowball;
|
2013-05-22 20:08:28 +00:00
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.api.Items;
|
|
|
|
import biomesoplenty.blocks.renderers.FoliageRenderer;
|
|
|
|
import biomesoplenty.blocks.renderers.PlantsRenderer;
|
2013-05-22 20:08:28 +00:00
|
|
|
import biomesoplenty.blocks.renderers.SmallBlockRenderer;
|
2013-05-29 01:05:27 +00:00
|
|
|
import biomesoplenty.ftfluidsapi.FluidRegistry;
|
|
|
|
import biomesoplenty.ftfluidsapi.RenderBlockFluid;
|
2013-05-07 01:02:25 +00:00
|
|
|
import biomesoplenty.items.projectiles.EntityDart;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.items.projectiles.EntityMudball;
|
2013-05-11 12:51:16 +00:00
|
|
|
import biomesoplenty.items.projectiles.RenderDart;
|
2013-05-17 07:18:08 +00:00
|
|
|
import biomesoplenty.mobs.EntityGlob;
|
|
|
|
import biomesoplenty.mobs.RenderGlob;
|
2013-05-13 07:49:06 +00:00
|
|
|
import biomesoplenty.particles.EntityDandelionFX;
|
2013-05-30 08:18:07 +00:00
|
|
|
import biomesoplenty.particles.EntitySteamFX;
|
2013-05-03 13:00:44 +00:00
|
|
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
|
|
|
|
|
|
public class ClientProxy extends CommonProxy {
|
|
|
|
|
|
|
|
public static Minecraft mc = Minecraft.getMinecraft();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void registerRenderers()
|
|
|
|
{
|
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(Items.mudball.get(), 0));
|
2013-05-15 09:15:31 +00:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, new RenderDart());
|
2013-05-16 13:50:12 +00:00
|
|
|
//RenderingRegistry.registerEntityRenderingHandler(EntityPoisonDart.class, new RenderPoisonDart());
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-17 07:18:08 +00:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityGlob.class, new RenderGlob(new ModelSlime(16), new ModelSlime(0), 0.25F));
|
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
RenderingRegistry.registerBlockHandler(new FoliageRenderer());
|
|
|
|
RenderingRegistry.registerBlockHandler(new PlantsRenderer());
|
2013-05-22 20:08:28 +00:00
|
|
|
RenderingRegistry.registerBlockHandler(new SmallBlockRenderer());
|
2013-05-29 01:05:27 +00:00
|
|
|
|
2013-05-30 08:18:07 +00:00
|
|
|
//TODO: Remove upon Fluid API being integrated into Forge
|
2013-05-29 01:05:27 +00:00
|
|
|
FluidRegistry.renderIdFluid = RenderingRegistry.getNextAvailableRenderId();
|
|
|
|
RenderingRegistry.registerBlockHandler(RenderBlockFluid.instance);
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
2013-05-11 12:51:16 +00:00
|
|
|
|
|
|
|
@Override
|
2013-05-13 08:20:06 +00:00
|
|
|
public void spawnParticle(String string, double x, double y, double z)
|
2013-05-11 12:51:16 +00:00
|
|
|
{
|
|
|
|
EntityFX entityfx = null;
|
|
|
|
|
2013-05-13 08:20:06 +00:00
|
|
|
if (string == "mud")
|
|
|
|
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.mudball.get(), mc.renderEngine);
|
|
|
|
else if (string == "dart")
|
|
|
|
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.dart.get(), mc.renderEngine);
|
|
|
|
else if (string == "dandelion")
|
2013-05-17 00:36:06 +00:00
|
|
|
entityfx = new EntityDandelionFX(mc.theWorld, x, y, z, 2.0F);
|
2013-05-13 08:20:06 +00:00
|
|
|
|
2013-05-30 08:18:07 +00:00
|
|
|
mc.effectRenderer.addEffect(entityfx);
|
2013-05-13 08:20:06 +00:00
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public int addArmor(String armor)
|
|
|
|
{
|
|
|
|
return RenderingRegistry.addNewArmourRendererPrefix(armor);
|
|
|
|
}
|
2013-05-22 20:08:28 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderStandardInvBlock(RenderBlocks renderblocks, Block block, int meta)
|
|
|
|
{
|
|
|
|
Tessellator tessellator = Tessellator.instance;
|
|
|
|
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
|
|
|
tessellator.startDrawingQuads();
|
|
|
|
tessellator.setNormal(0.0F, -1F, 0.0F);
|
|
|
|
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
|
|
|
|
tessellator.draw();
|
|
|
|
tessellator.startDrawingQuads();
|
|
|
|
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
|
|
|
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
|
|
|
|
tessellator.draw();
|
|
|
|
tessellator.startDrawingQuads();
|
|
|
|
tessellator.setNormal(0.0F, 0.0F, -1F);
|
|
|
|
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
|
|
|
|
tessellator.draw();
|
|
|
|
tessellator.startDrawingQuads();
|
|
|
|
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
|
|
|
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
|
|
|
|
tessellator.draw();
|
|
|
|
tessellator.startDrawingQuads();
|
|
|
|
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
|
|
|
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
|
|
|
|
tessellator.draw();
|
|
|
|
tessellator.startDrawingQuads();
|
|
|
|
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
|
|
|
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
|
|
|
|
tessellator.draw();
|
|
|
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
|
|
|
}
|
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|