From dbcc6a51bd79fb5ca57e7c75c43f083a68b99f0c Mon Sep 17 00:00:00 2001 From: HbmMods Date: Sun, 31 Jul 2016 16:22:34 +0200 Subject: [PATCH] ZOMG --- assets/hbm/lang/de_DE.lang | 4 + assets/hbm/lang/en_US.lang | 4 + assets/hbm/textures/items/energy_ball.png | Bin 0 -> 765 bytes .../hbm/textures/items/energy_ball.png.mcmeta | 3 + assets/hbm/textures/items/grenade_lemon.png | Bin 0 -> 336 bytes assets/hbm/textures/items/gun_zomg.png | Bin 0 -> 308 bytes assets/hbm/textures/items/lemon.png | Bin 0 -> 284 bytes assets/hbm/textures/items/singularity.png | Bin 0 -> 365 bytes assets/hbm/textures/items/singularity_alt.png | Bin 0 -> 348 bytes assets/hbm/textures/models/Rainbow.png | Bin 0 -> 251 bytes com/hbm/entity/EntityBullet.java | 8 +- com/hbm/entity/EntityCombineBall.java | 572 ++++++++++++++++++ com/hbm/entity/EntityGrenadeLemon.java | 54 ++ com/hbm/entity/EntityHunterChopper.java | 26 +- .../entity/EntityNukeExplosionAdvanced.java | 3 +- com/hbm/entity/EntityRainbow.java | 532 ++++++++++++++++ com/hbm/explosion/ExplosionFleija.java | 8 +- com/hbm/items/GunOSIPR.java | 25 +- com/hbm/items/GunZOMG.java | 181 ++++++ com/hbm/items/ItemDrop.java | 65 ++ com/hbm/items/ItemGrenade.java | 177 +++--- com/hbm/items/ItemLemon.java | 21 + com/hbm/items/ItemStarterKit.java | 1 + com/hbm/items/ModItems.java | 21 + com/hbm/lib/Library.java | 3 + com/hbm/lib/ModDamageSource.java | 26 + com/hbm/main/ClientProxy.java | 7 + com/hbm/main/CraftingManager.java | 3 + com/hbm/main/MainRegistry.java | 9 + com/hbm/render/ModelHunterChopper.java | 6 - com/hbm/render/ModelRainbow.java | 123 ++++ com/hbm/render/RenderHunterChopper.java | 3 + com/hbm/render/RenderRainbow.java | 89 +++ 33 files changed, 1846 insertions(+), 128 deletions(-) create mode 100644 assets/hbm/textures/items/energy_ball.png create mode 100644 assets/hbm/textures/items/energy_ball.png.mcmeta create mode 100644 assets/hbm/textures/items/grenade_lemon.png create mode 100644 assets/hbm/textures/items/gun_zomg.png create mode 100644 assets/hbm/textures/items/lemon.png create mode 100644 assets/hbm/textures/items/singularity.png create mode 100644 assets/hbm/textures/items/singularity_alt.png create mode 100644 assets/hbm/textures/models/Rainbow.png create mode 100644 com/hbm/entity/EntityCombineBall.java create mode 100644 com/hbm/entity/EntityGrenadeLemon.java create mode 100644 com/hbm/entity/EntityRainbow.java create mode 100644 com/hbm/items/GunZOMG.java create mode 100644 com/hbm/items/ItemLemon.java create mode 100644 com/hbm/render/ModelRainbow.java create mode 100644 com/hbm/render/RenderRainbow.java diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 8e24b7c5a..ff94a68ea 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -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 diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 3bb1e66fa..d69e82232 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -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 diff --git a/assets/hbm/textures/items/energy_ball.png b/assets/hbm/textures/items/energy_ball.png new file mode 100644 index 0000000000000000000000000000000000000000..a523d7cbb3ee3f35bc670b0f00c3ccc7d8b23562 GIT binary patch literal 765 zcmeAS@N?(olHy`uVBq!ia0vp^0zmA*!3HFSYrjteQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4ude`@%$AjKtah8*NBqf{Irtt#G+J&g2c?c61}|C5(N`I z13g27wOm{W7#NsxJzX3_BHZ6j+vp|hDAJ~TwBeBH2~ov^ZY&428bvgj!lv1EOXMZa zRofQDQTB_WvSE+It=g{NB9H6Z|4ujFoL>HZ#i*FK4P}?_uIsFvwaoM7_oGbPJV9~=xACiQiI*7Wg}cA}n0EYL=ps$S6t-7QtuqvauB7oc=ou^$ z?o`n^I)T^5sL4a)P!ezA#colJMp3-VGwoW*<&u_+Z+~(zJDscr%letVXR@o%XSwO^xEy z*gI!yDX-_`{iS_3Hd#U0Kx6j|k>5575e5r|!C~Ti=bnq)Q${uynb;qbXG(5Jl!&+; z^H`7n1rzhL5`8u{k-d$(R{Z*Z;C-`8aMB4LpfjEyeAaSQ3gl(M8!mxcJB2<<{#`C( ze2OhDLQVx74b2+-D_%NOo?Q}Qzs@MB&vajRBja1IGmC9Lh@V;>ly*R+JL1iM`wLU& znLN0=r?K>+t5mY&l$|%E8}75eUgWE|&_bFwG(fz8vtDrFk0#LT=By}Z;C1rt33 zJwt=FTwDi$iVk?XIEGmGFP)$$bjU!!wRrxF87txztTWnH?yzu&gjl!R!^a;_|64Nq zX6md9jA?OYH-EnGwo>}V{W(20T+Zx6@2?O1pG`HzhExCm literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/gun_zomg.png b/assets/hbm/textures/items/gun_zomg.png new file mode 100644 index 0000000000000000000000000000000000000000..22e1afb1e0ac66d926bcbff436e9d8f90f841680 GIT binary patch literal 308 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwt=FTwDi$ik5h~IEGmGFYUi5$gIf0y8gev_6C;d4eYZwa6K+glS=q~dqe^DC0rCb@d8TweWH_VI>I9fsdN?Ou89Rnch+fr;Llyq?Xu`;7QJ7o`12 zJHZn%J1w_a6%)pM?#Hzu1PH7eLFk*PsmL!h)b9|c0#LT=By}Z;C1rt33 zJwt=FTwDi$ih4X<978Ppm!47NYcSwpy)d^$VTTOc`MVn;Ot|`wPoJ{(>GYBV4ttio z{#CEADE>|==jRo-97@Gky!@HTUtIFwg5VrkfgPK=MQ$uRF~wky?;EB=FV-Eg*|R}I zE8@8DG>$Vb4*U>4yi@4R3xz#R+Iy}$p15e_A|X<-o_SIM-@R84D!Gh5|2Pyotzi25 az#EJ^0v>Q3_|gq>JcFmJpUXO@geCwn$83K9 literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/singularity.png b/assets/hbm/textures/items/singularity.png new file mode 100644 index 0000000000000000000000000000000000000000..a9cbde44446895933a6739ab53d51dbf945a6bea GIT binary patch literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwt=FTwDi$itc*4IEGmGFP*rN_mF{r>)j>^hR%|XNnJvnO^iVoFI`xc#Hul)p-*$g zj7C$5Cm$yNm^QaqK(k$!_s{PCt|D>%nwZ!lvI6;>1s;*b z3=DjSK$uZf!>a)(C|TkfQ4*Y=R#Ki=l*&+$n3-3imzP?iV4`QBXK1jNi|YVT(M?Ym z#}Etur4u*uG8yu?UcPW4(7{aoUaK4q*NDw&U_Ezcz0lN<#g|5tt7YK>fv%lnibEMcZ((z#m(31?Fu6{1-oD!M!lvI6;>1s;*b3=DjSL74G){)!Z!-~>+>$B+p3w^tmw8WaRtA8srz*|YA#zS?%P z<1$QzZd;rdeb?RO%JO%yr4aYel5n%-p_?y$UB?z2)m~^lH-2Bx4&xsmSc<0xJnUR1 z^qBj|YP0&>cXL1Mbt+%@R9t3T8J*P|>#(PUX-1^O4ON$T!QBks7&brq@6h>5ZpHck sah+9+ZNU=`&o}t~)E4NN59KcG&z@O`b}rv|3CLyeboFyt=akR{063aoM*si- literal 0 HcmV?d00001 diff --git a/com/hbm/entity/EntityBullet.java b/com/hbm/entity/EntityBullet.java index b291029e4..1e81d8f9f 100644 --- a/com/hbm/entity/EntityBullet.java +++ b/com/hbm/entity/EntityBullet.java @@ -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()) { diff --git a/com/hbm/entity/EntityCombineBall.java b/com/hbm/entity/EntityCombineBall.java new file mode 100644 index 000000000..fc8ca7c44 --- /dev/null +++ b/com/hbm/entity/EntityCombineBall.java @@ -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; + } +} \ No newline at end of file diff --git a/com/hbm/entity/EntityGrenadeLemon.java b/com/hbm/entity/EntityGrenadeLemon.java new file mode 100644 index 000000000..cd402e562 --- /dev/null +++ b/com/hbm/entity/EntityGrenadeLemon.java @@ -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); + } + } +} diff --git a/com/hbm/entity/EntityHunterChopper.java b/com/hbm/entity/EntityHunterChopper.java index 8ed9f59df..668d36cae 100644 --- a/com/hbm/entity/EntityHunterChopper.java +++ b/com/hbm/entity/EntityHunterChopper.java @@ -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); } } diff --git a/com/hbm/entity/EntityNukeExplosionAdvanced.java b/com/hbm/entity/EntityNukeExplosionAdvanced.java index 113b60380..2609b3fe5 100644 --- a/com/hbm/entity/EntityNukeExplosionAdvanced.java +++ b/com/hbm/entity/EntityNukeExplosionAdvanced.java @@ -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; diff --git a/com/hbm/entity/EntityRainbow.java b/com/hbm/entity/EntityRainbow.java new file mode 100644 index 000000000..2302ca1f9 --- /dev/null +++ b/com/hbm/entity/EntityRainbow.java @@ -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)); + } +} diff --git a/com/hbm/explosion/ExplosionFleija.java b/com/hbm/explosion/ExplosionFleija.java index 9556b6015..24be058f0 100644 --- a/com/hbm/explosion/ExplosionFleija.java +++ b/com/hbm/explosion/ExplosionFleija.java @@ -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; @@ -31,8 +32,9 @@ public class ExplosionFleija this.radius = rad; 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); } diff --git a/com/hbm/items/GunOSIPR.java b/com/hbm/items/GunOSIPR.java index e2b3da913..fe9f26bf2 100644 --- a/com/hbm/items/GunOSIPR.java +++ b/com/hbm/items/GunOSIPR.java @@ -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"); + 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); } diff --git a/com/hbm/items/GunZOMG.java b/com/hbm/items/GunZOMG.java new file mode 100644 index 000000000..9a62dffed --- /dev/null +++ b/com/hbm/items/GunZOMG.java @@ -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; + } +} diff --git a/com/hbm/items/ItemDrop.java b/com/hbm/items/ItemDrop.java index 3b00a4d76..d4feca834 100644 --- a/com/hbm/items/ItemDrop.java +++ b/com/hbm/items/ItemDrop.java @@ -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; @@ -45,5 +84,31 @@ 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."); + } + } } diff --git a/com/hbm/items/ItemGrenade.java b/com/hbm/items/ItemGrenade.java index e18eb8f05..2f7c70211 100644 --- a/com/hbm/items/ItemGrenade.java +++ b/com/hbm/items/ItemGrenade.java @@ -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,107 +24,89 @@ import net.minecraft.world.World; public class ItemGrenade extends Item { - 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) - { - --p_77659_1_.stackSize; - } + public ItemGrenade() { + this.maxStackSize = 16; + } - p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + @Override + 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; + } - 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) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeStrong(p_77659_2_, p_77659_3_)); - } - 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) - { - 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) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeCluster(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_flare) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeFlare(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_electric) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeElectric(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_poison) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadePoison(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_gas) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeGas(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_schrabidium) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeSchrabidium(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_nuke) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeNuke(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_nuclear) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeNuclear(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_plasma) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadePlasma(p_77659_2_, p_77659_3_)); - } - if(this == ModItems.grenade_tau) - { - p_77659_2_.spawnEntityInWorld(new EntityGrenadeTau(p_77659_2_, p_77659_3_)); - } - } + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - return p_77659_1_; - } + 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) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadeStrong(p_77659_2_, p_77659_3_)); + } + 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) { + 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) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadeCluster(p_77659_2_, p_77659_3_)); + } + if (this == ModItems.grenade_flare) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadeFlare(p_77659_2_, p_77659_3_)); + } + if (this == ModItems.grenade_electric) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadeElectric(p_77659_2_, p_77659_3_)); + } + if (this == ModItems.grenade_poison) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadePoison(p_77659_2_, p_77659_3_)); + } + if (this == ModItems.grenade_gas) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadeGas(p_77659_2_, p_77659_3_)); + } + if (this == ModItems.grenade_schrabidium) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadeSchrabidium(p_77659_2_, p_77659_3_)); + } + if (this == ModItems.grenade_nuke) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadeNuke(p_77659_2_, p_77659_3_)); + } + if (this == ModItems.grenade_nuclear) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadeNuclear(p_77659_2_, p_77659_3_)); + } + if (this == ModItems.grenade_plasma) { + p_77659_2_.spawnEntityInWorld(new EntityGrenadePlasma(p_77659_2_, p_77659_3_)); + } + 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_)); + } + } - @Override + return p_77659_1_; + } + + @Override public EnumRarity getRarity(ItemStack p_77613_1_) { - - if(this == ModItems.grenade_schrabidium) - { - return EnumRarity.rare; - } - - if(this == ModItems.grenade_plasma) - { - return EnumRarity.epic; - } - - if(this == ModItems.grenade_nuke || this == ModItems.grenade_nuclear || this == ModItems.grenade_tau) - { - return EnumRarity.uncommon; - } - - return EnumRarity.common; - } + + if (this == ModItems.grenade_schrabidium) { + return EnumRarity.rare; + } + + if (this == ModItems.grenade_plasma) { + return EnumRarity.epic; + } + + if (this == ModItems.grenade_nuke || this == ModItems.grenade_nuclear || this == ModItems.grenade_tau || this == ModItems.grenade_lemon) { + return EnumRarity.uncommon; + } + + return EnumRarity.common; + } } diff --git a/com/hbm/items/ItemLemon.java b/com/hbm/items/ItemLemon.java new file mode 100644 index 000000000..38ea5a677 --- /dev/null +++ b/com/hbm/items/ItemLemon.java @@ -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."); + } + +} diff --git a/com/hbm/items/ItemStarterKit.java b/com/hbm/items/ItemStarterKit.java index 7990598ce..66d65ecd0 100644 --- a/com/hbm/items/ItemStarterKit.java +++ b/com/hbm/items/ItemStarterKit.java @@ -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)); } diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index f15f16916..a3f7a0440 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -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()); } } diff --git a/com/hbm/lib/Library.java b/com/hbm/lib/Library.java index bbee13261..75a8d332e 100644 --- a/com/hbm/lib/Library.java +++ b/com/hbm/lib/Library.java @@ -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 superuser = new ArrayList(); + public static boolean checkArmor(EntityPlayer player, Item helmet, Item plate, Item legs, Item boots) { if(player.inventory.armorInventory[0] != null && diff --git a/com/hbm/lib/ModDamageSource.java b/com/hbm/lib/ModDamageSource.java index 0c4ee09c4..ce9ebae17 100644 --- a/com/hbm/lib/ModDamageSource.java +++ b/com/hbm/lib/ModDamageSource.java @@ -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(); @@ -66,5 +76,21 @@ 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; + } } diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index 2e943f366..14abbfba2 100644 --- a/com/hbm/main/ClientProxy.java +++ b/com/hbm/main/ClientProxy.java @@ -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"); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 443be7e4a..cfb187031 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -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 })); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index d56fa5716..b824421c1 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -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; @@ -214,6 +218,8 @@ public class MainRegistry CraftingManager.mainRegistry(); proxy.registerRenderInfo(); HbmWorld.mainRegistry(); + + Library.superuser.add("192af5d7-ed0f-48d8-bd89-9d41af8524f8"); enumArmorMaterialSchrabidium.customCraftingMaterial = ModItems.ingot_schrabidium; enumArmorMaterialHazmat.customCraftingMaterial = ModItems.hazmat_cloth; @@ -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); diff --git a/com/hbm/render/ModelHunterChopper.java b/com/hbm/render/ModelHunterChopper.java index a99641bde..c0bb770ba 100644 --- a/com/hbm/render/ModelHunterChopper.java +++ b/com/hbm/render/ModelHunterChopper.java @@ -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()); diff --git a/com/hbm/render/ModelRainbow.java b/com/hbm/render/ModelRainbow.java new file mode 100644 index 000000000..7cb770333 --- /dev/null +++ b/com/hbm/render/ModelRainbow.java @@ -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); + } + +} diff --git a/com/hbm/render/RenderHunterChopper.java b/com/hbm/render/RenderHunterChopper.java index 869c5740c..185197d34 100644 --- a/com/hbm/render/RenderHunterChopper.java +++ b/com/hbm/render/RenderHunterChopper.java @@ -32,6 +32,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")); diff --git a/com/hbm/render/RenderRainbow.java b/com/hbm/render/RenderRainbow.java new file mode 100644 index 000000000..e29db6fd1 --- /dev/null +++ b/com/hbm/render/RenderRainbow.java @@ -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"); + } +}