ironshod, bouncy grenades, mk4 for cyclotron

This commit is contained in:
HbmMods 2018-10-16 16:16:32 +02:00
parent 68ac149390
commit f96761f8ae
59 changed files with 1595 additions and 84 deletions

View File

@ -1080,6 +1080,20 @@ item.grenade_mirv.name=MIRV-Granate
item.grenade_breach.name=Durchbruchgranate
item.grenade_burst.name=Gräbergranate
item.grenade_if_generic.name=IF - Nullgranate
item.grenade_if_he.name=IF - HE-Granate
item.grenade_if_bouncy.name=IF - Elastissche Granate
item.grenade_if_sticky.name=IF - Klebrige Granate
item.grenade_if_impact.name=IF - Aufschlaggranate
item.grenade_if_incendiary.name=IF - Brandgranate
item.grenade_if_toxic.name=IF - Toxische Granate
item.grenade_if_concussion.name=IF - Erschütterungsgranate
item.grenade_if_brimstone.name=IF - Werfbare Brimstone-Mine
item.grenade_if_mystery.name=IF - M.-Granate
item.grenade_if_spark.name=IF - S.-Granate
item.grenade_if_hopwire.name=IF - Schwarzes Loch Hopwire
item.grenade_if_null.name=IF - Null-Granate
item.rod_uranium_fuel.name=Urankernbrennstoffzelle
item.rod_dual_uranium_fuel.name=Doppelte Urankernbrennstoffzelle
item.rod_quad_uranium_fuel.name=Vierfache Urankernbrennstoffzelle

View File

@ -1080,6 +1080,20 @@ item.grenade_mirv.name=MIRV Grenade
item.grenade_breach.name=Breaching Grenade
item.grenade_burst.name=Digger Grenade
item.grenade_if_generic.name=IF - Grenade
item.grenade_if_he.name=IF - HE Grenade
item.grenade_if_bouncy.name=IF - Bouncy Grenade
item.grenade_if_sticky.name=IF - Sticky Grenade
item.grenade_if_impact.name=IF - Impact Grenade
item.grenade_if_incendiary.name=IF - Incendiary Grenade
item.grenade_if_toxic.name=IF - Toxic Grenade
item.grenade_if_concussion.name=IF - Concussion Grenade
item.grenade_if_brimstone.name=IF - Tossable Brimsstone Mine
item.grenade_if_mystery.name=IF - M.-Grenade
item.grenade_if_spark.name=IF - S.-Grenade
item.grenade_if_hopwire.name=IF - Black Hole Hopwire
item.grenade_if_null.name=IF - Null Grenade
item.rod_uranium_fuel.name=Uranium Fuel Rod
item.rod_dual_uranium_fuel.name=Uranium Dual Fuel Rod
item.rod_quad_uranium_fuel.name=Uranium Quad Fuel Rod

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

View File

@ -13,6 +13,7 @@ import com.hbm.entity.effect.EntityCloudFleija;
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
import com.hbm.entity.projectile.EntityBurningFOEQ;
import com.hbm.entity.projectile.EntityMeteor;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNukeRay;
import com.hbm.explosion.ExplosionNukeRay.FloatTriplet;
import com.hbm.lib.HbmChestContents;
@ -31,6 +32,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@ -293,7 +295,7 @@ public class TestEventTester extends Block {
WeightedRandomChestContent.generateChestContents(worldObj.rand, HbmChestContents.getLoot(3), (TileEntityCrateSteel)worldObj.getTileEntity(par2, par3, par4), 32);
}*/
EntityBurningFOEQ foeq = new EntityBurningFOEQ(worldObj);
/*EntityBurningFOEQ foeq = new EntityBurningFOEQ(worldObj);
foeq.posX = par2;
foeq.posY = 400;
foeq.posZ = par4;
@ -302,7 +304,19 @@ public class TestEventTester extends Block {
foeq.motionY = -4D;
if(!worldObj.isRemote)
worldObj.spawnEntityInWorld(foeq);
worldObj.spawnEntityInWorld(foeq);*/
if(!worldObj.isRemote) {
worldObj.setBlockToAir(par2, par3, par4);
ExplosionLarge.jolt(worldObj, par2 - 0.5, par3 - 0.5, par4 - 0.5, 5, 200, 0.25);
ExplosionLarge.explode(worldObj, par2 + 0.5, par3 + 0.5, par4 + 0.5, 5, false, false, false);
}
/*if(!worldObj.isRemote) {
EntityFallingBlock entityfallingblock = new EntityFallingBlock(worldObj, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this, worldObj.getBlockMetadata(par2, par3, par4));
worldObj.spawnEntityInWorld(entityfallingblock);
}*/
return true;
}

View File

@ -5,8 +5,10 @@ import net.minecraft.world.World;
import com.hbm.entity.effect.EntityBlackHole;
import com.hbm.entity.effect.EntityRagingVortex;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
public class EntityGrenadeBlackHole extends EntityGrenadeBase
public class EntityGrenadeBlackHole extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -40,4 +42,14 @@ public class EntityGrenadeBlackHole extends EntityGrenadeBase
this.worldObj.spawnEntityInWorld(bl);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_black_hole);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,246 @@
package com.hbm.entity.grenade;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public abstract class EntityGrenadeBouncyBase extends Entity implements IProjectile {
protected EntityLivingBase thrower;
protected String throwerName;
protected int timer = 0;
public EntityGrenadeBouncyBase(World world) {
super(world);
this.setSize(0.25F, 0.25F);
}
public EntityGrenadeBouncyBase(World world, EntityLivingBase living)
{
super(world);
this.thrower = living;
this.setSize(0.25F, 0.25F);
this.setLocationAndAngles(living.posX, living.posY + (double)living.getEyeHeight(), living.posZ, living.rotationYaw, living.rotationPitch);
this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
this.posY -= 0.10000000149011612D;
this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F;
float f = 0.4F;
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f);
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f);
this.motionY = (double)(-MathHelper.sin((this.rotationPitch + this.func_70183_g()) / 180.0F * (float)Math.PI) * f);
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.func_70182_d(), 1.0F);
}
public EntityGrenadeBouncyBase(World world, double posX, double posY, double posZ)
{
super(world);
this.setSize(0.25F, 0.25F);
this.setPosition(posX, posY, posZ);
this.yOffset = 0.0F;
}
@Override
protected void entityInit() { }
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double p_70112_1_)
{
double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
d1 *= 64.0D;
return p_70112_1_ < d1 * d1;
}
protected float func_70182_d()
{
return 1.5F;
}
protected float func_70183_g()
{
return 0.0F;
}
protected float getGravityVelocity()
{
return 0.03F;
}
public void setThrowableHeading(double motionX, double motionY, double motionZ, float f0, float f1)
{
float f2 = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ);
motionX /= (double)f2;
motionY /= (double)f2;
motionZ /= (double)f2;
motionX += this.rand.nextGaussian() * 0.007499999832361937D * (double)f1;
motionY += this.rand.nextGaussian() * 0.007499999832361937D * (double)f1;
motionZ += this.rand.nextGaussian() * 0.007499999832361937D * (double)f1;
motionX *= (double)f0;
motionY *= (double)f0;
motionZ *= (double)f0;
this.motionX = motionX;
this.motionY = motionY;
this.motionZ = motionZ;
float f3 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(motionY, (double)f3) * 180.0D / Math.PI);
}
@SideOnly(Side.CLIENT)
public void setVelocity(double motionX, double motionY, double motionZ)
{
this.motionX = motionX;
this.motionY = motionY;
this.motionZ = motionZ;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(motionY, (double)f) * 180.0D / Math.PI);
}
}
public void onUpdate()
{
this.lastTickPosX = this.posX;
this.lastTickPosY = this.posY;
this.lastTickPosZ = this.posZ;
super.onUpdate();
//Bounce here
boolean bounce = false;
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31);
if (movingobjectposition != null)
{
vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
this.posX += (movingobjectposition.hitVec.xCoord - this.posX) * 0.6;
this.posY += (movingobjectposition.hitVec.yCoord - this.posY) * 0.6;
this.posZ += (movingobjectposition.hitVec.zCoord - this.posZ) * 0.6;
switch(movingobjectposition.sideHit) {
case 0:
case 1:
motionY *= -1; break;
case 2:
case 3:
motionZ *= -1; break;
case 4:
case 5:
motionX *= -1; break;
}
bounce = true;
motionX *= getBounceMod();
motionY *= getBounceMod();
motionZ *= getBounceMod();
}
//Bounce here [END]
if(!bounce) {
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
}
float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float f2 = 0.99F;
float f3 = this.getGravityVelocity();
if (this.isInWater())
{
for (int i = 0; i < 4; ++i)
{
float f4 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ);
}
f2 = 0.8F;
}
this.motionX *= (double)f2;
this.motionY *= (double)f2;
this.motionZ *= (double)f2;
this.motionY -= (double)f3;
this.setPosition(this.posX, this.posY, this.posZ);
timer++;
if(timer >= getMaxTimer()) {
explode();
}
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
timer = nbt.getInteger("timer");
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setInteger("timer", timer);
}
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
public EntityLivingBase getThrower()
{
if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0)
{
this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName);
}
return this.thrower;
}
public abstract void explode();
protected abstract int getMaxTimer();
protected abstract double getBounceMod();
}

View File

@ -1,6 +1,7 @@
package com.hbm.entity.grenade;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -9,7 +10,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class EntityGrenadeBurst extends EntityGrenadeBase {
public class EntityGrenadeBurst extends EntityGrenadeBouncyBase {
public EntityGrenadeBurst(World p_i1773_1_)
{
@ -27,10 +28,10 @@ public class EntityGrenadeBurst extends EntityGrenadeBase {
}
@Override
public void onUpdate() {
super.onUpdate();
public void explode() {
if(this.ticksExisted > 20 && !worldObj.isRemote) {
if (!this.worldObj.isRemote)
{
this.setDead();
for(int i = 0; i < 8; i++) {
@ -49,12 +50,12 @@ public class EntityGrenadeBurst extends EntityGrenadeBase {
}
@Override
public void explode() {
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_burst);
}
if (!this.worldObj.isRemote)
{
this.setDead();
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, new ItemStack(ModItems.grenade_burst)));
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -4,8 +4,10 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
public class EntityGrenadeCluster extends EntityGrenadeBase
public class EntityGrenadeCluster extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -34,4 +36,14 @@ public class EntityGrenadeCluster extends EntityGrenadeBase
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_cluster);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,10 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.world.World;
public class EntityGrenadeElectric extends EntityGrenadeBase
public class EntityGrenadeElectric extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -34,4 +37,14 @@ public class EntityGrenadeElectric extends EntityGrenadeBase
this.worldObj.spawnEntityInWorld(new EntityLightningBolt(this.worldObj, this.posX, this.posY, this.posZ));
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_electric);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -5,8 +5,10 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
public class EntityGrenadeFire extends EntityGrenadeBase
public class EntityGrenadeFire extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
public Entity shooter;
@ -38,4 +40,14 @@ public class EntityGrenadeFire extends EntityGrenadeBase
this.worldObj.playSoundEffect((int)this.posX, (int)this.posY, (int)this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_fire);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -5,8 +5,10 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
public class EntityGrenadeFrag extends EntityGrenadeBase
public class EntityGrenadeFrag extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
public Entity shooter;
@ -45,4 +47,14 @@ public class EntityGrenadeFrag extends EntityGrenadeBase
}
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_frag);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -7,8 +7,10 @@ import java.util.Random;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
public class EntityGrenadeGas extends EntityGrenadeBase {
public class EntityGrenadeGas extends EntityGrenadeBouncyBase {
private static final String __OBFID = "CL_00001722";
Random rand = new Random();
@ -48,4 +50,14 @@ public class EntityGrenadeGas extends EntityGrenadeBase {
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_gas);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -3,7 +3,7 @@ package com.hbm.entity.grenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeGeneric extends EntityGrenadeBase
public class EntityGrenadeGeneric extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -32,4 +32,14 @@ public class EntityGrenadeGeneric extends EntityGrenadeBase
}
}
@Override
protected int getMaxTimer() {
return 100;
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,48 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFBouncy extends EntityGrenadeBouncyBase {
public EntityGrenadeIFBouncy(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFBouncy(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFBouncy(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_bouncy);
}
@Override
protected double getBounceMod() {
return 0.75D;
}
}

View File

@ -0,0 +1,96 @@
package com.hbm.entity.grenade;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class EntityGrenadeIFBrimstone extends EntityGrenadeBouncyBase {
public EntityGrenadeIFBrimstone(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFBrimstone(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFBrimstone(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void onUpdate() {
super.onUpdate();
if(this.timer > (this.getMaxTimer() * 0.65)) {
if(!worldObj.isRemote) {
EntityBullet fragment;
fragment = new EntityBullet(worldObj, (EntityPlayer) this.thrower, 3.0F, 35, 45, false, "tauDay");
fragment.setDamage(rand.nextInt(301) + 100);
fragment.motionX = rand.nextGaussian();
fragment.motionY = rand.nextGaussian();
fragment.motionZ = rand.nextGaussian();
fragment.shootingEntity = this.thrower;
fragment.posX = posX;
fragment.posY = posY;
fragment.posZ = posZ;
fragment.setIsCritical(true);
worldObj.spawnEntityInWorld(fragment);
}
}
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
worldObj.newExplosion(this, posX, posY, posZ, 5, false, false);
for(int i = 0; i < 100; i++) {
EntityBullet fragment;
fragment = new EntityBullet(worldObj, (EntityPlayer) this.thrower, 3.0F, 35, 45, false, "tauDay");
fragment.setDamage(rand.nextInt(301) + 100);
fragment.motionX = rand.nextGaussian() * 0.25;
fragment.motionY = rand.nextGaussian() * 0.25;
fragment.motionZ = rand.nextGaussian() * 0.25;
fragment.shootingEntity = this.thrower;
fragment.posX = posX;
fragment.posY = posY;
fragment.posZ = posZ;
fragment.setIsCritical(true);
worldObj.spawnEntityInWorld(fragment);
}
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_brimstone);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,47 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFConcussion extends EntityGrenadeBouncyBase {
public EntityGrenadeIFConcussion(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFConcussion(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFConcussion(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
worldObj.newExplosion(this, posX, posY, posZ, 15, false, false);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_concussion);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,48 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFGeneric extends EntityGrenadeBouncyBase {
public EntityGrenadeIFGeneric(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFGeneric(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFGeneric(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_generic);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,48 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFHE extends EntityGrenadeBouncyBase {
public EntityGrenadeIFHE(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFHE(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFHE(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 7.5, 300, 0.25);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 7, true, true, true);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_he);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,51 @@
package com.hbm.entity.grenade;
import com.hbm.entity.effect.EntityVortex;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFHopwire extends EntityGrenadeBouncyBase {
public EntityGrenadeIFHopwire(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFHopwire(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFHopwire(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
EntityVortex vortex = new EntityVortex(worldObj, 0.75F);
vortex.posX = posX;
vortex.posY = posY;
vortex.posZ = posZ;
worldObj.spawnEntityInWorld(vortex);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_hopwire);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,38 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFImpact extends EntityGrenadeBase {
public EntityGrenadeIFImpact(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFImpact(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFImpact(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
}
}
}

View File

@ -0,0 +1,53 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionThermo;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFIncendiary extends EntityGrenadeBouncyBase {
public EntityGrenadeIFIncendiary(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFIncendiary(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFIncendiary(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
ExplosionThermo.setEntitiesOnFire(worldObj, (int)posX, (int)posY, (int)posZ, 8);
ExplosionChaos.flameDeath(worldObj, (int)posX, (int)posY, (int)posZ, 15);
ExplosionChaos.burn(worldObj, (int)posX, (int)posY, (int)posZ, 10);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_incendiary);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,46 @@
package com.hbm.entity.grenade;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFMystery extends EntityGrenadeBouncyBase {
public EntityGrenadeIFMystery(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFMystery(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFMystery(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
worldObj.newExplosion(this, posX, posY, posZ, 10, false, false);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_mystery);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,69 @@
package com.hbm.entity.grenade;
import java.util.List;
import com.hbm.entity.effect.EntityVortex;
import com.hbm.entity.particle.EntityDSmokeFX;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class EntityGrenadeIFNull extends EntityGrenadeBouncyBase {
public EntityGrenadeIFNull(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFNull(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFNull(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
for(int a = -3; a <= 3; a++)
for(int b = -3; b <= 3; b++)
for(int c = -3; c <= 3; c++)
worldObj.setBlockToAir((int)posX + a, (int)posY + b, (int)posZ + c);
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox((int)posX + 0.5 - 3, (int)posY + 0.5 - 3, (int)posZ + 0.5 - 3, (int)posX + 0.5 + 3, (int)posY + 0.5 + 3, (int)posZ + 0.5 + 3));
for(Object o : list) {
if(o instanceof EntityLivingBase) {
EntityLivingBase e = (EntityLivingBase)o;
e.setHealth(0);
} else if(o instanceof Entity) {
Entity e = (Entity)o;
e.setDead();
}
}
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_null);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,51 @@
package com.hbm.entity.grenade;
import com.hbm.entity.effect.EntityRagingVortex;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFSpark extends EntityGrenadeBouncyBase {
public EntityGrenadeIFSpark(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFSpark(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFSpark(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
EntityRagingVortex vortex = new EntityRagingVortex(worldObj, 1.5F);
vortex.posX = posX;
vortex.posY = posY;
vortex.posZ = posZ;
worldObj.spawnEntityInWorld(vortex);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_spark);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -0,0 +1,48 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFSticky extends EntityGrenadeBouncyBase {
public EntityGrenadeIFSticky(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFSticky(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFSticky(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_sticky);
}
@Override
protected double getBounceMod() {
return 0.05D;
}
}

View File

@ -0,0 +1,53 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeIFToxic extends EntityGrenadeBouncyBase {
public EntityGrenadeIFToxic(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityGrenadeIFToxic(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public EntityGrenadeIFToxic(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void explode() {
if (!this.worldObj.isRemote)
{
this.setDead();
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 3, 200, 0.25);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 2, true, true, true);
ExplosionChaos.poison(worldObj, (int)posX, (int)posY, (int)posZ, 12);
ExplosionNukeGeneric.waste(worldObj, (int)posX, (int)posY, (int)posZ, 12);
ExplosionChaos.spawnChlorine(worldObj, posX, posY, posZ, 50, 1.5, 0);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_if_toxic);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,10 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeLemon extends EntityGrenadeBase
public class EntityGrenadeLemon extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -32,4 +35,14 @@ public class EntityGrenadeLemon extends EntityGrenadeBase
this.worldObj.newExplosion((Entity)null, (float)this.posX, (float)this.posY, (float)this.posZ, 5.0F, true, true);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_lemon);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -2,6 +2,7 @@ package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -10,7 +11,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class EntityGrenadeMIRV extends EntityGrenadeBase {
public class EntityGrenadeMIRV extends EntityGrenadeBouncyBase {
public EntityGrenadeMIRV(World p_i1773_1_)
{
@ -28,10 +29,10 @@ public class EntityGrenadeMIRV extends EntityGrenadeBase {
}
@Override
public void onUpdate() {
super.onUpdate();
public void explode() {
if(this.ticksExisted > 20 && !worldObj.isRemote) {
if (!this.worldObj.isRemote)
{
this.setDead();
for(int i = 0; i < 8; i++) {
@ -51,12 +52,12 @@ public class EntityGrenadeMIRV extends EntityGrenadeBase {
}
@Override
public void explode() {
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_mirv);
}
if (!this.worldObj.isRemote)
{
this.setDead();
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, new ItemStack(ModItems.grenade_mirv)));
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,11 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeMk2 extends EntityGrenadeBase {
public class EntityGrenadeMk2 extends EntityGrenadeBouncyBase {
private static final String __OBFID = "CL_00001722";
@ -31,4 +33,14 @@ public class EntityGrenadeMk2 extends EntityGrenadeBase {
ExplosionLarge.explode(worldObj, posX, posY, posZ, 7.5F, true, false, false);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_mk2);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -5,12 +5,14 @@ import com.hbm.entity.logic.EntityNukeExplosionMK3;
import com.hbm.entity.logic.EntityNukeExplosionMK4;
import com.hbm.explosion.ExplosionParticle;
import com.hbm.explosion.ExplosionParticleB;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import com.hbm.main.MainRegistry;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeNuclear extends EntityGrenadeBase
public class EntityGrenadeNuclear extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -52,4 +54,14 @@ public class EntityGrenadeNuclear extends EntityGrenadeBase
}
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_nuclear);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,10 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadePlasma extends EntityGrenadeBase
public class EntityGrenadePlasma extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -33,4 +36,14 @@ public class EntityGrenadePlasma extends EntityGrenadeBase
ExplosionChaos.plasma(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 7 );
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_plasma);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,11 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadePoison extends EntityGrenadeBase
public class EntityGrenadePoison extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -36,4 +38,14 @@ public class EntityGrenadePoison extends EntityGrenadeBase
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_poison);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -2,11 +2,13 @@ package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadePulse extends EntityGrenadeBase {
public class EntityGrenadePulse extends EntityGrenadeBouncyBase {
private static final String __OBFID = "CL_00001722";
@ -35,4 +37,14 @@ public class EntityGrenadePulse extends EntityGrenadeBase {
ExplosionLarge.spawnShock(worldObj, posX, posY, posZ, 24, 2);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_pulse);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,11 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeSchrabidium extends EntityGrenadeBase
public class EntityGrenadeSchrabidium extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -35,4 +37,14 @@ public class EntityGrenadeSchrabidium extends EntityGrenadeBase
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_schrabidium);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -5,8 +5,10 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
public class EntityGrenadeShrapnel extends EntityGrenadeBase
public class EntityGrenadeShrapnel extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
public Entity shooter;
@ -38,4 +40,14 @@ public class EntityGrenadeShrapnel extends EntityGrenadeBase
}
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_shrapnel);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,11 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeStrong extends EntityGrenadeBase
public class EntityGrenadeStrong extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -33,4 +35,14 @@ public class EntityGrenadeStrong extends EntityGrenadeBase
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5.0F, true, false, false);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_strong);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,11 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeTau extends EntityGrenadeBase
public class EntityGrenadeTau extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -34,4 +36,14 @@ public class EntityGrenadeTau extends EntityGrenadeBase
ExplosionChaos.tauMeSinPi(this.worldObj, this.posX, this.posY, this.posZ, 100, this.getThrower(), this);
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_tau);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -1,11 +1,13 @@
package com.hbm.entity.grenade;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGrenade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityGrenadeZOMG extends EntityGrenadeBase
public class EntityGrenadeZOMG extends EntityGrenadeBouncyBase
{
private static final String __OBFID = "CL_00001722";
@ -34,4 +36,14 @@ public class EntityGrenadeZOMG extends EntityGrenadeBase
}
}
@Override
protected int getMaxTimer() {
return ItemGrenade.getFuseTicks(ModItems.grenade_tau);
}
@Override
protected double getBounceMod() {
return 0.25D;
}
}

View File

@ -198,6 +198,7 @@ public class EntityBullet extends Entity implements IProjectile {
this.setIsCritical(isTau != "chopper");
}
//why the living shit did i make isTau a string? who knows, who cares.
public EntityBullet(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax,
boolean instakill, String isTau, EntityGrenadeTau grenade) {
super(p_i1756_1_);

View File

@ -10,6 +10,7 @@ import com.hbm.entity.projectile.EntityRubble;
import com.hbm.entity.projectile.EntityShrapnel;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@ -202,6 +203,57 @@ public class ExplosionLarge {
spawnShrapnels(world, x, y, z, shrapnelFunction((int)strength));
}
public static void jolt(World world, double posX, double posY, double posZ, double strength, int count, double vel) {
for(int j = 0; j < count; j++) {
double phi = rand.nextDouble() * (Math.PI * 2);
double costheta = rand.nextDouble() * 2 - 1;
double theta = Math.acos(costheta);
double x = Math.sin( theta) * Math.cos( phi );
double y = Math.sin( theta) * Math.sin( phi );
double z = Math.cos( theta );
Vec3 vec = Vec3.createVectorHelper(x, y, z);
for(int i = 0; i < strength; i ++) {
double x0 = posX + (vec.xCoord * i);
double y0 = posY + (vec.yCoord * i);
double z0 = posZ + (vec.zCoord * i);
if(!world.isRemote) {
if(world.getBlock((int)x0, (int)y0, (int)z0).getMaterial().isLiquid()) {
world.setBlock((int)x0, (int)y0, (int)z0, Blocks.air);
}
if(world.getBlock((int)x0, (int)y0, (int)z0) != Blocks.air) {
if(world.getBlock((int)x0, (int)y0, (int)z0).getExplosionResistance(null) > 70)
continue;
EntityRubble rubble = new EntityRubble(world);
rubble.posX = x0 + 0.5F;
rubble.posY = y0 + 0.5F;
rubble.posZ = z0 + 0.5F;
rubble.setMetaBasedOnMat(world.getBlock((int)x0, (int)y0, (int)z0).getMaterial());
Vec3 vec4 = Vec3.createVectorHelper(posX - rubble.posX, posY - rubble.posY, posZ - rubble.posZ);
vec4.normalize();
rubble.motionX = vec4.xCoord * vel;
rubble.motionY = vec4.yCoord * vel;
rubble.motionZ = vec4.zCoord * vel;
world.spawnEntityInWorld(rubble);
world.setBlock((int)x0, (int)y0, (int)z0, Blocks.air);
break;
}
}
}
}
}
public static int cloudFunction(int i) {
//return (int)(345 * (1 - Math.pow(Math.E, -i/15)) + 15);
return (int)(545 * (1 - Math.pow(Math.E, -i/15)) + 15);

View File

@ -830,6 +830,20 @@ public class ModItems {
public static Item grenade_pink_cloud;
public static Item ullapool_caber;
public static Item grenade_if_generic;
public static Item grenade_if_he;
public static Item grenade_if_bouncy;
public static Item grenade_if_sticky;
public static Item grenade_if_impact;
public static Item grenade_if_incendiary;
public static Item grenade_if_toxic;
public static Item grenade_if_concussion;
public static Item grenade_if_brimstone;
public static Item grenade_if_mystery;
public static Item grenade_if_spark;
public static Item grenade_if_hopwire;
public static Item grenade_if_null;
public static Item grenade_smart;
public static Item grenade_mirv;
public static Item grenade_breach;
@ -2076,36 +2090,50 @@ public class ModItems {
gun_moist_nugget = new ItemNugget(3, false).setUnlocalizedName("gun_moist_nugget").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_moist_nugget");
gun_dampfmaschine = new GunDampfmaschine().setUnlocalizedName("gun_dampfmaschine").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_dampfmaschine");
grenade_generic = new ItemGrenade().setUnlocalizedName("grenade_generic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_generic");
grenade_strong = new ItemGrenade().setUnlocalizedName("grenade_strong").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_strong");
grenade_frag = new ItemGrenade().setUnlocalizedName("grenade_frag").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_frag_alt");
grenade_fire = new ItemGrenade().setUnlocalizedName("grenade_fire").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_fire_alt");
grenade_shrapnel = new ItemGrenade().setUnlocalizedName("grenade_shrapnel").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_shrapnel");
grenade_cluster = new ItemGrenade().setUnlocalizedName("grenade_cluster").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_cluster_alt");
grenade_flare = new ItemGrenade().setUnlocalizedName("grenade_flare").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_flare_alt");
grenade_electric = new ItemGrenade().setUnlocalizedName("grenade_electric").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_electric_alt");
grenade_poison = new ItemGrenade().setUnlocalizedName("grenade_poison").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_poison_alt");
grenade_gas = new ItemGrenade().setUnlocalizedName("grenade_gas").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_gas_alt");
grenade_pulse = new ItemGrenade().setUnlocalizedName("grenade_pulse").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_pulse");
grenade_plasma = new ItemGrenade().setUnlocalizedName("grenade_plasma").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_plasma_alt");
grenade_tau = new ItemGrenade().setUnlocalizedName("grenade_tau").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_tau_alt");
grenade_schrabidium = new ItemGrenade().setUnlocalizedName("grenade_schrabidium").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_schrabidium_alt");
grenade_lemon = new ItemGrenade().setUnlocalizedName("grenade_lemon").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_lemon");
grenade_gascan = new ItemGrenade().setUnlocalizedName("grenade_gascan").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_gascan");
grenade_mk2 = new ItemGrenade().setUnlocalizedName("grenade_mk2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mk2_alt");
grenade_aschrab = new ItemGrenade().setUnlocalizedName("grenade_aschrab").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_aschrab");
grenade_nuke = new ItemGrenade().setUnlocalizedName("grenade_nuke").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_nuke_alt");
grenade_nuclear = new ItemGrenade().setUnlocalizedName("grenade_nuclear").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_nuclear");
grenade_zomg = new ItemGrenade().setUnlocalizedName("grenade_zomg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_zomg");
grenade_black_hole = new ItemGrenade().setUnlocalizedName("grenade_black_hole").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_black_hole");
grenade_cloud = new ItemGrenade().setUnlocalizedName("grenade_cloud").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_cloud");
grenade_pink_cloud = new ItemGrenade().setUnlocalizedName("grenade_pink_cloud").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_pink_cloud");
grenade_generic = new ItemGrenade(4).setUnlocalizedName("grenade_generic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_generic");
grenade_strong = new ItemGrenade(5).setUnlocalizedName("grenade_strong").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_strong");
grenade_frag = new ItemGrenade(4).setUnlocalizedName("grenade_frag").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_frag_alt");
grenade_fire = new ItemGrenade(4).setUnlocalizedName("grenade_fire").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_fire_alt");
grenade_shrapnel = new ItemGrenade(4).setUnlocalizedName("grenade_shrapnel").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_shrapnel");
grenade_cluster = new ItemGrenade(5).setUnlocalizedName("grenade_cluster").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_cluster_alt");
grenade_flare = new ItemGrenade(0).setUnlocalizedName("grenade_flare").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_flare_alt");
grenade_electric = new ItemGrenade(5).setUnlocalizedName("grenade_electric").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_electric_alt");
grenade_poison = new ItemGrenade(4).setUnlocalizedName("grenade_poison").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_poison_alt");
grenade_gas = new ItemGrenade(4).setUnlocalizedName("grenade_gas").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_gas_alt");
grenade_pulse = new ItemGrenade(4).setUnlocalizedName("grenade_pulse").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_pulse");
grenade_plasma = new ItemGrenade(5).setUnlocalizedName("grenade_plasma").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_plasma_alt");
grenade_tau = new ItemGrenade(5).setUnlocalizedName("grenade_tau").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_tau_alt");
grenade_schrabidium = new ItemGrenade(7).setUnlocalizedName("grenade_schrabidium").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_schrabidium_alt");
grenade_lemon = new ItemGrenade(4).setUnlocalizedName("grenade_lemon").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_lemon");
grenade_gascan = new ItemGrenade(-1).setUnlocalizedName("grenade_gascan").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_gascan");
grenade_mk2 = new ItemGrenade(5).setUnlocalizedName("grenade_mk2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mk2_alt");
grenade_aschrab = new ItemGrenade(-1).setUnlocalizedName("grenade_aschrab").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_aschrab");
grenade_nuke = new ItemGrenade(-1).setUnlocalizedName("grenade_nuke").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_nuke_alt");
grenade_nuclear = new ItemGrenade(7).setUnlocalizedName("grenade_nuclear").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_nuclear");
grenade_zomg = new ItemGrenade(7).setUnlocalizedName("grenade_zomg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_zomg");
grenade_black_hole = new ItemGrenade(7).setUnlocalizedName("grenade_black_hole").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_black_hole");
grenade_cloud = new ItemGrenade(-1).setUnlocalizedName("grenade_cloud").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_cloud");
grenade_pink_cloud = new ItemGrenade(-1).setUnlocalizedName("grenade_pink_cloud").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_pink_cloud");
ullapool_caber = new WeaponSpecial(MainRegistry.enumToolMaterialSteel).setUnlocalizedName("ullapool_caber").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ullapool_caber");
grenade_smart = new ItemGrenade().setUnlocalizedName("grenade_smart").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_smart");
grenade_mirv = new ItemGrenade().setUnlocalizedName("grenade_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mirv");
grenade_breach = new ItemGrenade().setUnlocalizedName("grenade_breach").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_breach");
grenade_burst = new ItemGrenade().setUnlocalizedName("grenade_burst").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_burst");
grenade_if_generic = new ItemGrenade(4).setUnlocalizedName("grenade_if_generic").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_generic");
grenade_if_he = new ItemGrenade(5).setUnlocalizedName("grenade_if_he").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_he");
grenade_if_bouncy = new ItemGrenade(4).setUnlocalizedName("grenade_if_bouncy").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_bouncy");
grenade_if_sticky = new ItemGrenade(4).setUnlocalizedName("grenade_if_sticky").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_sticky");
grenade_if_impact = new ItemGrenade(-1).setUnlocalizedName("grenade_if_impact").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_impact");
grenade_if_incendiary = new ItemGrenade(4).setUnlocalizedName("grenade_if_incendiary").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_incendiary");
grenade_if_toxic = new ItemGrenade(4).setUnlocalizedName("grenade_if_toxic").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_toxic");
grenade_if_concussion = new ItemGrenade(4).setUnlocalizedName("grenade_if_concussion").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_concussion");
grenade_if_brimstone = new ItemGrenade(5).setUnlocalizedName("grenade_if_brimstone").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_brimstone");
grenade_if_mystery = new ItemGrenade(5).setUnlocalizedName("grenade_if_mystery").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_mystery");
grenade_if_spark = new ItemGrenade(5).setUnlocalizedName("grenade_if_spark").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_spark");
grenade_if_hopwire = new ItemGrenade(7).setUnlocalizedName("grenade_if_hopwire").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_hopwire");
grenade_if_null = new ItemGrenade(7).setUnlocalizedName("grenade_if_null").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_null");
grenade_smart = new ItemGrenade(-1).setUnlocalizedName("grenade_smart").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_smart");
grenade_mirv = new ItemGrenade(1).setUnlocalizedName("grenade_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mirv");
grenade_breach = new ItemGrenade(-1).setUnlocalizedName("grenade_breach").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_breach");
grenade_burst = new ItemGrenade(1).setUnlocalizedName("grenade_burst").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_burst");
weaponized_starblaster_cell = new WeaponizedCell().setUnlocalizedName("weaponized_starblaster_cell").setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b92_ammo_weaponized");
@ -3598,6 +3626,21 @@ public class ModItems {
GameRegistry.registerItem(grenade_nuclear, grenade_nuclear.getUnlocalizedName());
GameRegistry.registerItem(grenade_zomg, grenade_zomg.getUnlocalizedName());
GameRegistry.registerItem(grenade_black_hole, grenade_black_hole.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_generic, grenade_if_generic.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_he, grenade_if_he.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_bouncy, grenade_if_bouncy.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_sticky, grenade_if_sticky.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_impact, grenade_if_impact.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_incendiary, grenade_if_incendiary.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_toxic, grenade_if_toxic.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_concussion, grenade_if_concussion.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_brimstone, grenade_if_brimstone.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_mystery, grenade_if_mystery.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_spark, grenade_if_spark.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_hopwire, grenade_if_hopwire.getUnlocalizedName());
GameRegistry.registerItem(grenade_if_null, grenade_if_null.getUnlocalizedName());
GameRegistry.registerItem(ullapool_caber, ullapool_caber.getUnlocalizedName());
GameRegistry.registerItem(weaponized_starblaster_cell, weaponized_starblaster_cell.getUnlocalizedName());

View File

@ -1,5 +1,7 @@
package com.hbm.items.weapon;
import java.util.List;
import com.hbm.entity.grenade.EntityGrenadeASchrab;
import com.hbm.entity.grenade.EntityGrenadeBlackHole;
import com.hbm.entity.grenade.EntityGrenadeBreach;
@ -13,6 +15,19 @@ import com.hbm.entity.grenade.EntityGrenadeFrag;
import com.hbm.entity.grenade.EntityGrenadeGas;
import com.hbm.entity.grenade.EntityGrenadeGascan;
import com.hbm.entity.grenade.EntityGrenadeGeneric;
import com.hbm.entity.grenade.EntityGrenadeIFBouncy;
import com.hbm.entity.grenade.EntityGrenadeIFBrimstone;
import com.hbm.entity.grenade.EntityGrenadeIFConcussion;
import com.hbm.entity.grenade.EntityGrenadeIFGeneric;
import com.hbm.entity.grenade.EntityGrenadeIFHE;
import com.hbm.entity.grenade.EntityGrenadeIFHopwire;
import com.hbm.entity.grenade.EntityGrenadeIFImpact;
import com.hbm.entity.grenade.EntityGrenadeIFIncendiary;
import com.hbm.entity.grenade.EntityGrenadeIFMystery;
import com.hbm.entity.grenade.EntityGrenadeIFNull;
import com.hbm.entity.grenade.EntityGrenadeIFSpark;
import com.hbm.entity.grenade.EntityGrenadeIFSticky;
import com.hbm.entity.grenade.EntityGrenadeIFToxic;
import com.hbm.entity.grenade.EntityGrenadeLemon;
import com.hbm.entity.grenade.EntityGrenadeMIRV;
import com.hbm.entity.grenade.EntityGrenadeMk2;
@ -38,8 +53,11 @@ import net.minecraft.world.World;
public class ItemGrenade extends Item {
public ItemGrenade() {
public int fuse = 4;
public ItemGrenade(int fuse) {
this.maxStackSize = 16;
this.fuse = fuse;
}
@Override
@ -139,6 +157,46 @@ public class ItemGrenade extends Item {
if (this == ModItems.grenade_burst) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeBurst(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_generic) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFGeneric(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_he) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFHE(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_bouncy) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFBouncy(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_sticky) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFSticky(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_impact) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFImpact(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_incendiary) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFIncendiary(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_toxic) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFToxic(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_concussion) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFConcussion(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_brimstone) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFBrimstone(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_mystery) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFMystery(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_spark) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFSpark(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_hopwire) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFHopwire(p_77659_2_, p_77659_3_));
}
if (this == ModItems.grenade_if_null) {
p_77659_2_.spawnEntityInWorld(new EntityGrenadeIFNull(p_77659_2_, p_77659_3_));
}
}
return p_77659_1_;
@ -162,4 +220,24 @@ public class ItemGrenade extends Item {
return EnumRarity.common;
}
private String translateFuse() {
if(fuse == -1)
return "Impact";
if(fuse == 0)
return "Instant";
return fuse + "s";
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add("Fuse: " + translateFuse());
}
public static int getFuseTicks(Item grenade) {
return ((ItemGrenade)grenade).fuse * 20;
}
}

View File

@ -147,6 +147,19 @@ public class ClientProxy extends ServerProxy
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeMIRV.class, new RenderSnowball(ModItems.grenade_mirv));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeBreach.class, new RenderSnowball(ModItems.grenade_breach));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeBurst.class, new RenderSnowball(ModItems.grenade_burst));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFGeneric.class, new RenderSnowball(ModItems.grenade_if_generic));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFHE.class, new RenderSnowball(ModItems.grenade_if_he));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFBouncy.class, new RenderSnowball(ModItems.grenade_if_bouncy));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFSticky.class, new RenderSnowball(ModItems.grenade_if_sticky));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFImpact.class, new RenderSnowball(ModItems.grenade_if_impact));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFIncendiary.class, new RenderSnowball(ModItems.grenade_if_incendiary));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFToxic.class, new RenderSnowball(ModItems.grenade_if_toxic));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFConcussion.class, new RenderSnowball(ModItems.grenade_if_concussion));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFBrimstone.class, new RenderSnowball(ModItems.grenade_if_brimstone));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFMystery.class, new RenderSnowball(ModItems.grenade_if_mystery));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFSpark.class, new RenderSnowball(ModItems.grenade_if_spark));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFHopwire.class, new RenderSnowball(ModItems.grenade_if_hopwire));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeIFNull.class, new RenderSnowball(ModItems.grenade_if_null));
RenderingRegistry.registerEntityRenderingHandler(EntitySchrab.class, new RenderFlare());

View File

@ -77,6 +77,19 @@ import com.hbm.entity.grenade.EntityGrenadeFrag;
import com.hbm.entity.grenade.EntityGrenadeGas;
import com.hbm.entity.grenade.EntityGrenadeGascan;
import com.hbm.entity.grenade.EntityGrenadeGeneric;
import com.hbm.entity.grenade.EntityGrenadeIFBouncy;
import com.hbm.entity.grenade.EntityGrenadeIFBrimstone;
import com.hbm.entity.grenade.EntityGrenadeIFConcussion;
import com.hbm.entity.grenade.EntityGrenadeIFGeneric;
import com.hbm.entity.grenade.EntityGrenadeIFHE;
import com.hbm.entity.grenade.EntityGrenadeIFHopwire;
import com.hbm.entity.grenade.EntityGrenadeIFImpact;
import com.hbm.entity.grenade.EntityGrenadeIFIncendiary;
import com.hbm.entity.grenade.EntityGrenadeIFMystery;
import com.hbm.entity.grenade.EntityGrenadeIFNull;
import com.hbm.entity.grenade.EntityGrenadeIFSpark;
import com.hbm.entity.grenade.EntityGrenadeIFSticky;
import com.hbm.entity.grenade.EntityGrenadeIFToxic;
import com.hbm.entity.grenade.EntityGrenadeLemon;
import com.hbm.entity.grenade.EntityGrenadeMIRV;
import com.hbm.entity.grenade.EntityGrenadeMk2;
@ -536,6 +549,7 @@ public class MainRegistry
@EventHandler
public void PreLoad(FMLPreInitializationEvent PreEvent)
{
if(logger == null)
logger = PreEvent.getModLog();
//Reroll Polaroid
@ -822,6 +836,19 @@ public class MainRegistry
EntityRegistry.registerModEntity(EntityGrenadeBreach.class, "entity_grenade_breach", 114, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeBurst.class, "entity_grenade_burst", 115, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityBurningFOEQ.class, "entity_burning_foeq", 116, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFGeneric.class, "entity_grenade_ironshod", 117, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFHE.class, "entity_grenade_ironshod", 118, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFBouncy.class, "entity_grenade_ironshod", 119, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFSticky.class, "entity_grenade_ironshod", 120, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFImpact.class, "entity_grenade_ironshod", 121, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFIncendiary.class, "entity_grenade_ironshod", 122, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFToxic.class, "entity_grenade_ironshod", 123, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFConcussion.class, "entity_grenade_ironshod", 124, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFBrimstone.class, "entity_grenade_ironshod", 125, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFMystery.class, "entity_grenade_ironshod", 126, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFSpark.class, "entity_grenade_ironshod", 127, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFHopwire.class, "entity_grenade_ironshod", 128, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeIFNull.class, "entity_grenade_ironshod", 129, this, 250, 1, true);
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd);
@ -1036,6 +1063,97 @@ public class MainRegistry
{
return new EntityGrenadeBurst(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_generic, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFGeneric(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_he, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFHE(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_bouncy, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFBouncy(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_sticky, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFSticky(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_impact, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFImpact(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_incendiary, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFIncendiary(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_toxic, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFToxic(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_concussion, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFConcussion(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_brimstone, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFBrimstone(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_mystery, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFMystery(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_spark, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFSpark(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_hopwire, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFHopwire(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_null, new BehaviorProjectileDispense() {
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
{
return new EntityGrenadeIFNull(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
}
});
}
@ -1408,6 +1526,9 @@ public class MainRegistry
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
if(logger == null)
logger = event.getModLog();
FMLCommonHandler.instance().bus().register(new ModEventHandler());
MinecraftForge.EVENT_BUS.register(new ModEventHandler());
MinecraftForge.TERRAIN_GEN_BUS.register(new ModEventHandler());

View File

@ -6,7 +6,7 @@ import java.util.Random;
import com.hbm.entity.effect.EntityBlackHole;
import com.hbm.entity.effect.EntityCloudFleija;
import com.hbm.entity.logic.EntityNukeExplosionAdvanced;
import com.hbm.entity.logic.EntityNukeExplosionMK3;
import com.hbm.entity.logic.EntityNukeExplosionMK4;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge;
@ -281,7 +281,7 @@ public class TileEntityMachineCyclotron extends TileEntity implements ISidedInve
}
if(i == 2) {
EntityNukeExplosionAdvanced entity = new EntityNukeExplosionAdvanced(worldObj);
EntityNukeExplosionMK3 entity = new EntityNukeExplosionMK3(worldObj);
entity.posX = this.xCoord;
entity.posY = this.yCoord;
entity.posZ = this.zCoord;