mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
faster cracking, more gas funnies
This commit is contained in:
parent
b86801dd14
commit
c76267ebd1
@ -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(EntityCreeperNuclear.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);
|
||||
addMob(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
|
||||
addMob(EntityCreeperTainted.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
|
||||
addMob(EntityCreeperPhosgene.class, "entity_mob_tainted_phosgene", 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
|
||||
|
||||
@ -45,9 +45,12 @@ public class EntityCreeperNuclear extends EntityCreeper {
|
||||
|
||||
@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) {
|
||||
this.heal(amount);
|
||||
if(this.isEntityAlive()) this.heal(amount);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -96,7 +99,7 @@ public class EntityCreeperNuclear extends EntityCreeper {
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
if(this.isEntityAlive() && this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
@ -104,6 +107,9 @@ public class EntityCreeperNuclear extends EntityCreeper {
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
if(!this.worldObj.isRemote) {
|
||||
|
||||
this.setDead();
|
||||
|
||||
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
if(this.getPowered()) {
|
||||
@ -126,8 +132,6 @@ public class EntityCreeperNuclear extends EntityCreeper {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_SAFE);
|
||||
}
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -11,9 +11,9 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityTaintedCreeper extends EntityCreeper implements IRadiationImmune {
|
||||
public class EntityCreeperTainted extends EntityCreeper implements IRadiationImmune {
|
||||
|
||||
public EntityTaintedCreeper(World world) {
|
||||
public EntityCreeperTainted(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@ -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.*;
|
||||
@ -682,27 +683,28 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMovingPackage.class, new RenderMovingPackage());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTNTPrimedBase.class, new RenderTNTPrimedBase());
|
||||
//mobs
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperNuclear.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 }));
|
||||
|
||||
@ -24,7 +24,7 @@ import com.hbm.entity.mob.EntityCyberCrab;
|
||||
import com.hbm.entity.mob.EntityDuck;
|
||||
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;
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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,138 +0,0 @@
|
||||
package com.hbm.render.entity.mob;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||
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");
|
||||
private ModelBase creeperModel = new ModelCreeper(2.0F);
|
||||
|
||||
public RenderNuclearCreeper() {
|
||||
super(new ModelCreeper(), 0.5F);
|
||||
}
|
||||
|
||||
protected void preRenderCallback(EntityCreeperNuclear 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);
|
||||
}
|
||||
|
||||
protected int getColorMultiplier(EntityCreeperNuclear 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;
|
||||
}
|
||||
}
|
||||
|
||||
protected int shouldRenderPass(EntityCreeperNuclear 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(EntityCreeperNuclear p_77035_1_, int p_77035_2_, float p_77035_3_) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(EntityCreeperNuclear p_110775_1_) {
|
||||
return creeperTextures;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) {
|
||||
this.preRenderCallback((EntityCreeperNuclear) p_77041_1_, p_77041_2_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_) {
|
||||
return this.getColorMultiplier((EntityCreeperNuclear) p_77030_1_, p_77030_2_, p_77030_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
|
||||
return this.shouldRenderPass((EntityCreeperNuclear) 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((EntityCreeperNuclear) p_77035_1_, p_77035_2_, p_77035_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return this.getEntityTexture((EntityCreeperNuclear) 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_);
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -1,3 +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
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user