aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/entity/projectile
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-09-24 19:05:03 +1000
committerAlkalus <draknyte1@hotmail.com>2017-09-24 19:05:03 +1000
commitbf75cef777ce71bdb3be87519216c6f984d3994f (patch)
tree06dbf8175d4fbf32dc41463e403a125daf82a1cc /src/Java/gtPlusPlus/core/entity/projectile
parent160aeab1167363fc38cf348a8fe413ab829c8612 (diff)
downloadGT5-Unofficial-bf75cef777ce71bdb3be87519216c6f984d3994f.tar.gz
GT5-Unofficial-bf75cef777ce71bdb3be87519216c6f984d3994f.tar.bz2
GT5-Unofficial-bf75cef777ce71bdb3be87519216c6f984d3994f.zip
+ Added a throwable potion of sulfuric acid.
Diffstat (limited to 'src/Java/gtPlusPlus/core/entity/projectile')
-rw-r--r--src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java b/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java
new file mode 100644
index 0000000000..6f4c57f294
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java
@@ -0,0 +1,51 @@
+package gtPlusPlus.core.entity.projectile;
+
+import gtPlusPlus.core.util.entity.EntityUtils;
+import gtPlusPlus.core.util.math.MathUtils;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.projectile.EntityThrowable;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.world.World;
+
+public class EntitySulfuricAcidPotion extends EntityThrowable {
+
+ public EntitySulfuricAcidPotion(World world) {
+ super(world);
+ }
+
+ public EntitySulfuricAcidPotion(World world, EntityLivingBase entity) {
+ super(world, entity);
+ }
+
+ public EntitySulfuricAcidPotion(World world, double posX, double posY, double posZ) {
+ super(world, posX, posY, posZ);
+ }
+
+ /**
+ * Called when this EntityThrowable hits a block or entity.
+ */
+ protected void onImpact(MovingObjectPosition object) {
+ if (object.entityHit != null) {
+ byte b0 = 6;
+ object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float) b0);
+ EntityUtils.setEntityOnFire(object.entityHit, 10);
+ }
+
+ String mParticleType = "reddust";
+ int e=0;
+ for (int i = 0; i < 24; ++i) {
+ if ((e = MathUtils.randInt(0, 5)) <= 1){
+ if (e==0)
+ mParticleType = "largesmoke";
+ if (e==1)
+ mParticleType = "flame";
+ }
+ this.worldObj.spawnParticle(mParticleType, this.posX+MathUtils.randDouble(0, 2), this.posY+MathUtils.randDouble(0, 2), this.posZ+MathUtils.randDouble(0, 2), 0.0D, 0.0D, 0.0D);
+ }
+
+ if (!this.worldObj.isRemote) {
+ this.setDead();
+ }
+ }
+} \ No newline at end of file