mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
095d50e611
@ -102,6 +102,13 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
// add AT to meta-inf
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'FMLAT': 'HBM_at.cfg'
|
||||
}
|
||||
}
|
||||
|
||||
task version {
|
||||
doFirst {
|
||||
println project.version
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.mob.EntityTaintCrab;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperTainted;
|
||||
import com.hbm.entity.mob.EntityTeslaCrab;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
@ -186,7 +186,7 @@ public class BlockTaint extends Block/*Container*/ {
|
||||
}
|
||||
|
||||
if(entity instanceof EntityCreeper) {
|
||||
EntityTaintedCreeper creep = new EntityTaintedCreeper(world);
|
||||
EntityCreeperTainted creep = new EntityCreeperTainted(world);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
@ -203,9 +203,11 @@ public class EntityMappings {
|
||||
addEntity(EntityCog.class, "entity_stray_cog", 1000);
|
||||
addEntity(EntitySawblade.class, "entity_stray_saw", 1000);
|
||||
addEntity(EntityChemical.class, "entity_chemthrower_splash", 1000);
|
||||
addEntity(EntityMist.class, "entity_mist", 1000);
|
||||
|
||||
addMob(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);
|
||||
addMob(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
|
||||
addMob(EntityCreeperNuclear.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);
|
||||
addMob(EntityCreeperTainted.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
|
||||
addMob(EntityCreeperPhosgene.class, "entity_mob_phosgene_creeper", 0xE3D398, 0xB8A06B);
|
||||
addMob(EntityHunterChopper.class, "entity_mob_hunter_chopper", 0x000020, 0x2D2D72);
|
||||
addMob(EntityCyberCrab.class, "entity_cyber_crab", 0xAAAAAA, 0x444444);
|
||||
addMob(EntityTeslaCrab.class, "entity_tesla_crab", 0xAAAAAA, 0x440000);
|
||||
|
||||
@ -37,15 +37,22 @@ public class EntityMist extends Entity {
|
||||
public EntityMist(World world) {
|
||||
super(world);
|
||||
this.noClip = true;
|
||||
this.setSize(10F, 3F);
|
||||
}
|
||||
|
||||
public EntityMist setArea(float width, float height) {
|
||||
this.dataWatcher.updateObject(11, width);
|
||||
this.dataWatcher.updateObject(12, height);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(10, new Integer(0));
|
||||
this.dataWatcher.addObject(11, new Float(0));
|
||||
this.dataWatcher.addObject(12, new Float(0));
|
||||
}
|
||||
|
||||
public EntityMist setFluid(FluidType fluid) {
|
||||
public EntityMist setType(FluidType fluid) {
|
||||
this.dataWatcher.updateObject(10, fluid.getID());
|
||||
return this;
|
||||
}
|
||||
@ -58,6 +65,10 @@ public class EntityMist extends Entity {
|
||||
@Override
|
||||
public void onEntityUpdate() {
|
||||
|
||||
float height = this.dataWatcher.getWatchableObjectFloat(12);
|
||||
this.yOffset = -height / 2F;
|
||||
this.setSize(this.dataWatcher.getWatchableObjectFloat(11), height);
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(this.ticksExisted > this.getMaxAge()) {
|
||||
@ -114,7 +125,7 @@ public class EntityMist extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
if(type.hasTrait(FT_Flammable.class)) {
|
||||
if(type.hasTrait(FT_Flammable.class) && type.hasTrait(FT_Liquid.class)) {
|
||||
if(living != null) {
|
||||
HbmLivingProps.setOil(living, 200); //doused in oil for 10 seconds
|
||||
}
|
||||
@ -169,7 +180,7 @@ public class EntityMist extends Entity {
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
this.setFluid(Fluids.fromID(nbt.getInteger("type")));
|
||||
this.setType(Fluids.fromID(nbt.getInteger("type")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
137
src/main/java/com/hbm/entity/mob/EntityCreeperNuclear.java
Normal file
137
src/main/java/com/hbm/entity/mob/EntityCreeperNuclear.java
Normal file
@ -0,0 +1,137 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCreeperNuclear extends EntityCreeper {
|
||||
|
||||
public EntityCreeperNuclear(World world) {
|
||||
super(world);
|
||||
this.fuseTime = 75;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
|
||||
// for some reason the nuclear explosion would damage the already dead entity, reviving it and forcing it to play the death animation
|
||||
if(this.isDead) return false;
|
||||
|
||||
if(source == ModDamageSource.radiation || source == ModDamageSource.mudPoisoning) {
|
||||
if(this.isEntityAlive()) this.heal(amount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem() {
|
||||
return Item.getItemFromBlock(Blocks.tnt);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
|
||||
|
||||
super.dropFewItems(p_70628_1_, p_70628_2_);
|
||||
|
||||
if(rand.nextInt(3) == 0)
|
||||
this.dropItem(ModItems.coin_creeper, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(50, 50, 50));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
player.triggerAchievement(MainRegistry.bossCreeper);
|
||||
}
|
||||
|
||||
if(p_70645_1_.getEntity() instanceof EntitySkeleton || (p_70645_1_.isProjectile() && p_70645_1_.getEntity() instanceof EntityArrow && ((EntityArrow) (p_70645_1_.getEntity())).shootingEntity == null)) {
|
||||
this.entityDropItem(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.STOCK), 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(5, 5, 5));
|
||||
|
||||
for(Entity e : list) {
|
||||
if(e instanceof EntityLivingBase) {
|
||||
ContaminationUtil.contaminate((EntityLivingBase) e, HazardType.RADIATION, ContaminationType.CREATIVE, 0.25F);
|
||||
}
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if(this.isEntityAlive() && this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
if(!this.worldObj.isRemote) {
|
||||
|
||||
this.setDead();
|
||||
|
||||
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
if(this.getPowered()) {
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "muke");
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250));
|
||||
worldObj.playSoundEffect(posX, posY + 0.5, posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
||||
|
||||
if(flag) {
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, 50, posX, posY, posZ).mute());
|
||||
} else {
|
||||
ExplosionNukeGeneric.dealDamage(worldObj, posX, posY + 0.5, posZ, 100);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(flag) {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_MEDIUM);
|
||||
} else {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_SAFE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
42
src/main/java/com/hbm/entity/mob/EntityCreeperPhosgene.java
Normal file
42
src/main/java/com/hbm/entity/mob/EntityCreeperPhosgene.java
Normal file
@ -0,0 +1,42 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.entity.effect.EntityMist;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCreeperPhosgene extends EntityCreeper {
|
||||
|
||||
public EntityCreeperPhosgene(World world) {
|
||||
super(world);
|
||||
this.fuseTime = 20; //ehehehehehe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
|
||||
if(!source.isDamageAbsolute() && !source.isUnblockable()) {
|
||||
amount -= 4F;
|
||||
}
|
||||
|
||||
if(amount < 0) return false;
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
EntityMist mist = new EntityMist(worldObj);
|
||||
mist.setType(Fluids.PHOSGENE);
|
||||
mist.setPosition(posX, posY, posZ);
|
||||
mist.setArea(10, 5);
|
||||
worldObj.spawnEntityInWorld(mist);
|
||||
}
|
||||
}
|
||||
}
|
||||
100
src/main/java/com/hbm/entity/mob/EntityCreeperTainted.java
Normal file
100
src/main/java/com/hbm/entity/mob/EntityCreeperTainted.java
Normal file
@ -0,0 +1,100 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
|
||||
import api.hbm.entity.IRadiationImmune;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCreeperTainted extends EntityCreeper implements IRadiationImmune {
|
||||
|
||||
public EntityCreeperTainted(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(this.isEntityAlive()) {
|
||||
|
||||
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem() {
|
||||
return Item.getItemFromBlock(Blocks.tnt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
if(!this.worldObj.isRemote) {
|
||||
boolean griefing = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
worldObj.newExplosion(this, posX, posY, posZ, 5.0F, false, false);
|
||||
|
||||
if(griefing) {
|
||||
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)) {
|
||||
if(!GeneralConfig.enableHardcoreTaint) {
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2);
|
||||
} else {
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 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)) {
|
||||
if(!GeneralConfig.enableHardcoreTaint) {
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2);
|
||||
} else {
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 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;
|
||||
}
|
||||
}
|
||||
@ -27,7 +27,7 @@ public class EntityCyberCrab extends EntityMob implements IRangedAttackMob, IRad
|
||||
|
||||
private static final IEntitySelector selector = new IEntitySelector() {
|
||||
public boolean isEntityApplicable(Entity p_82704_1_) {
|
||||
return !(p_82704_1_ instanceof EntityCyberCrab || p_82704_1_ instanceof EntityCreeper || p_82704_1_ instanceof EntityNuclearCreeper);
|
||||
return !(p_82704_1_ instanceof EntityCyberCrab || p_82704_1_ instanceof EntityCreeper);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,349 +0,0 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.entity.mob.ai.EntityAINuclearCreeperSwell;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.world.World;
|
||||
|
||||
public class EntityNuclearCreeper extends EntityMob {
|
||||
|
||||
private int lastActiveTime;
|
||||
private int timeSinceIgnited;
|
||||
private int fuseTime = 75;
|
||||
|
||||
public EntityNuclearCreeper(World p_i1733_1_) {
|
||||
super(p_i1733_1_);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, new EntityAINuclearCreeperSwell(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(50.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
|
||||
if(source == ModDamageSource.radiation || source == ModDamageSource.mudPoisoning) {
|
||||
this.heal(amount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAIEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSafePointTries() {
|
||||
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
@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_.setBoolean("ignited", this.func_146078_ca());
|
||||
}
|
||||
|
||||
@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_.getBoolean("ignited")) {
|
||||
this.func_146079_cb();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if(this.isDead) {
|
||||
this.isDead = false;
|
||||
this.heal(10.0F);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
|
||||
|
||||
for(Entity e : list)
|
||||
if(e instanceof EntityLivingBase) {
|
||||
ContaminationUtil.contaminate((EntityLivingBase) e, HazardType.RADIATION, ContaminationType.CREATIVE, 0.25F);
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getHurtSound() {
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDeathSound() {
|
||||
return "mob.creeper.death";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(50, 50, 50));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
player.triggerAchievement(MainRegistry.bossCreeper);
|
||||
}
|
||||
|
||||
if(p_70645_1_.getEntity() instanceof EntitySkeleton || (p_70645_1_.isProjectile() && p_70645_1_.getEntity() instanceof EntityArrow && ((EntityArrow) (p_70645_1_.getEntity())).shootingEntity == null)) {
|
||||
int i = rand.nextInt(11);
|
||||
int j = rand.nextInt(3);
|
||||
if(i == 0)
|
||||
this.dropItem(ModItems.nugget_u235, j);
|
||||
if(i == 1)
|
||||
this.dropItem(ModItems.nugget_pu238, j);
|
||||
if(i == 2)
|
||||
this.dropItem(ModItems.nugget_pu239, j);
|
||||
if(i == 3)
|
||||
this.dropItem(ModItems.nugget_neptunium, j);
|
||||
if(i == 4)
|
||||
this.dropItem(ModItems.man_core, 1);
|
||||
if(i == 5) {
|
||||
this.dropItem(ModItems.sulfur, j * 2);
|
||||
this.dropItem(ModItems.niter, j * 2);
|
||||
}
|
||||
if(i == 6)
|
||||
this.dropItem(ModItems.syringe_awesome, 1);
|
||||
if(i == 7)
|
||||
this.dropItem(ModItems.fusion_core, 1);
|
||||
if(i == 8)
|
||||
this.dropItem(ModItems.syringe_metal_stimpak, 1);
|
||||
if(i == 9) {
|
||||
switch(rand.nextInt(4)) {
|
||||
case 0:
|
||||
this.dropItem(ModItems.t45_helmet, 1);
|
||||
break;
|
||||
case 1:
|
||||
this.dropItem(ModItems.t45_plate, 1);
|
||||
break;
|
||||
case 2:
|
||||
this.dropItem(ModItems.t45_legs, 1);
|
||||
break;
|
||||
case 3:
|
||||
this.dropItem(ModItems.t45_boots, 1);
|
||||
break;
|
||||
}
|
||||
this.dropItem(ModItems.fusion_core, 1);
|
||||
}
|
||||
if(i == 10)
|
||||
this.entityDropItem(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH), 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity p_70652_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean getPowered() {
|
||||
return this.dataWatcher.getWatchableObjectByte(17) == 1;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
|
||||
|
||||
super.dropFewItems(p_70628_1_, p_70628_2_);
|
||||
|
||||
if(rand.nextInt(3) == 0)
|
||||
this.dropItem(ModItems.coin_creeper, 1);
|
||||
}
|
||||
|
||||
public int getCreeperState() {
|
||||
return this.dataWatcher.getWatchableObjectByte(16);
|
||||
}
|
||||
|
||||
public void setCreeperState(int p_70829_1_) {
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte) p_70829_1_));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
|
||||
super.onStruckByLightning(p_70077_1_);
|
||||
this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1));
|
||||
}
|
||||
|
||||
@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()) {
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "muke");
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250));
|
||||
worldObj.playSoundEffect(posX, posY + 0.5, posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
||||
|
||||
if(flag) {
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, 50, posX, posY, posZ).mute());
|
||||
} else {
|
||||
ExplosionNukeGeneric.dealDamage(worldObj, posX, posY + 0.5, posZ, 100);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(flag) {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_MEDIUM);
|
||||
} else {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_SAFE);
|
||||
}
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -1,286 +0,0 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.entity.mob.ai.EntityAITaintedCreeperSwell;
|
||||
|
||||
import api.hbm.entity.IRadiationImmune;
|
||||
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.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.passive.EntityOcelot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityTaintedCreeper extends EntityMob implements IRadiationImmune {
|
||||
|
||||
private int lastActiveTime;
|
||||
private int timeSinceIgnited;
|
||||
private int fuseTime = 30;
|
||||
private int explosionRadius = 20;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAIEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSafePointTries() {
|
||||
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
@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());
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getHurtSound() {
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDeathSound() {
|
||||
return "mob.creeper.death";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity p_70652_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean getPowered() {
|
||||
return this.dataWatcher.getWatchableObjectByte(17) == 1;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
public int getCreeperState() {
|
||||
return this.dataWatcher.getWatchableObjectByte(16);
|
||||
}
|
||||
|
||||
public void setCreeperState(int p_70829_1_) {
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte) p_70829_1_));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
|
||||
super.onStruckByLightning(p_70077_1_);
|
||||
this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1));
|
||||
}
|
||||
|
||||
@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) {
|
||||
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)) {
|
||||
|
||||
if(!GeneralConfig.enableHardcoreTaint)
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2);
|
||||
else
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 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)) {
|
||||
|
||||
if(!GeneralConfig.enableHardcoreTaint)
|
||||
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2);
|
||||
else
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 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);
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
package com.hbm.entity.mob.ai;
|
||||
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
|
||||
public class EntityAINuclearCreeperSwell extends EntityAIBase {
|
||||
/** The creeper that is swelling. */
|
||||
EntityNuclearCreeper swellingCreeper;
|
||||
/** The creeper's attack target. This is used for the changing of the creeper's state. */
|
||||
EntityLivingBase creeperAttackTarget;
|
||||
public EntityAINuclearCreeperSwell(EntityNuclearCreeper 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
package com.hbm.entity.mob.ai;
|
||||
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
|
||||
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;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ import net.minecraft.world.World;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.RedBarrel;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||
import com.hbm.entity.particle.EntityBSmokeFX;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
@ -494,7 +494,7 @@ public class EntityBullet extends Entity implements IProjectile {
|
||||
if (entitylivingbase instanceof EntityPlayer
|
||||
&& ArmorUtil.checkForHazmat((EntityPlayer) entitylivingbase)) {
|
||||
} else if (entitylivingbase instanceof EntityCreeper) {
|
||||
EntityNuclearCreeper creep = new EntityNuclearCreeper(this.worldObj);
|
||||
EntityCreeperNuclear creep = new EntityCreeperNuclear(this.worldObj);
|
||||
creep.setLocationAndAngles(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ,
|
||||
entitylivingbase.rotationYaw, entitylivingbase.rotationPitch);
|
||||
if (!entitylivingbase.isDead)
|
||||
@ -509,7 +509,7 @@ public class EntityBullet extends Entity implements IProjectile {
|
||||
if (!this.worldObj.isRemote)
|
||||
this.worldObj.spawnEntityInWorld(creep);
|
||||
} else if (entitylivingbase instanceof EntityLivingBase
|
||||
&& !(entitylivingbase instanceof EntityNuclearCreeper)
|
||||
&& !(entitylivingbase instanceof EntityCreeperNuclear)
|
||||
&& !(entitylivingbase instanceof EntityMooshroom)
|
||||
&& !(entitylivingbase instanceof EntityZombie)) {
|
||||
entitylivingbase.addPotionEffect(new PotionEffect(Potion.poison.getId(), 2 * 60 * 20, 2));
|
||||
|
||||
@ -35,6 +35,9 @@ public class FT_Toxin extends FluidTrait {
|
||||
|
||||
public void affect(EntityLivingBase entity, double intensity) {
|
||||
|
||||
for(ToxinEntry entry : entries) {
|
||||
entry.poison(entity, intensity);
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class ToxinEntry {
|
||||
|
||||
@ -66,6 +66,7 @@ import com.hbm.handler.ImpactWorldHandler;
|
||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
||||
import com.hbm.items.IAnimatedItem;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.particle.*;
|
||||
import com.hbm.particle.psys.engine.EventHandlerParticleEngine;
|
||||
import com.hbm.render.anim.*;
|
||||
@ -577,6 +578,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCog.class, new RenderCog());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySawblade.class, new RenderSawblade());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChemical.class, new RenderChemical());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMist.class, new RenderMist());
|
||||
//grenades
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeGeneric.class, new RenderSnowball(ModItems.grenade_generic));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeStrong.class, new RenderSnowball(ModItems.grenade_strong));
|
||||
@ -682,27 +684,28 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMovingPackage.class, new RenderMovingPackage());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTNTPrimedBase.class, new RenderTNTPrimedBase());
|
||||
//mobs
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNuclearCreeper.class, new RenderNuclearCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintedCreeper.class, new RenderTaintedCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHunterChopper.class, new RenderHunterChopper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCyberCrab.class, new RenderCyberCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTeslaCrab.class, new RenderTeslaCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintCrab.class, new RenderTaintCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMaskMan.class, new RenderMaskMan());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeHead.class, new RenderWormHead());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeBody.class, new RenderWormBody());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDuck.class, new RenderDuck(new ModelChicken(), 0.3F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityQuackos.class, new RenderQuacc(new ModelChicken(), 7.5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFBI.class, new RenderFBI());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityRADBeast.class, new RenderRADBeast());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBlockSpider.class, new RenderBlockSpider());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityUFO.class, new RenderUFO());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeZombie.class, new RenderSiegeZombie());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeUFO.class, new RenderSiegeUFO());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeCraft.class, new RenderSiegeCraft());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeSkeleton.class, new RenderSiegeSkeleton());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeTunneler.class, new RenderSiegeTunneler());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new RenderGhost());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperNuclear.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor.png").setSwellMod(5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperTainted.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_tainted.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor_taint.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperPhosgene.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_phosgene.png", "textures/entity/creeper/creeper_armor.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHunterChopper.class, new RenderHunterChopper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCyberCrab.class, new RenderCyberCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTeslaCrab.class, new RenderTeslaCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintCrab.class, new RenderTaintCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMaskMan.class, new RenderMaskMan());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeHead.class, new RenderWormHead());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeBody.class, new RenderWormBody());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDuck.class, new RenderDuck(new ModelChicken(), 0.3F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityQuackos.class, new RenderQuacc(new ModelChicken(), 7.5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFBI.class, new RenderFBI());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityRADBeast.class, new RenderRADBeast());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBlockSpider.class, new RenderBlockSpider());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityUFO.class, new RenderUFO());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeZombie.class, new RenderSiegeZombie());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeUFO.class, new RenderSiegeUFO());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeCraft.class, new RenderSiegeCraft());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeSkeleton.class, new RenderSiegeSkeleton());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeTunneler.class, new RenderSiegeTunneler());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new RenderGhost());
|
||||
//"particles"
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.smoke1, ModItems.smoke2, ModItems.smoke3, ModItems.smoke4, ModItems.smoke5, ModItems.smoke6, ModItems.smoke7, ModItems.smoke8 }));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.b_smoke1, ModItems.b_smoke2, ModItems.b_smoke3, ModItems.b_smoke4, ModItems.b_smoke5, ModItems.b_smoke6, ModItems.b_smoke7, ModItems.b_smoke8 }));
|
||||
|
||||
@ -22,9 +22,9 @@ import com.hbm.entity.missile.EntityMissileBaseAdvanced;
|
||||
import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.entity.mob.EntityCyberCrab;
|
||||
import com.hbm.entity.mob.EntityDuck;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||
import com.hbm.entity.mob.EntityQuackos;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperTainted;
|
||||
import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.entity.projectile.EntityBurningFOEQ;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
@ -284,7 +284,7 @@ public class ModEventHandler {
|
||||
event.entity.dropItem(ModItems.book_of_, 1);
|
||||
}
|
||||
|
||||
if(event.entity instanceof EntityTaintedCreeper && event.source == ModDamageSource.boxcar) {
|
||||
if(event.entity instanceof EntityCreeperTainted && event.source == ModDamageSource.boxcar) {
|
||||
|
||||
for(Object o : event.entity.worldObj.getEntitiesWithinAABB(EntityPlayer.class, event.entity.boundingBox.expand(50, 50, 50))) {
|
||||
EntityPlayer player = (EntityPlayer)o;
|
||||
@ -577,7 +577,7 @@ public class ModEventHandler {
|
||||
if(entity instanceof EntityCreeper && eRad >= 200 && entity.getHealth() > 0) {
|
||||
|
||||
if(event.world.rand.nextInt(3) == 0 ) {
|
||||
EntityNuclearCreeper creep = new EntityNuclearCreeper(event.world);
|
||||
EntityCreeperNuclear creep = new EntityCreeperNuclear(event.world);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
|
||||
if(!entity.isDead)
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.blocks.bomb.BlockTaint;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.PotionConfig;
|
||||
import com.hbm.entity.mob.EntityTaintCrab;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperTainted;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -102,7 +102,7 @@ public class HbmPotion extends Potion {
|
||||
|
||||
if(this == taint) {
|
||||
|
||||
if(!(entity instanceof EntityTaintedCreeper) && !(entity instanceof EntityTaintCrab) && entity.worldObj.rand.nextInt(40) == 0)
|
||||
if(!(entity instanceof EntityCreeperTainted) && !(entity instanceof EntityTaintCrab) && entity.worldObj.rand.nextInt(40) == 0)
|
||||
entity.attackEntityFrom(ModDamageSource.taint, (level + 1));
|
||||
|
||||
if(GeneralConfig.enableHardcoreTaint && !entity.worldObj.isRemote) {
|
||||
|
||||
18
src/main/java/com/hbm/render/entity/effect/RenderMist.java
Normal file
18
src/main/java/com/hbm/render/entity/effect/RenderMist.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.hbm.render.entity.effect;
|
||||
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderMist extends Render {
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package com.hbm.render.entity.mob;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderCreeper;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderCreeperUniversal extends RenderCreeper {
|
||||
|
||||
private final ResourceLocation creeperTextures;
|
||||
private final ResourceLocation armoredCreeperTextures;
|
||||
private float swellMod = 1.0F;
|
||||
|
||||
public RenderCreeperUniversal(String texture, String overlay) {
|
||||
super();
|
||||
|
||||
creeperTextures = new ResourceLocation(texture);
|
||||
armoredCreeperTextures = new ResourceLocation(overlay);
|
||||
}
|
||||
|
||||
public RenderCreeperUniversal setSwellMod(float mod) {
|
||||
this.swellMod = mod;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityCreeper creeper, float interp) {
|
||||
float swell = creeper.getCreeperFlashIntensity(interp);
|
||||
float flash = 1.0F + MathHelper.sin(swell * 100.0F) * swell * 0.01F;
|
||||
|
||||
if(swell < 0.0F) {
|
||||
swell = 0.0F;
|
||||
}
|
||||
|
||||
if(swell > 1.0F) {
|
||||
swell = 1.0F;
|
||||
}
|
||||
|
||||
swell *= swell;
|
||||
swell *= swell;
|
||||
swell *= swellMod;
|
||||
float scaleHorizontal = (1.0F + swell * 0.4F) * flash;
|
||||
float scaleVertical = (1.0F + swell * 0.1F) / flash;
|
||||
GL11.glScalef(scaleHorizontal, scaleVertical, scaleHorizontal);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int shouldRenderPass(EntityCreeper creeper, int pass, float interp) {
|
||||
if(creeper.getPowered()) {
|
||||
if(creeper.isInvisible()) {
|
||||
GL11.glDepthMask(false);
|
||||
} else {
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
if(pass == 1) {
|
||||
float time = (float) creeper.ticksExisted + interp;
|
||||
this.bindTexture(armoredCreeperTextures);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
float x = time * 0.01F;
|
||||
float y = time * 0.01F;
|
||||
GL11.glTranslatef(x, y, 0.0F);
|
||||
this.setRenderPassModel(this.creeperModel);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float flashColor = 0.5F;
|
||||
GL11.glColor4f(flashColor, flashColor, flashColor, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(pass == 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityCreeper p_110775_1_) {
|
||||
return creeperTextures;
|
||||
}
|
||||
}
|
||||
@ -1,189 +0,0 @@
|
||||
package com.hbm.render.entity.mob;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelCreeper;
|
||||
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 RenderNuclearCreeper extends RenderLiving
|
||||
{
|
||||
private static final ResourceLocation armoredCreeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_armor.png");
|
||||
private static final ResourceLocation creeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper.png");
|
||||
/** The creeper model. */
|
||||
private ModelBase creeperModel = new ModelCreeper(2.0F);
|
||||
|
||||
public RenderNuclearCreeper()
|
||||
{
|
||||
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(EntityNuclearCreeper 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(EntityNuclearCreeper 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(EntityNuclearCreeper 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(EntityNuclearCreeper 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(EntityNuclearCreeper 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((EntityNuclearCreeper)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((EntityNuclearCreeper)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((EntityNuclearCreeper)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((EntityNuclearCreeper)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((EntityNuclearCreeper)p_110775_1_);
|
||||
}
|
||||
}
|
||||
@ -1,189 +0,0 @@
|
||||
package com.hbm.render.entity.mob;
|
||||
|
||||
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.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);
|
||||
|
||||
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_);
|
||||
}
|
||||
}
|
||||
@ -34,6 +34,7 @@ public class ItemRenderBoltgun implements IItemRenderer {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.boltgun_tex);
|
||||
|
||||
switch(type) {
|
||||
@ -56,11 +57,12 @@ public class ItemRenderBoltgun implements IItemRenderer {
|
||||
|
||||
case EQUIPPED:
|
||||
|
||||
double scale = -0.375D;
|
||||
double scale = 0.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotated(85, 0, 1, 0);
|
||||
GL11.glRotated(135D, 1.0D, 0.0D, 0.0D);
|
||||
GL11.glTranslated(-0.125, -2.0, 1.75);
|
||||
GL11.glRotated(10, 0, 1, 0);
|
||||
GL11.glRotated(10, 0, 0, 1);
|
||||
GL11.glRotated(10, 1, 0, 0);
|
||||
GL11.glTranslated(1.5, -0.25, 1);
|
||||
|
||||
break;
|
||||
|
||||
@ -86,7 +88,6 @@ public class ItemRenderBoltgun implements IItemRenderer {
|
||||
default: break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.boltgun.renderPart("Gun");
|
||||
if(type != type.EQUIPPED_FIRST_PERSON) {
|
||||
ResourceManager.boltgun.renderPart("Barrel");
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.mob.EntityCyberCrab;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityTaintCrab;
|
||||
import com.hbm.entity.mob.EntityTeslaCrab;
|
||||
import com.hbm.lib.Library;
|
||||
@ -134,10 +133,6 @@ public class TileEntityTesla extends TileEntityMachineBase implements IEnergyUse
|
||||
((EntityCreeper)e).getDataWatcher().updateObject(17, Byte.valueOf((byte)1));
|
||||
}
|
||||
|
||||
if(e instanceof EntityNuclearCreeper) {
|
||||
((EntityNuclearCreeper)e).getDataWatcher().updateObject(17, Byte.valueOf((byte)1));
|
||||
}
|
||||
|
||||
double offset = 0;
|
||||
|
||||
if(source != null && e instanceof EntityPlayer && worldObj.isRemote)
|
||||
|
||||
@ -1,17 +1,10 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.recipes.CrackingRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
@ -24,20 +17,17 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase implements IFluidSource, IFluidAcceptor, INBTPacketReceiver, IFluidStandardTransceiver {
|
||||
public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase implements INBTPacketReceiver, IFluidStandardTransceiver {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public List<IFluidAcceptor> list1 = new ArrayList();
|
||||
public List<IFluidAcceptor> list2 = new ArrayList();
|
||||
public List<IFluidAcceptor> list3 = new ArrayList();
|
||||
|
||||
public TileEntityMachineCatalyticCracker() {
|
||||
tanks = new FluidTank[5];
|
||||
tanks[0] = new FluidTank(Fluids.BITUMEN, 4000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.STEAM, 8000, 1);
|
||||
tanks[2] = new FluidTank(Fluids.OIL, 4000, 2);
|
||||
tanks[3] = new FluidTank(Fluids.PETROLEUM, 4000, 3);
|
||||
tanks[4] = new FluidTank(Fluids.SPENTSTEAM, 800, 4);
|
||||
tanks[0] = new FluidTank(Fluids.BITUMEN, 4000);
|
||||
tanks[1] = new FluidTank(Fluids.STEAM, 8000);
|
||||
tanks[2] = new FluidTank(Fluids.OIL, 4000);
|
||||
tanks[3] = new FluidTank(Fluids.PETROLEUM, 4000);
|
||||
tanks[4] = new FluidTank(Fluids.SPENTSTEAM, 800);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -51,14 +41,11 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
|
||||
updateConnections();
|
||||
|
||||
this.worldObj.theProfiler.endStartSection("catalyticCracker_do_recipe");
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0)
|
||||
if(worldObj.getTotalWorldTime() % 5 == 0)
|
||||
crack();
|
||||
|
||||
this.worldObj.theProfiler.endStartSection("catalyticCracker_send_fluid");
|
||||
if(worldObj.getTotalWorldTime() % 10 == 0) {
|
||||
fillFluidInit(tanks[2].getTankType());
|
||||
fillFluidInit(tanks[3].getTankType());
|
||||
fillFluidInit(tanks[4].getTankType());
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
for(int i = 2; i <= 4; i++) {
|
||||
@ -149,63 +136,6 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
|
||||
for(int i = 0; i < 5; i++)
|
||||
tanks[i].writeToNBT(nbt, "tank" + i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 5 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
this.tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
if(type == tanks[0].getTankType())
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type == tanks[1].getTankType())
|
||||
return tanks[1].getMaxFill();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
fillFluid(xCoord + dir.offsetX * 4 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 4 + rot.offsetZ * 1, this.getTact(), type);
|
||||
fillFluid(xCoord + dir.offsetX * 4 - rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 4 - rot.offsetZ * 2, this.getTact(), type);
|
||||
fillFluid(xCoord - dir.offsetX * 4 + rot.offsetX * 1, yCoord, zCoord - dir.offsetZ * 4 + rot.offsetZ * 1, this.getTact(), type);
|
||||
fillFluid(xCoord - dir.offsetX * 4 - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 4 - rot.offsetZ * 2, this.getTact(), type);
|
||||
|
||||
fillFluid(xCoord + dir.offsetX * 2 + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * 3, this.getTact(), type);
|
||||
fillFluid(xCoord + dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord + dir.offsetZ * 2 - rot.offsetZ * 4, this.getTact(), type);
|
||||
fillFluid(xCoord - dir.offsetX * 2 + rot.offsetX * 3, yCoord, zCoord - dir.offsetZ * 2 + rot.offsetZ * 3, this.getTact(), type);
|
||||
fillFluid(xCoord - dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ * 4, this.getTact(), type);
|
||||
}
|
||||
|
||||
protected DirPos[] getConPos() {
|
||||
|
||||
@ -223,31 +153,6 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
|
||||
new DirPos(xCoord - dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ * 4, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
return worldObj.getTotalWorldTime() % 20 < 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
if(type == tanks[2].getTankType()) return list1;
|
||||
if(type == tanks[3].getTankType()) return list2;
|
||||
if(type == tanks[4].getTankType()) return list3;
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
if(type == tanks[2].getTankType()) list1.clear();
|
||||
if(type == tanks[3].getTankType()) list2.clear();
|
||||
if(type == tanks[4].getTankType()) list3.clear();
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -410,6 +410,15 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
}
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFuelType(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
return new Object[] {rod.getName()};
|
||||
}
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
@ -443,12 +452,15 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
Object OC_enrich_buf;
|
||||
Object OC_poison_buf;
|
||||
Object OC_fuelType;
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
OC_enrich_buf = ItemRBMKRod.getEnrichment(slots[0]);
|
||||
OC_poison_buf = ItemRBMKRod.getPoison(slots[0]);
|
||||
OC_fuelType = rod.getName();
|
||||
} else {
|
||||
OC_enrich_buf = "N/A";
|
||||
OC_poison_buf = "N/A";
|
||||
OC_fuelType = "N/A";
|
||||
}
|
||||
return new Object[] {heat, fluxSlow, fluxFast, OC_enrich_buf, OC_poison_buf, ((RBMKRod)this.getBlockType()).moderated, xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.util;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.hbm.entity.mob.EntityDuck;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||
import com.hbm.entity.mob.EntityQuackos;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.HazmatRegistry;
|
||||
@ -65,7 +65,7 @@ public class ContaminationUtil {
|
||||
return true;
|
||||
|
||||
if(immuneEntities.isEmpty()) {
|
||||
immuneEntities.add(EntityNuclearCreeper.class);
|
||||
immuneEntities.add(EntityCreeperNuclear.class);
|
||||
immuneEntities.add(EntityMooshroom.class);
|
||||
immuneEntities.add(EntityZombie.class);
|
||||
immuneEntities.add(EntitySkeleton.class);
|
||||
|
||||
10
src/main/resources/META-INF/HBM_at.cfg
Normal file
10
src/main/resources/META-INF/HBM_at.cfg
Normal file
@ -0,0 +1,10 @@
|
||||
# It's access transformer time, baby!
|
||||
# Cracks open stupid as shit keywords that are being used wrong because Mojang shouldn't be entrusted with computers.
|
||||
# After changing anything here, run `./gradlew clean setupDecompWorkspace`, this should scrap all the cached nonsense and patch the src to reflect changes made.
|
||||
|
||||
# EntityCreeper
|
||||
public net.minecraft.entity.monster.EntityCreeper field_82225_f # fuseTime
|
||||
public net.minecraft.entity.monster.EntityCreeper func_146077_cc()V # explode
|
||||
|
||||
# RenderCreeper
|
||||
public net.minecraft.client.renderer.entity.RenderCreeper field_77064_a # creeperModel
|
||||
@ -503,6 +503,7 @@ entity.hbm.entity_ntm_ufo.name=Marsianisches Invasionsschiff
|
||||
entity.entity_mob_hunter_chopper.name=Jagdschrauber
|
||||
entity.entity_mob_mask_man.name=Maskenmann
|
||||
entity.entity_mob_nuclear_creeper.name=Nuklearer Creeper
|
||||
entity.entity_mob_phosgene_creeper.name=Phosgen-Creeper
|
||||
entity.entity_mob_tainted_creeper.name=Verseuchter Creeper
|
||||
entity.entity_taint_crab.name=Verseuchte Krabbe
|
||||
entity.entity_tesla_crab.name=Tesla-Krabbe
|
||||
|
||||
@ -948,6 +948,7 @@ entity.hbm.entity_ntm_ufo.name=Martian Invasion Ship
|
||||
entity.entity_mob_hunter_chopper.name=Hunter Chopper
|
||||
entity.entity_mob_mask_man.name=Mask Man
|
||||
entity.entity_mob_nuclear_creeper.name=Nuclear Creeper
|
||||
entity.entity_mob_phosgene_creeper.name=Phosgene Creeper
|
||||
entity.entity_mob_tainted_creeper.name=Tainted Creeper
|
||||
entity.entity_taint_crab.name=Taint Crab
|
||||
entity.entity_tesla_crab.name=Tesla Crab
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/entity/creeper_base.png
Normal file
BIN
src/main/resources/assets/hbm/textures/entity/creeper_base.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
Loading…
x
Reference in New Issue
Block a user