BiomesOPlenty/src/main/java/biomesoplenty/ClientProxy.java

84 lines
2.9 KiB
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty;
2013-12-24 01:21:58 +00:00
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.particle.EntityFX;
2013-12-24 04:28:03 +00:00
import biomesoplenty.api.BOPItemHelper;
2013-12-26 11:38:55 +00:00
import biomesoplenty.client.render.blocks.BambooRenderer;
import biomesoplenty.client.render.blocks.GraveRenderer;
import biomesoplenty.client.render.blocks.RenderUtils;
import biomesoplenty.client.render.blocks.SmallBlockRenderer;
2013-12-24 01:21:58 +00:00
import biomesoplenty.client.render.entities.RenderDart;
2013-12-24 04:28:03 +00:00
import biomesoplenty.common.entities.projectiles.EntityDart;
2013-12-24 01:21:58 +00:00
import cpw.mods.fml.client.registry.RenderingRegistry;
2013-11-17 01:18:19 +00:00
public class ClientProxy extends CommonProxy
{
2013-12-24 01:21:58 +00:00
public static Minecraft minecraft = Minecraft.getMinecraft();
@Override
public void registerEventHandlers()
{
}
//Client Only
@Override
public void registerRenderers()
{
2013-12-26 11:38:55 +00:00
RenderUtils.foliageModel = RenderingRegistry.getNextAvailableRenderId();
RenderUtils.plantsModel = RenderingRegistry.getNextAvailableRenderId();
RenderUtils.bonesModel = RenderingRegistry.getNextAvailableRenderId();
RenderUtils.graveModel = RenderingRegistry.getNextAvailableRenderId();
RenderUtils.bambooModel = RenderingRegistry.getNextAvailableRenderId();
2013-12-24 01:21:58 +00:00
RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, new RenderDart());
2013-12-26 11:38:55 +00:00
//TODO: FEATURE RenderingRegistry.registerBlockHandler(new FoliageRenderer());
//TODO: FEATURE RenderingRegistry.registerBlockHandler(new PlantsRenderer());
RenderingRegistry.registerBlockHandler(new SmallBlockRenderer());
RenderingRegistry.registerBlockHandler(new GraveRenderer());
RenderingRegistry.registerBlockHandler(new BambooRenderer());
2013-12-24 01:21:58 +00:00
}
@Override
public void spawnParticle(String string, double x, double y, double z)
{
EntityFX entityfx = null;
Random rand = new Random();
/*if (string == "mud")
{
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.mudball.get());
}
else*/ if (string == "dart")
{
2013-12-24 04:28:03 +00:00
entityfx = new EntityBreakingFX(minecraft.theWorld, x, y, z, BOPItemHelper.get("dart"), 0);
2013-12-24 01:21:58 +00:00
}
else if (string == "poisondart")
{
2013-12-24 04:28:03 +00:00
entityfx = new EntityBreakingFX(minecraft.theWorld, x, y, z, BOPItemHelper.get("dart"), 1);
2013-12-24 01:21:58 +00:00
}
/*else if (string == "dandelion")
{
entityfx = new EntityDandelionFX(mc.theWorld, x, y, z, 2.0F);
}
else if (string == "steam")
{
entityfx = new EntitySteamFX(mc.theWorld, x, y, z, 0.0D, 0.0D, 0.0D);
}
else if (string == "magictree")
{
entityfx = new EntityMagicTreeFX(mc.theWorld, x, y, z, MathHelper.getRandomDoubleInRange(rand, -0.03, 0.03), -0.02D, MathHelper.getRandomDoubleInRange(rand, -0.03, 0.03));
}
else if (string == "pixietrail")
{
entityfx = new EntityPixieTrailFX(mc.theWorld, x, y, z, MathHelper.getRandomDoubleInRange(rand, -0.03, 0.03), -0.02D, MathHelper.getRandomDoubleInRange(rand, -0.03, 0.03));
}*/
minecraft.effectRenderer.addEffect(entityfx);
}
2013-05-03 13:00:44 +00:00
}