cut grenades, taint creeper, fixed orbital laser targeting
@ -1048,6 +1048,10 @@ item.grenade_black_hole.name=Schwarzes-Loch-Granate
|
||||
item.grenade_cloud.name=Gefäß voll Wolke
|
||||
item.grenade_pink_cloud.name=Gefäß voll pinker Wolke
|
||||
item.ullapool_caber.name=Ullapool'sche Stiel
|
||||
item.grenade_smart.name=Smart-Granate
|
||||
item.grenade_mirv.name=MIRV-Granate
|
||||
item.grenade_breach.name=Durchbruchgranate
|
||||
item.grenade_burst.name=Gräbergranate
|
||||
|
||||
item.rod_uranium_fuel.name=Urankernbrennstoffzelle
|
||||
item.rod_dual_uranium_fuel.name=Doppelte Urankernbrennstoffzelle
|
||||
@ -1257,6 +1261,7 @@ entity.hbm.entity_bullet.name=Patrone
|
||||
entity.hbm.entity_rocket.name=Rakete
|
||||
entity.hbm.entity_schrabnel.name=Schrabnel
|
||||
entity.entity_mob_nuclear_creeper.name=Nuklearer Creeper
|
||||
entity.entity_mob_tainted_creeper.name=Verseuchter Creeper
|
||||
entity.entity_mob_hunter_chopper.name=Jagdschrauber
|
||||
entity.entity_cyber_crab.name=Cyber-Krabbe
|
||||
|
||||
|
||||
@ -1048,6 +1048,10 @@ item.grenade_black_hole.name=Black Hole Grenade
|
||||
item.grenade_cloud.name=Jar of Cloud
|
||||
item.grenade_pink_cloud.name=Jar of Pink Cloud
|
||||
item.ullapool_caber.name=Ullapool Caber
|
||||
item.grenade_smart.name=Smart Grenade
|
||||
item.grenade_mirv.name=MIRV Grenade
|
||||
item.grenade_breach.name=Breaching Grenade
|
||||
item.grenade_burst.name=Digger Grenade
|
||||
|
||||
item.rod_uranium_fuel.name=Uranium Fuel Rod
|
||||
item.rod_dual_uranium_fuel.name=Uranium Dual Fuel Rod
|
||||
@ -1257,6 +1261,7 @@ entity.hbm.entity_bullet.name=Bullet
|
||||
entity.hbm.entity_rocket.name=Rocket
|
||||
entity.hbm.entity_schrabnel.name=Schrabnel
|
||||
entity.entity_mob_nuclear_creeper.name=Nuclear Creeper
|
||||
entity.entity_mob_tainted_creeper.name=Tainted Creeper
|
||||
entity.entity_mob_hunter_chopper.name=Hunter Chopper
|
||||
entity.entity_cyber_crab.name=Cyber Crab
|
||||
|
||||
|
||||
BIN
assets/hbm/textures/entity/creeper_armor_taint.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
assets/hbm/textures/items/grenade_breach.png
Normal file
|
After Width: | Height: | Size: 322 B |
BIN
assets/hbm/textures/items/grenade_burst.png
Normal file
|
After Width: | Height: | Size: 387 B |
BIN
assets/hbm/textures/items/grenade_mirv.png
Normal file
|
After Width: | Height: | Size: 371 B |
BIN
assets/hbm/textures/items/grenade_smart.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
assets/hbm/textures/items/key.png
Normal file
|
After Width: | Height: | Size: 220 B |
BIN
assets/hbm/textures/items/padlock.png
Normal file
|
After Width: | Height: | Size: 225 B |
@ -5,6 +5,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
@ -20,6 +21,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemDye;
|
||||
@ -178,9 +180,24 @@ public class BlockTaint extends Block/*Container*/ {
|
||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||
PotionEffect effect = new PotionEffect(HbmPotion.taint.id, 15 * 20, level);
|
||||
effect.setCurativeItems(list);
|
||||
if(entity instanceof EntityLivingBase)
|
||||
if(world.rand.nextInt(50) == 0)
|
||||
|
||||
if(entity instanceof EntityLivingBase) {
|
||||
if(world.rand.nextInt(50) == 0) {
|
||||
((EntityLivingBase)entity).addPotionEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
if(entity instanceof EntityCreeper) {
|
||||
EntityTaintedCreeper creep = new EntityTaintedCreeper(world);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
|
||||
System.out.println(entity.getClass().toString());
|
||||
|
||||
if(!world.isRemote) {
|
||||
entity.setDead();
|
||||
world.spawnEntityInWorld(creep);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
37
com/hbm/entity/grenade/EntityGrenadeBreach.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeBreach extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeBreach(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBreach(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBreach(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if(rand.nextInt(10) == 0)
|
||||
this.setDead();
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 2.5F, false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
60
com/hbm/entity/grenade/EntityGrenadeBurst.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeBurst extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeBurst(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBurst(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBurst(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(this.ticksExisted > 20 && !worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
|
||||
EntityGrenadeBreach grenade = new EntityGrenadeBreach(worldObj);
|
||||
grenade.posX = posX;
|
||||
grenade.posY = posY;
|
||||
grenade.posZ = posZ;
|
||||
grenade.motionX = rand.nextGaussian() * 0.1D;
|
||||
grenade.motionY = -0.25D;
|
||||
grenade.motionZ = rand.nextGaussian() * 0.1D;
|
||||
|
||||
worldObj.spawnEntityInWorld(grenade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, new ItemStack(ModItems.grenade_burst)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,6 @@ import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeGascan extends EntityGrenadeBase
|
||||
{
|
||||
private static final String __OBFID = "CL_00001722";
|
||||
|
||||
public EntityGrenadeGascan(World p_i1773_1_)
|
||||
{
|
||||
|
||||
62
com/hbm/entity/grenade/EntityGrenadeMIRV.java
Normal file
@ -0,0 +1,62 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeMIRV extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeMIRV(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeMIRV(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeMIRV(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(this.ticksExisted > 20 && !worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
|
||||
EntityGrenadeSmart grenade = new EntityGrenadeSmart(worldObj);
|
||||
grenade.posX = posX;
|
||||
grenade.posY = posY;
|
||||
grenade.posZ = posZ;
|
||||
grenade.motionX = motionX + rand.nextGaussian() * 0.25D;
|
||||
grenade.motionY = motionY + rand.nextGaussian() * 0.25D;
|
||||
grenade.motionZ = motionZ + rand.nextGaussian() * 0.25D;
|
||||
grenade.ticksExisted = 10;
|
||||
|
||||
worldObj.spawnEntityInWorld(grenade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, new ItemStack(ModItems.grenade_mirv)));
|
||||
}
|
||||
}
|
||||
}
|
||||
43
com/hbm/entity/grenade/EntityGrenadeSmart.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeSmart extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeSmart(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeSmart(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeSmart(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
if(this.ticksExisted > 10)
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5.0F, true, false, false);
|
||||
else
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, new ItemStack(ModItems.grenade_smart)));
|
||||
}
|
||||
}
|
||||
}
|
||||
71
com/hbm/entity/mob/EntityAITaintedCreeperSwell.java
Normal file
@ -0,0 +1,71 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
|
||||
public class EntityAITaintedCreeperSwell extends EntityAIBase {
|
||||
/** The creeper that is swelling. */
|
||||
EntityTaintedCreeper swellingCreeper;
|
||||
/** The creeper's attack target. This is used for the changing of the creeper's state. */
|
||||
EntityLivingBase creeperAttackTarget;
|
||||
private static final String __OBFID = "CL_00001614";
|
||||
|
||||
public EntityAITaintedCreeperSwell(EntityTaintedCreeper p_i1655_1_)
|
||||
{
|
||||
this.swellingCreeper = p_i1655_1_;
|
||||
this.setMutexBits(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the EntityAIBase should begin execution.
|
||||
*/
|
||||
@Override
|
||||
public boolean shouldExecute()
|
||||
{
|
||||
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSqToEntity(entitylivingbase) < 9.0D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a one shot task or start executing a continuous task
|
||||
*/
|
||||
@Override
|
||||
public void startExecuting()
|
||||
{
|
||||
this.swellingCreeper.getNavigator().clearPathEntity();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the task
|
||||
*/
|
||||
@Override
|
||||
public void resetTask()
|
||||
{
|
||||
this.creeperAttackTarget = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the task
|
||||
*/
|
||||
@Override
|
||||
public void updateTask()
|
||||
{
|
||||
if (this.creeperAttackTarget == null)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
379
com/hbm/entity/mob/EntityTaintedCreeper.java
Normal file
@ -0,0 +1,379 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
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.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
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;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityTaintedCreeper extends EntityMob {
|
||||
/**
|
||||
* Time when this creeper was last in an active state (Messed up code here, probably causes creeper animation to go
|
||||
* weird)
|
||||
*/
|
||||
private int lastActiveTime;
|
||||
/** The amount of time since the creeper was close enough to the player to ignite */
|
||||
private int timeSinceIgnited;
|
||||
private int fuseTime = 30;
|
||||
/** Explosion radius for this creeper. */
|
||||
private int explosionRadius = 20;
|
||||
private static final String __OBFID = "CL_00001684";
|
||||
|
||||
public EntityTaintedCreeper(World p_i1733_1_)
|
||||
{
|
||||
super(p_i1733_1_);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, new EntityAITaintedCreeperSwell(this));
|
||||
this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 0.8D));
|
||||
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(6, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
|
||||
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
|
||||
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityOcelot.class, 0, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes()
|
||||
{
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the newer Entity AI code should be run
|
||||
*/
|
||||
@Override
|
||||
public boolean isAIEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of iterations PathFinder.getSafePoint will execute before giving up.
|
||||
*/
|
||||
@Override
|
||||
public int getMaxSafePointTries()
|
||||
{
|
||||
return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the mob is falling. Calculates and applies fall damage.
|
||||
*/
|
||||
@Override
|
||||
protected void fall(float p_70069_1_)
|
||||
{
|
||||
super.fall(p_70069_1_);
|
||||
this.timeSinceIgnited = (int)(this.timeSinceIgnited + p_70069_1_ * 1.5F);
|
||||
|
||||
if (this.timeSinceIgnited > this.fuseTime - 5)
|
||||
{
|
||||
this.timeSinceIgnited = this.fuseTime - 5;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1));
|
||||
this.dataWatcher.addObject(17, Byte.valueOf((byte)0));
|
||||
this.dataWatcher.addObject(18, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
|
||||
{
|
||||
super.writeEntityToNBT(p_70014_1_);
|
||||
|
||||
if (this.dataWatcher.getWatchableObjectByte(17) == 1)
|
||||
{
|
||||
p_70014_1_.setBoolean("powered", true);
|
||||
}
|
||||
|
||||
p_70014_1_.setShort("Fuse", (short)this.fuseTime);
|
||||
p_70014_1_.setByte("ExplosionRadius", (byte)this.explosionRadius);
|
||||
p_70014_1_.setBoolean("ignited", this.func_146078_ca());
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
|
||||
{
|
||||
super.readEntityFromNBT(p_70037_1_);
|
||||
this.dataWatcher.updateObject(17, Byte.valueOf((byte)(p_70037_1_.getBoolean("powered") ? 1 : 0)));
|
||||
|
||||
if (p_70037_1_.hasKey("Fuse", 99))
|
||||
{
|
||||
this.fuseTime = p_70037_1_.getShort("Fuse");
|
||||
}
|
||||
|
||||
if (p_70037_1_.hasKey("ExplosionRadius", 99))
|
||||
{
|
||||
this.explosionRadius = p_70037_1_.getByte("ExplosionRadius");
|
||||
}
|
||||
|
||||
if (p_70037_1_.getBoolean("ignited"))
|
||||
{
|
||||
this.func_146079_cb();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if (this.isEntityAlive())
|
||||
{
|
||||
this.lastActiveTime = this.timeSinceIgnited;
|
||||
|
||||
if (this.func_146078_ca())
|
||||
{
|
||||
this.setCreeperState(1);
|
||||
}
|
||||
|
||||
int i = this.getCreeperState();
|
||||
|
||||
if (i > 0 && this.timeSinceIgnited == 0)
|
||||
{
|
||||
this.playSound("creeper.primed", 1.0F * 30 / 75, 0.5F);
|
||||
}
|
||||
|
||||
this.timeSinceIgnited += i;
|
||||
|
||||
if (this.timeSinceIgnited < 0)
|
||||
{
|
||||
this.timeSinceIgnited = 0;
|
||||
}
|
||||
|
||||
if (this.timeSinceIgnited >= this.fuseTime)
|
||||
{
|
||||
this.timeSinceIgnited = this.fuseTime;
|
||||
this.func_146077_cc();
|
||||
}
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0)
|
||||
{
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sound this mob makes when it is hurt.
|
||||
*/
|
||||
@Override
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sound this mob makes on death.
|
||||
*/
|
||||
@Override
|
||||
protected String getDeathSound()
|
||||
{
|
||||
return "mob.creeper.death";
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the mob's health reaches 0.
|
||||
*/
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_)
|
||||
{
|
||||
super.onDeath(p_70645_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity p_70652_1_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the creeper is powered by a lightning bolt.
|
||||
*/
|
||||
public boolean getPowered()
|
||||
{
|
||||
return this.dataWatcher.getWatchableObjectByte(17) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getCreeperFlashIntensity(float p_70831_1_)
|
||||
{
|
||||
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem()
|
||||
{
|
||||
return Item.getItemFromBlock(Blocks.tnt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current state of creeper, -1 is idle, 1 is 'in fuse'
|
||||
*/
|
||||
public int getCreeperState()
|
||||
{
|
||||
return this.dataWatcher.getWatchableObjectByte(16);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the state of creeper, -1 to idle and 1 to be 'in fuse'
|
||||
*/
|
||||
public void setCreeperState(int p_70829_1_)
|
||||
{
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte)p_70829_1_));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a lightning bolt hits the entity.
|
||||
*/
|
||||
@Override
|
||||
public void onStruckByLightning(EntityLightningBolt p_70077_1_)
|
||||
{
|
||||
super.onStruckByLightning(p_70077_1_);
|
||||
this.dataWatcher.updateObject(17, Byte.valueOf((byte)1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
|
||||
*/
|
||||
@Override
|
||||
protected boolean interact(EntityPlayer p_70085_1_)
|
||||
{
|
||||
ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Items.flint_and_steel)
|
||||
{
|
||||
this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
|
||||
p_70085_1_.swingItem();
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.func_146079_cb();
|
||||
itemstack.damageItem(1, p_70085_1_);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.interact(p_70085_1_);
|
||||
}
|
||||
|
||||
private void func_146077_cc()
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
if (this.getPowered())
|
||||
{
|
||||
this.explosionRadius *= 3;
|
||||
}
|
||||
|
||||
worldObj.newExplosion(this, posX, posY, posZ, 5.0F, false, false);
|
||||
|
||||
if(this.getPowered())
|
||||
{
|
||||
|
||||
for(int i = 0; i < 255; i++) {
|
||||
int a = rand.nextInt(15) + (int)posX - 7;
|
||||
int b = rand.nextInt(15) + (int)posY - 7;
|
||||
int c = rand.nextInt(15) + (int)posZ - 7;
|
||||
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c))
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
for(int i = 0; i < 85; i++) {
|
||||
int a = rand.nextInt(7) + (int)posX - 3;
|
||||
int b = rand.nextInt(7) + (int)posY - 3;
|
||||
int c = rand.nextInt(7) + (int)posZ - 3;
|
||||
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c))
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2);
|
||||
}
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasPosNeightbour(World world, int x, int y, int z) {
|
||||
Block b0 = world.getBlock(x + 1, y, z);
|
||||
Block b1 = world.getBlock(x, y + 1, z);
|
||||
Block b2 = world.getBlock(x, y, z + 1);
|
||||
Block b3 = world.getBlock(x - 1, y, z);
|
||||
Block b4 = world.getBlock(x, y - 1, z);
|
||||
Block b5 = world.getBlock(x, y, z - 1);
|
||||
boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) ||
|
||||
(b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) ||
|
||||
(b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) ||
|
||||
(b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) ||
|
||||
(b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) ||
|
||||
(b5.renderAsNormalBlock() && b5.getMaterial().isOpaque());
|
||||
return b;
|
||||
}
|
||||
|
||||
public boolean func_146078_ca()
|
||||
{
|
||||
return this.dataWatcher.getWatchableObjectByte(18) != 0;
|
||||
}
|
||||
|
||||
public void func_146079_cb()
|
||||
{
|
||||
this.dataWatcher.updateObject(18, Byte.valueOf((byte)1));
|
||||
}
|
||||
|
||||
public void setPowered(int power) {
|
||||
this.dataWatcher.updateObject(17, power);
|
||||
}
|
||||
}
|
||||
@ -40,6 +40,7 @@ import com.hbm.interfaces.ISource;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
|
||||
import cofh.api.energy.IEnergyProvider;
|
||||
@ -623,6 +624,10 @@ public class ExplosionNukeGeneric {
|
||||
if(random.nextInt(5) <= 1)
|
||||
world.setBlock(x, y, z, ModBlocks.block_electrical_scrap);
|
||||
}
|
||||
if (te != null && te instanceof TileEntityTurretBase) {
|
||||
|
||||
((TileEntityTurretBase)te).ammo = 0;
|
||||
}
|
||||
if((b == ModBlocks.fusion_conductor || b == ModBlocks.fwatz_conductor || b == ModBlocks.fusion_motor || b == ModBlocks.fusion_heater || b == ModBlocks.fwatz_computer) && random.nextInt(10) == 0)
|
||||
world.setBlock(x, y, z, ModBlocks.block_electrical_scrap);
|
||||
}
|
||||
|
||||
@ -74,8 +74,8 @@ public class GUIScreenSatInterface extends GuiScreen {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:item.techBleep"), 1.0F));
|
||||
|
||||
|
||||
int x = (int)player.posX - guiLeft + i - 8 - 100;
|
||||
int z = (int)player.posZ - guiTop + j - 8 - 100;
|
||||
int x = this.x - guiLeft + i - 8 - 100;
|
||||
int z = this.z - guiTop + j - 8 - 100;
|
||||
PacketDispatcher.wrapper.sendToServer(new SatLaserPacket(x, z, connectedSat.satelliteID));
|
||||
}
|
||||
}
|
||||
|
||||
@ -825,6 +825,11 @@ public class ModItems {
|
||||
public static Item grenade_pink_cloud;
|
||||
public static Item ullapool_caber;
|
||||
|
||||
public static Item grenade_smart;
|
||||
public static Item grenade_mirv;
|
||||
public static Item grenade_breach;
|
||||
public static Item grenade_burst;
|
||||
|
||||
public static Item weaponized_starblaster_cell;
|
||||
|
||||
public static Item bomb_waffle;
|
||||
@ -2062,6 +2067,11 @@ public class ModItems {
|
||||
grenade_pink_cloud = new ItemGrenade().setUnlocalizedName("grenade_pink_cloud").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_pink_cloud");
|
||||
ullapool_caber = new WeaponSpecial(MainRegistry.enumToolMaterialSteel).setUnlocalizedName("ullapool_caber").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ullapool_caber");
|
||||
|
||||
grenade_smart = new ItemGrenade().setUnlocalizedName("grenade_smart").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_smart");
|
||||
grenade_mirv = new ItemGrenade().setUnlocalizedName("grenade_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mirv");
|
||||
grenade_breach = new ItemGrenade().setUnlocalizedName("grenade_breach").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_breach");
|
||||
grenade_burst = new ItemGrenade().setUnlocalizedName("grenade_burst").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_burst");
|
||||
|
||||
weaponized_starblaster_cell = new WeaponizedCell().setUnlocalizedName("weaponized_starblaster_cell").setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b92_ammo_weaponized");
|
||||
|
||||
bomb_waffle = new ItemWaffle(20, false).setUnlocalizedName("bomb_waffle").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bomb_waffle");
|
||||
@ -3503,6 +3513,10 @@ public class ModItems {
|
||||
GameRegistry.registerItem(grenade_gas, grenade_gas.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_cloud, grenade_cloud.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_pink_cloud, grenade_pink_cloud.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_smart, grenade_smart.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_mirv, grenade_mirv.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_breach, grenade_breach.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_burst, grenade_burst.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_pulse, grenade_pulse.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_plasma, grenade_plasma.getUnlocalizedName());
|
||||
GameRegistry.registerItem(grenade_tau, grenade_tau.getUnlocalizedName());
|
||||
|
||||
@ -244,6 +244,10 @@ public class ItemStarterKit extends Item {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_gas, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_cloud, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_pink_cloud, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_smart, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_mirv, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_breach, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_burst, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_pulse, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_plasma, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.grenade_tau, 16));
|
||||
|
||||
@ -71,7 +71,7 @@ public class ItemWiring extends Item {
|
||||
list.add("Wire start y: " + itemstack.stackTagCompound.getInteger("y"));
|
||||
list.add("Wire start z: " + itemstack.stackTagCompound.getInteger("z"));
|
||||
} else {
|
||||
list.add("Richt-click poles to connect");
|
||||
list.add("Right-click poles to connect");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,8 @@ package com.hbm.items.weapon;
|
||||
|
||||
import com.hbm.entity.grenade.EntityGrenadeASchrab;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBlackHole;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBreach;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBurst;
|
||||
import com.hbm.entity.grenade.EntityGrenadeCloud;
|
||||
import com.hbm.entity.grenade.EntityGrenadeCluster;
|
||||
import com.hbm.entity.grenade.EntityGrenadeElectric;
|
||||
@ -12,6 +14,7 @@ import com.hbm.entity.grenade.EntityGrenadeGas;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGascan;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGeneric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeLemon;
|
||||
import com.hbm.entity.grenade.EntityGrenadeMIRV;
|
||||
import com.hbm.entity.grenade.EntityGrenadeMk2;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuke;
|
||||
@ -21,6 +24,7 @@ import com.hbm.entity.grenade.EntityGrenadePoison;
|
||||
import com.hbm.entity.grenade.EntityGrenadePulse;
|
||||
import com.hbm.entity.grenade.EntityGrenadeSchrabidium;
|
||||
import com.hbm.entity.grenade.EntityGrenadeShrapnel;
|
||||
import com.hbm.entity.grenade.EntityGrenadeSmart;
|
||||
import com.hbm.entity.grenade.EntityGrenadeStrong;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
@ -123,6 +127,18 @@ public class ItemGrenade extends Item {
|
||||
if (this == ModItems.grenade_pink_cloud) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadePC(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if (this == ModItems.grenade_smart) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeSmart(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if (this == ModItems.grenade_mirv) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeMIRV(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if (this == ModItems.grenade_breach) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeBreach(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
if (this == ModItems.grenade_burst) {
|
||||
p_77659_2_.spawnEntityInWorld(new EntityGrenadeBurst(p_77659_2_, p_77659_3_));
|
||||
}
|
||||
}
|
||||
|
||||
return p_77659_1_;
|
||||
|
||||
@ -141,6 +141,10 @@ public class ClientProxy extends ServerProxy
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeGascan.class, new RenderSnowball(ModItems.grenade_gascan));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeCloud.class, new RenderSnowball(ModItems.grenade_cloud));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadePC.class, new RenderSnowball(ModItems.grenade_pink_cloud));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeSmart.class, new RenderSnowball(ModItems.grenade_smart));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeMIRV.class, new RenderSnowball(ModItems.grenade_mirv));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeBreach.class, new RenderSnowball(ModItems.grenade_breach));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeBurst.class, new RenderSnowball(ModItems.grenade_burst));
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySchrab.class, new RenderFlare());
|
||||
|
||||
@ -333,6 +337,7 @@ public class ClientProxy extends ServerProxy
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.steel_scaffold), new ItemRenderDecoBlock());
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNuclearCreeper.class, new RenderNuclearCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintedCreeper.class, new RenderTaintedCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHunterChopper.class, new RenderHunterChopper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCyberCrab.class, new RenderCyberCrab());
|
||||
|
||||
|
||||
@ -807,6 +807,10 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.grenade_lemon, 1), new Object[] { ModItems.lemon, ModItems.grenade_strong }));
|
||||
//GameRegistry.addRecipe(new ItemStack(ModItems.grenade_black_hole, 1), new Object[] { " C ", "PBP", "PCP", 'C', ModItems.coil_advanced_alloy, 'P', ModItems.ingot_polymer, 'B', ModItems.black_hole });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.gun_moist_nugget, 12), new Object[] { Items.bread, Items.wheat, Items.cooked_chicken, Items.egg });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.grenade_smart, 4), new Object[] { " A ", "ACA", " A ", 'A', ModItems.grenade_strong, 'C', ModItems.circuit_aluminium });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.grenade_mirv, 1), new Object[] { "GGG", "GCG", "GGG", 'G', ModItems.grenade_smart, 'C', ModItems.grenade_generic });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.grenade_breach, 1), new Object[] { "G", "G", "P", 'G', ModItems.grenade_smart, 'P', "plateSaturnite" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.grenade_burst, 1), new Object[] { "GGG", "GCG", "GGG", 'G', ModItems.grenade_breach, 'C', ModItems.grenade_generic });
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.bomb_waffle, 1), new Object[] { "WEW", "MPM", "WEW", 'W', Items.wheat, 'E', Items.egg, 'M', Items.milk_bucket, 'P', ModItems.man_core });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.schnitzel_vegan, 3), new Object[] { "RWR", "WPW", "RWR", 'W', ModItems.nuclear_waste, 'R', Items.reeds, 'P', Items.pumpkin_seeds });
|
||||
|
||||
@ -66,6 +66,8 @@ import com.hbm.entity.effect.EntityRagingVortex;
|
||||
import com.hbm.entity.effect.EntityVortex;
|
||||
import com.hbm.entity.grenade.EntityGrenadeASchrab;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBlackHole;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBreach;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBurst;
|
||||
import com.hbm.entity.grenade.EntityGrenadeCloud;
|
||||
import com.hbm.entity.grenade.EntityGrenadeCluster;
|
||||
import com.hbm.entity.grenade.EntityGrenadeElectric;
|
||||
@ -76,6 +78,7 @@ import com.hbm.entity.grenade.EntityGrenadeGas;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGascan;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGeneric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeLemon;
|
||||
import com.hbm.entity.grenade.EntityGrenadeMIRV;
|
||||
import com.hbm.entity.grenade.EntityGrenadeMk2;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuke;
|
||||
@ -85,6 +88,7 @@ import com.hbm.entity.grenade.EntityGrenadePoison;
|
||||
import com.hbm.entity.grenade.EntityGrenadePulse;
|
||||
import com.hbm.entity.grenade.EntityGrenadeSchrabidium;
|
||||
import com.hbm.entity.grenade.EntityGrenadeShrapnel;
|
||||
import com.hbm.entity.grenade.EntityGrenadeSmart;
|
||||
import com.hbm.entity.grenade.EntityGrenadeStrong;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
@ -130,6 +134,7 @@ import com.hbm.entity.missile.EntityTestMissile;
|
||||
import com.hbm.entity.mob.EntityCyberCrab;
|
||||
import com.hbm.entity.mob.EntityHunterChopper;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.entity.particle.EntityBSmokeFX;
|
||||
import com.hbm.entity.particle.EntityChlorineFX;
|
||||
import com.hbm.entity.particle.EntityCloudFX;
|
||||
@ -793,10 +798,15 @@ public class MainRegistry
|
||||
EntityRegistry.registerModEntity(EntityBombletZeta.class, "entity_zeta", 109, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityOrangeFX.class, "entity_agent_orange", 110, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityDeathBlast.class, "entity_laser_blast", 111, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityGrenadeSmart.class, "entity_grenade_smart", 112, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityGrenadeMIRV.class, "entity_grenade_mirv", 113, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityGrenadeBreach.class, "entity_grenade_breach", 114, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityGrenadeBurst.class, "entity_grenade_burst", 115, this, 250, 1, true);
|
||||
|
||||
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
|
||||
EntityRegistry.registerGlobalEntityID(EntityHunterChopper.class, "entity_mob_hunter_chopper", EntityRegistry.findGlobalUniqueEntityId(), 0x000020, 0x2D2D72);
|
||||
EntityRegistry.registerGlobalEntityID(EntityCyberCrab.class, "entity_cyber_crab", EntityRegistry.findGlobalUniqueEntityId(), 0xAAAAAA, 0x444444);
|
||||
EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd);
|
||||
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(this, new LoadingCallback() {
|
||||
|
||||
@ -978,6 +988,34 @@ public class MainRegistry
|
||||
{
|
||||
return new EntityGrenadePC(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_smart, new BehaviorProjectileDispense() {
|
||||
|
||||
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
|
||||
{
|
||||
return new EntityGrenadeSmart(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_mirv, new BehaviorProjectileDispense() {
|
||||
|
||||
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
|
||||
{
|
||||
return new EntityGrenadeMIRV(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_breach, new BehaviorProjectileDispense() {
|
||||
|
||||
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
|
||||
{
|
||||
return new EntityGrenadeBreach(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_burst, new BehaviorProjectileDispense() {
|
||||
|
||||
protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_)
|
||||
{
|
||||
return new EntityGrenadeBurst(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.potion;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
@ -74,7 +75,8 @@ public class HbmPotion extends Potion {
|
||||
|
||||
if(this == taint) {
|
||||
|
||||
entity.attackEntityFrom(ModDamageSource.taint, (level + 1));
|
||||
if(!(entity instanceof EntityTaintedCreeper))
|
||||
entity.attackEntityFrom(ModDamageSource.taint, (level + 1));
|
||||
}
|
||||
if(this == radiation) {
|
||||
|
||||
|
||||
191
com/hbm/render/entity/RenderTaintedCreeper.java
Normal file
@ -0,0 +1,191 @@
|
||||
package com.hbm.render.entity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelCreeper;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderTaintedCreeper extends RenderLiving
|
||||
{
|
||||
private static final ResourceLocation armoredCreeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_armor_taint.png");
|
||||
private static final ResourceLocation creeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_tainted.png");
|
||||
/** The creeper model. */
|
||||
private ModelBase creeperModel = new ModelCreeper(2.0F);
|
||||
private static final String __OBFID = "CL_00000985";
|
||||
|
||||
public RenderTaintedCreeper()
|
||||
{
|
||||
super(new ModelCreeper(), 0.5F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
|
||||
* entityLiving, partialTickTime
|
||||
*/
|
||||
protected void preRenderCallback(EntityTaintedCreeper p_77041_1_, float p_77041_2_)
|
||||
{
|
||||
float f1 = p_77041_1_.getCreeperFlashIntensity(p_77041_2_);
|
||||
float f2 = 1.0F + MathHelper.sin(f1 * 100.0F) * f1 * 0.01F;
|
||||
|
||||
if (f1 < 0.0F)
|
||||
{
|
||||
f1 = 0.0F;
|
||||
}
|
||||
|
||||
if (f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
|
||||
f1 *= f1;
|
||||
f1 *= f1;
|
||||
float f3 = (1.0F + f1 * 0.4F) * f2;
|
||||
float f4 = (1.0F + f1 * 0.1F) / f2;
|
||||
GL11.glScalef(f3, f4, f3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
|
||||
*/
|
||||
protected int getColorMultiplier(EntityTaintedCreeper p_77030_1_, float p_77030_2_, float p_77030_3_)
|
||||
{
|
||||
float f2 = p_77030_1_.getCreeperFlashIntensity(p_77030_3_);
|
||||
|
||||
if ((int)(f2 * 10.0F) % 2 == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i = (int)(f2 * 0.2F * 255.0F);
|
||||
|
||||
if (i < 0)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
|
||||
if (i > 255)
|
||||
{
|
||||
i = 255;
|
||||
}
|
||||
|
||||
short short1 = 255;
|
||||
short short2 = 255;
|
||||
short short3 = 255;
|
||||
return i << 24 | short1 << 16 | short2 << 8 | short3;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries whether should render the specified pass or not.
|
||||
*/
|
||||
protected int shouldRenderPass(EntityTaintedCreeper p_77032_1_, int p_77032_2_, float p_77032_3_)
|
||||
{
|
||||
if (p_77032_1_.getPowered())
|
||||
{
|
||||
if (p_77032_1_.isInvisible())
|
||||
{
|
||||
GL11.glDepthMask(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
if (p_77032_2_ == 1)
|
||||
{
|
||||
float f1 = p_77032_1_.ticksExisted + p_77032_3_;
|
||||
this.bindTexture(armoredCreeperTextures);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
float f2 = f1 * 0.01F;
|
||||
float f3 = f1 * 0.01F;
|
||||
GL11.glTranslatef(f2, f3, 0.0F);
|
||||
this.setRenderPassModel(this.creeperModel);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float f4 = 0.5F;
|
||||
GL11.glColor4f(f4, f4, f4, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (p_77032_2_ == 2)
|
||||
{
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
protected int inheritRenderPass(EntityTaintedCreeper p_77035_1_, int p_77035_2_, float p_77035_3_)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntityTaintedCreeper p_110775_1_)
|
||||
{
|
||||
return creeperTextures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
|
||||
* entityLiving, partialTickTime
|
||||
*/
|
||||
@Override
|
||||
protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_)
|
||||
{
|
||||
this.preRenderCallback((EntityTaintedCreeper)p_77041_1_, p_77041_2_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
|
||||
*/
|
||||
@Override
|
||||
protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_)
|
||||
{
|
||||
return this.getColorMultiplier((EntityTaintedCreeper)p_77030_1_, p_77030_2_, p_77030_3_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries whether should render the specified pass or not.
|
||||
*/
|
||||
@Override
|
||||
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
|
||||
{
|
||||
return this.shouldRenderPass((EntityTaintedCreeper)p_77032_1_, p_77032_2_, p_77032_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_)
|
||||
{
|
||||
return this.inheritRenderPass((EntityTaintedCreeper)p_77035_1_, p_77035_2_, p_77035_3_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
|
||||
{
|
||||
return this.getEntityTexture((EntityTaintedCreeper)p_110775_1_);
|
||||
}
|
||||
}
|
||||