BiomesOPlenty/src/minecraft/biomesoplenty/ClientProxy.java

79 lines
3.2 KiB
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty;
import net.minecraft.client.Minecraft;
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;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.RenderBlockFluid;
2013-05-03 13:00:44 +00:00
import biomesoplenty.api.Items;
import biomesoplenty.blocks.renderers.AltarRenderer;
2013-05-03 13:00:44 +00:00
import biomesoplenty.blocks.renderers.FoliageRenderer;
import biomesoplenty.blocks.renderers.PlantsRenderer;
import biomesoplenty.blocks.renderers.PuddleRender;
import biomesoplenty.blocks.renderers.RenderUtils;
import biomesoplenty.blocks.renderers.SmallBlockRenderer;
import biomesoplenty.entities.EntityGlob;
import biomesoplenty.entities.RenderGlob;
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;
import biomesoplenty.particles.EntityDandelionFX;
import biomesoplenty.particles.EntitySteamFX;
2013-05-03 13:00:44 +00:00
import cpw.mods.fml.client.registry.RenderingRegistry;
public class ClientProxy extends CommonProxy {
2013-05-31 10:34:02 +00:00
public static Minecraft mc = Minecraft.getMinecraft();
public static int puddleRenderPass;
2013-05-03 13:00:44 +00:00
@Override
2013-05-31 10:34:02 +00:00
public void registerRenderers()
2013-05-03 13:00:44 +00:00
{
RenderUtils.altarModel = RenderingRegistry.getNextAvailableRenderId();
2013-07-01 00:31:34 +00:00
RenderUtils.foliageModel = RenderingRegistry.getNextAvailableRenderId();;
RenderUtils.plantsModel = RenderingRegistry.getNextAvailableRenderId();;
RenderUtils.puddleModel = RenderingRegistry.getNextAvailableRenderId();;
RenderUtils.bonesModel = RenderingRegistry.getNextAvailableRenderId();;
2013-05-31 10:34:02 +00:00
RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(Items.mudball.get(), 0));
RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, new RenderDart());
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());
RenderingRegistry.registerBlockHandler(new SmallBlockRenderer());
RenderingRegistry.registerBlockHandler(new AltarRenderer());
RenderingRegistry.registerBlockHandler(new PuddleRender());
2013-05-31 10:34:02 +00:00
//TODO: Remove upon Fluid API being integrated into Forge
FluidRegistry.renderIdFluid = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(RenderBlockFluid.instance);
2013-05-03 13:00:44 +00:00
}
2013-05-31 10:34:02 +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
{
2013-05-31 10:34:02 +00:00
EntityFX entityfx = null;
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") {
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);
}
mc.effectRenderer.addEffect(entityfx);
2013-05-31 10:34:02 +00:00
}
2013-05-03 13:00:44 +00:00
@Override
public int addArmor(String armor)
{
return RenderingRegistry.addNewArmourRendererPrefix(armor);
}
}