2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty;
|
|
|
|
|
|
|
|
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;
|
|
|
|
import net.minecraft.client.renderer.entity.RenderSnowball;
|
2013-07-01 07:33:41 +00:00
|
|
|
import net.minecraftforge.client.MinecraftForgeClient;
|
2013-05-30 09:41:07 +00:00
|
|
|
import net.minecraftforge.fluids.FluidRegistry;
|
|
|
|
import net.minecraftforge.fluids.RenderBlockFluid;
|
2013-07-01 07:33:41 +00:00
|
|
|
import biomesoplenty.api.Blocks;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.api.Items;
|
2013-06-07 21:36:52 +00:00
|
|
|
import biomesoplenty.blocks.renderers.AltarRenderer;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.blocks.renderers.FoliageRenderer;
|
2013-07-01 07:33:41 +00:00
|
|
|
import biomesoplenty.blocks.renderers.ItemGraveRenderer;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.blocks.renderers.PlantsRenderer;
|
2013-06-25 08:53:40 +00:00
|
|
|
import biomesoplenty.blocks.renderers.PuddleRender;
|
2013-06-08 07:04:09 +00:00
|
|
|
import biomesoplenty.blocks.renderers.RenderUtils;
|
2013-05-22 20:08:28 +00:00
|
|
|
import biomesoplenty.blocks.renderers.SmallBlockRenderer;
|
2013-07-01 07:33:41 +00:00
|
|
|
import biomesoplenty.blocks.renderers.TileEntityGraveRenderer;
|
2013-06-15 08:46:50 +00:00
|
|
|
import biomesoplenty.entities.EntityGlob;
|
|
|
|
import biomesoplenty.entities.RenderGlob;
|
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-13 07:49:06 +00:00
|
|
|
import biomesoplenty.particles.EntityDandelionFX;
|
2013-05-30 08:18:07 +00:00
|
|
|
import biomesoplenty.particles.EntitySteamFX;
|
2013-07-01 07:33:41 +00:00
|
|
|
import biomesoplenty.tileentity.TileEntityGrave;
|
|
|
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
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();
|
2013-06-30 09:14:10 +00:00
|
|
|
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
|
|
|
{
|
2013-07-01 07:33:41 +00:00
|
|
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGrave.class, new TileEntityGraveRenderer());
|
|
|
|
MinecraftForgeClient.registerItemRenderer(Blocks.grave.get().blockID, new ItemGraveRenderer());
|
|
|
|
|
2013-06-08 07:04:09 +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-06-08 07:04:09 +00:00
|
|
|
|
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());
|
2013-05-22 20:08:28 +00:00
|
|
|
RenderingRegistry.registerBlockHandler(new SmallBlockRenderer());
|
2013-06-07 21:36:52 +00:00
|
|
|
RenderingRegistry.registerBlockHandler(new AltarRenderer());
|
2013-06-25 08:53:40 +00:00
|
|
|
RenderingRegistry.registerBlockHandler(new PuddleRender());
|
2013-05-31 10:34:02 +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-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") {
|
2013-07-02 03:57:49 +00:00
|
|
|
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.mudball.get());
|
2013-05-31 10:34:02 +00:00
|
|
|
} else if (string == "dart") {
|
2013-07-02 03:57:49 +00:00
|
|
|
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.dart.get());
|
2013-05-31 10:34:02 +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);
|
|
|
|
}
|
|
|
|
|
2013-05-30 08:18:07 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|