Beat Amnet to giving mud balls proper particles :)
This commit is contained in:
parent
fb19fd7ca6
commit
bd18ea4a78
3 changed files with 37 additions and 5 deletions
|
@ -1,13 +1,21 @@
|
||||||
package tdwp_ftw.biomesop;
|
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.declarations.BOPItems;
|
||||||
import tdwp_ftw.biomesop.items.projectiles.EntityMudball;
|
import tdwp_ftw.biomesop.items.projectiles.EntityMudball;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy {
|
public class ClientProxy extends CommonProxy {
|
||||||
|
|
||||||
|
public static Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerRenderers()
|
public void registerRenderers()
|
||||||
{
|
{
|
||||||
|
@ -19,6 +27,15 @@ public class ClientProxy extends CommonProxy {
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(BOPItems.mudBall));
|
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
|
@Override
|
||||||
public int addArmor(String armor)
|
public int addArmor(String armor)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
package tdwp_ftw.biomesop;
|
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 class CommonProxy {
|
||||||
public static String ARMOR_MUD1_PNG = "/mods/BiomesOPlenty/textures/armor/mud_1.png";
|
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";
|
public static String ARMOR_MUD2_PNG = "/mods/BiomesOPlenty/textures/armor/mud_2.png";
|
||||||
|
@ -15,4 +19,10 @@ public class CommonProxy {
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void spawnMud(World world, double x, double y, double z, double xVel, double yVel, double zVel)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,8 @@
|
||||||
package tdwp_ftw.biomesop.items.projectiles;
|
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.EntityLiving;
|
||||||
import net.minecraft.entity.projectile.EntityThrowable;
|
import net.minecraft.entity.projectile.EntityThrowable;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
|
@ -26,7 +29,9 @@ public class EntityMudball extends EntityThrowable
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
||||||
|
{
|
||||||
|
|
||||||
if (par1MovingObjectPosition.entityHit != null)
|
if (par1MovingObjectPosition.entityHit != null)
|
||||||
{
|
{
|
||||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 1);
|
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)
|
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)
|
if (!this.worldObj.isRemote)
|
||||||
|
|
Loading…
Reference in a new issue