it's not rocket science

This commit is contained in:
Boblet 2025-03-28 14:34:31 +01:00
parent b1f4dfd984
commit 6ae779cb23
7 changed files with 193 additions and 1 deletions

View File

@ -7,8 +7,11 @@
* Reduced the AoE size of 7.62mm, .50 BMG and 10 gauge explosive projectiles
* Removed the old gun mechanism items, turrets now use the new cast parts
* A secret weapon and its variant have become craftable
* NEI now shows RBMK fuel rod recycling and cooling
* Removed most of the old unused siege mobs
## Fixed
* Fixed taint destroying bedrock
* Fixed ferrouranium plate not being castable
* Fixed bayonet not rendering properly in third person
* Fixed bayonet not rendering properly in third person
* Fixed xenon poison gauge in the RBMK control panel not showing up on colums (oops)

View File

@ -247,6 +247,7 @@ public class EntityMappings {
addMob(EntityPlasticBag.class, "entity_plastic_bag", 0xd0d0d0, 0x808080);
addMob(EntityParasiteMaggot.class, "entity_parasite_maggot", 0xd0d0d0, 0x808080);
addMob(EntityDummy.class, "entity_ntm_test_dummy", 0xffffff, 0x000000);
addMob(EntityUndeadSoldier.class, "entity_ntm_undead_soldier", 0x749F30, 0x6C5B44);
addSpawn(EntityCreeperPhosgene.class, 5, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());
addSpawn(EntityCreeperVolatile.class, 10, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());

View File

@ -0,0 +1,111 @@
package com.hbm.entity.mob;
import com.hbm.items.ModItems;
import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
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.monster.EntityMob;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class EntityUndeadSoldier extends EntityMob {
public static final int DW_TYPE = 12;
public static final byte TYPE_ZOMBIE = 0;
public static final byte TYPE_SKELETON = 1;
public EntityUndeadSoldier(World world) {
super(world);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, true));
}
protected void entityInit() {
super.entityInit();
this.getDataWatcher().addObject(DW_TYPE, Byte.valueOf((byte) 0));
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D);
}
@Override
protected boolean isAIEnabled() {
return true;
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
this.addRandomArmor();
this.dataWatcher.updateObject(DW_TYPE, rand.nextBoolean() ? TYPE_ZOMBIE : TYPE_SKELETON);
return super.onSpawnWithEgg(data);
}
@Override
protected void addRandomArmor() {
this.setCurrentItemOrArmor(4, new ItemStack(ModItems.taurun_helmet));
this.setCurrentItemOrArmor(3, new ItemStack(ModItems.taurun_plate));
this.setCurrentItemOrArmor(2, new ItemStack(ModItems.taurun_legs));
this.setCurrentItemOrArmor(1, new ItemStack(ModItems.taurun_boots));
this.setCurrentItemOrArmor(0, new ItemStack(ModItems.gun_heavy_revolver));
}
@Override
protected String getLivingSound() {
byte type = this.dataWatcher.getWatchableObjectByte(DW_TYPE);
if(type == TYPE_ZOMBIE) return "mob.zombie.say";
if(type == TYPE_SKELETON) return "mob.skeleton.say";
return super.getLivingSound();
}
@Override
protected String getHurtSound() {
byte type = this.dataWatcher.getWatchableObjectByte(DW_TYPE);
if(type == TYPE_ZOMBIE) return "mob.zombie.hurt";
if(type == TYPE_SKELETON) return "mob.skeleton.hurt";
return super.getHurtSound();
}
@Override
protected String getDeathSound() {
byte type = this.dataWatcher.getWatchableObjectByte(DW_TYPE);
if(type == TYPE_ZOMBIE) return "mob.zombie.death";
if(type == TYPE_SKELETON) return "mob.skeleton.death";
return super.getDeathSound();
}
@Override
protected void func_145780_a(int x, int y, int z, Block blck) {
byte type = this.dataWatcher.getWatchableObjectByte(DW_TYPE);
if(type == TYPE_ZOMBIE) this.playSound("mob.zombie.step", 0.15F, 1.0F);
if(type == TYPE_SKELETON) this.playSound("mob.skeleton.step", 0.15F, 1.0F);
}
@Override
public EnumCreatureAttribute getCreatureAttribute() {
return EnumCreatureAttribute.UNDEAD;
}
@Override protected void dropFewItems(boolean player, int loot) { }
@Override protected void dropEquipment(boolean player, int loot) { }
}

View File

@ -758,6 +758,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityPlasticBag.class, new RenderPlasticBag());
RenderingRegistry.registerEntityRenderingHandler(EntityPigeon.class, new RenderPigeon(new ModelPigeon(), 0.3F));
RenderingRegistry.registerEntityRenderingHandler(EntityDummy.class, new RenderDummy());
RenderingRegistry.registerEntityRenderingHandler(EntityUndeadSoldier.class, new RenderUndeadSoldier());
//"particles"
RenderingRegistry.registerEntityRenderingHandler(EntityChlorineFX.class, new MultiCloudRenderer(new Item[] { ModItems.chlorine1, ModItems.chlorine2, ModItems.chlorine3, ModItems.chlorine4, ModItems.chlorine5, ModItems.chlorine6, ModItems.chlorine7, ModItems.chlorine8 }));
RenderingRegistry.registerEntityRenderingHandler(EntityPinkCloudFX.class, new MultiCloudRenderer(new Item[] { ModItems.pc1, ModItems.pc2, ModItems.pc3, ModItems.pc4, ModItems.pc5, ModItems.pc6, ModItems.pc7, ModItems.pc8 }));

View File

@ -0,0 +1,39 @@
package com.hbm.render.entity.mob;
import com.hbm.entity.mob.EntityUndeadSoldier;
import com.hbm.render.model.ModelSkeletonNT;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelZombie;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
public class RenderUndeadSoldier extends RenderBiped {
public static ResourceLocation textureZombie = new ResourceLocation("textures/entity/zombie/zombie.png");
public static ResourceLocation textureSkeleton = new ResourceLocation("textures/entity/skeleton/skeleton.png");
public static ModelBiped modelZombie = new ModelZombie();
public static ModelBiped modelSkeleton = new ModelSkeletonNT();
public RenderUndeadSoldier() {
super(modelZombie, 0.5F);
}
@Override
protected void preRenderCallback(EntityLivingBase living, float interp) {
byte type = living.getDataWatcher().getWatchableObjectByte(EntityUndeadSoldier.DW_TYPE);
if(type == EntityUndeadSoldier.TYPE_ZOMBIE) this.mainModel = this.modelBipedMain = modelZombie;
if(type == EntityUndeadSoldier.TYPE_SKELETON) this.mainModel = this.modelBipedMain = modelSkeleton;
}
@Override
protected ResourceLocation getEntityTexture(EntityLiving living) {
byte type = living.getDataWatcher().getWatchableObjectByte(EntityUndeadSoldier.DW_TYPE);
if(type == EntityUndeadSoldier.TYPE_ZOMBIE) return textureZombie;
if(type == EntityUndeadSoldier.TYPE_SKELETON) return textureSkeleton;
return null;
}
}

View File

@ -5,6 +5,7 @@ import com.hbm.render.loader.ModelRendererObj;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
@ -174,6 +175,13 @@ public class ModelArmorBase extends ModelBiped {
leftArm.copyRotationFrom(render.modelBipedMain.bipedLeftArm);
rightArm.copyRotationFrom(render.modelBipedMain.bipedRightArm);
}
} else {
Object o = RenderManager.instance.entityRenderMap.get(entity.getClass());
if(o instanceof RenderBiped) {
RenderBiped render = (RenderBiped) o;
leftArm.copyRotationFrom(render.modelBipedMain.bipedLeftArm);
rightArm.copyRotationFrom(render.modelBipedMain.bipedRightArm);
}
}
}

View File

@ -0,0 +1,29 @@
package com.hbm.render.model;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.ModelZombie;
public class ModelSkeletonNT extends ModelZombie {
public ModelSkeletonNT() {
this(0.0F);
}
public ModelSkeletonNT(float scale) {
super(scale, 0.0F, 64, 32);
this.bipedRightArm = new ModelRenderer(this, 40, 16);
this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, scale);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
this.bipedLeftArm = new ModelRenderer(this, 40, 16);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, scale);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
this.bipedRightLeg = new ModelRenderer(this, 0, 16);
this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, scale);
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, scale);
this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F);
}
}