diff --git a/src/minecraft/tdwp_ftw/biomesop/ClientProxy.java b/src/minecraft/tdwp_ftw/biomesop/ClientProxy.java index c93506473..82591778c 100644 --- a/src/minecraft/tdwp_ftw/biomesop/ClientProxy.java +++ b/src/minecraft/tdwp_ftw/biomesop/ClientProxy.java @@ -1,12 +1,20 @@ package tdwp_ftw.biomesop; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityBreakingFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.entity.RenderSnowball; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; import tdwp_ftw.biomesop.declarations.BOPItems; import tdwp_ftw.biomesop.items.projectiles.EntityMudball; import cpw.mods.fml.client.registry.RenderingRegistry; -import net.minecraft.client.renderer.entity.RenderSnowball; -import net.minecraftforge.client.MinecraftForgeClient; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ClientProxy extends CommonProxy { + + public static Minecraft mc = Minecraft.getMinecraft(); @Override public void registerRenderers() @@ -15,10 +23,19 @@ public class ClientProxy extends CommonProxy { MinecraftForgeClient.preloadTexture(ARMOR_MUD2_PNG); MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST1_PNG); MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST2_PNG); - + RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(BOPItems.mudBall)); } + @SideOnly(Side.CLIENT) + public void spawnMud(World world, double x, double y, double z, double xVel, double yVel, double zVel) + { + EntityFX entityfx = null; + + entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, BOPItems.mudBall, mc.renderEngine); + mc.effectRenderer.addEffect(entityfx); + } + @Override public int addArmor(String armor) { diff --git a/src/minecraft/tdwp_ftw/biomesop/CommonProxy.java b/src/minecraft/tdwp_ftw/biomesop/CommonProxy.java index f025f8aad..40595eb62 100644 --- a/src/minecraft/tdwp_ftw/biomesop/CommonProxy.java +++ b/src/minecraft/tdwp_ftw/biomesop/CommonProxy.java @@ -1,5 +1,9 @@ package tdwp_ftw.biomesop; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class CommonProxy { public static String ARMOR_MUD1_PNG = "/mods/BiomesOPlenty/textures/armor/mud_1.png"; public static String ARMOR_MUD2_PNG = "/mods/BiomesOPlenty/textures/armor/mud_2.png"; @@ -15,4 +19,10 @@ public class CommonProxy { { return 0; } + + @SideOnly(Side.CLIENT) + public void spawnMud(World world, double x, double y, double z, double xVel, double yVel, double zVel) + { + + } } \ No newline at end of file diff --git a/src/minecraft/tdwp_ftw/biomesop/items/projectiles/EntityMudball.java b/src/minecraft/tdwp_ftw/biomesop/items/projectiles/EntityMudball.java index 15915c8ff..c7f64c64b 100644 --- a/src/minecraft/tdwp_ftw/biomesop/items/projectiles/EntityMudball.java +++ b/src/minecraft/tdwp_ftw/biomesop/items/projectiles/EntityMudball.java @@ -1,5 +1,8 @@ package tdwp_ftw.biomesop.items.projectiles; +import tdwp_ftw.biomesop.mod_BiomesOPlenty; +import tdwp_ftw.biomesop.declarations.BOPConfiguration; +import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.potion.Potion; @@ -26,7 +29,9 @@ public class EntityMudball extends EntityThrowable } @Override - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { + protected void onImpact(MovingObjectPosition par1MovingObjectPosition) + { + if (par1MovingObjectPosition.entityHit != null) { par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 1); @@ -35,7 +40,7 @@ public class EntityMudball extends EntityThrowable for (int i = 0; i < 16; ++i) { - this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + mod_BiomesOPlenty.proxy.spawnMud(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } if (!this.worldObj.isRemote)