Beat Amnet to giving mud balls proper particles :)

This commit is contained in:
Adubbz 2013-04-06 19:12:51 +11:00
parent fb19fd7ca6
commit bd18ea4a78
3 changed files with 37 additions and 5 deletions

View File

@ -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)
{

View File

@ -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)
{
}
}

View File

@ -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)