radiation elemental

This commit is contained in:
Bob 2020-12-25 18:38:23 +01:00
parent 06c34f4f0f
commit cddc0d3154
17 changed files with 359 additions and 69 deletions

View File

@ -274,6 +274,7 @@ entity.entity_cyber_crab.name=Cyber-Krabbe
entity.entity_elder_one.name=Quackos der Älteste
entity.entity_fucc_a_ducc.name=Ente
entity.entity_ntm_fbi.name=FBI Agent
entity.entity_ntm_radiation_blaze.name=Kernschmelze-Elementar
entity.entity_mob_hunter_chopper.name=Jagdschrauber
entity.entity_mob_mask_man.name=Maskenmann
entity.entity_mob_nuclear_creeper.name=Nuklearer Creeper
@ -910,7 +911,7 @@ item.euphemium_boots.name=Euphemiumstiefel
item.euphemium_helmet.name=Euphemiumstiefel
item.euphemium_kit.name=Euphemium Kit
item.euphemium_legs.name=Euphemiumbeinschutz
item.euphemium_plate.name=Euphemiumbrustplatte
item.euphemium_plate.name=Euphemiumbrustpanzer
item.euphemium_stopper.name=Stopper
item.factory_core_advanced.name=Fortgeschrittener Fabrikenergiecluster
item.factory_core_titanium.name=Einfacher Fabrikenergiecluster
@ -1141,7 +1142,7 @@ item.hazmat_legs_red.name=Verbesserte Strahlenschutzhose
item.hazmat_paa_boots.name=PaA-Kampfschutzanzug Stiefel
item.hazmat_paa_helmet.name=PaA-Kampfschutzanzug Helm
item.hazmat_paa_legs.name=PaA-Kampfschutzanzug Hose
item.hazmat_paa_plate.name=PaA-Kampfschutzanzug Brustplatte
item.hazmat_paa_plate.name=PaA-Kampfschutzanzug Brustpanzer
item.hazmat_plate.name=Strahlenschutzbrustplatte
item.hazmat_plate_grey.name=Hochleistungs-Strahlenschutzbrustplatte
item.hazmat_plate_red.name=Verbesserte Strahlenschutzbrustplatte
@ -1820,7 +1821,7 @@ item.schrabidium_helmet.name=Schrabidiumhelm
item.schrabidium_hoe.name=Schrabidiumfeldhacke
item.schrabidium_legs.name=Schrabidiumbeinschutz
item.schrabidium_pickaxe.name=Schrabidiumspitzhacke
item.schrabidium_plate.name=Schrabidiumbrustplatte
item.schrabidium_plate.name=Schrabidiumbrustpanzer
item.schrabidium_shovel.name=Schrabidiumschaufel
item.schrabidium_sword.name=Schrabidiumschwert
item.scrap.name=Schrott

View File

@ -274,6 +274,7 @@ entity.entity_cyber_crab.name=Cyber Crab
entity.entity_elder_one.name=Quackos The Elder One
entity.entity_fucc_a_ducc.name=Duck
entity.entity_ntm_fbi.name=FBI Agent
entity.entity_ntm_radiation_blaze.name=Meltdown Elemental
entity.entity_mob_hunter_chopper.name=Hunter Chopper
entity.entity_mob_mask_man.name=Mask Man
entity.entity_mob_nuclear_creeper.name=Nuclear Creeper

View File

@ -17,24 +17,36 @@ public class MobConfig {
public static int raidAttackDelay = 40;
public static int raidAttackReach = 2;
public static int raidAttackDistance = 32;
public static boolean enableElementals = true;
public static int elementalDelay = 30 * 60 * 60;
public static int elementalChance = 2;
public static int elementalAmount = 10;
public static int elementalDistance = 32;
public static void loadFromConfig(Configuration config) {
final String CATEGORY = "12_mobs";
enableMaskman = CommonConfig.createConfigBool(config, CATEGORY, "12.00_enableMaskman", "Whether mask man should spawn", true);
maskmanDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.01_maskmanDelay", "How many world ticks need to pass for a check to be performed", 60 * 60 * 60);
maskmanChance = CommonConfig.createConfigInt(config, CATEGORY, "12.02_maskmanChance", "1:x chance to spawn mask man, must be at least 1", 3);
maskmanMinRad = CommonConfig.createConfigInt(config, CATEGORY, "12.03_maskmanMinRad", "The amount of radiation needed for mask man to spawn", 50);
maskmanUnderground = CommonConfig.createConfigBool(config, CATEGORY, "12.04_maskmanUnderound", "Whether players need to be underground for mask man to spawn", true);
enableMaskman = CommonConfig.createConfigBool(config, CATEGORY, "12.M00_enableMaskman", "Whether mask man should spawn", true);
maskmanDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.M01_maskmanDelay", "How many world ticks need to pass for a check to be performed", 60 * 60 * 60);
maskmanChance = CommonConfig.createConfigInt(config, CATEGORY, "12.M02_maskmanChance", "1:x chance to spawn mask man, must be at least 1", 3);
maskmanMinRad = CommonConfig.createConfigInt(config, CATEGORY, "12.M03_maskmanMinRad", "The amount of radiation needed for mask man to spawn", 50);
maskmanUnderground = CommonConfig.createConfigBool(config, CATEGORY, "12.M04_maskmanUnderound", "Whether players need to be underground for mask man to spawn", true);
enableRaids = CommonConfig.createConfigBool(config, CATEGORY, "12.05_enableFBIRaids", "Whether there should be FBI raids", false);
raidDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.06_raidDelay", "How many world ticks need to pass for a check to be performed", 30 * 60 * 60);
raidChance = CommonConfig.createConfigInt(config, CATEGORY, "12.07_raidChance", "1:x chance to spawn a raid, must be at least 1", 3);
raidAmount = CommonConfig.createConfigInt(config, CATEGORY, "12.08_raidAmount", "How many FBI agents are spawned each raid", 15);
raidAttackDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.09_raidAttackDelay", "Time between individual attempts to break machines", 40);
raidAttackReach = CommonConfig.createConfigInt(config, CATEGORY, "12.10_raidAttackReach", "How far away machines can be broken", 2);
raidAttackDistance = CommonConfig.createConfigInt(config, CATEGORY, "12.11_raidAttackDistance", "How far away agents will spawn from the targeted player", 32);
enableRaids = CommonConfig.createConfigBool(config, CATEGORY, "12.F00_enableFBIRaids", "Whether there should be FBI raids", false);
raidDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.F01_raidDelay", "How many world ticks need to pass for a check to be performed", 30 * 60 * 60);
raidChance = CommonConfig.createConfigInt(config, CATEGORY, "12.F02_raidChance", "1:x chance to spawn a raid, must be at least 1", 3);
raidAmount = CommonConfig.createConfigInt(config, CATEGORY, "12.F03_raidAmount", "How many FBI agents are spawned each raid", 15);
raidAttackDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.F04_raidAttackDelay", "Time between individual attempts to break machines", 40);
raidAttackReach = CommonConfig.createConfigInt(config, CATEGORY, "12.F05_raidAttackReach", "How far away machines can be broken", 2);
raidAttackDistance = CommonConfig.createConfigInt(config, CATEGORY, "12.F06_raidAttackDistance", "How far away agents will spawn from the targeted player", 32);
enableElementals = CommonConfig.createConfigBool(config, CATEGORY, "12.E00_enableMeltdownElementals", "Whether there should be radiation elementals", true);
elementalDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.E01_elementalDelay", "How many world ticks need to pass for a check to be performed", 30 * 60 * 60);
elementalChance = CommonConfig.createConfigInt(config, CATEGORY, "12.E02_elementalChance", "1:x chance to spawn elementals, must be at least 1", 2);
elementalAmount = CommonConfig.createConfigInt(config, CATEGORY, "12.E03_elementalAmount", "How many elementals are spawned each raid", 10);
elementalDistance = CommonConfig.createConfigInt(config, CATEGORY, "12.E04_elementalAttackDistance", "How far away elementals will spawn from the targeted player", 32);
}
}

View File

@ -1,6 +1,7 @@
package com.hbm.entity.mob;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.interfaces.IRadiationImmune;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
@ -22,7 +23,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityCyberCrab extends EntityMob implements IRangedAttackMob {
public class EntityCyberCrab extends EntityMob implements IRangedAttackMob, IRadiationImmune {
private static final IEntitySelector selector = new IEntitySelector() {
public boolean isEntityApplicable(Entity p_82704_1_) {

View File

@ -3,6 +3,7 @@ package com.hbm.entity.mob;
import com.hbm.entity.particle.EntitySmokeFX;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.entity.projectile.EntityChopperMine;
import com.hbm.interfaces.IRadiationImmune;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.lib.ModDamageSource;
@ -21,7 +22,7 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
public class EntityHunterChopper extends EntityFlying implements IMob, IBossDisplayData {
public class EntityHunterChopper extends EntityFlying implements IMob, IBossDisplayData, IRadiationImmune {
public int courseChangeCooldown;
public double waypointX;

View File

@ -3,6 +3,7 @@ package com.hbm.entity.mob;
import com.hbm.entity.mob.ai.EntityAIMaskmanCasualApproach;
import com.hbm.entity.mob.ai.EntityAIMaskmanLasergun;
import com.hbm.entity.mob.ai.EntityAIMaskmanMinigun;
import com.hbm.interfaces.IRadiationImmune;
import com.hbm.items.ModItems;
import net.minecraft.entity.SharedMonsterAttributes;
@ -19,7 +20,7 @@ import net.minecraft.init.Items;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityMaskMan extends EntityMob implements IBossDisplayData {
public class EntityMaskMan extends EntityMob implements IBossDisplayData, IRadiationImmune {
public EntityMaskMan(World world) {
super(world);
@ -75,8 +76,6 @@ public class EntityMaskMan extends EntityMob implements IBossDisplayData {
if(!worldObj.isRemote)
worldObj.createExplosion(this, posX, posY + 4, posZ, 2.5F, true);
}
getEntityData().setFloat("hfr_radiation", 0);
}
public boolean isAIEnabled() {

View File

@ -280,6 +280,15 @@ public class EntityNuclearCreeper extends EntityMob {
{
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()
{

View File

@ -1,12 +1,199 @@
package com.hbm.entity.mob;
import net.minecraft.entity.monster.EntityBlaze;
import com.hbm.interfaces.IRadiationImmune;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.saveddata.RadiationSavedData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityRADBeast extends EntityBlaze {
public class EntityRADBeast extends EntityMob implements IRadiationImmune {
private float heightOffset = 0.5F;
private int heightOffsetUpdateTime;
public EntityRADBeast(World p_i1731_1_) {
super(p_i1731_1_);
}
public EntityRADBeast(World world) {
super(world);
this.isImmuneToFire = true;
this.experienceValue = 30;
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(120.0D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(16.0D);
}
public EntityRADBeast makeLeader() {
this.setEquipmentDropChance(0, 1F);
this.setCurrentItemOrArmor(0, new ItemStack(ModItems.coin_radiation));
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(360.0D);
this.heal(this.getMaxHealth());
return this;
}
protected boolean canDespawn() {
return false;
}
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(16, (int)0);
}
protected String getLivingSound() {
return "hbm:item.geiger"+ (1 + rand.nextInt(6));
}
protected String getHurtSound() {
return "mob.blaze.hit";
}
protected String getDeathSound() {
return "hbm:step.iron";
}
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float f) {
return 15728880;
}
public float getBrightness(float f) {
return 1.0F;
}
public int getTotalArmorValue() {
return 8;
}
public void onLivingUpdate() {
if (!this.worldObj.isRemote) {
if (this.isWet()) {
this.attackEntityFrom(DamageSource.drown, 1.0F);
}
--this.heightOffsetUpdateTime;
if (this.heightOffsetUpdateTime <= 0) {
this.heightOffsetUpdateTime = 100;
this.heightOffset = 0.5F + (float)this.rand.nextGaussian() * 3.0F;
}
if (this.getEntityToAttack() != null && this.getEntityToAttack().posY + (double)this.getEntityToAttack().getEyeHeight() > this.posY + (double)this.getEyeHeight() + (double)this.heightOffset) {
this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D;
}
if(this.entityToAttack != null && attackTime < 10) {
if(this.dataWatcher.getWatchableObjectInt(16) != entityToAttack.getEntityId())
this.dataWatcher.updateObject(16, entityToAttack.getEntityId());
} else {
this.dataWatcher.updateObject(16, 0);
}
}
if (!this.onGround && this.motionY < 0.0D) {
this.motionY *= 0.6D;
}
if(this.getMaxHealth() <= 150) {
for (int i = 0; i < 6; i++) {
this.worldObj.spawnParticle("townaura",
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width * 1.5,
this.posY + this.rand.nextDouble() * (double)this.height,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width * 1.5,
0.0D, 0.0D, 0.0D);
}
if(this.rand.nextInt(6) == 0) {
this.worldObj.spawnParticle("flame",
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width,
this.posY + this.rand.nextDouble() * (double)this.height * 0.75,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width,
0.0D, 0.0D, 0.0D);
}
} else {
this.worldObj.spawnParticle("lava", this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, this.posY + this.rand.nextDouble() * (double) this.height * 0.75, this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, 0.0D, 0.0D, 0.0D);
}
super.onLivingUpdate();
}
protected void attackEntity(Entity target, float dist) {
if (this.attackTime <= 0 && dist < 2.0F && target.boundingBox.maxY > this.boundingBox.minY && target.boundingBox.minY < this.boundingBox.maxY) {
this.attackTime = 20;
this.attackEntityAsMob(target);
} else if(dist < 30.0F) {
double deltaX = target.posX - this.posX;
double deltaZ = target.posZ - this.posZ;
if (this.attackTime == 0 && getEntityToAttack() != null) {
RadiationSavedData.incrementRad(worldObj, (int)posX, (int)posZ, 150, 1000);
target.attackEntityFrom(ModDamageSource.radiation, 16.0F);
this.swingItem();
this.playLivingSound();
this.attackTime = 20;
}
this.rotationYaw = (float)(Math.atan2(deltaZ, deltaX) * 180.0D / Math.PI) - 90.0F;
this.hasAttacked = true;
}
}
public Entity getUnfortunateSoul() {
int id = this.dataWatcher.getWatchableObjectInt(16);
return worldObj.getEntityByID(id);
}
protected void fall(float p_70069_1_) {}
protected Item getDropItem() {
return ModItems.rod_uranium_fuel_depleted;
}
protected void dropFewItems(boolean beenHit, int looting) {
if(beenHit) {
if(looting > 0) {
this.dropItem(ModItems.nugget_polonium, looting);
}
int count = this.rand.nextInt(3) + 1;
for(int i = 0; i < count; i++) {
int r = this.rand.nextInt(3);
if(r == 0) {
this.dropItem(this.isWet() ? ModItems.waste_uranium : ModItems.rod_uranium_fuel_depleted, 1);
} else if(r == 1) {
this.dropItem(this.isWet() ? ModItems.waste_mox : ModItems.rod_mox_fuel_depleted, 1);
} else if(r == 2) {
this.dropItem(this.isWet() ? ModItems.waste_plutonium : ModItems.rod_plutonium_fuel_depleted, 1);
}
}
}
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.entity.mob;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import com.hbm.entity.mob.ai.EntityAITaintedCreeperSwell;
import com.hbm.interfaces.IRadiationImmune;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -28,7 +29,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityTaintedCreeper extends EntityMob {
public class EntityTaintedCreeper extends EntityMob implements IRadiationImmune {
private int lastActiveTime;
private int timeSinceIgnited;

View File

@ -3,6 +3,7 @@ package com.hbm.handler;
import com.hbm.config.MobConfig;
import com.hbm.entity.mob.EntityFBI;
import com.hbm.entity.mob.EntityMaskMan;
import com.hbm.entity.mob.EntityRADBeast;
import com.hbm.util.ContaminationUtil;
import cpw.mods.fml.common.eventhandler.Event.Result;
@ -42,8 +43,6 @@ public class BossSpawnHandler {
}
}
if(MobConfig.enableRaids) {
if(world.getTotalWorldTime() % MobConfig.raidDelay == 0) {
@ -67,6 +66,41 @@ public class BossSpawnHandler {
}
}
}
if(MobConfig.enableElementals) {
if(true || world.getTotalWorldTime() % MobConfig.elementalDelay == 0) {
if(world.rand.nextInt(MobConfig.elementalChance) == 0 && !world.playerEntities.isEmpty() && world.provider.isSurfaceWorld()) {
EntityPlayer player = (EntityPlayer) world.playerEntities.get(world.rand.nextInt(world.playerEntities.size()));
if(player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).getBoolean("radMark")) {
player.addChatComponentMessage(new ChatComponentText("You hear a faint clicking...").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).setBoolean("radMark", false);
Vec3 vec = Vec3.createVectorHelper(MobConfig.raidAttackDistance, 0, 0);
for(int i = 0; i < MobConfig.elementalAmount; i++) {
vec.rotateAroundY((float)(Math.PI * 2) * world.rand.nextFloat());
double spawnX = player.posX + vec.xCoord + world.rand.nextGaussian();
double spawnZ = player.posZ + vec.zCoord + world.rand.nextGaussian();
double spawnY = world.getHeightValue((int)spawnX, (int)spawnZ);
EntityRADBeast rad = new EntityRADBeast(world);
if(i == 0)
rad.makeLeader();
trySpawn(world, (float)spawnX, (float)spawnY, (float)spawnZ, rad);
}
}
}
}
}
}
private static void trySpawn(World world, float x, float y, float z, EntityLiving e) {

View File

@ -0,0 +1,5 @@
package com.hbm.interfaces;
public interface IRadiationImmune {
}

View File

@ -742,6 +742,8 @@ public class ModItems {
public static Item canned_bark;
public static Item can_key;
public static Item coin_creeper;
public static Item coin_radiation;
public static Item coin_maskman;
public static Item rod_empty;
@ -2684,6 +2686,8 @@ public class ModItems {
canned_bark = new ItemLemon(2, 5, false).setUnlocalizedName("canned_bark").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_bark");
can_key = new Item().setUnlocalizedName("can_key").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_key");
coin_creeper = new ItemCustomLore().setUnlocalizedName("coin_creeper").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coin_creeper");
coin_radiation = new ItemCustomLore().setUnlocalizedName("coin_radiation").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coin_radiation");
coin_maskman = new ItemCustomLore().setUnlocalizedName("coin_maskman").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coin_maskman");
recycled_ground = new Item().setUnlocalizedName("recycled_ground").setCreativeTab(null).setTextureName(RefStrings.MODID + ":recycled_ground");
@ -5899,6 +5903,8 @@ public class ModItems {
GameRegistry.registerItem(cap_star, cap_star.getUnlocalizedName());
GameRegistry.registerItem(ring_pull, ring_pull.getUnlocalizedName());
GameRegistry.registerItem(can_key, can_key.getUnlocalizedName());
GameRegistry.registerItem(coin_creeper, coin_creeper.getUnlocalizedName());
GameRegistry.registerItem(coin_radiation,coin_radiation.getUnlocalizedName());
GameRegistry.registerItem(coin_maskman, coin_maskman.getUnlocalizedName());
//Chaos

View File

@ -587,7 +587,7 @@ public class MainRegistry {
EntityRegistry.registerGlobalEntityID(EntityDuck.class, "entity_fucc_a_ducc", EntityRegistry.findGlobalUniqueEntityId(), 0xd0d0d0, 0xFFBF00);
EntityRegistry.registerGlobalEntityID(EntityQuackos.class, "entity_elder_one", EntityRegistry.findGlobalUniqueEntityId(), 0xd0d0d0, 0xFFBF00);
EntityRegistry.registerGlobalEntityID(EntityFBI.class, "entity_ntm_fbi", EntityRegistry.findGlobalUniqueEntityId(), 0x008000, 0x404040);
EntityRegistry.registerGlobalEntityID(EntityRADBeast.class, "entity_ntm_radiation_blaze", EntityRegistry.findGlobalUniqueEntityId(), 0x008000, 0x404040);
EntityRegistry.registerGlobalEntityID(EntityRADBeast.class, "entity_ntm_radiation_blaze", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x008000);
// EntityRegistry.registerGlobalEntityID(EntityBOTPrimeHead.class,
// "entity_balls_o_tron_mk0", EntityRegistry.findGlobalUniqueEntityId(),

View File

@ -1,15 +1,22 @@
package com.hbm.render.entity.mob;
import org.lwjgl.opengl.GL11;
import com.hbm.entity.mob.EntityRADBeast;
import com.hbm.lib.RefStrings;
import com.hbm.render.model.ModelM65Blaze;
import com.hbm.render.util.BeamPronter;
import com.hbm.render.util.BeamPronter.EnumBeamType;
import com.hbm.render.util.BeamPronter.EnumWaveType;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBlaze;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
public class RenderRADBeast extends RenderLiving {
@ -22,14 +29,8 @@ public class RenderRADBeast extends RenderLiving {
super(new ModelBlaze(), 0.5F);
this.field_77068_a = ((ModelBlaze)this.mainModel).func_78104_a();
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityRADBeast p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
public void doRender(EntityRADBeast entity, double x, double y, double z, float r0, float r1)
{
int i = ((ModelBlaze)this.mainModel).func_78104_a();
@ -38,54 +39,55 @@ public class RenderRADBeast extends RenderLiving {
this.field_77068_a = i;
this.mainModel = new ModelBlaze();
}
Entity victim = entity.getUnfortunateSoul();
if(victim != null) {
super.doRender((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
GL11.glPushMatrix();
GL11.glTranslated(x, y + 1.25, z);
double sx = entity.posX;
double sy = entity.posY + 1.25;
double sz = entity.posZ;
double tX = victim.posX;
double tY = victim.posY + victim.height / 2;
double tZ = victim.posZ;
if(victim == Minecraft.getMinecraft().thePlayer)
tY -= 1.5;
double length = Math.sqrt(Math.pow(tX - sx, 2) + Math.pow(tY - sy, 2) + Math.pow(tZ - sz, 2));
BeamPronter.prontBeam(Vec3.createVectorHelper(tX - sx, tY - sy, tZ - sz), EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x004000, 0x004000, (int) (entity.worldObj.getTotalWorldTime() % 1000 + 1), (int) (length * 5), 0.125F, 2, 0.03125F);
GL11.glPopMatrix();
}
super.doRender((EntityLiving)entity, x, y, z, r0, r1);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityRADBeast p_110775_1_)
{
return blazeTextures;
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityRADBeast)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityRADBeast)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityRADBeast)p_110775_1_);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityRADBeast)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
@ -99,9 +101,9 @@ public class RenderRADBeast extends RenderLiving {
if(p_77032_2_ == 0) {
this.bindTexture(mask);
//if (this.modelM65 == null) {
if (this.modelM65 == null) {
this.modelM65 = new ModelM65Blaze();
//}
}
this.setRenderPassModel(modelM65);
return 1;

View File

@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.MobConfig;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IFluidAcceptor;
@ -28,6 +29,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityMachineReactorLarge extends TileEntity
implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource {
@ -728,6 +730,14 @@ public class TileEntityMachineReactorLarge extends TileEntity
}
worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, ModBlocks.sellafield_core);
if(MobConfig.enableElementals) {
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(100, 100, 100));
for(EntityPlayer player : players) {
player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).setBoolean("radMark", true);
}
}
}
private void randomizeRadBlock(int x, int y, int z) {

View File

@ -5,6 +5,7 @@ import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.MachineReactor;
import com.hbm.config.MobConfig;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IFluidAcceptor;
@ -676,16 +677,26 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
}
private void explode() {
for(int i = 0; i < slots.length; i++) {
this.slots[i] = null;
}
worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
worldObj.createExplosion(null, this.xCoord, this.yCoord, this.zCoord, 18.0F, true);
ExplosionNukeGeneric.waste(worldObj, this.xCoord, this.yCoord, this.zCoord, 35);
worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, ModBlocks.toxic_block);
RadiationSavedData data = RadiationSavedData.getData(worldObj);
data.incrementRad(worldObj, xCoord, zCoord, 1000F, 2000F);
if(MobConfig.enableElementals) {
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(100, 100, 100));
for(EntityPlayer player : players) {
player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).setBoolean("radMark", true);
}
}
}
@Override

View File

@ -1,6 +1,7 @@
package com.hbm.util;
import com.hbm.handler.HazmatRegistry;
import com.hbm.interfaces.IRadiationImmune;
import com.hbm.potion.HbmPotion;
import com.hbm.saveddata.RadiationSavedData;
@ -40,6 +41,9 @@ public class ContaminationUtil {
if(!(e instanceof EntityLivingBase))
return;
if(e instanceof IRadiationImmune)
return;
if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
return;
@ -59,6 +63,9 @@ public class ContaminationUtil {
if(!(e instanceof EntityLivingBase))
return;
if(e instanceof IRadiationImmune)
return;
if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
return;
@ -74,6 +81,9 @@ public class ContaminationUtil {
if(!(e instanceof EntityLivingBase))
return 0.0F;
if(e instanceof IRadiationImmune)
return 0.0F;
return e.getEntityData().getFloat("hfr_radiation");
}