diff --git a/src/main/java/assets/hbm/lang/de_DE.lang b/src/main/java/assets/hbm/lang/de_DE.lang index b0bc3b661..ca4d67c39 100644 --- a/src/main/java/assets/hbm/lang/de_DE.lang +++ b/src/main/java/assets/hbm/lang/de_DE.lang @@ -354,6 +354,7 @@ item.ammo_50bmg_du.name=.50 BMG Patrone (DU) item.ammo_50bmg_explosive.name=.50 BMG Patrone (Explosiv) item.ammo_50bmg_incendiary.name=.50 BMG Patrone (Brand) item.ammo_50bmg_phosphorus.name=.50 BMG Patrone (WP) +item.ammo_50bmg_sleek.name=.50 BMG Patrone (IF-F&E) item.ammo_50bmg_star.name=.50 BMG Patrone (Sternenmetall) item.ammo_556.name=5.56mm Patrone item.ammo_556_ap.name=5.56mm Patrone (AP) @@ -362,8 +363,10 @@ item.ammo_556_flechette.name=5.56mm Patrone (Flechet) item.ammo_556_flechette_du.name=5.56mm Flechetpatrone (Uran-Penetrator) item.ammo_556_flechette_incendiary.name=5.56mm Flechetpatrone (Brand) item.ammo_556_flechette_phosphorus.name=5.56mm Flechetpatrone (Phosphorspitze) +item.ammo_556_flechette_sleek.name=5.56mm Flechetpatrone (IF-F&E) item.ammo_556_k.name=5.56mm K-Patrone item.ammo_556_phosphorus.name=5.56mm Patrone (WP) +item.ammo_556_sleek.name=5.56mm Patrone (IF-F&E) item.ammo_556_star.name=5.56mm Patrone (Sternenmetall) item.ammo_556_tracer.name=5.56mm Patrone (Leuchtspur) item.ammo_5mm.name=5mm Patrone diff --git a/src/main/java/assets/hbm/lang/en_US.lang b/src/main/java/assets/hbm/lang/en_US.lang index c3c329dd6..ea3aaee01 100644 --- a/src/main/java/assets/hbm/lang/en_US.lang +++ b/src/main/java/assets/hbm/lang/en_US.lang @@ -354,6 +354,7 @@ item.ammo_50bmg_du.name=.50 BMG Round (DU) item.ammo_50bmg_explosive.name=.50 BMG Round (Explosive) item.ammo_50bmg_incendiary.name=.50 BMG Round (Incendiary) item.ammo_50bmg_phosphorus.name=.50 BMG Round (WP) +item.ammo_50bmg_sleek.name=.50 BMG Round (IF-R&D) item.ammo_50bmg_star.name=.50 BMG Round (Starmetal) item.ammo_556.name=5.56mm Round item.ammo_556_ap.name=5.56mm Round (AP) @@ -362,8 +363,10 @@ item.ammo_556_flechette.name=5.56mm Flechette Round item.ammo_556_flechette_du.name=5.56mm Flechette Round (Uranium Penetrator) item.ammo_556_flechette_incendiary.name=5.56mm Flechette Round (Incendiary) item.ammo_556_flechette_phosphorus.name=5.56mm Flechette Round (Phosphorus-Tipped) +item.ammo_556_flechette_sleek.name=5.56mm Flechette Round (IF-R&D) item.ammo_556_k.name=5.56mm K-Round item.ammo_556_phosphorus.name=5.56mm Round (WP) +item.ammo_556_sleek.name=5.56mm Round (IF-R&D) item.ammo_556_star.name=5.56mm Round (Starmetal) item.ammo_556_tracer.name=5.56mm Round (Tracer) item.ammo_5mm.name=5mm Round diff --git a/src/main/java/assets/hbm/models/weapons/meteor.obj b/src/main/java/assets/hbm/models/weapons/meteor.obj new file mode 100644 index 000000000..6d8c66760 --- /dev/null +++ b/src/main/java/assets/hbm/models/weapons/meteor.obj @@ -0,0 +1,154 @@ +# Blender v2.79 (sub 0) OBJ File: 'meteor.blend' +# www.blender.org +o Cube +v 0.500000 -0.171667 -0.171667 +v 0.171667 -0.500000 -0.171667 +v 0.171667 -0.171667 -0.500000 +v 0.500000 -0.171667 0.171667 +v 0.171667 -0.171667 0.500000 +v 0.171667 -0.500000 0.171667 +v -0.171667 -0.171667 0.500000 +v -0.500000 -0.171667 0.171667 +v -0.171667 -0.500000 0.171667 +v -0.171667 -0.171667 -0.500000 +v -0.171667 -0.500000 -0.171667 +v -0.500000 -0.171667 -0.171667 +v 0.171667 0.171667 -0.500000 +v 0.171667 0.500000 -0.171667 +v 0.500000 0.171667 -0.171667 +v 0.171667 0.171667 0.500000 +v 0.500000 0.171667 0.171668 +v 0.171667 0.500000 0.171667 +v -0.500000 0.171667 0.171667 +v -0.171667 0.171667 0.500000 +v -0.171667 0.500000 0.171667 +v -0.500000 0.171667 -0.171667 +v -0.171667 0.500000 -0.171667 +v -0.171667 0.171667 -0.500000 +vt 0.671633 0.328367 +vt 0.328367 0.671633 +vt 0.328367 0.328367 +vt 0.671633 0.671633 +vt 0.328367 0.328367 +vt 0.671633 0.328367 +vt 0.328367 0.328367 +vt 0.671633 0.671633 +vt 0.328367 0.671633 +vt 0.328367 0.671633 +vt 0.671633 0.328367 +vt 0.671633 0.671633 +vt 0.671633 0.671633 +vt 0.328367 0.328367 +vt 0.671633 0.328367 +vt 0.671633 0.328367 +vt 0.671633 0.000100 +vt 0.999900 0.328367 +vt 0.328367 0.328367 +vt 0.000100 0.328367 +vt 0.328367 0.000100 +vt 0.000100 0.328367 +vt 0.328367 0.000100 +vt 0.328367 0.999900 +vt 0.000100 0.671633 +vt 0.671633 0.000100 +vt 0.999900 0.328367 +vt 0.999900 0.671633 +vt 0.671633 0.999900 +vt 0.000100 0.328367 +vt 0.328367 0.000100 +vt 0.671633 0.328367 +vt 0.671633 0.000100 +vt 0.999900 0.328367 +vt 0.671633 0.000100 +vt 0.999900 0.671633 +vt 0.671633 0.671633 +vt 0.671633 0.000100 +vt 0.328367 0.671633 +vt 0.328367 0.999900 +vt 0.328367 0.671633 +vt 0.999900 0.671633 +vt 0.999900 0.671633 +vt 0.328367 0.328367 +vt 0.671633 0.000100 +vt 0.000100 0.328367 +vt 0.671633 0.671633 +vt 0.328367 0.671633 +vt 0.328367 0.000100 +vt 0.000100 0.671633 +vt 0.671633 0.999900 +vt 0.000100 0.671633 +vt 0.999900 0.328367 +vt 0.328367 0.000100 +vt 0.328367 0.000100 +vt 0.000100 0.671633 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 -1.0000 0.0000 +vn -1.0000 0.0000 -0.0000 +vn 0.0000 1.0000 0.0000 +vn -0.0000 -0.0000 1.0000 +vn 0.5774 -0.5774 -0.5774 +vn 0.5774 -0.5774 0.5774 +vn -0.5774 -0.5774 0.5774 +vn -0.5774 -0.5774 -0.5774 +vn 0.5774 0.5774 -0.5774 +vn 0.5773 0.5774 0.5774 +vn -0.5774 0.5774 0.5774 +vn -0.5774 0.5774 -0.5774 +vn 0.7071 -0.7071 -0.0000 +vn 0.0000 -0.7071 -0.7071 +vn 0.7071 0.0000 -0.7071 +vn 0.0000 -0.7071 0.7071 +vn 0.7071 -0.0000 0.7071 +vn -0.7071 -0.7071 -0.0000 +vn -0.7071 -0.0000 0.7071 +vn -0.7071 0.0000 -0.7071 +vn 0.7071 0.7071 0.0000 +vn 0.0000 0.7071 -0.7071 +vn -0.0000 0.7071 0.7071 +vn -0.7071 0.7071 -0.0000 +vn 1.0000 -0.0000 0.0000 +s off +f 13/1/1 10/2/1 24/3/1 +f 6/4/2 11/5/2 2/6/2 +f 19/7/3 12/8/3 8/9/3 +f 23/10/4 18/11/4 14/12/4 +f 16/13/5 7/14/5 5/15/5 +f 1/16/6 2/17/6 3/18/6 +f 4/19/7 5/20/7 6/21/7 +f 7/14/8 8/22/8 9/23/8 +f 10/2/9 11/24/9 12/25/9 +f 13/1/10 14/26/10 15/27/10 +f 16/13/11 17/28/11 18/29/11 +f 19/7/12 20/30/12 21/31/12 +f 22/32/13 23/33/13 24/34/13 +f 1/16/14 6/21/14 2/17/14 +f 11/5/15 3/35/15 2/6/15 +f 13/1/16 1/36/16 3/37/16 +f 5/15/17 9/23/17 6/38/17 +f 17/39/18 5/20/18 4/19/18 +f 12/8/19 9/40/19 8/9/19 +f 20/41/20 8/22/20 7/14/20 +f 22/32/21 10/42/21 12/8/21 +f 18/11/22 15/43/22 14/12/22 +f 24/3/23 14/26/23 13/1/23 +f 21/44/24 16/45/24 18/11/24 +f 23/10/25 19/46/25 21/44/25 +f 15/47/26 4/19/26 1/16/26 +f 13/1/1 3/37/1 10/2/1 +f 6/4/2 9/48/2 11/5/2 +f 19/7/3 22/32/3 12/8/3 +f 23/10/4 21/44/4 18/11/4 +f 16/13/5 20/41/5 7/14/5 +f 1/16/14 4/19/14 6/21/14 +f 11/5/15 10/49/15 3/35/15 +f 13/1/16 15/27/16 1/36/16 +f 5/15/17 7/14/17 9/23/17 +f 17/39/18 16/50/18 5/20/18 +f 12/8/19 11/51/19 9/40/19 +f 20/41/20 19/52/20 8/22/20 +f 22/32/21 24/34/21 10/42/21 +f 18/11/22 17/53/22 15/43/22 +f 24/3/23 23/54/23 14/26/23 +f 21/44/24 20/55/24 16/45/24 +f 23/10/25 22/56/25 19/46/25 +f 15/47/26 17/39/26 4/19/26 diff --git a/src/main/java/assets/hbm/textures/items/ammo_50bmg_sleek.png b/src/main/java/assets/hbm/textures/items/ammo_50bmg_sleek.png new file mode 100644 index 000000000..71714637b Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ammo_50bmg_sleek.png differ diff --git a/src/main/java/assets/hbm/textures/items/ammo_556_flechette_sleek.png b/src/main/java/assets/hbm/textures/items/ammo_556_flechette_sleek.png new file mode 100644 index 000000000..c38664e14 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ammo_556_flechette_sleek.png differ diff --git a/src/main/java/assets/hbm/textures/items/ammo_556_sleek.png b/src/main/java/assets/hbm/textures/items/ammo_556_sleek.png new file mode 100644 index 000000000..226b4566e Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ammo_556_sleek.png differ diff --git a/src/main/java/assets/hbm/textures/items/ingot_semtex.png b/src/main/java/assets/hbm/textures/items/ingot_semtex.png new file mode 100644 index 000000000..ccfd01c43 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ingot_semtex.png differ diff --git a/src/main/java/assets/hbm/textures/items/motor_desh.png b/src/main/java/assets/hbm/textures/items/motor_desh.png index b4bbc2062..0aec89bac 100644 Binary files a/src/main/java/assets/hbm/textures/items/motor_desh.png and b/src/main/java/assets/hbm/textures/items/motor_desh.png differ diff --git a/src/main/java/com/hbm/entity/mob/EntityMaskMan.java b/src/main/java/com/hbm/entity/mob/EntityMaskMan.java index 360847810..8cc210e90 100644 --- a/src/main/java/com/hbm/entity/mob/EntityMaskMan.java +++ b/src/main/java/com/hbm/entity/mob/EntityMaskMan.java @@ -1,10 +1,11 @@ package com.hbm.entity.mob; -import com.hbm.entity.mob.ai.EntityAIShootTarget; +import com.hbm.entity.mob.ai.EntityAIMaskmanCasualApproach; +import com.hbm.entity.mob.ai.EntityAIMaskmanLasergun; +import com.hbm.entity.mob.ai.EntityAIMaskmanMinigun; import com.hbm.items.ModItems; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; @@ -22,8 +23,9 @@ public class EntityMaskMan extends EntityMob implements IBossDisplayData { super(world); this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); - this.tasks.addTask(2, new EntityAIShootTarget(this, true, true, 3)); + this.tasks.addTask(2, new EntityAIMaskmanCasualApproach(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(2, new EntityAIMaskmanMinigun(this, true, true, 3)); + this.tasks.addTask(3, new EntityAIMaskmanLasergun(this, true, true)); this.tasks.addTask(3, new EntityAIWander(this, 1.0D)); this.tasks.addTask(4, new EntityAILookIdle(this)); this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); @@ -37,35 +39,12 @@ public class EntityMaskMan extends EntityMob implements IBossDisplayData { protected void applyEntityAttributes() { super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(24.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(100.0D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(15.0D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(1000.0D); } - - //public static final int dwTargetPlayer = 12; - - /*protected void entityInit() { - super.entityInit(); - this.getDataWatcher().addObject(dwTargetPlayer, new Integer(0)); - }*/ - - public void onLivingUpdate() { - - super.onLivingUpdate(); - - /*if(worldObj.isRemote) { - - } else { - - if(this.getAITarget() != null) { - this.getDataWatcher().updateObject(dwTargetPlayer, this.getAITarget().getEntityId()); - } else { - this.getDataWatcher().updateObject(dwTargetPlayer, 0); - } - }*/ - } public boolean isAIEnabled() { return true; @@ -77,6 +56,7 @@ public class EntityMaskMan extends EntityMob implements IBossDisplayData { protected void dropFewItems(boolean bool, int i) { - this.dropItem(ModItems.coin_maskman, 1); + if(!worldObj.isRemote) + this.dropItem(ModItems.coin_maskman, 1); } } diff --git a/src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanCasualApproach.java b/src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanCasualApproach.java new file mode 100644 index 000000000..058f9211c --- /dev/null +++ b/src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanCasualApproach.java @@ -0,0 +1,165 @@ +package com.hbm.entity.mob.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityAIMaskmanCasualApproach extends EntityAIBase { + + World worldObj; + EntityCreature attacker; + int attackTick; + double speedTowardsTarget; + boolean longMemory; + PathEntity entityPathEntity; + Class classTarget; + private int pathTimer; + private double lastX; + private double lastY; + private double lastZ; + + private int failedPathFindingPenalty; + + public EntityAIMaskmanCasualApproach(EntityCreature owner, Class target, double speed, boolean longMemory) { + this(owner, speed, longMemory); + this.classTarget = target; + } + + public EntityAIMaskmanCasualApproach(EntityCreature owner, double speed, boolean longMemory) { + this.attacker = owner; + this.worldObj = owner.worldObj; + this.speedTowardsTarget = speed; + this.longMemory = longMemory; + this.setMutexBits(3); + } + + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + + if(entitylivingbase == null) { + return false; + + } else if(!entitylivingbase.isEntityAlive()) { + return false; + + } else if(this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) { + return false; + + } else { + + if(--this.pathTimer <= 0) { + + double[] pos = getApproachPos(); + this.entityPathEntity = this.attacker.getNavigator().getPathToXYZ(pos[0], pos[1], pos[2]); + this.pathTimer = 4 + this.attacker.getRNG().nextInt(7); + return this.entityPathEntity != null; + + } else { + return true; + } + } + } + + + public boolean continueExecuting() { + + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + + return entitylivingbase == null ? false + : (!entitylivingbase.isEntityAlive() ? false + : (!this.longMemory ? !this.attacker.getNavigator().noPath() + : this.attacker.isWithinHomeDistance(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)))); + } + + + public void startExecuting() { + this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); + this.pathTimer = 0; + } + + + public void resetTask() { + this.attacker.getNavigator().clearPathEntity(); + } + + + public void updateTask() { + + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + this.attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F); + double d0 = this.attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ); + double d1 = (double) (this.attacker.width * 2.0F * this.attacker.width * 2.0F + entitylivingbase.width); + + this.pathTimer--; + + if((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && this.pathTimer <= 0 + && (this.lastX == 0.0D && this.lastY == 0.0D && this.lastZ == 0.0D + || entitylivingbase.getDistanceSq(this.lastX, this.lastY, this.lastZ) >= 1.0D + || this.attacker.getRNG().nextFloat() < 0.05F)) { + + this.lastX = entitylivingbase.posX; + this.lastY = entitylivingbase.boundingBox.minY; + this.lastZ = entitylivingbase.posZ; + this.pathTimer = failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7); + + if(this.attacker.getNavigator().getPath() != null) { + + PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint(); + if(finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) { + failedPathFindingPenalty = 0; + + } else { + failedPathFindingPenalty += 10; + } + + } else { + failedPathFindingPenalty += 10; + } + + if(d0 > 1024.0D) { + this.pathTimer += 10; + } else if(d0 > 256.0D) { + this.pathTimer += 5; + } + + double[] pos = getApproachPos(); + if(!this.attacker.getNavigator().tryMoveToXYZ(pos[0], pos[1], pos[2], speedTowardsTarget)) { + this.pathTimer += 15; + } + } + + this.attackTick = Math.max(this.attackTick - 1, 0); + + /*if(d0 <= d1 && this.attackTick <= 20) { + this.attackTick = 20; + + if(this.attacker.getHeldItem() != null) { + this.attacker.swingItem(); + } + + this.attacker.attackEntityAsMob(entitylivingbase); + }*/ + } + + public double[] getApproachPos() { + + EntityLivingBase target = this.attacker.getAttackTarget(); + + Vec3 vec = Vec3.createVectorHelper(this.attacker.posX - target.posX, this.attacker.posY - target.posY, this.attacker.posZ - target.posZ); + + double range = Math.min(vec.lengthVector(), 20) - 10; + + vec = vec.normalize(); + + double x = this.attacker.posX + vec.xCoord * range + this.attacker.getRNG().nextGaussian() * 2; + double y = this.attacker.posY + vec.yCoord - 5 + this.attacker.getRNG().nextInt(11); + double z = this.attacker.posZ + vec.zCoord * range + this.attacker.getRNG().nextGaussian() * 2; + + return new double[] {x, y, z}; + } +} diff --git a/src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanLasergun.java b/src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanLasergun.java new file mode 100644 index 000000000..a298ce331 --- /dev/null +++ b/src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanLasergun.java @@ -0,0 +1,113 @@ +package com.hbm.entity.mob.ai; + +import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.handler.BulletConfigSyncingUtil; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.util.Vec3; + +public class EntityAIMaskmanLasergun extends EntityAIBase { + + private EntityCreature owner; + private EntityLivingBase target; + private EnumLaserAttack attack; + private int timer; + private int attackCount; + + public EntityAIMaskmanLasergun(EntityCreature owner, boolean checkSight, boolean nearbyOnly) { + this.owner = owner; + + attack = EnumLaserAttack.values()[owner.getRNG().nextInt(3)]; + } + + @Override + public boolean shouldExecute() { + + EntityLivingBase entity = this.owner.getAttackTarget(); + + if(entity == null) { + return false; + + } else { + this.target = entity; + double dist = Vec3.createVectorHelper(target.posX - owner.posX, target.posY - owner.posY, target.posZ - owner.posZ).lengthVector(); + return dist > 10; + } + } + + @Override + public boolean continueExecuting() { + return this.shouldExecute() || !this.owner.getNavigator().noPath(); + } + + @Override + public void updateTask() { + + timer--; + + if(timer <= 0) { + timer = attack.delay; + + switch(attack) { + case ORB: + EntityBulletBase orb = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.MASKMAN_ORB, owner, target, 2.0F, 0); + orb.motionY += 0.5D; + + owner.worldObj.spawnEntityInWorld(orb); + owner.playSound("hbm:weapon.teslaShoot", 1.0F, 1.0F); + break; + + case MISSILE: + EntityBulletBase missile = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.MASKMAN_ROCKET, owner, target, 1.0F, 0); + Vec3 vec = Vec3.createVectorHelper(target.posX - owner.posX, 0, target.posZ - owner.posZ); + missile.motionX = vec.xCoord * 0.05D; + missile.motionY = 0.5D + owner.getRNG().nextDouble() * 0.5D; + missile.motionZ = vec.zCoord * 0.05D; + + owner.worldObj.spawnEntityInWorld(missile); + owner.playSound("hbm:weapon.hkShoot", 1.0F, 1.0F); + break; + + case SPLASH: + + for(int i = 0; i < 5; i++) { + EntityBulletBase tracer = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.MASKMAN_TRACER, owner, target, 1.0F, 0.05F); + owner.worldObj.spawnEntityInWorld(tracer); + } + break; + + default: + break; + } + + attackCount++; + + if(attackCount >= attack.amount) { + + attackCount = 0; + + int newAtk = attack.ordinal() + owner.getRNG().nextInt(EnumLaserAttack.values().length - 1); + attack = EnumLaserAttack.values()[newAtk % EnumLaserAttack.values().length]; + } + } + + this.owner.rotationYaw = this.owner.rotationYawHead; + } + + private static enum EnumLaserAttack { + + ORB(60, 5), + MISSILE(10, 10), + SPLASH(40, 3); + + public int delay; + public int amount; + + private EnumLaserAttack(int delay, int amount) { + this.delay = delay; + this.amount = amount; + } + } +} diff --git a/src/main/java/com/hbm/entity/mob/ai/EntityAIShootTarget.java b/src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanMinigun.java similarity index 85% rename from src/main/java/com/hbm/entity/mob/ai/EntityAIShootTarget.java rename to src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanMinigun.java index 4efa9240d..e56037204 100644 --- a/src/main/java/com/hbm/entity/mob/ai/EntityAIShootTarget.java +++ b/src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanMinigun.java @@ -8,14 +8,14 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.util.Vec3; -public class EntityAIShootTarget extends EntityAIBase { +public class EntityAIMaskmanMinigun extends EntityAIBase { private EntityCreature owner; private EntityLivingBase target; int delay; int timer; - public EntityAIShootTarget(EntityCreature owner, boolean checkSight, boolean nearbyOnly, int delay) { + public EntityAIMaskmanMinigun(EntityCreature owner, boolean checkSight, boolean nearbyOnly, int delay) { this.owner = owner; this.delay = delay; timer = delay; @@ -49,7 +49,7 @@ public class EntityAIShootTarget extends EntityAIBase { if(timer <= 0) { timer = delay; - EntityBulletBase bullet = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.G20_SHRAPNEL, owner, target, 1.6F, 0); + EntityBulletBase bullet = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.MASKMAN_BULLET, owner, target, 1.0F, 0); owner.worldObj.spawnEntityInWorld(bullet); owner.playSound("hbm:weapon.calShoot", 1.0F, 1.0F); } diff --git a/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java b/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java index 3935b5116..859d1c1e1 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java +++ b/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java @@ -59,6 +59,11 @@ public class EntityBulletBase extends Entity implements IProjectile { this.dataWatcher.updateObject(18, config); this.renderDistanceWeight = 10.0D; + if(this.config == null) { + this.setDead(); + return; + } + this.dataWatcher.updateObject(16, (byte)this.config.style); this.dataWatcher.updateObject(17, (byte)this.config.trail); @@ -184,6 +189,11 @@ public class EntityBulletBase extends Entity implements IProjectile { if(config == null) config = BulletConfigSyncingUtil.pullConfig(dataWatcher.getWatchableObjectInt(18)); + + if(config == null){ + this.setDead(); + return; + } if(config.maxAge == 0) { this.setDead(); diff --git a/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java b/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java index 9278b9984..b6375f0b1 100644 --- a/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java +++ b/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java @@ -93,6 +93,7 @@ public class BulletConfigSyncingUtil { public static int BMG50_DU = i++; public static int BMG50_STAR = i++; public static int BMG50_PHOSPHORUS = i++; + public static int BMG50_SLEEK = i++; public static int R5_NORMAL = i++; public static int R5_EXPLOSIVE = i++; @@ -131,11 +132,13 @@ public class BulletConfigSyncingUtil { public static int R556_AP = i++; public static int R556_DU = i++; public static int R556_STAR = i++; + public static int R556_SLEEK = i++; public static int R556_TRACER = i++; public static int R556_FLECHETTE = i++; public static int R556_FLECHETTE_INCENDIARY = i++; public static int R556_FLECHETTE_PHOSPHORUS = i++; public static int R556_FLECHETTE_DU = i++; + public static int R556_FLECHETTE_SLEEK = i++; public static int R556_K = i++; public static int G20_NORMAL_FIRE = i++; @@ -163,6 +166,13 @@ public class BulletConfigSyncingUtil { public static int NUKE_MIRV = i++; public static int NUKE_AMAT = i++; public static int NUKE_PROTO = i++; + + public static int MASKMAN_BULLET = i++; + public static int MASKMAN_ORB = i++; + public static int MASKMAN_BOLT = i++; + public static int MASKMAN_ROCKET = i++; + public static int MASKMAN_TRACER = i++; + public static int MASKMAN_METEOR = i++; public static void loadConfigsForSync() { @@ -248,6 +258,7 @@ public class BulletConfigSyncingUtil { configSet.put(BMG50_AP, Gun50BMGFactory.get50BMGAPConfig()); configSet.put(BMG50_DU, Gun50BMGFactory.get50BMGDUConfig()); configSet.put(BMG50_STAR, Gun50BMGFactory.get50BMGStarConfig()); + configSet.put(BMG50_SLEEK, Gun50BMGFactory.get50BMGSleekConfig()); configSet.put(R5_NORMAL, Gun5mmFactory.get5mmConfig()); configSet.put(R5_EXPLOSIVE, Gun5mmFactory.get5mmExplosiveConfig()); @@ -286,11 +297,13 @@ public class BulletConfigSyncingUtil { configSet.put(R556_AP, Gun556mmFactory.get556APConfig()); configSet.put(R556_DU, Gun556mmFactory.get556DUConfig()); configSet.put(R556_STAR, Gun556mmFactory.get556StarConfig()); + configSet.put(R556_SLEEK, Gun556mmFactory.get556SleekConfig()); configSet.put(R556_TRACER, Gun556mmFactory.get556TracerConfig()); configSet.put(R556_FLECHETTE, Gun556mmFactory.get556FlechetteConfig()); configSet.put(R556_FLECHETTE_INCENDIARY, Gun556mmFactory.get556FlechetteIncendiaryConfig()); configSet.put(R556_FLECHETTE_PHOSPHORUS, Gun556mmFactory.get556FlechettePhosphorusConfig()); configSet.put(R556_FLECHETTE_DU, Gun556mmFactory.get556FlechetteDUConfig()); + configSet.put(R556_FLECHETTE_SLEEK, Gun556mmFactory.get556FlechetteSleekConfig()); configSet.put(R556_K, Gun556mmFactory.get556KConfig()); configSet.put(G20_NORMAL_FIRE, Gun20GaugeFactory.get20GaugeConfig().setToFire(3)); @@ -315,8 +328,16 @@ public class BulletConfigSyncingUtil { configSet.put(ROCKET_TOXIC_LASER, GunRocketFactory.getRocketChlorineConfig().setToGuided()); configSet.put(NUKE_NORMAL, GunFatmanFactory.getNukeConfig()); + configSet.put(NUKE_MIRV, GunFatmanFactory.getMirvConfig()); configSet.put(NUKE_PROTO, GunFatmanFactory.getNukeProtoConfig()); configSet.put(NUKE_AMAT, GunFatmanFactory.getBalefireConfig()); + + configSet.put(MASKMAN_BULLET, GunNPCFactory.getMaskmanBullet()); + configSet.put(MASKMAN_ORB, GunNPCFactory.getMaskmanOrb()); + configSet.put(MASKMAN_BOLT, GunNPCFactory.getMaskmanBolt()); + configSet.put(MASKMAN_ROCKET, GunNPCFactory.getMaskmanRocket()); + configSet.put(MASKMAN_TRACER, GunNPCFactory.getMaskmanTracer()); + configSet.put(MASKMAN_METEOR, GunNPCFactory.getMaskmanMeteor()); } public static BulletConfiguration pullConfig(int key) { diff --git a/src/main/java/com/hbm/handler/BulletConfiguration.java b/src/main/java/com/hbm/handler/BulletConfiguration.java index aa0fab3f9..f1c5f3afb 100644 --- a/src/main/java/com/hbm/handler/BulletConfiguration.java +++ b/src/main/java/com/hbm/handler/BulletConfiguration.java @@ -99,6 +99,7 @@ public class BulletConfiguration { public static final int STYLE_GRENADE = 9; public static final int STYLE_BF = 10; public static final int STYLE_ORB = 11; + public static final int STYLE_METEOR = 12; public static final int PLINK_NONE = 0; public static final int PLINK_BULLET = 1; diff --git a/src/main/java/com/hbm/handler/RadiationWorldHandler.java b/src/main/java/com/hbm/handler/RadiationWorldHandler.java index 3884bb2dc..9636a8751 100644 --- a/src/main/java/com/hbm/handler/RadiationWorldHandler.java +++ b/src/main/java/com/hbm/handler/RadiationWorldHandler.java @@ -1,6 +1,5 @@ package com.hbm.handler; -import java.util.List; import java.util.Map.Entry; import com.hbm.saveddata.RadiationSavedData; @@ -9,7 +8,6 @@ import net.minecraft.init.Blocks; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.WorldServer; -import net.minecraft.world.chunk.Chunk; import net.minecraft.world.gen.ChunkProviderServer; public class RadiationWorldHandler { @@ -22,7 +20,7 @@ public class RadiationWorldHandler { WorldServer serv = (WorldServer)world; RadiationSavedData data = RadiationSavedData.getData(serv); - List loadedChunks = ((ChunkProviderServer) serv.getChunkProvider()).func_152380_a(); + ChunkProviderServer provider = (ChunkProviderServer) serv.getChunkProvider(); int count = 50;//MainRegistry.worldRad; int threshold = 5;//MainRegistry.worldRadThreshold; @@ -35,7 +33,6 @@ public class RadiationWorldHandler { Entry randEnt = (Entry) entries[world.rand.nextInt(entries.length)]; ChunkCoordIntPair coords = randEnt.getKey(); - Chunk chunk = world.getChunkFromChunkCoords(coords.chunkXPos, coords.chunkZPos); for(int i = 0; i < 1; i++) { @@ -43,7 +40,7 @@ public class RadiationWorldHandler { if(randEnt == null || randEnt.getValue() < threshold) continue; - if(chunk != null && loadedChunks.contains(chunk)) { + if(provider.chunkExists(coords.chunkXPos, coords.chunkZPos)) { for(int a = 0; a < 16; a ++) { for(int b = 0; b < 16; b ++) { diff --git a/src/main/java/com/hbm/handler/guncfg/Gun50BMGFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun50BMGFactory.java index 56a8dcb01..2bac92a86 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun50BMGFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun50BMGFactory.java @@ -6,6 +6,7 @@ import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; +import com.hbm.interfaces.IBulletHitBehavior; import com.hbm.interfaces.IBulletImpactBehavior; import com.hbm.items.ModItems; import com.hbm.packet.AuxParticlePacketNT; @@ -14,6 +15,7 @@ import com.hbm.potion.HbmPotion; import com.hbm.render.util.RenderScreenOverlay.Crosshair; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; @@ -49,6 +51,7 @@ public class Gun50BMGFactory { config.config.add(BulletConfigSyncingUtil.BMG50_AP); config.config.add(BulletConfigSyncingUtil.BMG50_DU); config.config.add(BulletConfigSyncingUtil.BMG50_STAR); + config.config.add(BulletConfigSyncingUtil.BMG50_SLEEK); return config; } @@ -82,6 +85,7 @@ public class Gun50BMGFactory { config.config.add(BulletConfigSyncingUtil.BMG50_AP); config.config.add(BulletConfigSyncingUtil.BMG50_DU); config.config.add(BulletConfigSyncingUtil.BMG50_STAR); + config.config.add(BulletConfigSyncingUtil.BMG50_SLEEK); return config; } @@ -204,4 +208,54 @@ public class Gun50BMGFactory { return bullet; } + public static BulletConfiguration get50BMGSleekConfig() { + + BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + + bullet.ammo = ModItems.ammo_50bmg_sleek; + bullet.spread *= inaccuracy; + bullet.dmgMin = 50; + bullet.dmgMax = 70; + bullet.wear = 10; + bullet.leadChance = 100; + bullet.doesPenetrate = false; + + bullet.bHit = new IBulletHitBehavior() { + + @Override + public void behaveEntityHit(EntityBulletBase bullet, Entity hit) { + + if(bullet.worldObj.isRemote) + return; + + EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR); + meteor.setPosition(hit.posX, hit.posY + 30 + meteor.worldObj.rand.nextInt(10), hit.posZ); + meteor.motionY = -1D; + meteor.shooter = bullet.shooter; + bullet.worldObj.spawnEntityInWorld(meteor); + } + }; + + bullet.bImpact = new IBulletImpactBehavior() { + + @Override + public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) { + + if(bullet.worldObj.isRemote) + return; + + if(y == -1) + return; + + EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR); + meteor.setPosition(bullet.posX, bullet.posY + 30 + meteor.worldObj.rand.nextInt(10), bullet.posZ); + meteor.motionY = -1D; + meteor.shooter = bullet.shooter; + bullet.worldObj.spawnEntityInWorld(meteor); + } + }; + + return bullet; + } + } diff --git a/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java index f15c635e9..6031b4099 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java @@ -6,6 +6,7 @@ import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; +import com.hbm.interfaces.IBulletHitBehavior; import com.hbm.interfaces.IBulletImpactBehavior; import com.hbm.items.ModItems; import com.hbm.packet.AuxParticlePacketNT; @@ -18,6 +19,7 @@ import com.hbm.render.anim.HbmAnimations.AnimType; import com.hbm.render.util.RenderScreenOverlay.Crosshair; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; @@ -56,6 +58,7 @@ public class Gun556mmFactory { config.config.add(BulletConfigSyncingUtil.R556_AP); config.config.add(BulletConfigSyncingUtil.R556_DU); config.config.add(BulletConfigSyncingUtil.R556_STAR); + config.config.add(BulletConfigSyncingUtil.R556_SLEEK); config.config.add(BulletConfigSyncingUtil.R556_K); return config; @@ -100,6 +103,7 @@ public class Gun556mmFactory { config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_INCENDIARY); config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_PHOSPHORUS); config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_DU); + config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_SLEEK); config.config.add(BulletConfigSyncingUtil.R556_K); return config; @@ -234,6 +238,55 @@ public class Gun556mmFactory { return bullet; } + public static BulletConfiguration get556SleekConfig() { + + BulletConfiguration bullet = get556Config(); + + bullet.ammo = ModItems.ammo_556_sleek; + bullet.dmgMin = 15; + bullet.dmgMax = 20; + bullet.wear = 10; + bullet.leadChance = 100; + bullet.doesPenetrate = false; + + bullet.bHit = new IBulletHitBehavior() { + + @Override + public void behaveEntityHit(EntityBulletBase bullet, Entity hit) { + + if(bullet.worldObj.isRemote) + return; + + EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR); + meteor.setPosition(hit.posX, hit.posY + 30 + meteor.worldObj.rand.nextInt(10), hit.posZ); + meteor.motionY = -1D; + meteor.shooter = bullet.shooter; + bullet.worldObj.spawnEntityInWorld(meteor); + } + }; + + bullet.bImpact = new IBulletImpactBehavior() { + + @Override + public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) { + + if(bullet.worldObj.isRemote) + return; + + if(y == -1) + return; + + EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR); + meteor.setPosition(bullet.posX, bullet.posY + 30 + meteor.worldObj.rand.nextInt(10), bullet.posZ); + meteor.motionY = -1D; + meteor.shooter = bullet.shooter; + bullet.worldObj.spawnEntityInWorld(meteor); + } + }; + + return bullet; + } + public static BulletConfiguration get556TracerConfig() { BulletConfiguration bullet = get556Config(); @@ -313,6 +366,55 @@ public class Gun556mmFactory { return bullet; } + + public static BulletConfiguration get556FlechetteSleekConfig() { + + BulletConfiguration bullet = get556FlechetteConfig(); + + bullet.ammo = ModItems.ammo_556_flechette_sleek; + bullet.dmgMin = 12; + bullet.dmgMax = 16; + bullet.wear = 10; + bullet.leadChance = 50; + bullet.doesPenetrate = false; + + bullet.bHit = new IBulletHitBehavior() { + + @Override + public void behaveEntityHit(EntityBulletBase bullet, Entity hit) { + + if(bullet.worldObj.isRemote) + return; + + EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR); + meteor.setPosition(hit.posX, hit.posY + 30 + meteor.worldObj.rand.nextInt(10), hit.posZ); + meteor.motionY = -1D; + meteor.shooter = bullet.shooter; + bullet.worldObj.spawnEntityInWorld(meteor); + } + }; + + bullet.bImpact = new IBulletImpactBehavior() { + + @Override + public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) { + + if(bullet.worldObj.isRemote) + return; + + if(y == -1) + return; + + EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR); + meteor.setPosition(bullet.posX, bullet.posY + 30 + meteor.worldObj.rand.nextInt(10), bullet.posZ); + meteor.motionY = -1D; + meteor.shooter = bullet.shooter; + bullet.worldObj.spawnEntityInWorld(meteor); + } + }; + + return bullet; + } public static BulletConfiguration get556KConfig() { diff --git a/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java b/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java index 8815ba808..bed1cb4d5 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java @@ -9,6 +9,7 @@ import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; import com.hbm.interfaces.IBulletImpactBehavior; +import com.hbm.interfaces.IBulletUpdateBehavior; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; import com.hbm.render.util.RenderScreenOverlay.Crosshair; @@ -43,6 +44,20 @@ public class GunFatmanFactory { return config; } + public static GunConfiguration getMIRVConfig() { + + GunConfiguration config = getFatmanConfig(); + + config.name = "M-42 Experimental MIRV"; + config.manufacturer = "Fort Strong"; + + config.config = new ArrayList(); + config.config.add(BulletConfigSyncingUtil.NUKE_MIRV); + config.durability = 1000; + + return config; + } + public static GunConfiguration getBELConfig() { GunConfiguration config = getFatmanConfig(); @@ -108,6 +123,34 @@ public class GunFatmanFactory { BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig(); bullet.ammo = ModItems.gun_mirv_ammo; + bullet.style = BulletConfiguration.STYLE_MIRV; + bullet.velocity *= 3; + + bullet.bUpdate = new IBulletUpdateBehavior() { + + @Override + public void behaveUpdate(EntityBulletBase bullet) { + + if(bullet.worldObj.isRemote) + return; + + if(bullet.ticksExisted == 15) { + bullet.setDead(); + + for(int i = 0; i < 6; i++) { + + EntityBulletBase nuke = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.NUKE_NORMAL); + nuke.setPosition(bullet.posX, bullet.posY, bullet.posZ); + double mod = 0.1D; + nuke.motionX = bullet.worldObj.rand.nextGaussian() * mod; + nuke.motionY = -0.1D; + nuke.motionZ = bullet.worldObj.rand.nextGaussian() * mod; + bullet.worldObj.spawnEntityInWorld(nuke); + } + } + } + + }; return bullet; } diff --git a/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java b/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java index 5da02c6eb..6db663e2b 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java @@ -148,8 +148,8 @@ public class GunGrenadeFactory { bullet.ammo = ModItems.ammo_grenade_concussion; bullet.velocity = 2.0F; - bullet.dmgMin = 20; - bullet.dmgMax = 15; + bullet.dmgMin = 15; + bullet.dmgMax = 20; bullet.blockDamage = false; bullet.explosive = 10.0F; bullet.trail = 3; diff --git a/src/main/java/com/hbm/handler/guncfg/GunNPCFactory.java b/src/main/java/com/hbm/handler/guncfg/GunNPCFactory.java new file mode 100644 index 000000000..75403262e --- /dev/null +++ b/src/main/java/com/hbm/handler/guncfg/GunNPCFactory.java @@ -0,0 +1,194 @@ +package com.hbm.handler.guncfg; + +import java.util.List; +import java.util.Random; + +import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.BulletConfiguration; +import com.hbm.interfaces.IBulletImpactBehavior; +import com.hbm.interfaces.IBulletUpdateBehavior; +import com.hbm.items.ModItems; +import com.hbm.main.MainRegistry; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Vec3; + +public class GunNPCFactory { + + public static BulletConfiguration getMaskmanOrb() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.ammo = ModItems.coin_maskman; + bullet.velocity = 0.25F; + bullet.spread = 0.000F; + bullet.wear = 10; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.dmgMin = 100; + bullet.dmgMax = 100; + bullet.gravity = 0.0D; + bullet.maxAge = 60; + bullet.doesRicochet = false; + bullet.ricochetAngle = 0; + bullet.HBRC = 0; + bullet.LBRC = 0; + bullet.bounceMod = 1.0; + bullet.doesPenetrate = false; + bullet.doesBreakGlass = false; + bullet.style = BulletConfiguration.STYLE_ORB; + bullet.trail = 1; + bullet.explosive = 1.5F; + + bullet.bUpdate = new IBulletUpdateBehavior() { + + @Override + public void behaveUpdate(EntityBulletBase bullet) { + + if(bullet.worldObj.isRemote) + return; + + if(bullet.ticksExisted % 10 != 5) + return; + + List players = bullet.worldObj.getEntitiesWithinAABB(EntityPlayer.class, bullet.boundingBox.expand(50, 50, 50)); + + for(EntityPlayer player : players) { + + Vec3 motion = Vec3.createVectorHelper(player.posX - bullet.posX, (player.posY + player.getEyeHeight()) - bullet.posY, player.posZ - bullet.posZ); + motion = motion.normalize(); + + EntityBulletBase bolt = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_BOLT); + bolt.shooter = bullet.shooter; + bolt.setPosition(bullet.posX, bullet.posY, bullet.posZ); + bolt.setThrowableHeading(motion.xCoord, motion.yCoord, motion.zCoord, 0.5F, 0.05F); + bullet.worldObj.spawnEntityInWorld(bolt); + } + } + }; + + return bullet; + } + + public static BulletConfiguration getMaskmanBolt() { + + BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + + bullet.ammo = ModItems.coin_maskman; + bullet.spread = 0.0F; + bullet.dmgMin = 15; + bullet.dmgMax = 20; + bullet.wear = 10; + bullet.leadChance = 0; + bullet.explosive = 0.5F; + bullet.setToBolt(BulletConfiguration.BOLT_LACUNAE); + bullet.vPFX = "reddust"; + + return bullet; + } + + public static BulletConfiguration getMaskmanBullet() { + + BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + + bullet.ammo = ModItems.coin_maskman; + bullet.spread = 0.0F; + bullet.dmgMin = 5; + bullet.dmgMax = 10; + bullet.wear = 10; + bullet.leadChance = 15; + bullet.style = BulletConfiguration.STYLE_FLECHETTE; + bullet.vPFX = "bluedust"; + + return bullet; + } + + public static BulletConfiguration getMaskmanTracer() { + + BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig(); + + bullet.ammo = ModItems.coin_maskman; + bullet.spread = 0.0F; + bullet.dmgMin = 15; + bullet.dmgMax = 20; + bullet.wear = 10; + bullet.leadChance = 0; + bullet.setToBolt(BulletConfiguration.BOLT_NIGHTMARE); + bullet.vPFX = "reddust"; + + bullet.bImpact = new IBulletImpactBehavior() { + + @Override + public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) { + + if(bullet.worldObj.isRemote) + return; + + EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR); + meteor.setPosition(bullet.posX, bullet.posY + 30 + meteor.worldObj.rand.nextInt(10), bullet.posZ); + meteor.motionY = -1D; + meteor.shooter = bullet.shooter; + bullet.worldObj.spawnEntityInWorld(meteor); + } + }; + + return bullet; + } + + public static BulletConfiguration getMaskmanRocket() { + + BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig(); + + bullet.ammo = ModItems.coin_maskman; + bullet.gravity = 0.1D; + bullet.velocity = 1.0F; + bullet.dmgMin = 15; + bullet.dmgMax = 20; + bullet.blockDamage = false; + bullet.explosive = 5.0F; + bullet.style = BulletConfiguration.STYLE_ROCKET; + + return bullet; + } + + public static BulletConfiguration getMaskmanMeteor() { + + BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig(); + + bullet.ammo = ModItems.coin_maskman; + bullet.gravity = 0.1D; + bullet.velocity = 1.0F; + bullet.dmgMin = 20; + bullet.dmgMax = 30; + bullet.incendiary = 3; + bullet.explosive = 2.5F; + bullet.style = BulletConfiguration.STYLE_METEOR; + + bullet.bUpdate = new IBulletUpdateBehavior() { + + @Override + public void behaveUpdate(EntityBulletBase bullet) { + + if(!bullet.worldObj.isRemote) + return; + + Random rand = bullet.worldObj.rand; + + for(int i = 0; i < 5; i++) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "vanillaExt"); + nbt.setString("mode", "flame"); + nbt.setDouble("posX", bullet.posX + rand.nextDouble() * 0.5 - 0.25); + nbt.setDouble("posY", bullet.posY + rand.nextDouble() * 0.5 - 0.25); + nbt.setDouble("posZ", bullet.posZ + rand.nextDouble() * 0.5 - 0.25); + MainRegistry.proxy.effectNT(nbt); + } + } + }; + + return bullet; + } + +} diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 8ab22f726..a662b9ddc 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -1159,11 +1159,13 @@ public class ModItems { public static Item ammo_556_ap; public static Item ammo_556_du; public static Item ammo_556_star; + public static Item ammo_556_sleek; public static Item ammo_556_tracer; public static Item ammo_556_flechette; public static Item ammo_556_flechette_incendiary; public static Item ammo_556_flechette_phosphorus; public static Item ammo_556_flechette_du; + public static Item ammo_556_flechette_sleek; public static Item ammo_556_k; public static Item ammo_22lr; public static Item ammo_22lr_ap; @@ -1178,6 +1180,7 @@ public class ModItems { public static Item ammo_50bmg_ap; public static Item ammo_50bmg_du; public static Item ammo_50bmg_star; + public static Item ammo_50bmg_sleek; public static Item ammo_folly; public static Item ammo_folly_nuclear; public static Item ammo_folly_du; @@ -2968,11 +2971,13 @@ public class ModItems { ammo_556_ap = new ItemAmmo().setUnlocalizedName("ammo_556_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_ap"); ammo_556_du = new ItemAmmo().setUnlocalizedName("ammo_556_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_du"); ammo_556_star = new ItemAmmo().setUnlocalizedName("ammo_556_star").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_star"); + ammo_556_sleek = new ItemAmmo().setUnlocalizedName("ammo_556_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_sleek"); ammo_556_tracer = new ItemAmmo().setUnlocalizedName("ammo_556_tracer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_tracer"); ammo_556_flechette = new ItemAmmo().setUnlocalizedName("ammo_556_flechette").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette"); ammo_556_flechette_incendiary = new ItemAmmo().setUnlocalizedName("ammo_556_flechette_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette_incendiary"); ammo_556_flechette_phosphorus = new ItemAmmo().setUnlocalizedName("ammo_556_flechette_phosphorus").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette_phosphorus"); ammo_556_flechette_du = new ItemAmmo().setUnlocalizedName("ammo_556_flechette_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette_du"); + ammo_556_flechette_sleek = new ItemAmmo().setUnlocalizedName("ammo_556_flechette_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette_sleek"); ammo_556_k = new ItemAmmo().setUnlocalizedName("ammo_556_k").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_k"); ammo_50ae = new ItemAmmo().setUnlocalizedName("ammo_50ae").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50ae"); ammo_50ae_ap = new ItemAmmo().setUnlocalizedName("ammo_50ae_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50ae_ap"); @@ -2985,6 +2990,7 @@ public class ModItems { ammo_50bmg_ap = new ItemAmmo().setUnlocalizedName("ammo_50bmg_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_ap"); ammo_50bmg_du = new ItemAmmo().setUnlocalizedName("ammo_50bmg_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_du"); ammo_50bmg_star = new ItemAmmo().setUnlocalizedName("ammo_50bmg_star").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_star"); + ammo_50bmg_sleek = new ItemAmmo().setUnlocalizedName("ammo_50bmg_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_sleek"); ammo_357_desh = new ItemAmmo().setUnlocalizedName("ammo_357_desh").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_357_desh"); ammo_44 = new ItemAmmo().setUnlocalizedName("ammo_44").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_44"); ammo_44_ap = new ItemAmmo().setUnlocalizedName("ammo_44_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_44_ap"); @@ -3075,7 +3081,7 @@ public class ModItems { gun_fatman = new ItemGunBase(GunFatmanFactory.getFatmanConfig()).setUnlocalizedName("gun_fatman").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_fatman"); gun_proto = new ItemGunBase(GunFatmanFactory.getProtoConfig()).setUnlocalizedName("gun_proto").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_fatman"); gun_mirv_ammo = new Item().setUnlocalizedName("gun_mirv_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mirv_ammo"); - gun_mirv = new ItemGunBase(GunFatmanFactory.getFatmanConfig()).setUnlocalizedName("gun_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mirv"); + gun_mirv = new ItemGunBase(GunFatmanFactory.getMIRVConfig()).setUnlocalizedName("gun_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mirv"); gun_bf_ammo = new Item().setUnlocalizedName("gun_bf_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_bf_ammo"); gun_bf = new ItemGunBase(GunFatmanFactory.getBELConfig()).setUnlocalizedName("gun_bf").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_bf"); gun_mp40_ammo = new Item().setUnlocalizedName("gun_mp40_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_mp40_ammo"); @@ -5189,11 +5195,13 @@ public class ModItems { GameRegistry.registerItem(ammo_556_ap, ammo_556_ap.getUnlocalizedName()); GameRegistry.registerItem(ammo_556_du, ammo_556_du.getUnlocalizedName()); GameRegistry.registerItem(ammo_556_star, ammo_556_star.getUnlocalizedName()); + GameRegistry.registerItem(ammo_556_sleek, ammo_556_sleek.getUnlocalizedName()); GameRegistry.registerItem(ammo_556_tracer, ammo_556_tracer.getUnlocalizedName()); GameRegistry.registerItem(ammo_556_flechette, ammo_556_flechette.getUnlocalizedName()); GameRegistry.registerItem(ammo_556_flechette_incendiary, ammo_556_flechette_incendiary.getUnlocalizedName()); GameRegistry.registerItem(ammo_556_flechette_phosphorus, ammo_556_flechette_phosphorus.getUnlocalizedName()); GameRegistry.registerItem(ammo_556_flechette_du, ammo_556_flechette_du.getUnlocalizedName()); + GameRegistry.registerItem(ammo_556_flechette_sleek, ammo_556_flechette_sleek.getUnlocalizedName()); GameRegistry.registerItem(ammo_556_k, ammo_556_k.getUnlocalizedName()); GameRegistry.registerItem(ammo_22lr, ammo_22lr.getUnlocalizedName()); GameRegistry.registerItem(ammo_22lr_ap, ammo_22lr_ap.getUnlocalizedName()); @@ -5208,6 +5216,7 @@ public class ModItems { GameRegistry.registerItem(ammo_50bmg_ap, ammo_50bmg_ap.getUnlocalizedName()); GameRegistry.registerItem(ammo_50bmg_du, ammo_50bmg_du.getUnlocalizedName()); GameRegistry.registerItem(ammo_50bmg_star, ammo_50bmg_star.getUnlocalizedName()); + GameRegistry.registerItem(ammo_50bmg_sleek, ammo_50bmg_sleek.getUnlocalizedName()); GameRegistry.registerItem(ammo_fuel, ammo_fuel.getUnlocalizedName()); GameRegistry.registerItem(ammo_fuel_napalm, ammo_fuel_napalm.getUnlocalizedName()); GameRegistry.registerItem(ammo_fuel_phosphorus, ammo_fuel_phosphorus.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/weapon/ItemAmmo.java b/src/main/java/com/hbm/items/weapon/ItemAmmo.java index cd7fa2d73..f4a49574a 100644 --- a/src/main/java/com/hbm/items/weapon/ItemAmmo.java +++ b/src/main/java/com/hbm/items/weapon/ItemAmmo.java @@ -220,6 +220,9 @@ public class ItemAmmo extends Item { list.add(EnumChatFormatting.YELLOW + "* Starmetal"); list.add(EnumChatFormatting.RED + "- Highly increased wear"); } + if(this == ModItems.ammo_50bmg_sleek) { + list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite"); + } //.50 AE if(this == ModItems.ammo_50ae_ap) { @@ -382,6 +385,9 @@ public class ItemAmmo extends Item { list.add(EnumChatFormatting.YELLOW + "* Starmetal"); list.add(EnumChatFormatting.RED + "- Highly increased wear"); } + if(this == ModItems.ammo_556_sleek) { + list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite"); + } if(this == ModItems.ammo_556_flechette) { list.add(EnumChatFormatting.BLUE + "+ Increased damage"); list.add(EnumChatFormatting.YELLOW + "* Less bouncy"); @@ -410,6 +416,9 @@ public class ItemAmmo extends Item { list.add(EnumChatFormatting.YELLOW + "* Less bouncy"); list.add(EnumChatFormatting.RED + "- Highly increased wear"); } + if(this == ModItems.ammo_556_flechette_sleek) { + list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite"); + } if(this == ModItems.ammo_556_tracer) { list.add(EnumChatFormatting.YELLOW + "* Tracer"); } diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 4dffcbe92..642e42f54 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -858,6 +858,7 @@ public class CraftingManager { GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50bmg_ap, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50bmg, 'A', ModItems.ingot_dura_steel }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50bmg_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50bmg, 'A', ModItems.ingot_u238 }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50bmg_star, 4), new Object[] { " B ", "BAB", " B ", 'B', ModItems.ammo_50bmg_du, 'A', ModItems.ingot_starmetal }); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50bmg_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50bmg, 'A', ModItems.coin_maskman }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50ae_ap, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50ae, 'A', ModItems.ingot_dura_steel }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50ae_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50ae, 'A', ModItems.ingot_u238 }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50ae_star, 4), new Object[] { " B ", "BAB", " B ", 'B', ModItems.ammo_50ae_du, 'A', ModItems.ingot_starmetal }); @@ -865,11 +866,13 @@ public class CraftingManager { GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_ap, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556, 'A', ModItems.ingot_dura_steel }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556, 'A', ModItems.ingot_u238 }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_star, 4), new Object[] { " B ", "BAB", " B ", 'B', ModItems.ammo_556_du, 'A', ModItems.ingot_starmetal }); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556, 'A', ModItems.coin_maskman }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_tracer, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556, 'A', Items.redstone }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette, 4), new Object[] { " B ", "BAB", " B ", 'B', ModItems.ammo_556, 'A', ModItems.pellet_flechette }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette_incendiary, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556_flechette, 'A', ModItems.powder_fire }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette_phosphorus, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556_flechette, 'A', ModItems.ingot_phosphorus }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556_flechette, 'A', ModItems.ingot_u238 }); + GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556_flechette, 'A', ModItems.coin_maskman }); GameRegistry.addRecipe(new ItemStack(ModItems.folly_bullet, 1), new Object[] { " S ", "STS", "SMS", 'S', ModItems.ingot_starmetal, 'T', ModItems.powder_magic, 'M', ModBlocks.block_meteor }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.folly_bullet_nuclear, 1), new Object[] { " N ", "UTU", "UTU", 'N', ModItems.gun_fatman_ammo, 'U', "ingotIron", 'T', "blockTungsten" })); diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 5558f0a0e..67c2d0d25 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -96,6 +96,9 @@ public class ResourceManager { public static final IModelCustom sphere_uv = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sphere_uv.obj")); public static final IModelCustom sphere_uv_anim = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sphere_uv.hmf")); + //Meteor + public static final IModelCustom meteor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/weapons/meteor.obj")); + //Radgen public static final IModelCustom radgen_body = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rad_gen_body.obj")); public static final IModelCustom radgen_rotor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rad_gen_rotor.obj")); diff --git a/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java b/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java index 5d4cff303..83575b5ae 100644 --- a/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java +++ b/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java @@ -70,6 +70,7 @@ public class RenderBullet extends Render { case BulletConfiguration.STYLE_MIRV: renderNuke(1); break; case BulletConfiguration.STYLE_BF: renderNuke(2); break; case BulletConfiguration.STYLE_ORB: renderOrb(trail); break; + case BulletConfiguration.STYLE_METEOR: renderMeteor(trail); break; default: renderBullet(trail); break; } @@ -190,6 +191,19 @@ public class RenderBullet extends Render { for(int i = 0; i < 5; i++) RenderSparks.renderSpark((int) (System.currentTimeMillis() / 100 + 100 * i), 0, 0, 0, 0.5F, 2, 2, 0x8080FF, 0xFFFFFF); break; + + case 1: + GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glColor4f(0.5F, 0.0F, 0.0F, 0.5F); + ResourceManager.sphere_uv.renderAll(); + GL11.glScalef(0.75F, 0.75F, 0.75F); + ResourceManager.sphere_uv.renderAll(); + GL11.glScalef(1F/0.75F, 1F/0.75F, 1F/0.75F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + for(int i = 0; i < 3; i++) + RenderSparks.renderSpark((int) (System.currentTimeMillis() / 100 + 100 * i), 0, 0, 0, 1F, 2, 3, 0xFF0000, 0xFF8080); + break; } GL11.glDisable(GL11.GL_BLEND); @@ -198,6 +212,23 @@ public class RenderBullet extends Render { } + private void renderMeteor(int type) { + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_LIGHTING); + + switch(type) { + case 0: + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/blocks/block_meteor_molten.png")); break; + case 1: + bindTexture(new ResourceLocation("textures/blocks/obsidian.png")); break; + } + + ResourceManager.meteor.renderAll(); + + GL11.glEnable(GL11.GL_LIGHTING); + } + private void renderFlechette() { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); diff --git a/src/main/java/com/hbm/saveddata/AuxSavedData.java b/src/main/java/com/hbm/saveddata/AuxSavedData.java index 608cd3368..a768e79f5 100644 --- a/src/main/java/com/hbm/saveddata/AuxSavedData.java +++ b/src/main/java/com/hbm/saveddata/AuxSavedData.java @@ -10,17 +10,14 @@ import net.minecraft.world.WorldSavedData; public class AuxSavedData extends WorldSavedData { public List data = new ArrayList(); - - private World worldObj; public AuxSavedData(String p_i2141_1_) { super(p_i2141_1_); } - public AuxSavedData(World p_i1678_1_) + public AuxSavedData() { super("hbmauxdata"); - this.worldObj = p_i1678_1_; this.markDirty(); } @@ -75,7 +72,7 @@ public class AuxSavedData extends WorldSavedData { AuxSavedData data = (AuxSavedData)worldObj.perWorldStorage.loadData(AuxSavedData.class, "hbmauxdata"); if(data == null) { - worldObj.perWorldStorage.setData("hbmauxdata", new AuxSavedData(worldObj)); + worldObj.perWorldStorage.setData("hbmauxdata", new AuxSavedData()); data = (AuxSavedData)worldObj.perWorldStorage.loadData(AuxSavedData.class, "hbmauxdata"); } diff --git a/src/main/java/com/hbm/saveddata/BroadcastSavedData.java b/src/main/java/com/hbm/saveddata/BroadcastSavedData.java index b159a016f..64abedb3a 100644 --- a/src/main/java/com/hbm/saveddata/BroadcastSavedData.java +++ b/src/main/java/com/hbm/saveddata/BroadcastSavedData.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; import net.minecraft.world.WorldSavedData; public class BroadcastSavedData extends WorldSavedData { @@ -12,17 +11,14 @@ public class BroadcastSavedData extends WorldSavedData { public int bcCount; public List broadcasts = new ArrayList(); - - private World worldObj; public BroadcastSavedData(String p_i2141_1_) { super(p_i2141_1_); } - public BroadcastSavedData(World p_i1678_1_) + public BroadcastSavedData() { super("broadcasts"); - this.worldObj = p_i1678_1_; this.markDirty(); } diff --git a/src/main/java/com/hbm/saveddata/SatelliteSavedData.java b/src/main/java/com/hbm/saveddata/SatelliteSavedData.java index 432ee29cb..2e5fe33c1 100644 --- a/src/main/java/com/hbm/saveddata/SatelliteSavedData.java +++ b/src/main/java/com/hbm/saveddata/SatelliteSavedData.java @@ -12,17 +12,14 @@ import net.minecraft.world.WorldSavedData; public class SatelliteSavedData extends WorldSavedData { public HashMap sats = new HashMap(); - - private World worldObj; public SatelliteSavedData(String p_i2141_1_) { super(p_i2141_1_); } - public SatelliteSavedData(World p_i1678_1_) + public SatelliteSavedData() { super("satellites"); - this.worldObj = p_i1678_1_; this.markDirty(); } @@ -73,13 +70,11 @@ public class SatelliteSavedData extends WorldSavedData { SatelliteSavedData data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites"); if(data == null) { - worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj)); + worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData()); data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites"); } - data.worldObj = worldObj; - return data; } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityAMSBase.java b/src/main/java/com/hbm/tileentity/machine/TileEntityAMSBase.java index fc684bb23..de31c04e8 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityAMSBase.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityAMSBase.java @@ -542,7 +542,7 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS SatelliteSavedData data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites"); if(data == null) { - worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj)); + worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData()); data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites"); } data.markDirty(); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSatDock.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSatDock.java index 33b0e2181..d8a1e4b57 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSatDock.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSatDock.java @@ -199,7 +199,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites"); if(data == null) { - worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj)); + worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData()); data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites"); } data.markDirty();