Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mod.drakania.dynamite;
- import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import io.netty.buffer.ByteBuf;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.monster.EntityBlaze;
- import net.minecraft.entity.projectile.EntityThrowable;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.MathHelper;
- import net.minecraft.util.MovingObjectPosition;
- import net.minecraft.world.World;
- public class EntityBigDynamite extends EntityThrowable implements IEntityAdditionalSpawnData
- {
- private int fuseTime = 10;
- public EntityBigDynamite(World world)
- {
- super(world);
- }
- public EntityBigDynamite(World world, EntityLivingBase thrower)
- {
- super(world, thrower);
- this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 10 * 1.5F, 1.0F);
- }
- public EntityBigDynamite(World world, double x, double y, double z)
- {
- super(world, x, y, z);
- }
- protected void onImpact(MovingObjectPosition mop)
- {
- this.motionX = 0;
- this.motionY = 0;
- this.motionZ = 0;
- if (!this.worldObj.isRemote)
- {
- }
- }
- @Override
- public void onUpdate()
- {
- super.onUpdate();
- if(this.fuseTime > 0)
- {
- this.fuseTime --;
- }
- else if(!this.worldObj.isRemote)
- {
- this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 4F, false, true);
- this.setDead();
- }
- }
- @Override
- public void writeSpawnData(ByteBuf buffer)
- {
- buffer.writeInt(this.fuseTime);
- }
- @Override
- public void readSpawnData(ByteBuf additionalData)
- {
- this.fuseTime = additionalData.readInt();
- }
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement