ZOMG
@ -12,6 +12,8 @@ death.attack.euthanizedSelf2=%1$s gewinnt den Darwin Award.
|
||||
death.attack.tau=%1$s wurde von %2$s mit negativ geladenen Tauonen durchsiebt.
|
||||
death.attack.tauBlast=%1$s lud die XVL1456 zu lange auf und wurde in Stücke gerissen.
|
||||
death.attack.chopperBullet=%1$s wurde von %2$s gerekt.
|
||||
death.attack.cmb=%1$s wurde von %2$s pulverisiert.
|
||||
death.attack.subAtomic=%1$s's Atome wurden von %2$s vernichtet.
|
||||
|
||||
item.redstone_sword.name=Redstoneschwert
|
||||
item.big_sword.name=Großes Schwert
|
||||
@ -297,6 +299,8 @@ item.cell_deuterium.name=Deuteriumzelle
|
||||
item.cell_tritium.name=Tritiumzelle
|
||||
item.cell_sas3.name=Schrabidiumtrisulfat-Zelle
|
||||
item.cell_anti_schrabidium.name=Antischrabidiumzelle
|
||||
item.singularity.name=Singularität
|
||||
item.singularity_counter_resonant.name=Eingefasste nicht-resonante Singularität
|
||||
|
||||
item.inf_water.name=Unendlicher Wassertank
|
||||
item.inf_deuterium.name=Unendlicher Deuteriumtank
|
||||
|
||||
@ -12,6 +12,8 @@ death.attack.euthanizedSelf2=%1$s wins the Darwin Award.
|
||||
death.attack.tau=%1$s was riddeled by %2$s using negatively charged tauons.
|
||||
death.attack.tauBlast=%1$s charged the XVL1456 for too long and was blown into pieces.
|
||||
death.attack.chopperBullet=%1$s was rekt by %2$s.
|
||||
death.attack.cmb=%1$s was fizzeled by %2$s.
|
||||
death.attack.subAtomic=%1$s's atoms were annihilated by %2$s.
|
||||
|
||||
item.redstone_sword.name=Redstone Sword
|
||||
item.big_sword.name=Great Sword
|
||||
@ -297,6 +299,8 @@ item.cell_deuterium.name=Deuterium Cell
|
||||
item.cell_tritium.name=Tritium Cell
|
||||
item.cell_sas3.name=Schrabidium Trisulfide Cell
|
||||
item.cell_anti_schrabidium.name=Antischrabidium Cell
|
||||
item.singularity.name=Singularity
|
||||
item.singularity_counter_resonant.name=Contained Counter-Resonant Singularity
|
||||
|
||||
item.inf_water.name=Infinite Water Tank
|
||||
item.inf_deuterium.name=Infinite Deuterium Tank
|
||||
|
||||
BIN
assets/hbm/textures/items/energy_ball.png
Normal file
|
After Width: | Height: | Size: 765 B |
3
assets/hbm/textures/items/energy_ball.png.mcmeta
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"animation": {}
|
||||
}
|
||||
BIN
assets/hbm/textures/items/grenade_lemon.png
Normal file
|
After Width: | Height: | Size: 336 B |
BIN
assets/hbm/textures/items/gun_zomg.png
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
assets/hbm/textures/items/lemon.png
Normal file
|
After Width: | Height: | Size: 284 B |
BIN
assets/hbm/textures/items/singularity.png
Normal file
|
After Width: | Height: | Size: 365 B |
BIN
assets/hbm/textures/items/singularity_alt.png
Normal file
|
After Width: | Height: | Size: 348 B |
BIN
assets/hbm/textures/models/Rainbow.png
Normal file
|
After Width: | Height: | Size: 251 B |
@ -424,8 +424,7 @@ public class EntityBullet extends Entity implements IProjectile {
|
||||
movingobjectposition.entityHit.setFire(5);
|
||||
}
|
||||
|
||||
if (movingobjectposition.entityHit.attackEntityFrom(damagesource,
|
||||
/* (float)k */(float) damage)) {
|
||||
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float) damage)) {
|
||||
if (movingobjectposition.entityHit instanceof EntityLivingBase) {
|
||||
EntityLivingBase entitylivingbase = (EntityLivingBase) movingobjectposition.entityHit;
|
||||
|
||||
@ -465,7 +464,8 @@ public class EntityBullet extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
if (!this.getIsCritical())
|
||||
this.setDead();
|
||||
//this.setDead();
|
||||
;
|
||||
}
|
||||
} else if (!this.getIsCritical()) {
|
||||
/*this.motionX *= -0.10000000149011612D;
|
||||
@ -474,7 +474,7 @@ public class EntityBullet extends Entity implements IProjectile {
|
||||
this.rotationYaw += 180.0F;
|
||||
this.prevRotationYaw += 180.0F;
|
||||
this.ticksInAir = 0;*/
|
||||
this.setDead();
|
||||
//this.setDead();
|
||||
}
|
||||
}
|
||||
} else if (!this.getIsCritical()) {
|
||||
|
||||
572
com/hbm/entity/EntityCombineBall.java
Normal file
@ -0,0 +1,572 @@
|
||||
package com.hbm.entity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.play.server.S2BPacketChangeGameState;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCombineBall extends Entity implements IProjectile
|
||||
{
|
||||
private int field_145791_d = -1;
|
||||
private int field_145792_e = -1;
|
||||
private int field_145789_f = -1;
|
||||
public double gravity = 0.0D;
|
||||
private Block field_145790_g;
|
||||
private int inData;
|
||||
private boolean inGround;
|
||||
/** 1 if the player can pick up the arrow */
|
||||
public int canBePickedUp;
|
||||
/** Seems to be some sort of timer for animating an arrow. */
|
||||
public int arrowShake;
|
||||
/** The owner of this arrow. */
|
||||
public Entity shootingEntity;
|
||||
private int ticksInGround;
|
||||
private int ticksInAir;
|
||||
private double damage = 2.0D;
|
||||
/** The amount of knockback an arrow applies when it hits a mob. */
|
||||
private int knockbackStrength;
|
||||
private static final String __OBFID = "CL_00001715";
|
||||
|
||||
|
||||
public EntityCombineBall(World p_i1753_1_)
|
||||
{
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityCombineBall(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_)
|
||||
{
|
||||
super(p_i1754_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_);
|
||||
this.yOffset = 0.0F;
|
||||
}
|
||||
|
||||
public EntityCombineBall(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
|
||||
{
|
||||
super(p_i1755_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1755_2_;
|
||||
|
||||
if (p_i1755_2_ instanceof EntityPlayer)
|
||||
{
|
||||
this.canBePickedUp = 1;
|
||||
}
|
||||
|
||||
this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D;
|
||||
double d0 = p_i1755_3_.posX - p_i1755_2_.posX;
|
||||
double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY;
|
||||
double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ;
|
||||
double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
|
||||
|
||||
if (d3 >= 1.0E-7D)
|
||||
{
|
||||
float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
|
||||
float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
|
||||
double d4 = d0 / d3;
|
||||
double d5 = d2 / d3;
|
||||
this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3);
|
||||
this.yOffset = 0.0F;
|
||||
float f4 = (float)d3 * 0.2F;
|
||||
this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityCombineBall(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_)
|
||||
{
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
if (p_i1756_2_ instanceof EntityPlayer)
|
||||
{
|
||||
this.canBePickedUp = 1;
|
||||
}
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch);
|
||||
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
|
||||
this.posY -= 0.10000000149011612D;
|
||||
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.yOffset = 0.0F;
|
||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
|
||||
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
public EntityCombineBall(World world, int x, int y, int z, double mx, double my, double mz, double grav) {
|
||||
super(world);
|
||||
this.posX = x + 0.5F;
|
||||
this.posY = y + 0.5F;
|
||||
this.posZ = z + 0.5F;
|
||||
|
||||
this.motionX = mx;
|
||||
this.motionY = my;
|
||||
this.motionZ = mz;
|
||||
|
||||
this.gravity = grav;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
|
||||
*/
|
||||
@Override
|
||||
public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_)
|
||||
{
|
||||
float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_);
|
||||
p_70186_1_ /= f2;
|
||||
p_70186_3_ /= f2;
|
||||
p_70186_5_ /= f2;
|
||||
p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
|
||||
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
|
||||
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
|
||||
p_70186_1_ *= p_70186_7_;
|
||||
p_70186_3_ *= p_70186_7_;
|
||||
p_70186_5_ *= p_70186_7_;
|
||||
this.motionX = p_70186_1_;
|
||||
this.motionY = p_70186_3_;
|
||||
this.motionZ = p_70186_5_;
|
||||
float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
||||
* posY, posZ, yaw, pitch
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_)
|
||||
{
|
||||
this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
|
||||
this.setRotation(p_70056_7_, p_70056_8_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the velocity to the args. Args: x, y, z
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
|
||||
{
|
||||
this.motionX = p_70016_1_;
|
||||
this.motionY = p_70016_3_;
|
||||
this.motionZ = p_70016_5_;
|
||||
|
||||
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
||||
{
|
||||
float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch;
|
||||
this.prevRotationYaw = this.rotationYaw;
|
||||
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
//@Override
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
||||
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
||||
{
|
||||
float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
//this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
|
||||
}
|
||||
|
||||
Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
|
||||
if (block.getMaterial() != Material.air)
|
||||
{
|
||||
block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
|
||||
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))
|
||||
{
|
||||
this.inGround = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.arrowShake > 0)
|
||||
{
|
||||
--this.arrowShake;
|
||||
}
|
||||
|
||||
if (this.inGround)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
else
|
||||
{
|
||||
++this.ticksInAir;
|
||||
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
|
||||
vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
double d0 = 0.0D;
|
||||
int i;
|
||||
float f1;
|
||||
|
||||
for (i = 0; i < list.size(); ++i)
|
||||
{
|
||||
Entity entity1 = (Entity)list.get(i);
|
||||
|
||||
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
|
||||
{
|
||||
f1 = 0.3F;
|
||||
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);
|
||||
|
||||
if (movingobjectposition1 != null)
|
||||
{
|
||||
double d1 = vec31.distanceTo(movingobjectposition1.hitVec);
|
||||
|
||||
if (d1 < d0 || d0 == 0.0D)
|
||||
{
|
||||
entity = entity1;
|
||||
d0 = d1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
movingobjectposition = new MovingObjectPosition(entity);
|
||||
}
|
||||
|
||||
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
|
||||
|
||||
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))
|
||||
{
|
||||
movingobjectposition = null;
|
||||
}
|
||||
}
|
||||
|
||||
float f2;
|
||||
float f4;
|
||||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
if (movingobjectposition.entityHit != null)
|
||||
{
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||
int k = MathHelper.ceiling_double_int(f2 * this.damage);
|
||||
|
||||
if (this.getIsCritical())
|
||||
{
|
||||
k += this.rand.nextInt(k / 2 + 2);
|
||||
}
|
||||
|
||||
DamageSource damagesource = null;
|
||||
|
||||
if (this.shootingEntity == null)
|
||||
{
|
||||
damagesource = DamageSource.generic;
|
||||
}
|
||||
else
|
||||
{
|
||||
damagesource = ModDamageSource.causeCombineDamage(this, this);
|
||||
}
|
||||
|
||||
if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman))
|
||||
{
|
||||
movingobjectposition.entityHit.setFire(5);
|
||||
}
|
||||
|
||||
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, k))
|
||||
{
|
||||
if (movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit;
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1);
|
||||
}
|
||||
|
||||
if (this.knockbackStrength > 0)
|
||||
{
|
||||
f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
|
||||
if (f4 > 0.0F)
|
||||
{
|
||||
movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase)
|
||||
{
|
||||
EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);
|
||||
EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);
|
||||
}
|
||||
|
||||
if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
|
||||
{
|
||||
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F));
|
||||
}
|
||||
}
|
||||
|
||||
if (!(movingobjectposition.entityHit instanceof EntityEnderman))
|
||||
{
|
||||
if (!this.worldObj.isRemote && movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
movingobjectposition.entityHit.attackEntityFrom(damagesource, 1000F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.field_145791_d = movingobjectposition.blockX;
|
||||
this.field_145792_e = movingobjectposition.blockY;
|
||||
this.field_145789_f = movingobjectposition.blockZ;
|
||||
this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
this.motionX = ((float)(movingobjectposition.hitVec.xCoord - this.posX));
|
||||
this.motionY = ((float)(movingobjectposition.hitVec.yCoord - this.posY));
|
||||
this.motionZ = ((float)(movingobjectposition.hitVec.zCoord - this.posZ));
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||
this.posX -= this.motionX / f2 * 0.05000000074505806D;
|
||||
this.posY -= this.motionY / f2 * 0.05000000074505806D;
|
||||
this.posZ -= this.motionZ / f2 * 0.05000000074505806D;
|
||||
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
|
||||
this.inGround = true;
|
||||
this.arrowShake = 7;
|
||||
this.setIsCritical(false);
|
||||
|
||||
if (this.field_145790_g.getMaterial() != Material.air)
|
||||
{
|
||||
this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
float f3 = 0.99F;
|
||||
f1 = 0.05F;
|
||||
|
||||
if (this.isInWater())
|
||||
{
|
||||
for (int l = 0; l < 4; ++l)
|
||||
{
|
||||
f4 = 0.25F;
|
||||
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f4, this.posY - this.motionY * f4, this.posZ - this.motionZ * f4, this.motionX, this.motionY, this.motionZ);
|
||||
}
|
||||
|
||||
f3 = 0.8F;
|
||||
}
|
||||
|
||||
if (this.isWet())
|
||||
{
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.motionX *= f3;
|
||||
this.motionY *= f3;
|
||||
this.motionZ *= f3;
|
||||
this.motionY -= gravity;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.func_145775_I();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
|
||||
{
|
||||
p_70014_1_.setShort("xTile", (short)this.field_145791_d);
|
||||
p_70014_1_.setShort("yTile", (short)this.field_145792_e);
|
||||
p_70014_1_.setShort("zTile", (short)this.field_145789_f);
|
||||
p_70014_1_.setShort("life", (short)this.ticksInGround);
|
||||
p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g));
|
||||
p_70014_1_.setByte("inData", (byte)this.inData);
|
||||
p_70014_1_.setByte("shake", (byte)this.arrowShake);
|
||||
p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0));
|
||||
p_70014_1_.setByte("pickup", (byte)this.canBePickedUp);
|
||||
p_70014_1_.setDouble("damage", this.damage);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
|
||||
{
|
||||
this.field_145791_d = p_70037_1_.getShort("xTile");
|
||||
this.field_145792_e = p_70037_1_.getShort("yTile");
|
||||
this.field_145789_f = p_70037_1_.getShort("zTile");
|
||||
this.ticksInGround = p_70037_1_.getShort("life");
|
||||
this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255);
|
||||
this.inData = p_70037_1_.getByte("inData") & 255;
|
||||
this.arrowShake = p_70037_1_.getByte("shake") & 255;
|
||||
this.inGround = p_70037_1_.getByte("inGround") == 1;
|
||||
|
||||
if (p_70037_1_.hasKey("damage", 99))
|
||||
{
|
||||
this.damage = p_70037_1_.getDouble("damage");
|
||||
}
|
||||
|
||||
if (p_70037_1_.hasKey("pickup", 99))
|
||||
{
|
||||
this.canBePickedUp = p_70037_1_.getByte("pickup");
|
||||
}
|
||||
else if (p_70037_1_.hasKey("player", 99))
|
||||
{
|
||||
this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by a player entity when they collide with an entity
|
||||
*/
|
||||
@Override
|
||||
public void onCollideWithPlayer(EntityPlayer p_70100_1_)
|
||||
{
|
||||
if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
|
||||
{
|
||||
boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && p_70100_1_.capabilities.isCreativeMode;
|
||||
|
||||
if (this.canBePickedUp == 1 && !p_70100_1_.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_rpg_ammo, 1)))
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
p_70100_1_.onItemPickup(this, 1);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
|
||||
* prevent them from trampling crops
|
||||
*/
|
||||
@Override
|
||||
protected boolean canTriggerWalking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public void setDamage(double p_70239_1_)
|
||||
{
|
||||
this.damage = p_70239_1_;
|
||||
}
|
||||
|
||||
public double getDamage()
|
||||
{
|
||||
return this.damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the amount of knockback the arrow applies when it hits a mob.
|
||||
*/
|
||||
public void setKnockbackStrength(int p_70240_1_)
|
||||
{
|
||||
this.knockbackStrength = p_70240_1_;
|
||||
}
|
||||
|
||||
/**
|
||||
* If returns false, the item will not inflict any damage against entities.
|
||||
*/
|
||||
@Override
|
||||
public boolean canAttackWithItem()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the arrow has a stream of critical hit particles flying behind it.
|
||||
*/
|
||||
public void setIsCritical(boolean p_70243_1_)
|
||||
{
|
||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||
|
||||
if (p_70243_1_)
|
||||
{
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the arrow has a stream of critical hit particles flying behind it.
|
||||
*/
|
||||
public boolean getIsCritical()
|
||||
{
|
||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||
return (b0 & 1) != 0;
|
||||
}
|
||||
}
|
||||
54
com/hbm/entity/EntityGrenadeLemon.java
Normal file
@ -0,0 +1,54 @@
|
||||
package com.hbm.entity;
|
||||
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.EntityBlaze;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeLemon extends EntityThrowable
|
||||
{
|
||||
private static final String __OBFID = "CL_00001722";
|
||||
|
||||
public EntityGrenadeLemon(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeLemon(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeLemon(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
|
||||
protected void onImpact(MovingObjectPosition p_70184_1_)
|
||||
{
|
||||
if (p_70184_1_.entityHit != null)
|
||||
{
|
||||
byte b0 = 0;
|
||||
|
||||
if (p_70184_1_.entityHit instanceof EntityBlaze)
|
||||
{
|
||||
b0 = 3;
|
||||
}
|
||||
|
||||
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
this.worldObj.newExplosion((Entity)null, (float)this.posX, (float)this.posY, (float)this.posZ, 5.0F, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -93,8 +93,8 @@ public class EntityHunterChopper extends EntityFlying implements IMob, IBossDisp
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte) 0));
|
||||
this.dataWatcher.addObject(17, Float.valueOf((float) 0));
|
||||
this.dataWatcher.addObject(18, Float.valueOf((float) 0));
|
||||
this.dataWatcher.addObject(21, Float.valueOf((float) 0));
|
||||
this.dataWatcher.addObject(22, Float.valueOf((float) 0));
|
||||
}
|
||||
|
||||
protected void applyEntityAttributes() {
|
||||
@ -274,20 +274,18 @@ public class EntityHunterChopper extends EntityFlying implements IMob, IBossDisp
|
||||
this.prevRotationYaw = this.rotationYaw -= 10;
|
||||
if (this.rotationYaw - (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI) <= -10)
|
||||
this.prevRotationYaw = this.rotationYaw += 10;
|
||||
if (this.rotationYaw - (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI) < 10
|
||||
&& this.rotationYaw - (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI) > 10)
|
||||
this.prevRotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
if (this.rotationYaw - (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI) < 10 && this.rotationYaw - (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI) > 10)
|
||||
this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, f3) * 180.0D / Math.PI);
|
||||
} else {
|
||||
float f3 = MathHelper.sqrt_double((this.posX - targetedEntity.posX) * (this.posX - targetedEntity.posX)
|
||||
+ (this.posZ - targetedEntity.posZ) * (this.posZ - targetedEntity.posZ));
|
||||
float f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
if (this.rotationYaw - (float) (Math.atan2(this.posX - targetedEntity.posX, this.posZ - targetedEntity.posZ) * 180.0D / Math.PI) >= 10)
|
||||
this.prevRotationYaw = this.rotationYaw -= 10;
|
||||
if (this.rotationYaw
|
||||
- (float) (Math.atan2(this.posX - targetedEntity.posX, this.posZ - targetedEntity.posZ) * 180.0D / Math.PI) <= -10)
|
||||
if (this.rotationYaw - (float) (Math.atan2(this.posX - targetedEntity.posX, this.posZ - targetedEntity.posZ) * 180.0D / Math.PI) <= -10)
|
||||
this.prevRotationYaw = this.rotationYaw += 10;
|
||||
if (this.rotationYaw - (float) (Math.atan2(this.posX - targetedEntity.posX, this.posZ - targetedEntity.posZ) * 180.0D / Math.PI) < 10 && this.rotationYaw - (float) (Math.atan2(this.posX - targetedEntity.posX, this.posZ - targetedEntity.posZ) * 180.0D / Math.PI) > 10)
|
||||
this.rotationYaw = (float) (Math.atan2(this.posX - targetedEntity.posX, this.posZ - targetedEntity.posZ) * 180.0D / Math.PI);
|
||||
this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.posX - targetedEntity.posX, this.posZ - targetedEntity.posZ) * 180.0D / Math.PI);
|
||||
|
||||
this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, f3) * 180.0D / Math.PI);
|
||||
|
||||
double d8 = 2.0D;
|
||||
@ -432,18 +430,18 @@ public class EntityHunterChopper extends EntityFlying implements IMob, IBossDisp
|
||||
}
|
||||
|
||||
public void setYaw(float f) {
|
||||
this.dataWatcher.updateObject(17, Float.valueOf((float) f));
|
||||
this.dataWatcher.updateObject(21, Float.valueOf((float) f));
|
||||
}
|
||||
|
||||
public void setPitch(float f) {
|
||||
this.dataWatcher.updateObject(18, Float.valueOf((float) f));
|
||||
this.dataWatcher.updateObject(22, Float.valueOf((float) f));
|
||||
}
|
||||
|
||||
public float getYaw() {
|
||||
return this.dataWatcher.getWatchableObjectFloat(17);
|
||||
return this.dataWatcher.getWatchableObjectFloat(21);
|
||||
}
|
||||
|
||||
public float getPitch() {
|
||||
return this.dataWatcher.getWatchableObjectFloat(18);
|
||||
return this.dataWatcher.getWatchableObjectFloat(22);
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ public class EntityNukeExplosionAdvanced extends Entity {
|
||||
public ExplosionFleija expl;
|
||||
public int speed = 1;
|
||||
public float coefficient = 1;
|
||||
public float coefficient2 = 1;
|
||||
public boolean did = false;
|
||||
public boolean waste = true;
|
||||
|
||||
@ -43,7 +44,7 @@ public class EntityNukeExplosionAdvanced extends Entity {
|
||||
wst = new ExplosionNukeAdvanced((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, (int)(this.destructionRange * 1.8), this.coefficient, 2);
|
||||
vap = new ExplosionNukeAdvanced((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, (int)(this.destructionRange * 2.5), this.coefficient, 1);
|
||||
} else {
|
||||
expl = new ExplosionFleija((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, this.destructionRange, this.coefficient);
|
||||
expl = new ExplosionFleija((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, this.destructionRange, this.coefficient, this.coefficient2);
|
||||
}
|
||||
|
||||
this.did = true;
|
||||
|
||||
532
com/hbm/entity/EntityRainbow.java
Normal file
@ -0,0 +1,532 @@
|
||||
package com.hbm.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.play.server.S2BPacketChangeGameState;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityRainbow extends Entity implements IProjectile
|
||||
{
|
||||
private int field_145791_d = -1;
|
||||
private int field_145792_e = -1;
|
||||
private int field_145789_f = -1;
|
||||
public double gravity = 0.0D;
|
||||
private Block field_145790_g;
|
||||
private int inData;
|
||||
private boolean inGround;
|
||||
/** 1 if the player can pick up the arrow */
|
||||
public int canBePickedUp;
|
||||
/** Seems to be some sort of timer for animating an arrow. */
|
||||
public int arrowShake;
|
||||
/** The owner of this arrow. */
|
||||
public Entity shootingEntity;
|
||||
private int ticksInGround;
|
||||
private int ticksInAir;
|
||||
private double damage = 2.0D;
|
||||
/** The amount of knockback an arrow applies when it hits a mob. */
|
||||
private int knockbackStrength;
|
||||
private static final String __OBFID = "CL_00001715";
|
||||
|
||||
|
||||
public EntityRainbow(World p_i1753_1_)
|
||||
{
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityRainbow(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_)
|
||||
{
|
||||
super(p_i1754_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_);
|
||||
this.yOffset = 0.0F;
|
||||
}
|
||||
|
||||
public EntityRainbow(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
|
||||
{
|
||||
super(p_i1755_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1755_2_;
|
||||
|
||||
if (p_i1755_2_ instanceof EntityPlayer)
|
||||
{
|
||||
this.canBePickedUp = 1;
|
||||
}
|
||||
|
||||
this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D;
|
||||
double d0 = p_i1755_3_.posX - p_i1755_2_.posX;
|
||||
double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY;
|
||||
double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ;
|
||||
double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
|
||||
|
||||
if (d3 >= 1.0E-7D)
|
||||
{
|
||||
float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
|
||||
float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
|
||||
double d4 = d0 / d3;
|
||||
double d5 = d2 / d3;
|
||||
this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3);
|
||||
this.yOffset = 0.0F;
|
||||
float f4 = (float)d3 * 0.2F;
|
||||
this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityRainbow(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_)
|
||||
{
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch);
|
||||
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
|
||||
this.posY -= 0.10000000149011612D;
|
||||
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.yOffset = 0.0F;
|
||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
|
||||
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
public EntityRainbow(World world, int x, int y, int z, double mx, double my, double mz, double grav) {
|
||||
super(world);
|
||||
this.posX = x + 0.5F;
|
||||
this.posY = y + 0.5F;
|
||||
this.posZ = z + 0.5F;
|
||||
|
||||
this.motionX = mx;
|
||||
this.motionY = my;
|
||||
this.motionZ = mz;
|
||||
|
||||
this.gravity = grav;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
||||
this.dataWatcher.addObject(20, Byte.valueOf((byte)0));
|
||||
this.dataWatcher.addObject(21, Byte.valueOf((byte)0));
|
||||
this.dataWatcher.addObject(22, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
|
||||
*/
|
||||
@Override
|
||||
public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_)
|
||||
{
|
||||
float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_);
|
||||
p_70186_1_ /= f2;
|
||||
p_70186_3_ /= f2;
|
||||
p_70186_5_ /= f2;
|
||||
p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.054499999832361937D * p_70186_8_;
|
||||
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.054499999832361937D * p_70186_8_;
|
||||
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.054499999832361937D * p_70186_8_;
|
||||
p_70186_1_ *= p_70186_7_;
|
||||
p_70186_3_ *= p_70186_7_;
|
||||
p_70186_5_ *= p_70186_7_;
|
||||
this.motionX = p_70186_1_;
|
||||
this.motionY = p_70186_3_;
|
||||
this.motionZ = p_70186_5_;
|
||||
float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI);
|
||||
this.ticksInGround = 0;
|
||||
this.randomizeColor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
||||
* posY, posZ, yaw, pitch
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_)
|
||||
{
|
||||
this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
|
||||
this.setRotation(p_70056_7_, p_70056_8_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the velocity to the args. Args: x, y, z
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
|
||||
{
|
||||
this.motionX = p_70016_1_;
|
||||
this.motionY = p_70016_3_;
|
||||
this.motionZ = p_70016_5_;
|
||||
|
||||
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
||||
{
|
||||
float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch;
|
||||
this.prevRotationYaw = this.rotationYaw;
|
||||
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
//@Override
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
||||
if(this.ticksExisted > 100)
|
||||
this.setDead();
|
||||
|
||||
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
||||
{
|
||||
float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
//this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
|
||||
}
|
||||
|
||||
Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
|
||||
if (block.getMaterial() != Material.air)
|
||||
{
|
||||
block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
if(!worldObj.isRemote)
|
||||
ExplosionChaos.explode(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5);
|
||||
}
|
||||
|
||||
if (this.arrowShake > 0)
|
||||
{
|
||||
--this.arrowShake;
|
||||
}
|
||||
else
|
||||
{
|
||||
++this.ticksInAir;
|
||||
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
|
||||
vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
double d0 = 0.0D;
|
||||
int i;
|
||||
float f1;
|
||||
|
||||
for (i = 0; i < list.size(); ++i)
|
||||
{
|
||||
Entity entity1 = (Entity)list.get(i);
|
||||
|
||||
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
|
||||
{
|
||||
f1 = 0.3F;
|
||||
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);
|
||||
|
||||
if (movingobjectposition1 != null)
|
||||
{
|
||||
double d1 = vec31.distanceTo(movingobjectposition1.hitVec);
|
||||
|
||||
if (d1 < d0 || d0 == 0.0D)
|
||||
{
|
||||
entity = entity1;
|
||||
d0 = d1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
movingobjectposition = new MovingObjectPosition(entity);
|
||||
}
|
||||
|
||||
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
|
||||
|
||||
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))
|
||||
{
|
||||
movingobjectposition = null;
|
||||
}
|
||||
}
|
||||
|
||||
float f2;
|
||||
float f4;
|
||||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
if (movingobjectposition.entityHit != null)
|
||||
{
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||
int k = MathHelper.ceiling_double_int(f2 * this.damage);
|
||||
|
||||
if (this.getIsCritical())
|
||||
{
|
||||
k += this.rand.nextInt(k / 2 + 2);
|
||||
}
|
||||
|
||||
DamageSource damagesource = null;
|
||||
|
||||
if (this.shootingEntity == null)
|
||||
{
|
||||
damagesource = DamageSource.generic;
|
||||
}
|
||||
else
|
||||
{
|
||||
damagesource = ModDamageSource.causeSubatomicDamage(this, this.shootingEntity);
|
||||
}
|
||||
|
||||
if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman))
|
||||
{
|
||||
movingobjectposition.entityHit.setFire(5);
|
||||
}
|
||||
|
||||
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, k))
|
||||
{
|
||||
if (movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit;
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1);
|
||||
}
|
||||
|
||||
if (this.knockbackStrength > 0)
|
||||
{
|
||||
f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
|
||||
if (f4 > 0.0F)
|
||||
{
|
||||
movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase)
|
||||
{
|
||||
EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);
|
||||
EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);
|
||||
}
|
||||
|
||||
if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
|
||||
{
|
||||
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F));
|
||||
}
|
||||
}
|
||||
|
||||
if (!(movingobjectposition.entityHit instanceof EntityEnderman))
|
||||
{
|
||||
if (!this.worldObj.isRemote && movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
movingobjectposition.entityHit.attackEntityFrom(damagesource, 100000F);
|
||||
if(!worldObj.isRemote)
|
||||
ExplosionChaos.explode(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.field_145791_d = movingobjectposition.blockX;
|
||||
this.field_145792_e = movingobjectposition.blockY;
|
||||
this.field_145789_f = movingobjectposition.blockZ;
|
||||
this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
}
|
||||
}
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
float f3 = 0.99F;
|
||||
f1 = 0.05F;
|
||||
|
||||
if (this.isInWater())
|
||||
{
|
||||
for (int l = 0; l < 4; ++l)
|
||||
{
|
||||
f4 = 0.25F;
|
||||
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f4, this.posY - this.motionY * f4, this.posZ - this.motionZ * f4, this.motionX, this.motionY, this.motionZ);
|
||||
}
|
||||
|
||||
f3 = 0.8F;
|
||||
}
|
||||
|
||||
if (this.isWet())
|
||||
{
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.func_145775_I();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
|
||||
{
|
||||
p_70014_1_.setShort("xTile", (short)this.field_145791_d);
|
||||
p_70014_1_.setShort("yTile", (short)this.field_145792_e);
|
||||
p_70014_1_.setShort("zTile", (short)this.field_145789_f);
|
||||
p_70014_1_.setShort("life", (short)this.ticksInGround);
|
||||
p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g));
|
||||
p_70014_1_.setByte("inData", (byte)this.inData);
|
||||
p_70014_1_.setByte("shake", (byte)this.arrowShake);
|
||||
p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0));
|
||||
p_70014_1_.setByte("pickup", (byte)this.canBePickedUp);
|
||||
p_70014_1_.setDouble("damage", this.damage);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
|
||||
{
|
||||
this.field_145791_d = p_70037_1_.getShort("xTile");
|
||||
this.field_145792_e = p_70037_1_.getShort("yTile");
|
||||
this.field_145789_f = p_70037_1_.getShort("zTile");
|
||||
this.ticksInGround = p_70037_1_.getShort("life");
|
||||
this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255);
|
||||
this.inData = p_70037_1_.getByte("inData") & 255;
|
||||
this.arrowShake = p_70037_1_.getByte("shake") & 255;
|
||||
this.inGround = p_70037_1_.getByte("inGround") == 1;
|
||||
|
||||
if (p_70037_1_.hasKey("damage", 99))
|
||||
{
|
||||
this.damage = p_70037_1_.getDouble("damage");
|
||||
}
|
||||
|
||||
if (p_70037_1_.hasKey("pickup", 99))
|
||||
{
|
||||
this.canBePickedUp = p_70037_1_.getByte("pickup");
|
||||
}
|
||||
else if (p_70037_1_.hasKey("player", 99))
|
||||
{
|
||||
this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0;
|
||||
}
|
||||
|
||||
this.randomizeColor();
|
||||
}
|
||||
|
||||
/**
|
||||
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
|
||||
* prevent them from trampling crops
|
||||
*/
|
||||
@Override
|
||||
protected boolean canTriggerWalking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public void setDamage(double p_70239_1_)
|
||||
{
|
||||
this.damage = p_70239_1_;
|
||||
}
|
||||
|
||||
public double getDamage()
|
||||
{
|
||||
return this.damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the amount of knockback the arrow applies when it hits a mob.
|
||||
*/
|
||||
public void setKnockbackStrength(int p_70240_1_)
|
||||
{
|
||||
this.knockbackStrength = p_70240_1_;
|
||||
}
|
||||
|
||||
/**
|
||||
* If returns false, the item will not inflict any damage against entities.
|
||||
*/
|
||||
@Override
|
||||
public boolean canAttackWithItem()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the arrow has a stream of critical hit particles flying behind it.
|
||||
*/
|
||||
public void setIsCritical(boolean p_70243_1_)
|
||||
{
|
||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||
|
||||
if (p_70243_1_)
|
||||
{
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the arrow has a stream of critical hit particles flying behind it.
|
||||
*/
|
||||
public boolean getIsCritical()
|
||||
{
|
||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||
return (b0 & 1) != 0;
|
||||
}
|
||||
|
||||
public void randomizeColor() {
|
||||
this.dataWatcher.updateObject(20, (byte)rand.nextInt(2));
|
||||
this.dataWatcher.updateObject(21, (byte)rand.nextInt(2));
|
||||
this.dataWatcher.updateObject(22, (byte)rand.nextInt(2));
|
||||
}
|
||||
}
|
||||
@ -20,8 +20,9 @@ public class ExplosionFleija
|
||||
private int leg;
|
||||
private int element;
|
||||
public float explosionCoefficient = 1.0F;
|
||||
public float explosionCoefficient2 = 1.0F;
|
||||
|
||||
public ExplosionFleija(int x, int y, int z, World world, int rad, float coefficient)
|
||||
public ExplosionFleija(int x, int y, int z, World world, int rad, float coefficient, float coefficient2)
|
||||
{
|
||||
this.posX = x;
|
||||
this.posY = y;
|
||||
@ -33,6 +34,7 @@ public class ExplosionFleija
|
||||
this.radius2 = this.radius * this.radius;
|
||||
|
||||
this.explosionCoefficient = coefficient;
|
||||
this.explosionCoefficient2 = coefficient2;
|
||||
|
||||
this.nlimit = this.radius2 * 4;
|
||||
}
|
||||
@ -56,7 +58,7 @@ public class ExplosionFleija
|
||||
if (dist > 0)
|
||||
{
|
||||
dist = (int) Math.sqrt(dist);
|
||||
for (int y = dist; y > -dist / this.explosionCoefficient; y--)
|
||||
for (int y = (int)(dist / this.explosionCoefficient2); y > -dist / this.explosionCoefficient; y--)
|
||||
{
|
||||
if(!(this.worldObj.getBlock(this.posX+x, this.posY+y, this.posZ+z) == Blocks.bedrock && this.posY+y <= 0) && !(this.worldObj.getBlock(this.posX+x, this.posY+y, this.posZ+z) instanceof DecoBlockAlt))this.worldObj.setBlock(this.posX+x, this.posY+y, this.posZ+z, Blocks.air);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.EntityBullet;
|
||||
import com.hbm.entity.EntityCombineBall;
|
||||
import com.hbm.entity.EntityMiniNuke;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
@ -58,11 +59,10 @@ public class GunOSIPR extends Item {
|
||||
boolean flag = player.capabilities.isCreativeMode
|
||||
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
|
||||
if ((player.capabilities.isCreativeMode || player.inventory.hasItem(ModItems.gun_osipr_ammo)) && count % 3 == 0) {
|
||||
|
||||
EntityBullet entityarrow = new EntityBullet(world, player, 3.0F, 35, 45, false, "chopper");
|
||||
entityarrow.setDamage(35 + rand.nextInt(45 - 35));
|
||||
|
||||
world.playSoundAtEntity(player, "random.explode", 1.0F, 1.5F + (rand.nextFloat() * 0.5F));
|
||||
world.playSoundAtEntity(player, "random.explode", 1.0F, 1.5F + (rand.nextFloat() / 4));
|
||||
|
||||
if (flag) {
|
||||
entityarrow.canBePickedUp = 2;
|
||||
@ -70,6 +70,25 @@ public class GunOSIPR extends Item {
|
||||
player.inventory.consumeInventoryItem(ModItems.gun_osipr_ammo);
|
||||
}
|
||||
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(entityarrow);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
boolean flag = player.capabilities.isCreativeMode
|
||||
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
|
||||
if ((player.capabilities.isCreativeMode || player.inventory.hasItem(ModItems.gun_osipr_ammo2)) && count % 50 == 0 && (this.getMaxItemUseDuration(stack) - count) != 0) {
|
||||
EntityCombineBall entityarrow = new EntityCombineBall(player.worldObj, player, 3.0F);
|
||||
entityarrow.setDamage(35 + rand.nextInt(45 - 35));
|
||||
|
||||
world.playSoundAtEntity(player, "tile.piston.in", 1.0F, 0.75F);
|
||||
|
||||
if (flag) {
|
||||
entityarrow.canBePickedUp = 2;
|
||||
} else {
|
||||
player.inventory.consumeInventoryItem(ModItems.gun_osipr_ammo2);
|
||||
}
|
||||
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(entityarrow);
|
||||
}
|
||||
|
||||
181
com/hbm/items/GunZOMG.java
Normal file
@ -0,0 +1,181 @@
|
||||
package com.hbm.items;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.EntityBullet;
|
||||
import com.hbm.entity.EntityCombineBall;
|
||||
import com.hbm.entity.EntityRainbow;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
|
||||
public class GunZOMG extends Item {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
public GunZOMG() {
|
||||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
ArrowNockEvent event = new ArrowNockEvent(player, stack);
|
||||
{
|
||||
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||
}
|
||||
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setBoolean("valid", false);
|
||||
stack.stackTagCompound.setBoolean("superuser", false);
|
||||
}
|
||||
|
||||
if (!player.isSneaking()) {
|
||||
if (stack.stackTagCompound.getBoolean("valid")) {
|
||||
if ((player.inventory.hasItem(ModItems.nugget_euphemium)
|
||||
|| player.inventory.hasItem(ModItems.ingot_euphemium))) {
|
||||
} else {
|
||||
if (!player.inventory.hasItem(ModItems.nugget_euphemium)
|
||||
&& !player.inventory.hasItem(ModItems.ingot_euphemium)) {
|
||||
stack.stackTagCompound.setBoolean("valid", false);
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Validation lost!"));
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Request new validation!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Gun not validated!"));
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Validate your gun with shift right-click."));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (stack.stackTagCompound.getBoolean("valid")) {
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Gun has already been validated."));
|
||||
}
|
||||
} else {
|
||||
if (player.inventory.hasItem(ModItems.nugget_euphemium) || player.inventory.hasItem(ModItems.ingot_euphemium)) {
|
||||
stack.stackTagCompound.setBoolean("valid", true);
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Gun has been validated!"));
|
||||
}
|
||||
|
||||
if (Library.superuser.contains(player.getUniqueID().toString())) {
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Welcome, superuser!"));
|
||||
}
|
||||
stack.stackTagCompound.setBoolean("superuser", true);
|
||||
} else {
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Welcome, user!"));
|
||||
}
|
||||
stack.stackTagCompound.setBoolean("superuser", true);
|
||||
}
|
||||
} else {
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Validation failed!"));
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] No external negative gravity well found!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
|
||||
World world = player.worldObj;
|
||||
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setBoolean("valid", false);
|
||||
stack.stackTagCompound.setBoolean("superuser", false);
|
||||
}
|
||||
|
||||
if (!player.isSneaking()) {
|
||||
if (stack.stackTagCompound.getBoolean("valid")) {
|
||||
boolean flag = player.capabilities.isCreativeMode
|
||||
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
|
||||
if ((player.capabilities.isCreativeMode || player.inventory.hasItem(ModItems.nugget_euphemium)
|
||||
|| player.inventory.hasItem(ModItems.ingot_euphemium)) && count % 1 == 0) {
|
||||
if (!stack.stackTagCompound.getBoolean("superuser")) {
|
||||
EntityBullet entityarrow = new EntityBullet(world, player, 3.0F, 35, 45, false, "chopper");
|
||||
EntityBullet entityarrow1 = new EntityBullet(world, player, 3.0F, 35, 45, false, "chopper");
|
||||
EntityBullet entityarrow2 = new EntityBullet(world, player, 3.0F, 35, 45, false, "chopper");
|
||||
EntityBullet entityarrow3 = new EntityBullet(world, player, 3.0F, 35, 45, false, "chopper");
|
||||
EntityBullet entityarrow4 = new EntityBullet(world, player, 3.0F, 35, 45, false, "chopper");
|
||||
EntityBullet entityarrow5 = new EntityBullet(world, player, 3.0F, 35, 45, false, "chopper");
|
||||
entityarrow.setDamage(35 + rand.nextInt(45 - 35));
|
||||
entityarrow1.setDamage(35 + rand.nextInt(45 - 35));
|
||||
entityarrow2.setDamage(35 + rand.nextInt(45 - 35));
|
||||
entityarrow3.setDamage(35 + rand.nextInt(45 - 35));
|
||||
entityarrow4.setDamage(35 + rand.nextInt(45 - 35));
|
||||
entityarrow5.setDamage(35 + rand.nextInt(45 - 35));
|
||||
|
||||
world.playSoundAtEntity(player, "random.explode", 1.0F, 1.5F + (rand.nextFloat() / 4));
|
||||
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(entityarrow);
|
||||
world.spawnEntityInWorld(entityarrow1);
|
||||
world.spawnEntityInWorld(entityarrow2);
|
||||
world.spawnEntityInWorld(entityarrow3);
|
||||
world.spawnEntityInWorld(entityarrow4);
|
||||
world.spawnEntityInWorld(entityarrow5);
|
||||
}
|
||||
} else {
|
||||
EntityRainbow entityarrow = new EntityRainbow(world, player, 1F);
|
||||
EntityRainbow entityarrow1 = new EntityRainbow(world, player, 1F);
|
||||
EntityRainbow entityarrow2 = new EntityRainbow(world, player, 1F);
|
||||
entityarrow.setDamage(35 + rand.nextInt(45 - 35));
|
||||
entityarrow1.setDamage(35 + rand.nextInt(45 - 35));
|
||||
entityarrow2.setDamage(35 + rand.nextInt(45 - 35));
|
||||
|
||||
//world.playSoundAtEntity(player, "random.explode", 1.0F, 1.5F + (rand.nextFloat() / 4));
|
||||
world.playSoundAtEntity(player, "ambient.weather.thunder", 1.0F, 2);
|
||||
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(entityarrow);
|
||||
world.spawnEntityInWorld(entityarrow1);
|
||||
world.spawnEntityInWorld(entityarrow2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!player.inventory.hasItem(ModItems.nugget_euphemium)
|
||||
&& !player.inventory.hasItem(ModItems.ingot_euphemium)) {
|
||||
stack.stackTagCompound.setBoolean("valid", false);
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Validation lost!"));
|
||||
player.addChatMessage(new ChatComponentText("[ZOMG] Request new validation!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,12 @@
|
||||
package com.hbm.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.EntityNukeExplosionAdvanced;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -38,6 +41,42 @@ public class ItemDrop extends Item {
|
||||
entityItem.worldObj.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
if (stack.getItem() != null && stack.getItem() == ModItems.singularity) {
|
||||
if (!entityItem.worldObj.isRemote) {
|
||||
entityItem.worldObj.playSoundEffect(entityItem.posX, entityItem.posY, entityItem.posZ,
|
||||
"random.explode", 1.0f, entityItem.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
EntityNukeExplosionAdvanced entity = new EntityNukeExplosionAdvanced(entityItem.worldObj);
|
||||
entity.posX = entityItem.posX;
|
||||
entity.posY = entityItem.posY;
|
||||
entity.posZ = entityItem.posZ;
|
||||
entity.destructionRange = MainRegistry.aSchrabRadius;
|
||||
entity.speed = 25;
|
||||
entity.coefficient = 0.01F;
|
||||
entity.coefficient2 = 0.01F;
|
||||
entity.waste = false;
|
||||
|
||||
entityItem.worldObj.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
if (stack.getItem() != null && stack.getItem() == ModItems.singularity_counter_resonant) {
|
||||
if (!entityItem.worldObj.isRemote) {
|
||||
entityItem.worldObj.playSoundEffect(entityItem.posX, entityItem.posY, entityItem.posZ,
|
||||
"random.explode", 1.0f, entityItem.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
EntityNukeExplosionAdvanced entity = new EntityNukeExplosionAdvanced(entityItem.worldObj);
|
||||
entity.posX = entityItem.posX;
|
||||
entity.posY = entityItem.posY;
|
||||
entity.posZ = entityItem.posZ;
|
||||
entity.destructionRange = MainRegistry.aSchrabRadius * 2;
|
||||
entity.speed = 25;
|
||||
entity.coefficient = 0.01F;
|
||||
entity.coefficient2 = 0.01F;
|
||||
entity.waste = false;
|
||||
|
||||
entityItem.worldObj.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
entityItem.setDead();
|
||||
return true;
|
||||
@ -46,4 +85,30 @@ public class ItemDrop extends Item {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
if (itemstack.getItem() != null && itemstack.getItem() == ModItems.cell_antimatter) {
|
||||
list.add("Warning: Exposure to matter will");
|
||||
list.add("lead to violent annihilation!");
|
||||
}
|
||||
if (itemstack.getItem() != null && itemstack.getItem() == ModItems.cell_anti_schrabidium) {
|
||||
list.add("Warning: Exposure to matter will");
|
||||
list.add("create a fólkvangr field!");
|
||||
}
|
||||
if (itemstack.getItem() != null && itemstack.getItem() == ModItems.singularity) {
|
||||
list.add("You may be asking:");
|
||||
list.add("\"But HBM, a manifold with an undefined");
|
||||
list.add("state of spacetime? How is this possible?\"");
|
||||
list.add("Long answer short:");
|
||||
list.add("\"I have no idea!\"");
|
||||
}
|
||||
if (itemstack.getItem() != null && itemstack.getItem() == ModItems.singularity_counter_resonant) {
|
||||
list.add("Nullifies resonance of objects in");
|
||||
list.add("non-euclidean space, creates variable");
|
||||
list.add("gravity well. Spontaneously creates");
|
||||
list.add("tesseracts.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.entity.EntityGrenadeFlare;
|
||||
import com.hbm.entity.EntityGrenadeFrag;
|
||||
import com.hbm.entity.EntityGrenadeGas;
|
||||
import com.hbm.entity.EntityGrenadeGeneric;
|
||||
import com.hbm.entity.EntityGrenadeLemon;
|
||||
import com.hbm.entity.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.EntityGrenadeNuke;
|
||||
import com.hbm.entity.EntityGrenadePlasma;
|
||||
@ -23,83 +24,68 @@ import net.minecraft.world.World;
|
||||
|
||||
public class ItemGrenade extends Item {
|
||||
|
||||
public ItemGrenade()
|
||||
{
|
||||
public ItemGrenade() {
|
||||
this.maxStackSize = 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_)
|
||||
{
|
||||
if (!p_77659_3_.capabilities.isCreativeMode)
|
||||
{
|
||||
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
|
||||
if (!p_77659_3_.capabilities.isCreativeMode) {
|
||||
--p_77659_1_.stackSize;
|
||||
}
|
||||
|
||||
p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!p_77659_2_.isRemote)
|
||||
{
|
||||
if(this == ModItems.grenade_generic)
|
||||
{
|
||||
if (!p_77659_2_.isRemote) {
|
||||
if (this == ModItems.grenade_generic) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeGeneric(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_strong)
|
||||
{
|
||||
if (this == ModItems.grenade_strong) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeStrong(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_frag)
|
||||
{
|
||||
if (this == ModItems.grenade_frag) {
|
||||
EntityGrenadeFrag frag = new EntityGrenadeFrag(p_77659_2_, p_77659_3_);
|
||||
frag.shooter = p_77659_3_;
|
||||
p_77659_2_.spawnEntityInWorld(frag);
|
||||
}
|
||||
if(this == ModItems.grenade_fire)
|
||||
{
|
||||
if (this == ModItems.grenade_fire) {
|
||||
EntityGrenadeFire fire = new EntityGrenadeFire(p_77659_2_, p_77659_3_);
|
||||
fire.shooter = p_77659_3_;
|
||||
p_77659_2_.spawnEntityInWorld(fire);
|
||||
}
|
||||
if(this == ModItems.grenade_cluster)
|
||||
{
|
||||
if (this == ModItems.grenade_cluster) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeCluster(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_flare)
|
||||
{
|
||||
if (this == ModItems.grenade_flare) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeFlare(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_electric)
|
||||
{
|
||||
if (this == ModItems.grenade_electric) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeElectric(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_poison)
|
||||
{
|
||||
if (this == ModItems.grenade_poison) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadePoison(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_gas)
|
||||
{
|
||||
if (this == ModItems.grenade_gas) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeGas(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_schrabidium)
|
||||
{
|
||||
if (this == ModItems.grenade_schrabidium) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeSchrabidium(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_nuke)
|
||||
{
|
||||
if (this == ModItems.grenade_nuke) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeNuke(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_nuclear)
|
||||
{
|
||||
if (this == ModItems.grenade_nuclear) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeNuclear(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_plasma)
|
||||
{
|
||||
if (this == ModItems.grenade_plasma) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadePlasma(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if(this == ModItems.grenade_tau)
|
||||
{
|
||||
if (this == ModItems.grenade_tau) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeTau(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if (this == ModItems.grenade_lemon) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeLemon(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
}
|
||||
|
||||
return p_77659_1_;
|
||||
@ -108,18 +94,15 @@ public class ItemGrenade extends Item {
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack p_77613_1_) {
|
||||
|
||||
if(this == ModItems.grenade_schrabidium)
|
||||
{
|
||||
if (this == ModItems.grenade_schrabidium) {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
if(this == ModItems.grenade_plasma)
|
||||
{
|
||||
if (this == ModItems.grenade_plasma) {
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
if(this == ModItems.grenade_nuke || this == ModItems.grenade_nuclear || this == ModItems.grenade_tau)
|
||||
{
|
||||
if (this == ModItems.grenade_nuke || this == ModItems.grenade_nuclear || this == ModItems.grenade_tau || this == ModItems.grenade_lemon) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
|
||||
21
com/hbm/items/ItemLemon.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.hbm.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemLemon extends ItemFood {
|
||||
|
||||
public ItemLemon(int p_i45339_1_, float p_i45339_2_, boolean p_i45339_3_) {
|
||||
super(p_i45339_1_, p_i45339_2_, p_i45339_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
list.add("Eh, good enough.");
|
||||
}
|
||||
|
||||
}
|
||||
@ -242,6 +242,7 @@ public class ItemStarterKit extends Item {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_plasma, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_tau, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_schrabidium, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_lemon, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_nuke, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_nuclear, 16));
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemSoup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@ -198,6 +199,8 @@ public class ModItems {
|
||||
public static Item cell_sas3;
|
||||
public static Item cell_antimatter;
|
||||
public static Item cell_anti_schrabidium;
|
||||
public static Item singularity;
|
||||
public static Item singularity_counter_resonant;
|
||||
public static Item inf_water;
|
||||
public static Item inf_coolant;
|
||||
public static Item inf_deuterium;
|
||||
@ -360,6 +363,7 @@ public class ModItems {
|
||||
public static Item gun_osipr;
|
||||
public static Item gun_osipr_ammo;
|
||||
public static Item gun_osipr_ammo2;
|
||||
public static Item gun_zomg;
|
||||
public static Item gun_waluigi;
|
||||
|
||||
public static Item grenade_generic;
|
||||
@ -374,6 +378,7 @@ public class ModItems {
|
||||
public static Item grenade_plasma;
|
||||
public static Item grenade_tau;
|
||||
public static Item grenade_schrabidium;
|
||||
public static Item grenade_lemon;
|
||||
public static Item grenade_nuke;
|
||||
public static Item grenade_nuclear;
|
||||
|
||||
@ -383,6 +388,7 @@ public class ModItems {
|
||||
public static Item apple_schrabidium;
|
||||
public static Item tem_flakes;
|
||||
public static Item glowing_stew;
|
||||
public static Item lemon;
|
||||
|
||||
public static Item flame_pony;
|
||||
public static Item flame_conspiracy;
|
||||
@ -551,6 +557,7 @@ public class ModItems {
|
||||
public static Item b_smoke6;
|
||||
public static Item b_smoke7;
|
||||
public static Item b_smoke8;
|
||||
public static Item energy_ball;
|
||||
|
||||
public static void initializeItem()
|
||||
{
|
||||
@ -728,6 +735,8 @@ public class ModItems {
|
||||
cell_tritium = new Item().setUnlocalizedName("cell_tritium").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_tritium");
|
||||
cell_sas3 = new ItemCustomLore().setUnlocalizedName("cell_sas3").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_sas3");
|
||||
cell_anti_schrabidium = new ItemDrop().setUnlocalizedName("cell_anti_schrabidium").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_anti_schrabidium");
|
||||
singularity = new ItemDrop().setUnlocalizedName("singularity").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.nuclear_waste).setTextureName(RefStrings.MODID + ":singularity");
|
||||
singularity_counter_resonant = new ItemDrop().setUnlocalizedName("singularity_counter_resonant").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.nuclear_waste).setTextureName(RefStrings.MODID + ":singularity_alt");
|
||||
inf_water = new Item().setUnlocalizedName("inf_water").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":inf_water");
|
||||
inf_coolant = new Item().setUnlocalizedName("inf_coolant").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":inf_coolant");
|
||||
inf_deuterium = new Item().setUnlocalizedName("inf_deuterium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":inf_deuterium");
|
||||
@ -892,6 +901,7 @@ public class ModItems {
|
||||
gun_osipr_ammo = new Item().setUnlocalizedName("gun_osipr_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_osipr_ammo");
|
||||
gun_osipr_ammo2 = new Item().setUnlocalizedName("gun_osipr_ammo2").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_osipr_ammo2");
|
||||
gun_osipr = new GunOSIPR().setUnlocalizedName("gun_osipr").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_osipr");
|
||||
gun_zomg = new GunZOMG().setUnlocalizedName("gun_zomg").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_zomg");
|
||||
|
||||
grenade_generic = new ItemGrenade().setUnlocalizedName("grenade_generic").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_generic");
|
||||
grenade_strong = new ItemGrenade().setUnlocalizedName("grenade_strong").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_strong");
|
||||
@ -905,6 +915,7 @@ public class ModItems {
|
||||
grenade_plasma = new ItemGrenade().setUnlocalizedName("grenade_plasma").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_plasma");
|
||||
grenade_tau = new ItemGrenade().setUnlocalizedName("grenade_tau").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_tau");
|
||||
grenade_schrabidium = new ItemGrenade().setUnlocalizedName("grenade_schrabidium").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_schrabidium");
|
||||
grenade_lemon = new ItemGrenade().setUnlocalizedName("grenade_lemon").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_lemon");
|
||||
grenade_nuke = new ItemGrenade().setUnlocalizedName("grenade_nuke").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_nuke");
|
||||
grenade_nuclear = new ItemGrenade().setUnlocalizedName("grenade_nuclear").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_nuclear");
|
||||
|
||||
@ -914,6 +925,7 @@ public class ModItems {
|
||||
apple_schrabidium = new ItemAppleSchrabidium(20, 100, false).setUnlocalizedName("apple_schrabidium").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":apple_schrabidium");
|
||||
tem_flakes = new ItemTemFlakes(0, 0, false).setUnlocalizedName("tem_flakes").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":tem_flakes");
|
||||
glowing_stew = new ItemSoup(6).setUnlocalizedName("glowing_stew").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":glowing_stew");
|
||||
lemon = new ItemLemon(3, 5, false).setUnlocalizedName("lemon").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":lemon");
|
||||
|
||||
flame_pony = new ItemCustomLore().setUnlocalizedName("flame_pony").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":flame_pony");
|
||||
flame_conspiracy = new ItemCustomLore().setUnlocalizedName("flame_conspiracy").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":flame_conspiracy");
|
||||
@ -1080,6 +1092,7 @@ public class ModItems {
|
||||
b_smoke6 = new Item().setUnlocalizedName("b_smoke6").setTextureName(RefStrings.MODID + ":b_smoke6");
|
||||
b_smoke7 = new Item().setUnlocalizedName("b_smoke7").setTextureName(RefStrings.MODID + ":b_smoke7");
|
||||
b_smoke8 = new Item().setUnlocalizedName("b_smoke8").setTextureName(RefStrings.MODID + ":b_smoke8");
|
||||
energy_ball = new Item().setUnlocalizedName("energy_ball").setTextureName(RefStrings.MODID + ":energy_ball");
|
||||
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.mud_fluid, 1000), new ItemStack(ModItems.bucket_mud));
|
||||
BucketHandler.INSTANCE.buckets.put(ModBlocks.mud_block, ModItems.bucket_mud);
|
||||
@ -1296,6 +1309,10 @@ public class ModItems {
|
||||
GameRegistry.registerItem(cell_antimatter, cell_antimatter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cell_anti_schrabidium, cell_anti_schrabidium.getUnlocalizedName());
|
||||
|
||||
//OMG how the hell is that even possible!?
|
||||
GameRegistry.registerItem(singularity, singularity.getUnlocalizedName());
|
||||
GameRegistry.registerItem(singularity_counter_resonant, singularity_counter_resonant.getUnlocalizedName());
|
||||
|
||||
//Infinite Tanks
|
||||
GameRegistry.registerItem(inf_water, inf_water.getUnlocalizedName());
|
||||
GameRegistry.registerItem(inf_coolant, inf_coolant.getUnlocalizedName());
|
||||
@ -1466,6 +1483,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_osipr, gun_osipr.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_osipr_ammo, gun_osipr_ammo.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_osipr_ammo2, gun_osipr_ammo2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_zomg, gun_zomg.getUnlocalizedName());
|
||||
|
||||
//Grenades
|
||||
GameRegistry.registerItem(grenade_generic, grenade_generic.getUnlocalizedName());
|
||||
@ -1480,6 +1498,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(grenade_plasma, grenade_plasma.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_tau, grenade_tau.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_schrabidium, grenade_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_lemon, grenade_lemon.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_nuke, grenade_nuke.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_nuclear, grenade_nuclear.getUnlocalizedName());
|
||||
|
||||
@ -1533,6 +1552,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(apple_schrabidium, apple_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(tem_flakes, tem_flakes.getUnlocalizedName());
|
||||
GameRegistry.registerItem(glowing_stew, glowing_stew.getUnlocalizedName());
|
||||
GameRegistry.registerItem(lemon, lemon.getUnlocalizedName());
|
||||
|
||||
//Energy Drinks
|
||||
GameRegistry.registerItem(can_empty, can_empty.getUnlocalizedName());
|
||||
@ -1663,5 +1683,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(b_smoke6, b_smoke6.getUnlocalizedName());
|
||||
GameRegistry.registerItem(b_smoke7, b_smoke7.getUnlocalizedName());
|
||||
GameRegistry.registerItem(b_smoke8, b_smoke8.getUnlocalizedName());
|
||||
GameRegistry.registerItem(energy_ball, energy_ball.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.lib;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -105,6 +106,8 @@ public class Library {
|
||||
public static String LPkukin = "937c9804-e11f-4ad2-a5b1-42e62ac73077";
|
||||
public static String Dafnik = "3af1c262-61c0-4b12-a4cb-424cc3a9c8c0";
|
||||
|
||||
public static List<String> superuser = new ArrayList<String>();
|
||||
|
||||
public static boolean checkArmor(EntityPlayer player, Item helmet, Item plate, Item legs, Item boots) {
|
||||
|
||||
if(player.inventory.armorInventory[0] != null &&
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.hbm.lib;
|
||||
|
||||
import com.hbm.entity.EntityBullet;
|
||||
import com.hbm.entity.EntityCombineBall;
|
||||
import com.hbm.entity.EntityRainbow;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
@ -30,6 +32,14 @@ public class ModDamageSource extends DamageSource {
|
||||
{
|
||||
return (new EntityDamageSourceIndirect("tau", p_76353_0_, p_76353_1_)).setProjectile().setDamageBypassesArmor();
|
||||
}
|
||||
public static DamageSource causeCombineDamage(EntityCombineBall p_76353_0_, Entity p_76353_1_)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect("cmb", p_76353_0_, p_76353_1_)).setProjectile().setDamageBypassesArmor();
|
||||
}
|
||||
public static DamageSource causeSubatomicDamage(EntityRainbow p_76353_0_, Entity p_76353_1_)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect("subAtomic", p_76353_0_, p_76353_1_)).setProjectile().setDamageBypassesArmor();
|
||||
}
|
||||
public static DamageSource euthanized(Entity p_76353_0_, Entity p_76353_1_)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect("euthanized", p_76353_0_, p_76353_1_)).setDamageBypassesArmor();
|
||||
@ -67,4 +77,20 @@ public class ModDamageSource extends DamageSource {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean getIsCmb(DamageSource source) {
|
||||
if(source instanceof EntityDamageSourceIndirect)
|
||||
{
|
||||
return ((EntityDamageSourceIndirect)source).damageType.equals("cmb");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean getIsSubatomic(DamageSource source) {
|
||||
if(source instanceof EntityDamageSourceIndirect)
|
||||
{
|
||||
return ((EntityDamageSourceIndirect)source).damageType.equals("subAtomic");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ import com.hbm.blocks.TileEntityTestRender;
|
||||
import com.hbm.blocks.TileEntityYellowBarrel;
|
||||
import com.hbm.entity.EntityBullet;
|
||||
import com.hbm.entity.EntityChopperMine;
|
||||
import com.hbm.entity.EntityCombineBall;
|
||||
import com.hbm.entity.EntityGrenadeCluster;
|
||||
import com.hbm.entity.EntityGrenadeElectric;
|
||||
import com.hbm.entity.EntityGrenadeFire;
|
||||
@ -44,6 +45,7 @@ import com.hbm.entity.EntityGrenadeFlare;
|
||||
import com.hbm.entity.EntityGrenadeFrag;
|
||||
import com.hbm.entity.EntityGrenadeGas;
|
||||
import com.hbm.entity.EntityGrenadeGeneric;
|
||||
import com.hbm.entity.EntityGrenadeLemon;
|
||||
import com.hbm.entity.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.EntityGrenadeNuke;
|
||||
import com.hbm.entity.EntityGrenadePlasma;
|
||||
@ -74,6 +76,7 @@ import com.hbm.entity.EntityMissileStrong;
|
||||
import com.hbm.entity.EntityNuclearCreeper;
|
||||
import com.hbm.entity.EntityNukeCloudBig;
|
||||
import com.hbm.entity.EntityNukeCloudSmall;
|
||||
import com.hbm.entity.EntityRainbow;
|
||||
import com.hbm.entity.EntityRocket;
|
||||
import com.hbm.entity.EntitySchrab;
|
||||
import com.hbm.entity.EntityTestMissile;
|
||||
@ -131,6 +134,7 @@ import com.hbm.render.RenderNukeTsar;
|
||||
import com.hbm.render.RenderPoleSatelliteReceiver;
|
||||
import com.hbm.render.RenderPoleTop;
|
||||
import com.hbm.render.RenderPuF6Tank;
|
||||
import com.hbm.render.RenderRainbow;
|
||||
import com.hbm.render.RenderRedBarrel;
|
||||
import com.hbm.render.RenderRocket;
|
||||
import com.hbm.render.RenderRotationTester;
|
||||
@ -200,6 +204,7 @@ public class ClientProxy extends ServerProxy
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeNuclear.class, new RenderSnowball(ModItems.grenade_nuclear));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadePlasma.class, new RenderSnowball(ModItems.grenade_plasma));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeTau.class, new RenderSnowball(ModItems.grenade_tau));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeLemon.class, new RenderSnowball(ModItems.grenade_lemon));
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySchrab.class, new RenderFlare());
|
||||
|
||||
@ -233,6 +238,7 @@ public class ClientProxy extends ServerProxy
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBullet.class, new RenderRocket());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMiniNuke.class, new RenderMiniNuke());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_fatman_ammo, new ItemRenderMiniNuke());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityRainbow.class, new RenderRainbow());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukePrototype.class, new RenderNukePrototype());
|
||||
|
||||
@ -285,6 +291,7 @@ public class ClientProxy extends ServerProxy
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new ModEffectRenderer(ModItems.nuclear_waste));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new BSmokeRenderer(ModItems.nuclear_waste));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCombineBall.class, new RenderSnowball(ModItems.energy_ball));
|
||||
|
||||
RenderingRegistry.addNewArmourRendererPrefix("5");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("6");
|
||||
|
||||
@ -398,6 +398,9 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.titanium_filter, 1), new Object[] { "PFP", "CBC", "CBC", 'P', "plateLead", 'B', "U238", 'C', "plateTitanium", 'F', ModItems.fuse }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.detonator, 1), new Object[] { " W", "SC", "CE", 'S', "plateSteel", 'W', ModItems.wire_red_copper, 'C', ModItems.circuit_red_copper, 'E', "ingotSteel" }));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.singularity, 1), new Object[] { "ESE", "SBS", "ESE", 'E', ModItems.nugget_euphemium, 'S', ModItems.cell_anti_schrabidium, 'B', Item.getItemFromBlock(ModBlocks.block_schrabidium) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.singularity_counter_resonant, 1), new Object[] { "CTC", "TST", "CTC", 'C', ModItems.plate_combine_steel, 'T', ModItems.ingot_magnetized_tungsten, 'S', ModItems.singularity });
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_element), 1), new Object[] { "SCS", "CSC", "SCS", 'S', "ingotSteel", 'C', ModItems.rod_quad_empty }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_control), 1), new Object[] { "SLS", "SLS", "SLS", 'S', "ingotSteel", 'L', "ingotLead" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_conductor), 1), new Object[] { "SWS", "FFF", "SWS", 'S', "ingotSteel", 'W', Item.getItemFromBlock(ModBlocks.red_wire_coated), 'F', ModItems.fuse }));
|
||||
|
||||
@ -70,6 +70,7 @@ import com.hbm.creativetabs.PartsTab;
|
||||
import com.hbm.creativetabs.TestTab;
|
||||
import com.hbm.entity.EntityBullet;
|
||||
import com.hbm.entity.EntityChopperMine;
|
||||
import com.hbm.entity.EntityCombineBall;
|
||||
import com.hbm.entity.EntityGrenadeCluster;
|
||||
import com.hbm.entity.EntityGrenadeElectric;
|
||||
import com.hbm.entity.EntityGrenadeFire;
|
||||
@ -77,6 +78,7 @@ import com.hbm.entity.EntityGrenadeFlare;
|
||||
import com.hbm.entity.EntityGrenadeFrag;
|
||||
import com.hbm.entity.EntityGrenadeGas;
|
||||
import com.hbm.entity.EntityGrenadeGeneric;
|
||||
import com.hbm.entity.EntityGrenadeLemon;
|
||||
import com.hbm.entity.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.EntityGrenadeNuke;
|
||||
import com.hbm.entity.EntityGrenadePlasma;
|
||||
@ -109,11 +111,13 @@ import com.hbm.entity.EntityNukeCloudBig;
|
||||
import com.hbm.entity.EntityNukeCloudSmall;
|
||||
import com.hbm.entity.EntityNukeExplosion;
|
||||
import com.hbm.entity.EntityNukeExplosionAdvanced;
|
||||
import com.hbm.entity.EntityRainbow;
|
||||
import com.hbm.entity.EntityRocket;
|
||||
import com.hbm.entity.EntitySchrab;
|
||||
import com.hbm.entity.EntityTestMissile;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.HbmWorld;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.particles.EntityBSmokeFX;
|
||||
import com.hbm.particles.EntitySmokeFX;
|
||||
@ -215,6 +219,8 @@ public class MainRegistry
|
||||
proxy.registerRenderInfo();
|
||||
HbmWorld.mainRegistry();
|
||||
|
||||
Library.superuser.add("192af5d7-ed0f-48d8-bd89-9d41af8524f8");
|
||||
|
||||
enumArmorMaterialSchrabidium.customCraftingMaterial = ModItems.ingot_schrabidium;
|
||||
enumArmorMaterialHazmat.customCraftingMaterial = ModItems.hazmat_cloth;
|
||||
enumArmorMaterialT45.customCraftingMaterial = ModItems.plate_titanium;
|
||||
@ -320,6 +326,9 @@ public class MainRegistry
|
||||
EntityRegistry.registerModEntity(EntityGrenadePlasma.class, "entity_grenade_plasma", 41, this, 500, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityGrenadeTau.class, "entity_grenade_tau", 42, this, 500, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityChopperMine.class, "entity_chopper_mine", 43, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityCombineBall.class, "entity_combine_ball", 44, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityRainbow.class, "entity_rainbow", 45, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityGrenadeLemon.class, "entity_grenade_lemon", 46, this, 500, 1, true);
|
||||
|
||||
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
|
||||
EntityRegistry.registerGlobalEntityID(EntityHunterChopper.class, "entity_mob_hunter_chopper", EntityRegistry.findGlobalUniqueEntityId(), 0xffffff, 0xffffff);
|
||||
|
||||
@ -491,12 +491,6 @@ public class ModelHunterChopper extends ModelBase {
|
||||
}
|
||||
|
||||
public void setGunRotations(EntityHunterChopper rocket, float yaw, float pitch) {
|
||||
//setRotation(GunBarrel, 0F, rocket.gunYaw - yaw, rocket.gunPitch - pitch);
|
||||
//setRotation(GunBack, 0F, rocket.gunYaw - yaw, rocket.gunPitch - pitch);
|
||||
//setRotation(GunBarrel, 0F, 0 - yaw, 0 - pitch);
|
||||
//setRotation(GunBack, 0F, 0 - yaw, 0 - pitch);
|
||||
//setRotation(GunBarrel, 0F, rocket.gunYaw, rocket.gunPitch);
|
||||
//setRotation(GunBack, 0F, rocket.gunYaw, rocket.gunPitch);
|
||||
setRotation(GunBarrel, 0F, (rocket.getYaw() - yaw) / (180F / (float)Math.PI), (rocket.getPitch() - pitch) / (180F / (float)Math.PI));
|
||||
setRotation(GunBack, 0F, (rocket.getYaw() - yaw) / (180F / (float)Math.PI), (rocket.getPitch() - pitch) / (180F / (float)Math.PI));
|
||||
System.out.println(rocket.getYaw());
|
||||
|
||||
123
com/hbm/render/ModelRainbow.java
Normal file
@ -0,0 +1,123 @@
|
||||
// Date: 30.07.2016 17:36:41
|
||||
// Template version 1.1
|
||||
// Java generated by Techne
|
||||
// Keep in mind that you still need to fill in some blanks
|
||||
// - ZeuX
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package com.hbm.render;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelRainbow extends ModelBase
|
||||
{
|
||||
//fields
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
ModelRenderer Shape8;
|
||||
|
||||
public ModelRainbow()
|
||||
{
|
||||
textureWidth = 32;
|
||||
textureHeight = 32;
|
||||
|
||||
Shape1 = new ModelRenderer(this, 0, 0);
|
||||
Shape1.addBox(0F, 0F, 0F, 8, 2, 2);
|
||||
Shape1.setRotationPoint(-4F, -1F, 1F);
|
||||
Shape1.setTextureSize(32, 32);
|
||||
Shape1.mirror = true;
|
||||
setRotation(Shape1, 0F, 0F, 0F);
|
||||
Shape2 = new ModelRenderer(this, 0, 16);
|
||||
Shape2.addBox(0F, 0F, 0F, 8, 1, 1);
|
||||
Shape2.setRotationPoint(-5F, -4F, -1F);
|
||||
Shape2.setTextureSize(32, 32);
|
||||
Shape2.mirror = true;
|
||||
setRotation(Shape2, 0F, 0F, 0F);
|
||||
Shape3 = new ModelRenderer(this, 0, 4);
|
||||
Shape3.addBox(0F, 0F, 0F, 6, 1, 1);
|
||||
Shape3.setRotationPoint(-1F, -1F, -2F);
|
||||
Shape3.setTextureSize(32, 32);
|
||||
Shape3.mirror = true;
|
||||
setRotation(Shape3, 0F, 0F, 0F);
|
||||
Shape4 = new ModelRenderer(this, 0, 6);
|
||||
Shape4.addBox(0F, 0F, 0F, 8, 1, 1);
|
||||
Shape4.setRotationPoint(-6F, 2F, -1F);
|
||||
Shape4.setTextureSize(32, 32);
|
||||
Shape4.mirror = true;
|
||||
setRotation(Shape4, 0F, 0F, 0F);
|
||||
Shape5 = new ModelRenderer(this, 0, 14);
|
||||
Shape5.addBox(0F, 0F, 0F, 6, 1, 1);
|
||||
Shape5.setRotationPoint(-3F, -3F, 2F);
|
||||
Shape5.setTextureSize(32, 32);
|
||||
Shape5.mirror = true;
|
||||
setRotation(Shape5, 0F, 0F, 0F);
|
||||
Shape6 = new ModelRenderer(this, 0, 12);
|
||||
Shape6.addBox(0F, 0F, 0F, 8, 1, 1);
|
||||
Shape6.setRotationPoint(-3F, -4F, 4F);
|
||||
Shape6.setTextureSize(32, 32);
|
||||
Shape6.mirror = true;
|
||||
setRotation(Shape6, 0F, 0F, 0F);
|
||||
Shape7 = new ModelRenderer(this, 0, 10);
|
||||
Shape7.addBox(0F, 0F, 0F, 7, 1, 1);
|
||||
Shape7.setRotationPoint(-6F, 0F, 5F);
|
||||
Shape7.setTextureSize(32, 32);
|
||||
Shape7.mirror = true;
|
||||
setRotation(Shape7, 0F, 0F, 0F);
|
||||
Shape8 = new ModelRenderer(this, 0, 8);
|
||||
Shape8.addBox(0F, 0F, 0F, 6, 1, 1);
|
||||
Shape8.setRotationPoint(-2F, 2F, 3F);
|
||||
Shape8.setTextureSize(32, 32);
|
||||
Shape8.mirror = true;
|
||||
setRotation(Shape8, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
Shape1.render(f5);
|
||||
Shape2.render(f5);
|
||||
Shape3.render(f5);
|
||||
Shape4.render(f5);
|
||||
Shape5.render(f5);
|
||||
Shape6.render(f5);
|
||||
Shape7.render(f5);
|
||||
Shape8.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
|
||||
{
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
}
|
||||
|
||||
public void renderAll(float f5)
|
||||
{
|
||||
Shape1.render(f5);
|
||||
Shape2.render(f5);
|
||||
Shape3.render(f5);
|
||||
Shape4.render(f5);
|
||||
Shape5.render(f5);
|
||||
Shape6.render(f5);
|
||||
Shape7.render(f5);
|
||||
Shape8.render(f5);
|
||||
}
|
||||
|
||||
}
|
||||
@ -33,6 +33,9 @@ public class RenderHunterChopper extends Render {
|
||||
float yaw = rocket.prevRotationYaw + (rocket.rotationYaw - rocket.prevRotationYaw) * p_76986_9_ - 90.0F;
|
||||
float pitch = rocket.prevRotationPitch + (rocket.rotationPitch - rocket.prevRotationPitch) * p_76986_9_;
|
||||
|
||||
GL11.glRotatef(rocket.prevRotationYaw + (rocket.rotationYaw - rocket.prevRotationYaw) * p_76986_9_ - 90.0F, 0, 1.0F, 0);
|
||||
GL11.glRotatef(rocket.prevRotationPitch + (rocket.rotationPitch - rocket.prevRotationPitch) * p_76986_9_, 0, 0, 1.0F);
|
||||
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/TheGadget3_.png"));
|
||||
|
||||
if(rocket instanceof EntityHunterChopper)
|
||||
|
||||
89
com/hbm/render/RenderRainbow.java
Normal file
@ -0,0 +1,89 @@
|
||||
package com.hbm.render;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.EntityBullet;
|
||||
import com.hbm.entity.EntityRainbow;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderRainbow extends Render {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void doRender(Entity rocket, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
|
||||
float radius = 0.12F;
|
||||
int distance = 4;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
GL11.glRotatef(rocket.rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-rocket.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
boolean red = false;
|
||||
boolean green = false;
|
||||
boolean blue = false;
|
||||
|
||||
if(rocket instanceof EntityRainbow && ((EntityRainbow)rocket).getDataWatcher() != null)
|
||||
{
|
||||
red = ((EntityRainbow)rocket).getDataWatcher().getWatchableObjectByte(20) == 1;
|
||||
green = ((EntityRainbow)rocket).getDataWatcher().getWatchableObjectByte(21) == 1;
|
||||
blue = ((EntityRainbow)rocket).getDataWatcher().getWatchableObjectByte(22) == 1;
|
||||
}
|
||||
|
||||
for (float o = 0; o <= radius; o += radius / 8) {
|
||||
float color = 1f - (o * 8.333f);
|
||||
if (color < 0)
|
||||
color = 0;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return new ResourceLocation(RefStrings.MODID + ":textures/models/Rainbow.png");
|
||||
}
|
||||
}
|
||||