From f93820f57325a207cf957fc89a770e3611828bf5 Mon Sep 17 00:00:00 2001 From: Sunconure11 Date: Mon, 30 Mar 2020 07:31:38 -0400 Subject: [PATCH] Update mappings + new mindflayer model --- build.gradle | 4 +- src/main/java/com/gw/dm/DungeonMobs.java | 42 +- .../com/gw/dm/DungeonMobsDamageSource.java | 17 +- .../java/com/gw/dm/EntityDungeonFlying.java | 63 +- src/main/java/com/gw/dm/EntityDungeonMob.java | 26 +- src/main/java/com/gw/dm/ai/AIAngelAttack.java | 13 +- src/main/java/com/gw/dm/ai/AIAngelWander.java | 41 +- .../java/com/gw/dm/ai/AIBeholderAttack.java | 26 +- .../java/com/gw/dm/ai/AIEldermobMove.java | 101 +- .../java/com/gw/dm/ai/AIVampireAttack.java | 15 +- .../dm/ai/EntityAIAttackAnythingWanted.java | 52 +- .../java/com/gw/dm/ai/EntityAIFindItem.java | 145 ++- .../java/com/gw/dm/ai/EntityAIFollowTwin.java | 8 +- .../com/gw/dm/ai/EntityAIMonsterPanic.java | 24 +- .../java/com/gw/dm/ai/MoveHelperBeholder.java | 34 +- .../com/gw/dm/ai/TaskAngelAgroOnPlayer.java | 10 +- .../java/com/gw/dm/blocks/BlockBladeTrap.java | 59 +- .../java/com/gw/dm/blocks/BlockLavarock.java | 74 +- .../java/com/gw/dm/blocks/ModBlockBase.java | 3 +- .../com/gw/dm/blocks/ModContainerBase.java | 3 +- .../com/gw/dm/blocks/TileEntityBladeTrap.java | 83 +- src/main/java/com/gw/dm/compat/DLDCompat.java | 90 +- src/main/java/com/gw/dm/compat/Thaumic.java | 170 +-- .../java/com/gw/dm/entity/EntityAhriman.java | 286 ++--- .../com/gw/dm/entity/EntityBladeTrap.java | 229 ++-- .../com/gw/dm/entity/EntityCaveFisher.java | 300 +++-- .../com/gw/dm/entity/EntityCockatrice.java | 211 ++-- .../com/gw/dm/entity/EntityDestrachan.java | 253 ++-- .../java/com/gw/dm/entity/EntityEldermob.java | 281 ++--- .../com/gw/dm/entity/EntityFallenAngel.java | 239 ++-- .../java/com/gw/dm/entity/EntityGhost.java | 252 ++-- .../java/com/gw/dm/entity/EntityGhoul.java | 48 +- .../com/gw/dm/entity/EntityHookHorror.java | 228 ++-- .../java/com/gw/dm/entity/EntityIllithid.java | 270 ++--- .../java/com/gw/dm/entity/EntityLizalfos.java | 470 ++++---- .../com/gw/dm/entity/EntityManticore.java | 131 +-- .../com/gw/dm/entity/EntityNetherHound.java | 390 +++---- .../com/gw/dm/entity/EntityPetrified.java | 171 ++- .../java/com/gw/dm/entity/EntityRakshasa.java | 273 ++--- .../com/gw/dm/entity/EntityRakshasaImage.java | 132 +-- .../java/com/gw/dm/entity/EntityRevenant.java | 143 +-- .../com/gw/dm/entity/EntityRustMonster.java | 267 ++--- .../java/com/gw/dm/entity/EntityShrieker.java | 237 ++-- .../java/com/gw/dm/entity/EntityThoqqua.java | 298 ++--- .../java/com/gw/dm/entity/EntityTroll.java | 251 ++-- .../com/gw/dm/entity/EntityUmberHulk.java | 153 +-- .../java/com/gw/dm/entity/EntityVampire.java | 167 ++- .../java/com/gw/dm/entity/EntityVescavor.java | 182 ++- .../java/com/gw/dm/model/ModelAhriman.java | 236 ++-- .../java/com/gw/dm/model/ModelBladeTrap.java | 88 +- .../java/com/gw/dm/model/ModelCaveFisher.java | 199 ++-- .../java/com/gw/dm/model/ModelCockatrice.java | 36 +- .../java/com/gw/dm/model/ModelDestrachan.java | 195 ++-- .../java/com/gw/dm/model/ModelEldermob.java | 64 +- .../java/com/gw/dm/model/ModelEyeRay.java | 26 +- .../com/gw/dm/model/ModelFallenAngel.java | 59 +- src/main/java/com/gw/dm/model/ModelGhoul.java | 2 +- .../java/com/gw/dm/model/ModelHookHorror.java | 103 +- .../java/com/gw/dm/model/ModelIlithid.java | 173 +++ .../java/com/gw/dm/model/ModelIllithid.java | 330 ------ .../java/com/gw/dm/model/ModelLizalfos.java | 154 ++- .../java/com/gw/dm/model/ModelManticore.java | 102 +- .../com/gw/dm/model/ModelNetherHound.java | 107 +- .../java/com/gw/dm/model/ModelPetrified.java | 30 +- .../java/com/gw/dm/model/ModelRakshasa.java | 48 +- .../com/gw/dm/model/ModelRustMonster.java | 97 +- .../java/com/gw/dm/model/ModelShrieker.java | 32 +- .../java/com/gw/dm/model/ModelThoqqua.java | 42 +- src/main/java/com/gw/dm/model/ModelTroll.java | 28 +- .../java/com/gw/dm/model/ModelUmberHulk.java | 62 +- .../java/com/gw/dm/model/ModelVescavor.java | 64 +- .../gw/dm/network/ConfusionPacketHandler.java | 3 +- .../java/com/gw/dm/network/NetworkHelper.java | 12 +- .../java/com/gw/dm/potion/PotionAddle.java | 3 +- .../EntityBurningFireParticloid.java | 28 +- .../dm/projectile/EntityCloudGenerator.java | 76 +- .../gw/dm/projectile/EntityEldermobBall.java | 87 +- .../com/gw/dm/projectile/EntityEyeRay.java | 67 +- .../projectile/EntityFireCloudGenerator.java | 79 +- .../com/gw/dm/projectile/EntityLightball.java | 128 +- .../gw/dm/projectile/EntityMagicMissile.java | 81 +- .../com/gw/dm/projectile/EntitySonicBoom.java | 135 +-- .../java/com/gw/dm/proxy/ClientProxy.java | 549 ++++----- .../java/com/gw/dm/proxy/CommonProxy.java | 4 +- .../java/com/gw/dm/render/RenderAhriman.java | 3 +- .../gw/dm/render/RenderBladeTrapBlock.java | 26 +- .../gw/dm/render/RenderBladeTrapEntity.java | 11 +- .../com/gw/dm/render/RenderCaveFisher.java | 11 +- .../com/gw/dm/render/RenderCockatrice.java | 6 +- .../com/gw/dm/render/RenderDestrachan.java | 11 +- .../java/com/gw/dm/render/RenderEldermob.java | 3 +- .../com/gw/dm/render/RenderEldermobBall.java | 6 +- .../com/gw/dm/render/RenderFallenAngel.java | 13 +- .../java/com/gw/dm/render/RenderGhost.java | 37 +- .../java/com/gw/dm/render/RenderGhoul.java | 3 +- .../com/gw/dm/render/RenderHookHorror.java | 11 +- .../java/com/gw/dm/render/RenderIllithid.java | 3 +- .../java/com/gw/dm/render/RenderLizalfos.java | 3 +- .../com/gw/dm/render/RenderMagicMissile.java | 9 +- .../com/gw/dm/render/RenderManticore.java | 9 +- .../com/gw/dm/render/RenderNetherHound.java | 11 +- .../com/gw/dm/render/RenderPetrified.java | 9 +- .../com/gw/dm/render/RenderProjectile.java | 57 +- .../java/com/gw/dm/render/RenderRakshasa.java | 3 +- .../com/gw/dm/render/RenderRustMonster.java | 9 +- .../java/com/gw/dm/render/RenderShrieker.java | 3 +- .../java/com/gw/dm/render/RenderThoqqua.java | 3 +- .../java/com/gw/dm/render/RenderTroll.java | 3 +- .../com/gw/dm/render/RenderUmberHulk.java | 11 +- .../java/com/gw/dm/render/RenderVampire.java | 11 +- .../java/com/gw/dm/render/RenderVescavor.java | 11 +- .../java/com/gw/dm/util/AudioHandler.java | 105 +- .../java/com/gw/dm/util/ConfigHandler.java | 360 +++--- .../com/gw/dm/util/DMGenerationHandler.java | 71 +- .../com/gw/dm/util/DungeonMobsHelper.java | 87 +- .../com/gw/dm/util/InputConfusedMovement.java | 3 +- .../java/com/gw/dm/util/MiscRegistrar.java | 3 +- .../java/com/gw/dm/util/MobRegistrar.java | 396 ++----- src/main/java/com/gw/dm/util/RMFoodItem.java | 26 +- .../dungeonmobs/blockstates/bladetrap.json | 6 +- .../dungeonmobs/blockstates/lavarock.json | 96 +- .../dungeonmobs/models/block/bladetrap.json | 2 +- .../dungeonmobs/models/block/lavarock.json | 2 +- .../dungeonmobs/models/item/bladetrap.json | 2 +- .../resources/assets/dungeonmobs/sounds.json | 1036 ++++++++--------- src/main/resources/mcmod.info | 30 +- 126 files changed, 5636 insertions(+), 7379 deletions(-) create mode 100644 src/main/java/com/gw/dm/model/ModelIlithid.java delete mode 100644 src/main/java/com/gw/dm/model/ModelIllithid.java diff --git a/build.gradle b/build.gradle index 4d18f19..ca74687 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ compileJava { } minecraft { - version = "1.12.2-14.23.5.2796" + version = "1.12.2-14.23.5.2847" runDir = "run" // the mappings can be changed at any time, and must be in the following format. @@ -29,7 +29,7 @@ minecraft { // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20171003" + mappings = "stable_39" makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } diff --git a/src/main/java/com/gw/dm/DungeonMobs.java b/src/main/java/com/gw/dm/DungeonMobs.java index 22f9f3e..55eb720 100644 --- a/src/main/java/com/gw/dm/DungeonMobs.java +++ b/src/main/java/com/gw/dm/DungeonMobs.java @@ -4,7 +4,6 @@ import com.gw.dm.entity.EntityLizalfos; import com.gw.dm.proxy.CommonProxy; import com.gw.dm.util.*; - import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; @@ -16,49 +15,40 @@ import java.util.Arrays; -@Mod(modid = DungeonMobs.MODID, name = "Dungeon Mobs", version = DungeonMobs.VERSION, - dependencies = "after:thaumcraft; after:dldungeonsjbg") +@Mod(modid = DungeonMobs.MODID, name = "Dungeon Mobs", version = DungeonMobs.VERSION, dependencies = "after:thaumcraft; after:dldungeonsjbg") public class DungeonMobs { public static final String MODID = "dungeonmobs"; public static final String VERSION = "5.8.5"; - + @Instance(MODID) public static DungeonMobs instance; - @SidedProxy(clientSide = "com.gw.dm.proxy.ClientProxy", - serverSide = "com.gw.dm.proxy.CommonProxy") + @SidedProxy(clientSide = "com.gw.dm.proxy.ClientProxy", serverSide = "com.gw.dm.proxy.CommonProxy") public static CommonProxy proxy; private static boolean gotDLD; DMGenerationHandler worldGen; - + private static void initMonsterSpecialData() { EntityLizalfos.initLocations(); DMGenerationHandler.initTargetBlocks(); ConfigHandler.mobSpecialSetup(); } - + @EventHandler public void preInit(FMLPreInitializationEvent event) { ModMetadata modmeta = event.getModMetadata(); modmeta.authorList = Arrays.asList(new String[]{"GnomeWorks", "JaredBGreat", "Sunconure"}); modmeta.autogenerated = false; modmeta.credits = "_303, ZeuX, r4wk, Zorn_Taov, Wreckage, Crudedragos, DraxisWuf, MohawkyMagoo"; - modmeta.description = - "Adds a variety of new hostile mobs, all of which hate you.\n" + - "Inspiration includes: Dungeons & Dragons, Legend of Zelda, Hexen\n" + - "\n" + - "Rust Monster - Ghoul - Shrieker - Umber Hulk - Hook Horror " - + "- Beholder - Troll - Cave Fisher - Destrachan - Illithid " - + "- Hell Hound - Rakshasa - Lizalfos - Cockatrice - Manticore " - + "- Thoqqua - Vescavor - Revenant - Vampire - Fallen Angel - Outer Thing\n"; + modmeta.description = "Adds a variety of new hostile mobs, all of which hate you.\n" + "Inspiration includes: Dungeons & Dragons, Legend of Zelda, Hexen\n" + "\n" + "Rust Monster - Ghoul - Shrieker - Umber Hulk - Hook Horror " + "- Beholder - Troll - Cave Fisher - Destrachan - Illithid " + "- Hell Hound - Rakshasa - Lizalfos - Cockatrice - Manticore " + "- Thoqqua - Vescavor - Revenant - Vampire - Fallen Angel - Outer Thing\n"; modmeta.url = "https://minecraft.curseforge.com/projects/dungeon-mobs-reborn"; - - + + ConfigHandler.configDir = ConfigHandler.findConfigDir(event.getModConfigurationDirectory()); ConfigHandler.init(); - + MiscRegistrar.initBlocks(); - - + + MobRegistrar.registerMobs(); if (ConfigHandler.spawnNaturally) { MobRegistrar.registerSpawns(); @@ -68,21 +58,21 @@ public void preInit(FMLPreInitializationEvent event) { } proxy.registerRenders(); } - + @EventHandler public void init(FMLInitializationEvent event) { AudioHandler.registerSounds(); if (ConfigHandler.spawnBladeTrap) { worldGen = new DMGenerationHandler(); } - if(ConfigHandler.addToDoomlikeDungeons) { + if (ConfigHandler.addToDoomlikeDungeons) { DLDCompat.addDLD(); } } - + @EventHandler - public void postInit(FMLPostInitializationEvent event) { + public void postInit(FMLPostInitializationEvent event) { initMonsterSpecialData(); } - + } diff --git a/src/main/java/com/gw/dm/DungeonMobsDamageSource.java b/src/main/java/com/gw/dm/DungeonMobsDamageSource.java index 4965659..c75869d 100644 --- a/src/main/java/com/gw/dm/DungeonMobsDamageSource.java +++ b/src/main/java/com/gw/dm/DungeonMobsDamageSource.java @@ -3,19 +3,16 @@ import net.minecraft.util.DamageSource; public class DungeonMobsDamageSource extends DamageSource { - public static final DamageSource BLADE_TRAP = (new DamageSource("bladetrap")); - public static final DamageSource PETRIFIED = (new DamageSource("petrified")) - .setDamageBypassesArmor(); - public static final DamageSource ENERGY_DRAIN = (new DamageSource("energydrain")) - .setDamageBypassesArmor(); - public static final DamageSource LIGHT_BALL = new DamageSource("light_ball") - .setProjectile();//.setDamageBypassesArmor(); // Now partial, works differently - + public static final DamageSource BLADE_TRAP = (new DamageSource("bladetrap")); + public static final DamageSource PETRIFIED = (new DamageSource("petrified")).setDamageBypassesArmor(); + public static final DamageSource ENERGY_DRAIN = (new DamageSource("energydrain")).setDamageBypassesArmor(); + public static final DamageSource LIGHT_BALL = new DamageSource("light_ball").setProjectile();//.setDamageBypassesArmor(); // Now partial, works differently + public DungeonMobsDamageSource(String name) { super(name); } - - + + @Override public boolean isUnblockable() { return true; diff --git a/src/main/java/com/gw/dm/EntityDungeonFlying.java b/src/main/java/com/gw/dm/EntityDungeonFlying.java index 1281039..7fac360 100644 --- a/src/main/java/com/gw/dm/EntityDungeonFlying.java +++ b/src/main/java/com/gw/dm/EntityDungeonFlying.java @@ -10,50 +10,51 @@ public abstract class EntityDungeonFlying extends EntityFlying { public boolean ignoreHeight; public boolean spawnChecked; - - + + public EntityDungeonFlying(World worldIn) { super(worldIn); } - - + + public void setIgnoreHeight(boolean foo) { ignoreHeight = foo; } - - + + protected boolean isValidLightLevel() { int var1 = MathHelper.floor(posX); int var2 = MathHelper.floor(getEntityBoundingBox().minY); int var3 = MathHelper.floor(posZ); BlockPos bp = new BlockPos(var1, var2, var3); - - if (world.getLightFor(EnumSkyBlock.SKY, bp) - > rand.nextInt(32)) { + + if (world.getLightFor(EnumSkyBlock.SKY, bp) > rand.nextInt(32)) { return false; - } else { + } + else { int var4 = world.getLightFromNeighbors(bp); - + if (this.world.isThundering()) { int var5 = world.getSkylightSubtracted(); world.setSkylightSubtracted(10); var4 = world.getLightFromNeighbors(bp); world.setSkylightSubtracted(var5); } - + return var4 <= this.rand.nextInt(8); } } - - - public boolean getCanSpawnHere() { - if (!this.isValidLightLevel()) - return false; - - return super.getCanSpawnHere(); + + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + par1NBTTagCompound.setBoolean("spawnCheck", this.spawnChecked); + super.writeEntityToNBT(par1NBTTagCompound); } - - + + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + spawnChecked = par1NBTTagCompound.getBoolean("spawnCheck"); + } + public void onLivingUpdate() { // TODO: Implement these config options. /* @@ -65,20 +66,14 @@ public void onLivingUpdate() { this.spawnChecked = true; } */ - + super.onLivingUpdate(); } - - - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setBoolean("spawnCheck", this.spawnChecked); - super.writeEntityToNBT(par1NBTTagCompound); - } - - - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - spawnChecked = par1NBTTagCompound.getBoolean("spawnCheck"); + + public boolean getCanSpawnHere() { + if (!this.isValidLightLevel()) return false; + + return super.getCanSpawnHere(); } - + } diff --git a/src/main/java/com/gw/dm/EntityDungeonMob.java b/src/main/java/com/gw/dm/EntityDungeonMob.java index 32d706c..6982cca 100644 --- a/src/main/java/com/gw/dm/EntityDungeonMob.java +++ b/src/main/java/com/gw/dm/EntityDungeonMob.java @@ -7,15 +7,15 @@ public abstract class EntityDungeonMob extends EntityMob { public boolean ignoreHeight; public boolean spawnChecked; - - + + public EntityDungeonMob(World worldIn) { super(worldIn); //this.spawnChecked = !DungeonMobsHelper.getMSC(); // TODO Auto-generated constructor stub } - - + + // FIXME: I don't know what this is for, so I don't know if I // should fix this or delete it...? /* @@ -25,12 +25,12 @@ public int getMaxHealth() return 1; } */ - - + + public void setIgnoreHeight(boolean in) { ignoreHeight = in; } - + public void onLivingUpdate() { // TODO: Implement the use of these variable in config and gametime code. /* @@ -44,18 +44,18 @@ public void onLivingUpdate() { */ super.onLivingUpdate(); } - - + + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.setBoolean("spawnCheck", this.spawnChecked); super.writeEntityToNBT(par1NBTTagCompound); } - - + + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); spawnChecked = par1NBTTagCompound.getBoolean("spawnCheck"); } - - + + } diff --git a/src/main/java/com/gw/dm/ai/AIAngelAttack.java b/src/main/java/com/gw/dm/ai/AIAngelAttack.java index fb28f71..184bd4a 100644 --- a/src/main/java/com/gw/dm/ai/AIAngelAttack.java +++ b/src/main/java/com/gw/dm/ai/AIAngelAttack.java @@ -95,7 +95,8 @@ public void attackMovement() { double dist = ((dx * dx) + (dy * dy) + (dz * dz)); if (dist > 576) { movingIn = true; - } else if (dist < 256) { + } + else if (dist < 256) { movingIn = false; } dx *= r.nextDouble(); @@ -103,15 +104,15 @@ public void attackMovement() { dz *= r.nextDouble(); if (movingIn && !(((AngelicMoveHelper) owner.getMoveHelper()).blocked)) { dist = Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)) / 4; - baseMotion.setTarget((dx / dist), - (dy / dist), - (dz / dist)); + baseMotion.setTarget((dx / dist), (dy / dist), (dz / dist)); baseMotion.callMoveHelper(); - } else if ((dist < 64) && !(((AngelicMoveHelper) owner.getMoveHelper()).blocked)) { + } + else if ((dist < 64) && !(((AngelicMoveHelper) owner.getMoveHelper()).blocked)) { dist = -(Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)) / 4); baseMotion.setTarget(dx / dist, dy / dist, dz / dist); baseMotion.callMoveHelper(); - } else { + } + else { baseMotion.startExecuting(); } } diff --git a/src/main/java/com/gw/dm/ai/AIAngelWander.java b/src/main/java/com/gw/dm/ai/AIAngelWander.java index 48d6504..df6c4d1 100644 --- a/src/main/java/com/gw/dm/ai/AIAngelWander.java +++ b/src/main/java/com/gw/dm/ai/AIAngelWander.java @@ -36,27 +36,11 @@ public boolean shouldExecute() { return ((enemy == null) || enemy.isDead) && needNewTarget(); } - - public boolean needNewTarget() { - EntityMoveHelper helper = owner.getMoveHelper(); - if (helper.isUpdating()) { - return true; - } else { - double dx = helper.getX() - owner.posX; - double dy = helper.getY() - owner.posY; - double dz = helper.getZ() - owner.posZ; - double dist = ((dx * dx) + (dy * dy) + (dz * dz)); - return (dist < 1.0) || (dist > 432.0) || ((AngelicMoveHelper) helper).blocked; - } - } - - @Override public boolean shouldContinueExecuting() { return false; } - @Override public void startExecuting() { //System.out.println("Starting execution"); @@ -65,7 +49,8 @@ public void startExecuting() { dtx = (random.nextDouble() * 8.0) - 4.0; dty = (random.nextDouble() * 8.0) - 4.0; dtz = (random.nextDouble() * 8.0) - 4.0; - } else if (random.nextBoolean()) { + } + else if (random.nextBoolean()) { double change = random.nextDouble(); double stable = change - 1; dtx = (dtx * stable) + (change * ((random.nextDouble() * 8.0) - 4.0)); @@ -78,6 +63,19 @@ public void startExecuting() { owner.getMoveHelper().setMoveTo(targetx, targety, targetz, rate); } + public boolean needNewTarget() { + EntityMoveHelper helper = owner.getMoveHelper(); + if (helper.isUpdating()) { + return true; + } + else { + double dx = helper.getX() - owner.posX; + double dy = helper.getY() - owner.posY; + double dz = helper.getZ() - owner.posZ; + double dist = ((dx * dx) + (dy * dy) + (dz * dz)); + return (dist < 1.0) || (dist > 432.0) || ((AngelicMoveHelper) helper).blocked; + } + } private boolean atTarget() { EntityMoveHelper helper = owner.getMoveHelper(); @@ -127,7 +125,8 @@ public void onUpdateMoveHelper() { if (isColliding(posX, posY, posZ, dist)) { //System.out.println("Colliding"); blocked = true; - } else { + } + else { //System.out.println("Moving"); dist = Math.sqrt(dist); double diffEffect; @@ -156,11 +155,13 @@ public void onUpdateMoveHelper() { dx /= dist; dz /= dist; owner.rotationYaw = (float) (Math.toDegrees(MathHelper.atan2(dz, dx)) + 90f); - } else if (dist > 1.5) { + } + else if (dist > 1.5) { owner.rotationYaw = (float) (Math.toDegrees(MathHelper.atan2(dz, dx)) - 90f); } } - } else { + } + else { super.onUpdateMoveHelper(); } } diff --git a/src/main/java/com/gw/dm/ai/AIBeholderAttack.java b/src/main/java/com/gw/dm/ai/AIBeholderAttack.java index 6291f31..41ad0f3 100644 --- a/src/main/java/com/gw/dm/ai/AIBeholderAttack.java +++ b/src/main/java/com/gw/dm/ai/AIBeholderAttack.java @@ -7,42 +7,42 @@ public class AIBeholderAttack extends EntityAIBase { EntityAhriman owner; private int cooldown; - - + + public AIBeholderAttack(EntityAhriman it) { owner = it; } - - + + @Override public boolean shouldExecute() { return (owner.getAttackTarget() != null) && !owner.getAttackTarget().isDead; } - - + + @Override public boolean shouldContinueExecuting() { return shouldExecute(); } - - + + @Override public void startExecuting() { cooldown = 10 + owner.getRNG().nextInt(30); updateTask(); } - - + + @Override public void updateTask() { EntityLivingBase target = owner.getAttackTarget(); attackMovement(); owner.doAttack(); } - - + + public void attackMovement() { owner.getMoveHelper().onUpdateMoveHelper(); } - + } diff --git a/src/main/java/com/gw/dm/ai/AIEldermobMove.java b/src/main/java/com/gw/dm/ai/AIEldermobMove.java index b87a722..f9d2d26 100644 --- a/src/main/java/com/gw/dm/ai/AIEldermobMove.java +++ b/src/main/java/com/gw/dm/ai/AIEldermobMove.java @@ -15,8 +15,8 @@ public class AIEldermobMove extends EntityAIBase { private final double rate; private double targetx, targety, targetz, dtx, dty, dtz; private int cooldown; - - + + public AIEldermobMove(EntityEldermob it, double speed) { super(); owner = it; @@ -29,43 +29,26 @@ public AIEldermobMove(EntityEldermob it, double speed) { targety = owner.posY + dty; targetz = owner.posZ + dtz; } - - + + @Override public boolean shouldExecute() { if (cooldown < 2) { cooldown = 2; } - boolean out = (owner.getRNG().nextInt(--cooldown) < 1) - && needNewTarget(); + boolean out = (owner.getRNG().nextInt(--cooldown) < 1) && needNewTarget(); if (out) { - cooldown = 20 + owner.getRNG().nextInt(20) - - (DungeonMobsHelper.getDifficulty(owner.world) * 5); + cooldown = 20 + owner.getRNG().nextInt(20) - (DungeonMobsHelper.getDifficulty(owner.world) * 5); } return out; } - - + + @Override public boolean shouldContinueExecuting() { return false; } - - - public boolean needNewTarget() { - EntityMoveHelper helper = owner.getMoveHelper(); - if (helper.isUpdating()) { - return true; - } else { - double dx = helper.getX() - owner.posX; - double dy = helper.getY() - owner.posY; - double dz = helper.getZ() - owner.posZ; - double dist = ((dx * dx) + (dy * dy) + (dz * dz)); - return (dist < 1.0) || (dist > 432.0) || ((EldermobMover) helper).blocked; - } - } - - + @Override public void startExecuting() { //System.out.println("Starting execution"); @@ -74,11 +57,13 @@ public void startExecuting() { dtx = (random.nextDouble() * 48.0) - 24.0; if (owner.posY > 192.0) { dty = -((random.nextDouble() * 24.0) + 24.0); - } else { + } + else { dty = (random.nextDouble() * 24.0) - 12.0; } dtz = (random.nextDouble() * 48.0) - 24.0; - } else if (random.nextBoolean()) { + } + else if (random.nextBoolean()) { double change = random.nextDouble(); double stable = change - 1; dtx = (dtx * stable) + (change * ((random.nextDouble() * 8.0) - 4.0)); @@ -96,17 +81,28 @@ public void startExecuting() { } owner.getMoveHelper().setMoveTo(targetx, targety, targetz, rate); } - - + + public boolean needNewTarget() { + EntityMoveHelper helper = owner.getMoveHelper(); + if (helper.isUpdating()) { + return true; + } + else { + double dx = helper.getX() - owner.posX; + double dy = helper.getY() - owner.posY; + double dz = helper.getZ() - owner.posZ; + double dist = ((dx * dx) + (dy * dy) + (dz * dz)); + return (dist < 1.0) || (dist > 432.0) || ((EldermobMover) helper).blocked; + } + } + public AIEldermobMove startingMove() { - owner.getMoveHelper().setMoveTo(owner.posX, - owner.posY + (owner.getRNG().nextDouble() * 8.0) + 4.0, - owner.posZ, rate); + owner.getMoveHelper().setMoveTo(owner.posX, owner.posY + (owner.getRNG().nextDouble() * 8.0) + 4.0, owner.posZ, rate); cooldown = 2; return this; } - - + + private boolean isTooFar() { EntityLivingBase victim = owner.getAttackTarget(); if (victim == null || victim.isDead) { @@ -118,8 +114,8 @@ private boolean isTooFar() { double dist = ((dx * dx) + (dy * dy) + (dz * dz)); return (dist > 1024); } - - + + private boolean atTarget() { EntityMoveHelper helper = owner.getMoveHelper(); double dx = targetx - owner.posX; @@ -127,15 +123,15 @@ private boolean atTarget() { double dz = targetz - owner.posZ; return (((dx * dx) + (dy * dy) + (dz * dz)) < 1.0); } - - + + void setTarget(double toX, double toY, double toZ) { targetx = owner.posX + toX; targety = owner.posY + toY; targetz = owner.posZ + toZ; } - - + + void callMoveHelper() { owner.getMoveHelper().setMoveTo(targetx, targety, targetz, rate); } @@ -144,17 +140,17 @@ void callMoveHelper() { /*---------------------------------------------------* * MOVE HELPER * *---------------------------------------------------*/ - - + + public static class EldermobMover extends EntityMoveHelper { EntityEldermob owner; boolean blocked; - + public EldermobMover(EntityEldermob eldermob) { super(eldermob); owner = eldermob; } - + @Override public void onUpdateMoveHelper() { //System.out.println("Starting onUpdateMoveHelper, action = " + action); @@ -168,7 +164,8 @@ public void onUpdateMoveHelper() { if (isColliding(posX, posY, posZ, dist)) { //System.out.println("Colliding"); blocked = true; - } else { + } + else { //System.out.println("Moving"); dist = Math.sqrt(dist); double diffEffect; @@ -197,16 +194,18 @@ public void onUpdateMoveHelper() { dx /= dist; dz /= dist; owner.rotationYaw = (float) (Math.toDegrees(MathHelper.atan2(dz, dx)) + 90f); - } else if (dist > 1.5) { + } + else if (dist > 1.5) { owner.rotationYaw = (float) (Math.toDegrees(MathHelper.atan2(dz, dx)) - 90f); } } - } else { + } + else { super.onUpdateMoveHelper(); } } - - + + public boolean isColliding(double dx, double dy, double dz, double dist) { double dx0 = (dx - owner.posX) / dist; double dy0 = (dy - owner.posY) / dist; @@ -223,5 +222,5 @@ public boolean isColliding(double dx, double dy, double dz, double dist) { return false; } } - + } diff --git a/src/main/java/com/gw/dm/ai/AIVampireAttack.java b/src/main/java/com/gw/dm/ai/AIVampireAttack.java index 9419077..b1c3059 100644 --- a/src/main/java/com/gw/dm/ai/AIVampireAttack.java +++ b/src/main/java/com/gw/dm/ai/AIVampireAttack.java @@ -24,7 +24,8 @@ public AIVampireAttack(EntityVampire vampire) { public boolean shouldExecute() { if (shouldAttack()) { return attack.shouldExecute(); - } else { + } + else { return run.shouldExecute(); } } @@ -34,7 +35,8 @@ public boolean shouldExecute() { public boolean shouldContinueExecuting() { if (shouldAttack()) { return attack.shouldContinueExecuting(); - } else { + } + else { return run.shouldContinueExecuting(); } } @@ -44,7 +46,8 @@ public boolean shouldContinueExecuting() { public void startExecuting() { if (shouldAttack()) { attack.startExecuting(); - } else { + } + else { run.startExecuting(); } } @@ -54,7 +57,8 @@ public void startExecuting() { public void resetTask() { if (shouldAttack()) { attack.resetTask(); - } else { + } + else { run.resetTask(); } } @@ -69,8 +73,7 @@ public void updateTask() { private boolean shouldAttack() { - boolean out = (owner.getHealth() > THRESHHOLD) || owner.isTrapped() - || !(owner.getTags() instanceof EntityPlayer); + boolean out = (owner.getHealth() > THRESHHOLD) || owner.isTrapped() || !(owner.getTags() instanceof EntityPlayer); owner.setRunning(!out); return out; } diff --git a/src/main/java/com/gw/dm/ai/EntityAIAttackAnythingWanted.java b/src/main/java/com/gw/dm/ai/EntityAIAttackAnythingWanted.java index 9c862ac..0fe2123 100644 --- a/src/main/java/com/gw/dm/ai/EntityAIAttackAnythingWanted.java +++ b/src/main/java/com/gw/dm/ai/EntityAIAttackAnythingWanted.java @@ -26,17 +26,16 @@ public class EntityAIAttackAnythingWanted extends EntityAIAttackMelee { World world; EntityCreature attacker; Entity entityTarget; - + int attackTick; float field_75440_e; boolean field_75437_f; - + Path entityPathEntity; Class classTarget; private int field_75445_i; - - public EntityAIAttackAnythingWanted(EntityCreature par1EntityLiving, - Class par2Class, float par3, boolean par4) { + + public EntityAIAttackAnythingWanted(EntityCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { super(par1EntityLiving, par3, par4); classTarget = par2Class; attackTick = 0; @@ -46,57 +45,46 @@ public EntityAIAttackAnythingWanted(EntityCreature par1EntityLiving, field_75437_f = par4; setMutexBits(3); } - - + + @Override public boolean shouldExecute() { EntityRustMonster monster = (EntityRustMonster) attacker; Entity entity = monster.getTarget(); - - if (entity == null) - return false; + + if (entity == null) return false; else { entityTarget = entity; - entityPathEntity = attacker.getNavigator() - .getPathToXYZ(entity.posX, - entity.getEntityBoundingBox().minY, - entity.posZ); + entityPathEntity = attacker.getNavigator().getPathToXYZ(entity.posX, entity.getEntityBoundingBox().minY, entity.posZ); return entityPathEntity != null; } } - + @Override public boolean shouldContinueExecuting() { EntityRustMonster foo = (EntityRustMonster) attacker; Entity var1 = foo.getTarget(); return var1 != null; } - + @Override public void updateTask() { attacker.getLookHelper().setLookPositionWithEntity(entityTarget, 30.0F, 30.0F); - - if ((field_75437_f - || attacker.getEntitySenses().canSee(entityTarget)) - && --field_75445_i <= 0) { + + if ((field_75437_f || attacker.getEntitySenses().canSee(entityTarget)) && --field_75445_i <= 0) { field_75445_i = 4 + attacker.getRNG().nextInt(7); - attacker.getNavigator().tryMoveToXYZ(entityTarget.posX, - entityTarget.getEntityBoundingBox().minY, - entityTarget.posZ, field_75440_e); + attacker.getNavigator().tryMoveToXYZ(entityTarget.posX, entityTarget.getEntityBoundingBox().minY, entityTarget.posZ, field_75440_e); } - + attackTick = Math.max(attackTick - 1, 0); double var1 = (double) (attacker.width * 2.0F * attacker.width * 2.0F); - - if (attacker.getDistanceSq(entityTarget.posX, - entityTarget.getEntityBoundingBox().minY, - entityTarget.posZ) <= var1) { + + if (attacker.getDistanceSq(entityTarget.posX, entityTarget.getEntityBoundingBox().minY, entityTarget.posZ) <= var1) { if (attackTick <= 0) { attackTick = 20; - - if (attacker.getHeldItemMainhand() != null) - attacker.swingArm(EnumHand.MAIN_HAND); - + + if (attacker.getHeldItemMainhand() != null) attacker.swingArm(EnumHand.MAIN_HAND); + attacker.attackEntityAsMob(entityTarget); } } diff --git a/src/main/java/com/gw/dm/ai/EntityAIFindItem.java b/src/main/java/com/gw/dm/ai/EntityAIFindItem.java index f0883f8..48c49e5 100644 --- a/src/main/java/com/gw/dm/ai/EntityAIFindItem.java +++ b/src/main/java/com/gw/dm/ai/EntityAIFindItem.java @@ -28,7 +28,7 @@ import java.util.*; public class EntityAIFindItem extends EntityAIBase { - + private Entity targetEntity; private EntityRustMonster taskOwner; private World theWorld; @@ -37,8 +37,8 @@ public class EntityAIFindItem extends EntityAIBase { private boolean livingFlag; private boolean gottaCompare; private EntityAINearestWantedThingSorter theNearestWantedThingSorter; - - + + public EntityAIFindItem(EntityRustMonster par1, int par2, Set foods) { taskOwner = par1; theWorld = par1.world; @@ -47,33 +47,30 @@ public EntityAIFindItem(EntityRustMonster par1, int par2, Set foods) wantedThings = foods; theNearestWantedThingSorter = new EntityAINearestWantedThingSorter(this, par1); } - - + + @Override public boolean shouldExecute() { - List allThings = taskOwner.world.getEntitiesWithinAABB(Entity.class, - taskOwner.getEntityBoundingBox().expand((double) targetDistance, - 4.0D, (double) targetDistance)); - + List allThings = taskOwner.world.getEntitiesWithinAABB(Entity.class, taskOwner.getEntityBoundingBox().expand((double) targetDistance, 4.0D, (double) targetDistance)); + List wantLiving = new LinkedList(); List wantItems = new LinkedList(); - + for (int i = 0; i < allThings.size(); i++) { if (allThings.get(i) instanceof EntityPlayer) { EntityPlayer aPlayer = (EntityPlayer) allThings.get(i); InventoryPlayer theStuff = aPlayer.inventory; - + int numSlots = theStuff.getSizeInventory(); for (int j = 0; j < numSlots; j++) { ItemStack theItem = theStuff.getStackInSlot(j); //System.out.println("Checking Item: " + theItem.getItem()); - if (wantedThings.contains(new RMFoodItem(theItem.getItem(), - theItem.getItemDamage()))) { + if (wantedThings.contains(new RMFoodItem(theItem.getItem(), theItem.getItemDamage()))) { wantLiving.add(aPlayer); break; } } - + for (ItemStack armorPiece : aPlayer.getArmorInventoryList()) { if (armorPiece != null) { if (wantedThings.contains(new RMFoodItem(armorPiece.getItem()))) { @@ -83,57 +80,56 @@ public boolean shouldExecute() { } } } - - if (allThings.get(i) instanceof EntityMinecart) - wantItems.add(allThings.get(i)); - - if (allThings.get(i) instanceof EntityIronGolem) - wantLiving.add(allThings.get(i)); - + + if (allThings.get(i) instanceof EntityMinecart) wantItems.add(allThings.get(i)); + + if (allThings.get(i) instanceof EntityIronGolem) wantLiving.add(allThings.get(i)); + if (allThings.get(i) instanceof EntityItem) { EntityItem thisThing = (EntityItem) allThings.get(i); ItemStack theItem = thisThing.getItem(); - if (wantedThings.contains(new RMFoodItem(theItem.getItem(), - theItem.getItemDamage()))) { + if (wantedThings.contains(new RMFoodItem(theItem.getItem(), theItem.getItemDamage()))) { wantItems.add(allThings.get(i)); } } } - + Collections.sort(wantLiving, this.theNearestWantedThingSorter); Collections.sort(wantItems, this.theNearestWantedThingSorter); - + Iterator moarLiving = wantLiving.iterator(); Iterator moarItems = wantItems.iterator(); - + while (moarLiving.hasNext() || moarItems.hasNext()) { gottaCompare = false; livingFlag = false; - - if (moarLiving.hasNext() && moarItems.hasNext()) - gottaCompare = true; - + + if (moarLiving.hasNext() && moarItems.hasNext()) gottaCompare = true; + if (!gottaCompare) { if (moarLiving.hasNext()) { targetEntity = (Entity) moarLiving.next(); livingFlag = true; - } else if (moarItems.hasNext()) { + } + else if (moarItems.hasNext()) { targetEntity = (Entity) moarItems.next(); - } else { - System.out.println("[DUNGEON MOBS] ERROR: RM-AI-01 " - + "- please report this error code to JaredBGreat."); } - } else { + else { + System.out.println("[DUNGEON MOBS] ERROR: RM-AI-01 " + "- please report this error code to JaredBGreat."); + } + } + else { Entity foo = (Entity) wantLiving.get(0); Entity bar = (Entity) wantItems.get(0); - + float distFoo = taskOwner.getDistance(foo); float distBar = taskOwner.getDistance(bar); - + if (distBar > distFoo) { targetEntity = (Entity) moarLiving.next(); livingFlag = true; - } else { + } + else { targetEntity = (Entity) moarItems.next(); } } @@ -141,65 +137,64 @@ public boolean shouldExecute() { } return false; } - - - @Override - public void startExecuting() { - taskOwner.setTarget(targetEntity, livingFlag); - - super.startExecuting(); - } - - public void resetTask() { - livingFlag = false; - taskOwner.setTarget(null, false); - } - - + @Override public boolean shouldContinueExecuting() { Entity var1 = taskOwner.getTarget(); - + if (var1 == null) { return false; - } else if (!var1.isEntityAlive()) { + } + else if (!var1.isEntityAlive()) { return false; - } else if (taskOwner.getDistanceSq(var1) > (double) (targetDistance * targetDistance)) { + } + else if (taskOwner.getDistanceSq(var1) > (double) (targetDistance * targetDistance)) { return false; - } else { + } + else { return true; } } - - + + @Override + public void startExecuting() { + taskOwner.setTarget(targetEntity, livingFlag); + + super.startExecuting(); + } + + public void resetTask() { + livingFlag = false; + taskOwner.setTarget(null, false); + } + @Override public void updateTask() { if (livingFlag) { EntityLivingBase entity = (EntityLivingBase) taskOwner.getTarget(); - + List playerEntities = taskOwner.world.playerEntities; Iterator iter = playerEntities.iterator(); boolean hasStuff = false; - + while (iter.hasNext()) { EntityPlayer check = (EntityPlayer) iter.next(); - + if (check.getEntityId() == entity.getEntityId()) { hasStuff = false; - + InventoryPlayer theStuff = check.inventory; - + int numSlots = theStuff.getSizeInventory(); for (int j = 0; j < numSlots; j++) { ItemStack theItem = theStuff.getStackInSlot(j); //System.out.println("Checking Item: " + theItem.getItem()); - if (wantedThings.contains(new RMFoodItem(theItem.getItem(), - theItem.getItemDamage()))) { + if (wantedThings.contains(new RMFoodItem(theItem.getItem(), theItem.getItemDamage()))) { hasStuff = true; break; } } - + for (ItemStack armorPiece : check.getArmorInventoryList()) { if (armorPiece != null) { if (wantedThings.contains(new RMFoodItem(armorPiece.getItem()))) { @@ -210,29 +205,27 @@ public void updateTask() { } } } - if (!hasStuff && !(targetEntity instanceof EntityIronGolem)) - resetTask(); + if (!hasStuff && !(targetEntity instanceof EntityIronGolem)) resetTask(); } super.updateTask(); } - - + + public class EntityAINearestWantedThingSorter implements Comparator { final EntityAIFindItem parent; private Entity theEntity; - - public EntityAINearestWantedThingSorter(EntityAIFindItem - par1EntityAINearestItem, Entity par2Entity) { + + public EntityAINearestWantedThingSorter(EntityAIFindItem par1EntityAINearestItem, Entity par2Entity) { parent = par1EntityAINearestItem; theEntity = par2Entity; } - + public int compareDistanceSq(Entity par1Entity, Entity par2Entity) { double var3 = theEntity.getDistanceSq(par1Entity); double var5 = theEntity.getDistanceSq(par2Entity); return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); } - + public int compare(Object par1Obj, Object par2Obj) { return compareDistanceSq((Entity) par1Obj, (Entity) par2Obj); } diff --git a/src/main/java/com/gw/dm/ai/EntityAIFollowTwin.java b/src/main/java/com/gw/dm/ai/EntityAIFollowTwin.java index c5ac68f..277778d 100644 --- a/src/main/java/com/gw/dm/ai/EntityAIFollowTwin.java +++ b/src/main/java/com/gw/dm/ai/EntityAIFollowTwin.java @@ -31,12 +31,10 @@ public boolean shouldExecute() { @Override public boolean shouldContinueExecuting() { EntityLizalfos twin = entityOwner.getTwin(); - if ((path == null) - || entityOwner.isTwinDead() - || (entityOwner.getAttackTarget() != null) - || (twin == null)) { + if ((path == null) || entityOwner.isTwinDead() || (entityOwner.getAttackTarget() != null) || (twin == null)) { return false; - } else { + } + else { double var1 = this.entityOwner.getDistanceSq(this.entityOwner.getTwin()); return var1 >= 16.0D; } diff --git a/src/main/java/com/gw/dm/ai/EntityAIMonsterPanic.java b/src/main/java/com/gw/dm/ai/EntityAIMonsterPanic.java index b4e0fd6..de3869e 100644 --- a/src/main/java/com/gw/dm/ai/EntityAIMonsterPanic.java +++ b/src/main/java/com/gw/dm/ai/EntityAIMonsterPanic.java @@ -25,15 +25,16 @@ public EntityAIMonsterPanic(EntityMob par1EntityCreature, float par2) { */ @Override public boolean shouldExecute() { - if (this.theEntityCreature.getAttackTarget() == null - && !this.theEntityCreature.isBurning()) { + if (this.theEntityCreature.getAttackTarget() == null && !this.theEntityCreature.isBurning()) { return false; - } else { + } + else { Vec3d var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); if (var1 == null) { return false; - } else { + } + else { this.randPosX = var1.x; this.randPosY = var1.y; this.randPosZ = var1.z; @@ -42,22 +43,19 @@ public boolean shouldExecute() { } } - /** - * Execute a one shot task or start executing a continuous task + * Returns whether an in-progress EntityAIBase should continue executing */ @Override - public void startExecuting() { - this.theEntityCreature.getNavigator() - .tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); + public boolean shouldContinueExecuting() { + return !this.theEntityCreature.getNavigator().noPath(); } - /** - * Returns whether an in-progress EntityAIBase should continue executing + * Execute a one shot task or start executing a continuous task */ @Override - public boolean shouldContinueExecuting() { - return !this.theEntityCreature.getNavigator().noPath(); + public void startExecuting() { + this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); } } diff --git a/src/main/java/com/gw/dm/ai/MoveHelperBeholder.java b/src/main/java/com/gw/dm/ai/MoveHelperBeholder.java index 979fa6e..740d1ee 100644 --- a/src/main/java/com/gw/dm/ai/MoveHelperBeholder.java +++ b/src/main/java/com/gw/dm/ai/MoveHelperBeholder.java @@ -12,13 +12,13 @@ public class MoveHelperBeholder extends EntityMoveHelper { EntityAhriman owner; boolean blocked; - + public MoveHelperBeholder(EntityLiving entitylivingIn) { super(entitylivingIn); owner = (EntityAhriman) entitylivingIn; } - - + + @Override public void onUpdateMoveHelper() { Random rand = owner.getRNG(); @@ -27,43 +27,41 @@ public void onUpdateMoveHelper() { double dy = owner.waypointY - owner.posY; double dz = owner.waypointZ - owner.posZ; double dist2 = ((dx * dx) + (dy * dy) + (dz * dz)); - + if (dist2 < 1.0D || dist2 > 3600.0D) { - owner.waypointX = owner.posX + (double) ((rand.nextFloat() - * 2.0F - 1.0F) * 16.0F); - owner.waypointY = owner.posY + (double) ((rand.nextFloat() - * 2.0F - 1.0F) * 16.0F); - owner.waypointZ = owner.posZ + (double) ((rand.nextFloat() - * 2.0F - 1.0F) * 16.0F); - + owner.waypointX = owner.posX + (double) ((rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + owner.waypointY = owner.posY + (double) ((rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + owner.waypointZ = owner.posZ + (double) ((rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + if (owner.getAttackTarget() != null && !owner.getAttackTarget().isDead) { double fooX = rand.nextFloat() * 10.0F; double fooY = rand.nextFloat() * 10.0F; double fooZ = rand.nextFloat() * 10.0F; - + owner.waypointX = traget.posX + (fooX * (rand.nextInt(5) - 2)); owner.waypointY = traget.posY + (fooY * (rand.nextInt(5) - 2)); owner.waypointZ = traget.posZ + (fooZ * (rand.nextInt(5) - 2)); } } - + if (owner.courseChangeCooldown-- <= 0) { owner.courseChangeCooldown += rand.nextInt(5) + 2; dist2 = (double) MathHelper.sqrt(dist2); - + if (!isColliding(owner.waypointX, owner.waypointY, owner.waypointZ, dist2)) { owner.motionX += dx / dist2 * 0.1D; owner.motionY += dy / dist2 * 0.1D; owner.motionZ += dz / dist2 * 0.1D; - } else { + } + else { owner.waypointX = owner.posX; owner.waypointY = owner.posY; owner.waypointZ = owner.posZ; } } } - - + + /** * Borrowed from Doomlike Dungeons II Fallen Angel and similar to vanilla * ghast code and original Dungeons Mobs "ahriman" code. This determines @@ -90,5 +88,5 @@ public boolean isColliding(double dx, double dy, double dz, double dist) { } return false; } - + } diff --git a/src/main/java/com/gw/dm/ai/TaskAngelAgroOnPlayer.java b/src/main/java/com/gw/dm/ai/TaskAngelAgroOnPlayer.java index f95ccc8..169d80d 100644 --- a/src/main/java/com/gw/dm/ai/TaskAngelAgroOnPlayer.java +++ b/src/main/java/com/gw/dm/ai/TaskAngelAgroOnPlayer.java @@ -21,16 +21,14 @@ public boolean shouldExecute() { return ((target != null) && owner.canEntityBeSeen(target)); } - @Override - public void startExecuting() { - owner.setAttackTarget(target); + public boolean shouldContinueExecuting() { + return false; } - @Override - public boolean shouldContinueExecuting() { - return false; + public void startExecuting() { + owner.setAttackTarget(target); } } diff --git a/src/main/java/com/gw/dm/blocks/BlockBladeTrap.java b/src/main/java/com/gw/dm/blocks/BlockBladeTrap.java index 8b64fcb..0e1238c 100644 --- a/src/main/java/com/gw/dm/blocks/BlockBladeTrap.java +++ b/src/main/java/com/gw/dm/blocks/BlockBladeTrap.java @@ -31,15 +31,7 @@ public class BlockBladeTrap extends ModContainerBase { public static boolean fallInstantly = false; - public int[][] dir = - { - {0, -1, 0}, - {0, 1, 0}, - {-1, 0, 0}, - {1, 0, 0}, - {0, 0, -1}, - {0, 0, 1} - }; + public int[][] dir = {{0, -1, 0}, {0, 1, 0}, {-1, 0, 0}, {1, 0, 0}, {0, 0, -1}, {0, 0, 1}}; public BlockBladeTrap() { @@ -51,14 +43,12 @@ public BlockBladeTrap() { setUnlocalizedName(DungeonMobs.MODID + ".bladetrap"); setRegistryName(DungeonMobs.MODID, "bladetrap"); MiscRegistrar.addBlock(this); - MiscRegistrar.addItem(new ItemBlock(this) - .setRegistryName(getRegistryName())); + MiscRegistrar.addItem(new ItemBlock(this).setRegistryName(getRegistryName())); } public static boolean canMoveInto(World par0World, int par1, int par2, int par3) { Block l = par0World.getBlockState(new BlockPos(par1, par2, par3)).getBlock(); - return ((l == Blocks.AIR) || (l == Blocks.FIRE) - || (l == Blocks.WATER) || (l == Blocks.LAVA)); + return ((l == Blocks.AIR) || (l == Blocks.FIRE) || (l == Blocks.WATER) || (l == Blocks.LAVA)); } @Override @@ -70,19 +60,13 @@ public TileEntity createNewTileEntity(World par1World) { return new TileEntityBladeTrap(); } - @Override - public boolean isOpaqueCube(IBlockState state) { - return false; - } - @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT; } @Override - public void onEntityCollidedWithBlock(World world, - BlockPos pos, IBlockState state, Entity entity) { + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) { int dmgValue = 0; switch (world.getDifficulty()) { @@ -104,24 +88,28 @@ public void onEntityCollidedWithBlock(World world, } if (entity != null && !world.isRemote) { - if (entity instanceof EntityPlayer) - entity.attackEntityFrom(DungeonMobsDamageSource.BLADE_TRAP, dmgValue); + if (entity instanceof EntityPlayer) entity.attackEntityFrom(DungeonMobsDamageSource.BLADE_TRAP, dmgValue); } } @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, - IBlockAccess worldIn, BlockPos pos) { + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { float f = 0.0625F; - return new AxisAlignedBB( - (double) ((float) pos.getX() + f), (double) pos.getX(), - (double) ((float) pos.getY() + f), (double) ((float) (pos.getY() + 1) - f), - (double) ((float) (pos.getZ() + 1) - f), (double) ((float) (pos.getZ() + 1) - f)); + return new AxisAlignedBB((double) ((float) pos.getX() + f), (double) pos.getX(), (double) ((float) pos.getY() + f), (double) ((float) (pos.getY() + 1) - f), (double) ((float) (pos.getZ() + 1) - f), (double) ((float) (pos.getZ() + 1) - f)); + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; } @Override - public void onBlockDestroyedByPlayer(World world, - BlockPos pos, IBlockState state) { + public int quantityDropped(Random par1Random) { + return 0; + } + + @Override + public void onBlockDestroyedByPlayer(World world, BlockPos pos, IBlockState state) { int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); @@ -187,11 +175,6 @@ public void dropStuff(World w, int x, int y, int z) { } } - @Override - public int quantityDropped(Random par1Random) { - return 0; - } - public void spawnBladeTrapEntity(World world, int x, int y, int z, int d) { if (canMoveInto(world, x + dir[d][0], y + dir[d][1], z + dir[d][2]) && y >= 0) { BlockPos pos = new BlockPos(x, y, z); @@ -201,11 +184,7 @@ public void spawnBladeTrapEntity(World world, int x, int y, int z, int d) { EntityBladeTrap entity = new EntityBladeTrap(world); entity.setDirection(dir[d]); - entity.setLocationAndAngles((double) ((float) x + 0.5F), - (double) ((float) y + 0.1F), - (double) ((float) z + 0.5F), - MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), - 0.0F); + entity.setLocationAndAngles((double) ((float) x + 0.5F), (double) ((float) y + 0.1F), (double) ((float) z + 0.5F), MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F); entity.rotationYawHead = entity.rotationYaw; entity.renderYawOffset = entity.rotationYaw; world.spawnEntity(entity); diff --git a/src/main/java/com/gw/dm/blocks/BlockLavarock.java b/src/main/java/com/gw/dm/blocks/BlockLavarock.java index 5eb44cc..e9d0c2f 100644 --- a/src/main/java/com/gw/dm/blocks/BlockLavarock.java +++ b/src/main/java/com/gw/dm/blocks/BlockLavarock.java @@ -35,8 +35,7 @@ public BlockLavarock() { setLightLevel(0.4375f); setCreativeTab(CreativeTabs.BUILDING_BLOCKS); MiscRegistrar.addBlock(this); - MiscRegistrar.addItem(new ItemBlock(this) - .setRegistryName(getRegistryName())); + MiscRegistrar.addItem(new ItemBlock(this).setRegistryName(getRegistryName())); } @@ -46,74 +45,61 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s if ((worldIn.getTotalWorldTime() % 10) == 0) entity.attackEntityFrom(DamageSource.LAVA, 4); } - - @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, - IBlockAccess world, BlockPos pos) { - float f = 0.0625F; - return new AxisAlignedBB((double) ((float) pos.getX() + f), (double) pos.getX(), - (double) ((float) pos.getY() + f), (double) ((float) (pos.getY() + 1) - f), - (double) (float) (pos.getZ() + f), (double) (float) (pos.getZ() + f)); - } - - - @Override - public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { - super.updateTick(worldIn, pos, state, rand); - - int foo = rand.nextInt(DungeonMobsHelper.getDifficulty(worldIn) + 1); - - if (foo < 1) { - int age = state.getValue(TIME_TO_LIVE).intValue(); - if (age > 0) { - worldIn.setBlockState(pos, getDefaultState() - .withProperty(TIME_TO_LIVE, Integer.valueOf(age - 1))); - } else { - worldIn.setBlockState(pos, Blocks.STONE.getDefaultState(), 3); - } - } - } - - private boolean byWater(World world, BlockPos pos) { for (EnumFacing enumfacing : EnumFacing.values()) { - if (world.getBlockState(pos.offset(enumfacing)).getMaterial() - == Material.WATER) { + if (world.getBlockState(pos.offset(enumfacing)).getMaterial() == Material.WATER) { return true; } } return false; } - @Override - public void onBlockDestroyedByPlayer(World world, BlockPos pos, - IBlockState state) { + public void onBlockDestroyedByPlayer(World world, BlockPos pos, IBlockState state) { world.setBlockState(pos, Blocks.LAVA.getDefaultState(), 3); super.onBlockDestroyedByPlayer(world, pos, state); } - - @Override - protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[]{TIME_TO_LIVE}); - } - - @Override public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(TIME_TO_LIVE, meta); } - @Override public int getMetaFromState(IBlockState state) { return state.getValue(TIME_TO_LIVE).intValue(); } + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess world, BlockPos pos) { + float f = 0.0625F; + return new AxisAlignedBB((double) ((float) pos.getX() + f), (double) pos.getX(), (double) ((float) pos.getY() + f), (double) ((float) (pos.getY() + 1) - f), (double) (float) (pos.getZ() + f), (double) (float) (pos.getZ() + f)); + } + + @Override + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { + super.updateTick(worldIn, pos, state, rand); + + int foo = rand.nextInt(DungeonMobsHelper.getDifficulty(worldIn) + 1); + + if (foo < 1) { + int age = state.getValue(TIME_TO_LIVE).intValue(); + if (age > 0) { + worldIn.setBlockState(pos, getDefaultState().withProperty(TIME_TO_LIVE, Integer.valueOf(age - 1))); + } + else { + worldIn.setBlockState(pos, Blocks.STONE.getDefaultState(), 3); + } + } + } @Override public int damageDropped(IBlockState state) { return getMetaFromState(state); } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[]{TIME_TO_LIVE}); + } } diff --git a/src/main/java/com/gw/dm/blocks/ModBlockBase.java b/src/main/java/com/gw/dm/blocks/ModBlockBase.java index 38f2e11..c55ec6b 100644 --- a/src/main/java/com/gw/dm/blocks/ModBlockBase.java +++ b/src/main/java/com/gw/dm/blocks/ModBlockBase.java @@ -14,8 +14,7 @@ public ModBlockBase(Material materialIn) { @Override public void registerModel() { - DungeonMobs.proxy.registerItemRender(Item - .getItemFromBlock(this), 0, "inventory"); + DungeonMobs.proxy.registerItemRender(Item.getItemFromBlock(this), 0, "inventory"); } } diff --git a/src/main/java/com/gw/dm/blocks/ModContainerBase.java b/src/main/java/com/gw/dm/blocks/ModContainerBase.java index 7b675c0..28a0a30 100644 --- a/src/main/java/com/gw/dm/blocks/ModContainerBase.java +++ b/src/main/java/com/gw/dm/blocks/ModContainerBase.java @@ -15,8 +15,7 @@ protected ModContainerBase(Material materialIn) { @Override public void registerModel() { - DungeonMobs.proxy.registerItemRender(Item - .getItemFromBlock(this), 0, "inventory"); + DungeonMobs.proxy.registerItemRender(Item.getItemFromBlock(this), 0, "inventory"); } diff --git a/src/main/java/com/gw/dm/blocks/TileEntityBladeTrap.java b/src/main/java/com/gw/dm/blocks/TileEntityBladeTrap.java index 2834e5b..1a69a18 100644 --- a/src/main/java/com/gw/dm/blocks/TileEntityBladeTrap.java +++ b/src/main/java/com/gw/dm/blocks/TileEntityBladeTrap.java @@ -29,8 +29,7 @@ public EntityBladeTrap getTrap() { @Override public void update() { - if (spawnTicks < 40) - spawnTicks++; + if (spawnTicks < 40) spawnTicks++; BlockPos pos = getPos(); int xCoord = pos.getX(); @@ -70,9 +69,7 @@ public int isPlayerNearby(World w, int x, int y, int z) { List players = new ArrayList<>(); for (EntityPlayer player : world.playerEntities) { - if (((player.posX - x) * (player.posX - x)) + - ((player.posY - y) * (player.posY - y)) + - ((player.posZ - z) * (player.posZ - z)) < sqDist) { + if (((player.posX - x) * (player.posX - x)) + ((player.posY - y) * (player.posY - y)) + ((player.posZ - z) * (player.posZ - z)) < sqDist) { players.add(player); } } @@ -82,14 +79,14 @@ public int isPlayerNearby(World w, int x, int y, int z) { if (players.isEmpty()) { return -1; - } else { + } + else { Iterator iter = players.iterator(); while (iter.hasNext()) { EntityPlayer foo = (EntityPlayer) iter.next(); - if (canEntityBeSeen(w, x, y, z, foo) && !foo.capabilities.isCreativeMode) - playersCanSee.add(foo); + if (canEntityBeSeen(w, x, y, z, foo) && !foo.capabilities.isCreativeMode) playersCanSee.add(foo); } if (playersCanSee.isEmpty()) { return -1; @@ -110,22 +107,19 @@ public int isPlayerNearby(World w, int x, int y, int z) { int entY = (int) Math.floor(foo.posY); int entZ = (int) Math.floor(foo.posZ); - if (thisX == entX) - bar++; + if (thisX == entX) bar++; - if (thisY == entY) - bar++; + if (thisY == entY) bar++; - if (thisZ == entZ) - bar++; + if (thisZ == entZ) bar++; - if (bar > 1) - playersInLine.add(foo); + if (bar > 1) playersInLine.add(foo); } if (playersInLine.isEmpty()) { return -1; - } else { + } + else { Random rand = new Random(); EntityPlayer select = playersInLine.get(rand.nextInt(playersInLine.size())); @@ -137,19 +131,24 @@ public int isPlayerNearby(World w, int x, int y, int z) { if (thisX != entX) { if (thisX > entX) { return 2; - } else { + } + else { return 3; } - } else if (thisY != entY) { + } + else if (thisY != entY) { if (thisY > entY) { return 0; - } else { + } + else { return 1; } - } else { + } + else { if (thisZ > entZ) { return 4; - } else { + } + else { return 5; } } @@ -157,44 +156,40 @@ public int isPlayerNearby(World w, int x, int y, int z) { } - public boolean canEntityBeSeen(World world, - int x, int y, int z, Entity par1Entity) { - int maxX = Math.max(x, (int)par1Entity.posX); - int maxY = Math.max(y, (int)par1Entity.posY); - int maxZ = Math.max(z, (int)par1Entity.posZ); + public boolean canEntityBeSeen(World world, int x, int y, int z, Entity par1Entity) { + int maxX = Math.max(x, (int) par1Entity.posX); + int maxY = Math.max(y, (int) par1Entity.posY); + int maxZ = Math.max(z, (int) par1Entity.posZ); - int minX = Math.min(x, (int)par1Entity.posX); - int minY = Math.min(y, (int)par1Entity.posY); - int minZ = Math.min(z, (int)par1Entity.posZ); + int minX = Math.min(x, (int) par1Entity.posX); + int minY = Math.min(y, (int) par1Entity.posY); + int minZ = Math.min(z, (int) par1Entity.posZ); if (maxX != minX) { for (int i = minX + 1; i < maxX; i++) { - if (world.isAirBlock(new BlockPos(i, minY, minZ))) - return false; + if (world.isAirBlock(new BlockPos(i, minY, minZ))) return false; } - } else if (maxY != minY) { + } + else if (maxY != minY) { for (int i = minY + 1; i < maxY; i++) { - if (world.isAirBlock(new BlockPos(minX, i, minZ))) - return false; + if (world.isAirBlock(new BlockPos(minX, i, minZ))) return false; } - } else if (maxZ != minZ) { + } + else if (maxZ != minZ) { for (int i = minZ + 1; i < maxZ; i++) { - if (world.isAirBlock(new BlockPos(minX, minY, i))) - return false; + if (world.isAirBlock(new BlockPos(minX, minY, i))) return false; } } return true; } - @Override - public NBTTagCompound writeToNBT(NBTTagCompound par1) { - return super.writeToNBT(par1); + public void readFromNBT(NBTTagCompound par1) { + super.readFromNBT(par1); } - @Override - public void readFromNBT(NBTTagCompound par1) { - super.readFromNBT(par1); + public NBTTagCompound writeToNBT(NBTTagCompound par1) { + return super.writeToNBT(par1); } } diff --git a/src/main/java/com/gw/dm/compat/DLDCompat.java b/src/main/java/com/gw/dm/compat/DLDCompat.java index ae247cc..cf0a787 100644 --- a/src/main/java/com/gw/dm/compat/DLDCompat.java +++ b/src/main/java/com/gw/dm/compat/DLDCompat.java @@ -1,78 +1,38 @@ package com.gw.dm.compat; import jaredbgreat.dldungeons.api.DLDungeonsAPI; -import static com.gw.dm.DungeonMobs.*; + +import static com.gw.dm.DungeonMobs.MODID; import static com.gw.dm.util.ConfigHandler.*; public class DLDCompat { - public static void addDLD() { - if (spawnGhoul) - DLDungeonsAPI.addMob(MODID + ":dmghoul", 1, - "SWAMP", "DESERT", "DUNGEON", "URBAN", "NECRO"); - if (spawnBeholder) - DLDungeonsAPI.addMob(MODID + ":dmbeholder", 2, - "MAGICAL", "MOUNTAIN", "DUNGEON", "WASTELAND", "END"); - if (spawnTroll) - DLDungeonsAPI.addMob(MODID + ":dmtroll", 2, - "MOUNTAIN", "FOREST", "DUNGEON", "FROZEN", "URBAN"); - if (spawnManticore) - DLDungeonsAPI.addMob(MODID + ":dmmanticore", 2, - "MOUNTAIN", "DESERT", "DUNGEON", "WASTELAND"); - if (spawnRevenant) - DLDungeonsAPI.addMob(MODID + ":dmrevenant", 2, - "FOREST", "DUNGEON", "URBAN", "NECRO", "SHADOW"); - if (spawnVampire) - DLDungeonsAPI.addMob(MODID + ":dmvampire", 3, - "FOREST", "PLAINS", "DUNGEON", "URBAN", "NECRO", "SHADOW"); - if (spawnHookHorror) - DLDungeonsAPI.addMob(MODID + ":dmhookhorror", 2, - "MOUNTAIN", "FOREST", "DUNGEON", "JUNGLE", "TECH", "FROZEN"); - if (spawnDestrachan) - DLDungeonsAPI.addMob(MODID + ":dmdestrachan", 2, - "SWAMP", "JUNGLE", "DUNGEON", "URBAN", "MAGICAL", "TECH"); - if (spawnCaveFisher) - DLDungeonsAPI.addMob(MODID + ":dmcavefisher", 2, - "MAGICAL", "TECH", "DUNGEON", "URBAN", "WASTELAND", "FROZEN"); - if (spawnHellHound) - DLDungeonsAPI.addMob(MODID + ":dmnetherhound", 2, - "NETHER", "FIERY", "DUNGEON"); - if (spawnUmberHulk) - DLDungeonsAPI.addMob(MODID + ":dmumberhulk", 2, - "SWAMP", "WASTELAND", "DUNGEON", "MUSHROOM", "TECH"); - if (spawnRustMonster) - DLDungeonsAPI.addMob(MODID + ":dmrustmonster", 2, - "DUNGEON", "MAGICAL", "TECH", "MUSHROOM", "WASTELAND"); - if (spawnCockatrice) - DLDungeonsAPI.addMob(MODID + ":dmcockatrice", 1, - "FOREST", "PLAINS", "DESERT", "DUNGEON", "MAGICAL", "WASTELAND"); - if (spawnThoqqua) - DLDungeonsAPI.addMob(MODID + ":dmthoqqua", 2, - "DUNGEON", "MOUNTAIN", "FIERY", "NETHER"); + public static void addDLD() { + if (spawnGhoul) DLDungeonsAPI.addMob(MODID + ":dmghoul", 1, "SWAMP", "DESERT", "DUNGEON", "URBAN", "NECRO"); + if (spawnBeholder) DLDungeonsAPI.addMob(MODID + ":dmbeholder", 2, "MAGICAL", "MOUNTAIN", "DUNGEON", "WASTELAND", "END"); + if (spawnTroll) DLDungeonsAPI.addMob(MODID + ":dmtroll", 2, "MOUNTAIN", "FOREST", "DUNGEON", "FROZEN", "URBAN"); + if (spawnManticore) DLDungeonsAPI.addMob(MODID + ":dmmanticore", 2, "MOUNTAIN", "DESERT", "DUNGEON", "WASTELAND"); + if (spawnRevenant) DLDungeonsAPI.addMob(MODID + ":dmrevenant", 2, "FOREST", "DUNGEON", "URBAN", "NECRO", "SHADOW"); + if (spawnVampire) DLDungeonsAPI.addMob(MODID + ":dmvampire", 3, "FOREST", "PLAINS", "DUNGEON", "URBAN", "NECRO", "SHADOW"); + if (spawnHookHorror) DLDungeonsAPI.addMob(MODID + ":dmhookhorror", 2, "MOUNTAIN", "FOREST", "DUNGEON", "JUNGLE", "TECH", "FROZEN"); + if (spawnDestrachan) DLDungeonsAPI.addMob(MODID + ":dmdestrachan", 2, "SWAMP", "JUNGLE", "DUNGEON", "URBAN", "MAGICAL", "TECH"); + if (spawnCaveFisher) DLDungeonsAPI.addMob(MODID + ":dmcavefisher", 2, "MAGICAL", "TECH", "DUNGEON", "URBAN", "WASTELAND", "FROZEN"); + if (spawnHellHound) DLDungeonsAPI.addMob(MODID + ":dmnetherhound", 2, "NETHER", "FIERY", "DUNGEON"); + if (spawnUmberHulk) DLDungeonsAPI.addMob(MODID + ":dmumberhulk", 2, "SWAMP", "WASTELAND", "DUNGEON", "MUSHROOM", "TECH"); + if (spawnRustMonster) DLDungeonsAPI.addMob(MODID + ":dmrustmonster", 2, "DUNGEON", "MAGICAL", "TECH", "MUSHROOM", "WASTELAND"); + if (spawnCockatrice) DLDungeonsAPI.addMob(MODID + ":dmcockatrice", 1, "FOREST", "PLAINS", "DESERT", "DUNGEON", "MAGICAL", "WASTELAND"); + if (spawnThoqqua) DLDungeonsAPI.addMob(MODID + ":dmthoqqua", 2, "DUNGEON", "MOUNTAIN", "FIERY", "NETHER"); if (spawnVescavor) // Not really elite, but their power in a crowded dungeon...? ...might as well be! - DLDungeonsAPI.addMob(MODID + ":dmvescavor", 3, - "MAGICAL", "TECH", "DUNGEON", "WASTELAND", "JUNGLE"); - if (spawnIllithid) - DLDungeonsAPI.addMob(MODID + ":dmillithid", 2, - "URBAN", "MAGICAL", "DUNGEON", "TECH", "FROZEN", "END"); - if (spawnRakshasa) - DLDungeonsAPI.addMob(MODID + ":dmrakshasa", 3, - "URBAN", "DESERT", "JUNGLE", "MAGICAL"); - if (spawnLizalfos) - DLDungeonsAPI.addMob(MODID + ":dmlizalfos", 2, - "SWAMP", "FOREST", "DUNGEON", "JUNGLE"); - if (spawnOuterThing) - DLDungeonsAPI.addMob(MODID + ":dmeldermob", 3, - "END", "MAGICAL", "TECH", "SHADOW", "FROZEN"); - if (spawnFallenAngel) - DLDungeonsAPI.addMob(MODID + ":dmfallenangel", 3, - "NETHER", "MAGICAL", "PARADISE", "WASTELAND"); - if (spawnGhost) - DLDungeonsAPI.addMob(MODID + ":dmghost", 2, - "SHADOW", "PARADISE", "DUNGEON", "URBAN", "NECRO"); - + DLDungeonsAPI.addMob(MODID + ":dmvescavor", 3, "MAGICAL", "TECH", "DUNGEON", "WASTELAND", "JUNGLE"); + if (spawnIllithid) DLDungeonsAPI.addMob(MODID + ":dmillithid", 2, "URBAN", "MAGICAL", "DUNGEON", "TECH", "FROZEN", "END"); + if (spawnRakshasa) DLDungeonsAPI.addMob(MODID + ":dmrakshasa", 3, "URBAN", "DESERT", "JUNGLE", "MAGICAL"); + if (spawnLizalfos) DLDungeonsAPI.addMob(MODID + ":dmlizalfos", 2, "SWAMP", "FOREST", "DUNGEON", "JUNGLE"); + if (spawnOuterThing) DLDungeonsAPI.addMob(MODID + ":dmeldermob", 3, "END", "MAGICAL", "TECH", "SHADOW", "FROZEN"); + if (spawnFallenAngel) DLDungeonsAPI.addMob(MODID + ":dmfallenangel", 3, "NETHER", "MAGICAL", "PARADISE", "WASTELAND"); + if (spawnGhost) DLDungeonsAPI.addMob(MODID + ":dmghost", 2, "SHADOW", "PARADISE", "DUNGEON", "URBAN", "NECRO"); + } } diff --git a/src/main/java/com/gw/dm/compat/Thaumic.java b/src/main/java/com/gw/dm/compat/Thaumic.java index 36369f2..21734d5 100644 --- a/src/main/java/com/gw/dm/compat/Thaumic.java +++ b/src/main/java/com/gw/dm/compat/Thaumic.java @@ -1,5 +1,6 @@ package com.gw.dm.compat; +import com.gw.dm.util.MiscRegistrar; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Optional; @@ -9,12 +10,10 @@ import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectRegistryEvent; -import com.gw.dm.util.MiscRegistrar; - // The model code I was shown for this lacks the annotation, // yet everything I've been told says you need it. -@Mod.EventBusSubscriber(modid="dungeonmobs") +@Mod.EventBusSubscriber(modid = "dungeonmobs") public class Thaumic { // Hopefully this will work and allow this to still work without @@ -24,134 +23,57 @@ public class Thaumic { @SubscribeEvent public static void aspectRegistrationEvent(AspectRegistryEvent evt) { - ThaumcraftApi.registerEntityTag("dungeonmobs.dmghoul", - new AspectList().add(Aspect.UNDEAD, 10) - .add(Aspect.MAN, 10) - .add(Aspect.EARTH, 5)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmbeholder", - new AspectList().add(Aspect.MAGIC, 25) - .add(Aspect.ELDRITCH, 20) - .add(Aspect.AVERSION, 20) - .add(Aspect.SENSES, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmtroll", - new AspectList().add(Aspect.MAGIC, 15) - .add(Aspect.LIFE, 10) - .add(Aspect.EARTH, 20) - .add(Aspect.DARKNESS, 5)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmmanticore", - new AspectList().add(Aspect.BEAST, 15) - .add(Aspect.AVERSION, 15) - .add(Aspect.AIR, 5)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmrevenant", - new AspectList().add(Aspect.SOUL, 15) - .add(Aspect.UNDEAD, 20) - .add(Aspect.ENTROPY, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmvampire", - new AspectList().add(Aspect.MAN, 10) - .add(Aspect.UNDEAD, 25) - .add(Aspect.DARKNESS, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmhookhorror", - new AspectList().add(Aspect.ELDRITCH, 15) - .add(Aspect.AVERSION, 20) - .add(Aspect.TRAP, 5)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmdestrachan", - new AspectList().add(Aspect.SENSES, 15) - .add(Aspect.BEAST, 10) - .add(Aspect.DARKNESS, 5) - .add(Aspect.AVERSION, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmcavefisher", - new AspectList().add(Aspect.BEAST, 10) - .add(Aspect.TRAP, 25) - .add(Aspect.AVERSION, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmrustmonster", - new AspectList().add(Aspect.BEAST, 10) - .add(Aspect.METAL, 20) - .add(Aspect.ENTROPY, 20)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmumberhulk", - new AspectList().add(Aspect.BEAST, 20) - .add(Aspect.AVERSION, 25) - .add(Aspect.SENSES, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmcockatrice", - new AspectList().add(Aspect.BEAST, 15) - .add(Aspect.AVERSION, 15) - .add(Aspect.EARTH, 25)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmshrieker", - new AspectList().add(Aspect.PLANT, 15) - .add(Aspect.SENSES, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmthoqqua", - new AspectList().add(Aspect.FIRE, 30) - .add(Aspect.EARTH, 20) - .add(Aspect.BEAST, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmvescavor", - new AspectList().add(Aspect.ELDRITCH, 20) - .add(Aspect.SENSES, 20) - .add(Aspect.MIND, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmillithid", - new AspectList().add(Aspect.ELDRITCH, 20) - .add(Aspect.MIND, 25) - .add(Aspect.AVERSION, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmlizalfos", - new AspectList().add(Aspect.BEAST, 15) - .add(Aspect.MAN, 15) - .add(Aspect.WATER, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmeldermob", - new AspectList().add(Aspect.ELDRITCH, 25) - .add(Aspect.MAGIC, 20) - .add(Aspect.SENSES, 10) - .add(Aspect.WATER, 10)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmrakshasaImage", - new AspectList().add(Aspect.SENSES, 5) - .add(Aspect.MAGIC, 5)); + ThaumcraftApi.registerEntityTag("dungeonmobs.dmghoul", new AspectList().add(Aspect.UNDEAD, 10).add(Aspect.MAN, 10).add(Aspect.EARTH, 5)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmbeholder", new AspectList().add(Aspect.MAGIC, 25).add(Aspect.ELDRITCH, 20).add(Aspect.AVERSION, 20).add(Aspect.SENSES, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmtroll", new AspectList().add(Aspect.MAGIC, 15).add(Aspect.LIFE, 10).add(Aspect.EARTH, 20).add(Aspect.DARKNESS, 5)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmmanticore", new AspectList().add(Aspect.BEAST, 15).add(Aspect.AVERSION, 15).add(Aspect.AIR, 5)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmrevenant", new AspectList().add(Aspect.SOUL, 15).add(Aspect.UNDEAD, 20).add(Aspect.ENTROPY, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmvampire", new AspectList().add(Aspect.MAN, 10).add(Aspect.UNDEAD, 25).add(Aspect.DARKNESS, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmhookhorror", new AspectList().add(Aspect.ELDRITCH, 15).add(Aspect.AVERSION, 20).add(Aspect.TRAP, 5)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmdestrachan", new AspectList().add(Aspect.SENSES, 15).add(Aspect.BEAST, 10).add(Aspect.DARKNESS, 5).add(Aspect.AVERSION, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmcavefisher", new AspectList().add(Aspect.BEAST, 10).add(Aspect.TRAP, 25).add(Aspect.AVERSION, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmrustmonster", new AspectList().add(Aspect.BEAST, 10).add(Aspect.METAL, 20).add(Aspect.ENTROPY, 20)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmumberhulk", new AspectList().add(Aspect.BEAST, 20).add(Aspect.AVERSION, 25).add(Aspect.SENSES, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmcockatrice", new AspectList().add(Aspect.BEAST, 15).add(Aspect.AVERSION, 15).add(Aspect.EARTH, 25)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmshrieker", new AspectList().add(Aspect.PLANT, 15).add(Aspect.SENSES, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmthoqqua", new AspectList().add(Aspect.FIRE, 30).add(Aspect.EARTH, 20).add(Aspect.BEAST, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmvescavor", new AspectList().add(Aspect.ELDRITCH, 20).add(Aspect.SENSES, 20).add(Aspect.MIND, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmillithid", new AspectList().add(Aspect.ELDRITCH, 20).add(Aspect.MIND, 25).add(Aspect.AVERSION, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmlizalfos", new AspectList().add(Aspect.BEAST, 15).add(Aspect.MAN, 15).add(Aspect.WATER, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmeldermob", new AspectList().add(Aspect.ELDRITCH, 25).add(Aspect.MAGIC, 20).add(Aspect.SENSES, 10).add(Aspect.WATER, 10)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmrakshasaImage", new AspectList().add(Aspect.SENSES, 5).add(Aspect.MAGIC, 5)); // Demons -- perhaps different of if Bewitchment is available - ThaumcraftApi.registerEntityTag("dungeonmobs.dmrakshasa", - new AspectList().add(Aspect.SOUL, 25) - .add(Aspect.MAGIC, 20) - .add(Aspect.AVERSION, 25) - .add(Aspect.MAN, 8) - .add(Aspect.BEAST, 8)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmnetherhound", - new AspectList().add(Aspect.BEAST, 15) - .add(Aspect.FIRE, 25) - .add(Aspect.AVERSION, 20)); - - ThaumcraftApi.registerEntityTag("dungeonmobs.dmfallenangel", - new AspectList().add(Aspect.SOUL, 25) - .add(Aspect.LIGHT, 20) - .add(Aspect.AVERSION, 20) - .add(Aspect.FLIGHT, 20)); + ThaumcraftApi.registerEntityTag("dungeonmobs.dmrakshasa", new AspectList().add(Aspect.SOUL, 25).add(Aspect.MAGIC, 20).add(Aspect.AVERSION, 25).add(Aspect.MAN, 8).add(Aspect.BEAST, 8)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmnetherhound", new AspectList().add(Aspect.BEAST, 15).add(Aspect.FIRE, 25).add(Aspect.AVERSION, 20)); + + ThaumcraftApi.registerEntityTag("dungeonmobs.dmfallenangel", new AspectList().add(Aspect.SOUL, 25).add(Aspect.LIGHT, 20).add(Aspect.AVERSION, 20).add(Aspect.FLIGHT, 20)); // Blocks - evt.register.registerObjectTag(new ItemStack(MiscRegistrar.blockBladeTrap), - new AspectList().add(Aspect.MECHANISM, 20) - .add(Aspect.METAL, 10) - .add(Aspect.AVERSION, 10)); + evt.register.registerObjectTag(new ItemStack(MiscRegistrar.blockBladeTrap), new AspectList().add(Aspect.MECHANISM, 20).add(Aspect.METAL, 10).add(Aspect.AVERSION, 10)); - evt.register.registerObjectTag(new ItemStack(MiscRegistrar.blockLavarock), - new AspectList().add(Aspect.FIRE, 5) - .add(Aspect.EARTH, 5)); + evt.register.registerObjectTag(new ItemStack(MiscRegistrar.blockLavarock), new AspectList().add(Aspect.FIRE, 5).add(Aspect.EARTH, 5)); } - } diff --git a/src/main/java/com/gw/dm/entity/EntityAhriman.java b/src/main/java/com/gw/dm/entity/EntityAhriman.java index 9df60be..0e90ba4 100644 --- a/src/main/java/com/gw/dm/entity/EntityAhriman.java +++ b/src/main/java/com/gw/dm/entity/EntityAhriman.java @@ -1,6 +1,15 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.beholderIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonFlying; +import com.gw.dm.ai.AIBeholderAttack; +import com.gw.dm.ai.AIBeholderWander; +import com.gw.dm.ai.MoveHelperBeholder; +import com.gw.dm.ai.TaskBeholderAgro; +import com.gw.dm.projectile.EntityEyeRay; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; @@ -20,20 +29,10 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonFlying; -import com.gw.dm.ai.AIBeholderAttack; -import com.gw.dm.ai.AIBeholderWander; -import com.gw.dm.ai.MoveHelperBeholder; -import com.gw.dm.ai.TaskBeholderAgro; -import com.gw.dm.projectile.EntityEyeRay; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.beholderIg; -public class EntityAhriman extends EntityDungeonFlying - implements IMob, IRangedAttackMob, IBeMagicMob { +public class EntityAhriman extends EntityDungeonFlying implements IMob, IRangedAttackMob, IBeMagicMob { private static final double ADIST2 = 24.0d * 24.0d; public static String mobName = DungeonMobs.MODID + ":dmahriman"; public int courseChangeCooldown = 0; @@ -45,25 +44,14 @@ public class EntityAhriman extends EntityDungeonFlying public boolean ignoreHeight; private MoveHelperBeholder moveHelper; private int aggroCooldown = 0; - + public EntityAhriman(World par1World) { super(par1World); experienceValue = 40; ignoreHeight = false; setSize(1.2F, 2.0F); } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(24.0d); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(32.0d - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5d); - getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(10.d); - getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(0.0d); - } - - + @Override protected void initEntityAI() { moveHelper = new MoveHelperBeholder(this); @@ -74,14 +62,53 @@ protected void initEntityAI() { targetTasks.addTask(2, new TaskBeholderAgro()); targetTasks.addTask(3, new EntityAIFindEntityNearestPlayer(this)); } - - + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(24.0d); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(32.0d * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5d); + getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(10.d); + getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(0.0d); + } + + public MoveHelperBeholder getMoveHelper() { + return moveHelper; + } + @Override protected void entityInit() { super.entityInit(); } - - + + public int getTalkInterval() { + return 300; + } + + @Override + public void onUpdate() { + if (!world.isRemote && (world.getDifficulty() == EnumDifficulty.PEACEFUL)) { + setDead(); + } + super.onUpdate(); + } + + @Override + protected SoundEvent getAmbientSound() { + return AudioHandler.entityAhrimanAmbient; + } + + // TODO: New loot dropping system + protected void dropFewItems(boolean par1, int par2) { + int var3; + int var4; + int var5; + var3 = this.rand.nextInt(3); + for (var4 = 0; var4 < var3; var4++) { + this.dropItem(Items.SPIDER_EYE, 1); + } + } + /** * A convenience method to create potion effects (also good for debugging). * @@ -92,83 +119,54 @@ protected void entityInit() { */ private PotionEffect makePotionEffect(String id, int duration, int level) { //System.out.println("Creating potion effect " + id); - return new PotionEffect(Potion - .getPotionFromResourceLocation(id), duration, level); + return new PotionEffect(Potion.getPotionFromResourceLocation(id), duration, level); } - - + public PotionEffect[] defineEyeRay() { if (this.getAttackTarget() instanceof EntityPlayer) { EntityPlayer foo = (EntityPlayer) this.getAttackTarget(); - if (foo.capabilities.isCreativeMode) - return new PotionEffect[0]; + if (foo.capabilities.isCreativeMode) return new PotionEffect[0]; } - + int bar = 0; - - if (this.world.getDifficulty() == EnumDifficulty.EASY) - bar = 1; - if (this.world.getDifficulty() == EnumDifficulty.NORMAL) - bar = 2; - if (this.world.getDifficulty() == EnumDifficulty.HARD) - bar = 3; - + + if (this.world.getDifficulty() == EnumDifficulty.EASY) bar = 1; + if (this.world.getDifficulty() == EnumDifficulty.NORMAL) bar = 2; + if (this.world.getDifficulty() == EnumDifficulty.HARD) bar = 3; + int num = rand.nextInt(3) + bar; - + PotionEffect[] theEffect = new PotionEffect[num]; - + for (int i = 0; i < num; i++) { int eff = this.rand.nextInt(11); - - if (eff == 0) - theEffect[i] = makePotionEffect("slowness", 120, 2); - else if (eff == 1) - theEffect[i] = makePotionEffect("mining_fatigue", 160, 2); - else if (eff == 2) - theEffect[i] = makePotionEffect("instant_damage", 1, ConfigHandler.beholderPtLvl); - else if (eff == 3) - theEffect[i] = makePotionEffect("nausea", 280, 1); - else if (eff == 4) - theEffect[i] = makePotionEffect("resistance", 100, -2); - else if (eff == 5) - theEffect[i] = makePotionEffect("blindness", 120, 1); - else if (eff == 6) - theEffect[i] = makePotionEffect("hunger", 400, 3); - else if (eff == 7) - theEffect[i] = makePotionEffect("weakness", 120, 1); - else if (eff == 8) - theEffect[i] = makePotionEffect("poison", 200, 1); - else if (eff == 9) - theEffect[i] = makePotionEffect("wither", 100, 1); - else - theEffect[i] = makePotionEffect("levitation", 160, 1); - + + if (eff == 0) theEffect[i] = makePotionEffect("slowness", 120, 2); + else if (eff == 1) theEffect[i] = makePotionEffect("mining_fatigue", 160, 2); + else if (eff == 2) theEffect[i] = makePotionEffect("instant_damage", 1, ConfigHandler.beholderPtLvl); + else if (eff == 3) theEffect[i] = makePotionEffect("nausea", 280, 1); + else if (eff == 4) theEffect[i] = makePotionEffect("resistance", 100, -2); + else if (eff == 5) theEffect[i] = makePotionEffect("blindness", 120, 1); + else if (eff == 6) theEffect[i] = makePotionEffect("hunger", 400, 3); + else if (eff == 7) theEffect[i] = makePotionEffect("weakness", 120, 1); + else if (eff == 8) theEffect[i] = makePotionEffect("poison", 200, 1); + else if (eff == 9) theEffect[i] = makePotionEffect("wither", 100, 1); + else theEffect[i] = makePotionEffect("levitation", 160, 1); + if (i > 0) { - if (theEffect[i - 1].equals(theEffect[i])) - i--; + if (theEffect[i - 1].equals(theEffect[i])) i--; } //System.out.println("The Effect: " + theEffect + "; Contains: " + theEffect[i]); } - + return theEffect; } - - - @Override - public void onUpdate() { - if (!world.isRemote && - (world.getDifficulty() == EnumDifficulty.PEACEFUL)) { - setDead(); - } - super.onUpdate(); - } - - - public int getTalkInterval() { - return 300; + + protected boolean isValidLightLevel() { + BlockPos pos = new BlockPos(this.posX, getEntityBoundingBox().minY, this.posZ); + return world.getLight(pos, true) < 8; } - - + @Override public boolean getCanSpawnHere() { if (beholderIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { @@ -180,109 +178,65 @@ public boolean getCanSpawnHere() { if (posY > 32.0D && !ignoreHeight) { return false; } - return (world.getDifficulty() - != EnumDifficulty.PEACEFUL) - && isValidLightLevel(); - } - - - protected boolean isValidLightLevel() { - BlockPos pos = new BlockPos(this.posX, getEntityBoundingBox().minY, this.posZ); - return world.getLight(pos, true) < 8; + return (world.getDifficulty() != EnumDifficulty.PEACEFUL) && isValidLightLevel(); } - - - // TODO: New loot dropping system - protected void dropFewItems(boolean par1, int par2) { - int var3; - int var4; - int var5; - var3 = this.rand.nextInt(3); - for (var4 = 0; var4 < var3; var4++) { - this.dropItem(Items.SPIDER_EYE, 1); - } - } - - + public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { EntityLivingBase target = getAttackTarget(); - if (par1DamageSource.getTrueSource() != null && (par1DamageSource.getTrueSource() - instanceof EntityLiving - && !(par1DamageSource.getTrueSource() instanceof EntityEyeRay))) { + if (par1DamageSource.getTrueSource() != null && (par1DamageSource.getTrueSource() instanceof EntityLiving && !(par1DamageSource.getTrueSource() instanceof EntityEyeRay))) { if (par1DamageSource.getImmediateSource() instanceof EntityThrowable) { EntityThrowable foo = (EntityThrowable) par1DamageSource.getImmediateSource(); target = (EntityLivingBase) foo.getThrower(); - } else { + } + else { target = (EntityLivingBase) par1DamageSource.getTrueSource(); } } - - if (par1DamageSource.getImmediateSource() != null - && par1DamageSource.getImmediateSource() instanceof EntityEyeRay) - return false; - + + if (par1DamageSource.getImmediateSource() != null && par1DamageSource.getImmediateSource() instanceof EntityEyeRay) return false; + return super.attackEntityFrom(par1DamageSource, par2); } - - - @Override - protected SoundEvent getAmbientSound() { - return AudioHandler.entityAhrimanAmbient; - } - - + @Override protected SoundEvent getHurtSound(DamageSource ds) { return null; } - - + @Override protected SoundEvent getDeathSound() { return null; } - + @Override - public void attackEntityWithRangedAttack(EntityLivingBase target, - float distanceFactor) { + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { } - + @Override public void setSwingingArms(boolean swingingArms) { } - - - public MoveHelperBeholder getMoveHelper() { - return moveHelper; - } - - + public void doAttack() { EntityLivingBase target = getAttackTarget(); - - + + if (target != null && target.getDistanceSq(this) < ADIST2) { faceEntity(target, 10.0F, (float) getVerticalFaceSpeed()); - + double var11 = target.posX + target.motionX - posX; - double var13 = target.getEntityBoundingBox().minY - + target.motionY - + (double) (target.height / 4.0F) - posY; + double var13 = target.getEntityBoundingBox().minY + target.motionY + (double) (target.height / 4.0F) - posY; double var15 = target.posZ + target.motionZ - posZ; renderYawOffset = rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - + if (this.canEntityBeSeen(target)) { this.attackCounter++; - + int bar = 0; - - if (world.getDifficulty() == EnumDifficulty.EASY) - bar = 1; - if (world.getDifficulty() == EnumDifficulty.NORMAL) - bar = 2; - if (world.getDifficulty() == EnumDifficulty.HARD) - bar = 3; - + + if (world.getDifficulty() == EnumDifficulty.EASY) bar = 1; + if (world.getDifficulty() == EnumDifficulty.NORMAL) bar = 2; + if (world.getDifficulty() == EnumDifficulty.HARD) bar = 3; + if (this.attackCounter >= (15 - (bar * 2))) { PotionEffect[] foo = this.defineEyeRay(); EntityEyeRay ray = new EntityEyeRay(world, this); @@ -291,15 +245,15 @@ public void doAttack() { world.spawnEntity(ray); attackCounter = (-55 + (bar * 5)); } - } else if (this.attackCounter > 0) { - --attackCounter; } - } else { - renderYawOffset = rotationYaw = - -((float) Math.atan2(motionX, motionZ)) * 180.0F / (float) Math.PI; - - if (attackCounter > 0) + else if (this.attackCounter > 0) { --attackCounter; + } + } + else { + renderYawOffset = rotationYaw = -((float) Math.atan2(motionX, motionZ)) * 180.0F / (float) Math.PI; + + if (attackCounter > 0) --attackCounter; } } } diff --git a/src/main/java/com/gw/dm/entity/EntityBladeTrap.java b/src/main/java/com/gw/dm/entity/EntityBladeTrap.java index eb13948..8d21c3b 100644 --- a/src/main/java/com/gw/dm/entity/EntityBladeTrap.java +++ b/src/main/java/com/gw/dm/entity/EntityBladeTrap.java @@ -5,7 +5,6 @@ import com.gw.dm.util.AudioHandler; import com.gw.dm.util.ConfigHandler; import com.gw.dm.util.MiscRegistrar; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -28,12 +27,12 @@ public class EntityBladeTrap extends EntityLiving { public int moveTime = 0; public int attackTimer = 0; private int[] dir = {0, 0, 0}; - + public EntityBladeTrap(World par1World) { super(par1World); setSize(0.98F, 0.98F); } - + public EntityBladeTrap(World w, double x, double y, double z) { super(w); setSize(0.98F, 0.98F); @@ -41,88 +40,83 @@ public EntityBladeTrap(World w, double x, double y, double z) { posY = y; posZ = z; } - + protected void applyEntityAttributes() { super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(100.0D - * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(100.0D * ConfigHandler.healthx); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.0D); getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1.0D); } - - - public void setDirection(int[] d) { - dir = d; - } - - - protected boolean canTriggerWalking() { - return false; + + @Override + protected void entityInit() { + super.entityInit(); + // FIXME: What did this do, and do I need it? + //dataWatcher.addObject(16, new Byte((byte)0)); } - - - public boolean canBeCollidedWith() { - return false; + + @Override + public int getTalkInterval() { + return 20; } - - + public void onUpdate() { prevPosX = posX; prevPosY = posY; prevPosZ = posZ; ++moveTime; ++attackTimer; - - if (attackTimer > 11) - attackTimer = 11; - + + if (attackTimer > 11) attackTimer = 11; + motionX += (0.12d * dir[0]); motionY += (0.12d * dir[1]); motionZ += (0.12d * dir[2]); - + move(MoverType.SELF, motionX, motionY, motionZ); motionX *= 0.9800000190734863d; motionY *= 0.9800000190734863d; motionZ *= 0.9800000190734863d; - + BlockPos where; if (!world.isRemote) { int i = MathHelper.floor(posX); int j = MathHelper.floor(posY); int k = MathHelper.floor(posZ); - + where = new BlockPos(i, j, k); - + if (!BlockBladeTrap.canMoveInto(world, i + dir[0], j + dir[1], k + dir[2])) { world.setBlockState(where, MiscRegistrar.blockBladeTrap.getDefaultState(), 3); setDead(); - } else if (moveTime > 40) { + } + else if (moveTime > 40) { world.setBlockState(where, MiscRegistrar.blockBladeTrap.getDefaultState(), 3); setDead(); } } - + if (attackTimer > 10) { boolean flag = false; - + List foo = null; - + try { foo = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox()); - } catch (NullPointerException e) { + } + catch (NullPointerException e) { flag = true; } - + if (!flag && !(foo == null) && !foo.isEmpty()) { Iterator iter = foo.iterator(); - + while (iter.hasNext()) { Entity bar = (Entity) iter.next(); - playSound(AudioHandler.entityBladeTrapBlade, 1.0F, - (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F); - + playSound(AudioHandler.entityBladeTrapBlade, 1.0F, (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F); + float dmgValue = ConfigHandler.damagex; - + switch (world.getDifficulty()) { case EASY: dmgValue = 2 * ConfigHandler.damagex; @@ -143,26 +137,59 @@ public void onUpdate() { } } } - - + @Override - public void jump() {/*Do Nothing*/} - - + protected SoundEvent getAmbientSound() { + return AudioHandler.entityBladeTrapAmbient; + } + @Override - public void fall(float distance, float damageMultiplier) {/*NA*/} - - + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + super.writeEntityToNBT(par1NBTTagCompound); + + par1NBTTagCompound.setInteger("moveTime", moveTime); + par1NBTTagCompound.setInteger("atkTime", attackTimer); + + par1NBTTagCompound.setInteger("d0", dir[0]); + par1NBTTagCompound.setInteger("d1", dir[1]); + par1NBTTagCompound.setInteger("d2", dir[2]); + } + @Override - public boolean canRenderOnFire() { + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + + moveTime = par1NBTTagCompound.getInteger("moveTime"); + attackTimer = par1NBTTagCompound.getInteger("atkTime"); + + dir[0] = par1NBTTagCompound.getInteger("d0"); + dir[1] = par1NBTTagCompound.getInteger("d1"); + dir[2] = par1NBTTagCompound.getInteger("d2"); + } + + /* + * Apparently these once had spawning logic, but it was removed. + * This is probably the way it should be -- they should be placed + * by world-gen (in block for), not spawn in randomly in explored + * areas (or someone's base). + */ + @Override + public boolean getCanSpawnHere() { return false; } - - + + public void setDirection(int[] d) { + dir = d; + } + + protected boolean canTriggerWalking() { + return false; + } + @Override public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { int dmgValue = 4; - + switch (world.getDifficulty()) { case EASY: dmgValue += 2; @@ -179,97 +206,50 @@ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { } par1EntityPlayer.attackEntityFrom(DungeonMobsDamageSource.BLADE_TRAP, dmgValue); } - - + @Override - public boolean attackEntityFrom(DamageSource source, float amount) { + public boolean canRenderOnFire() { return false; } - - - @Override - protected void entityInit() { - super.entityInit(); - // FIXME: What did this do, and do I need it? - //dataWatcher.addObject(16, new Byte((byte)0)); - } - - + @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - par1NBTTagCompound.setInteger("moveTime", moveTime); - par1NBTTagCompound.setInteger("atkTime", attackTimer); - - par1NBTTagCompound.setInteger("d0", dir[0]); - par1NBTTagCompound.setInteger("d1", dir[1]); - par1NBTTagCompound.setInteger("d2", dir[2]); - } - - - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - moveTime = par1NBTTagCompound.getInteger("moveTime"); - attackTimer = par1NBTTagCompound.getInteger("atkTime"); - - dir[0] = par1NBTTagCompound.getInteger("d0"); - dir[1] = par1NBTTagCompound.getInteger("d1"); - dir[2] = par1NBTTagCompound.getInteger("d2"); - } - - - @Override - protected SoundEvent getAmbientSound() { - return AudioHandler.entityBladeTrapAmbient; + public boolean attackEntityFrom(DamageSource source, float amount) { + return false; } - - + @Override protected SoundEvent getHurtSound(DamageSource src) { return AudioHandler.entityBladeTrapHurt; } - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityBladeTrapDeath; } - - + @Override - public int getTalkInterval() { - return 20; - } - - - /* - * Apparently these once had spawning logic, but it was removed. - * This is probably the way it should be -- they should be placed - * by world-gen (in block for), not spawn in randomly in explored - * areas (or someone's base). - */ + public void fall(float distance, float damageMultiplier) {/*NA*/} + @Override - public boolean getCanSpawnHere() { + public void jump() {/*Do Nothing*/} + + public boolean canBeCollidedWith() { return false; } - - + private boolean tooManyTrapsNearby(int x, int y, int z) { int count = 0; int max = 4; - + for (int i = -6; i < 6; i++) for (int j = -6; j < 6; j++) for (int k = -6; k < 6; k++) { int foo = y + j; - + if (foo < 1) { foo = 1; } - if (world.getBlockState(new BlockPos(x + i, foo, z + k)).getBlock() - == MiscRegistrar.blockBladeTrap) { + if (world.getBlockState(new BlockPos(x + i, foo, z + k)).getBlock() == MiscRegistrar.blockBladeTrap) { count++; } } @@ -283,20 +263,17 @@ private boolean tooManyTrapsNearby(int x, int y, int z) { max += 3; } */ - - if (count > max) - return true; - else - return false; + + if (count > max) return true; + else return false; } - - + + public boolean findNearbyMoss(int x, int y, int z) { for (int i = -4; i < 4; i++) { for (int j = -4; j < 4; j++) { for (int k = -4; k < 4; k++) { - Block toTest = world.getBlockState(new - BlockPos(x + i, y + j, z + k)).getBlock(); + Block toTest = world.getBlockState(new BlockPos(x + i, y + j, z + k)).getBlock(); if (toTest == Blocks.STONEBRICK) { return true; } @@ -305,5 +282,5 @@ public boolean findNearbyMoss(int x, int y, int z) { } return false; } - + } \ No newline at end of file diff --git a/src/main/java/com/gw/dm/entity/EntityCaveFisher.java b/src/main/java/com/gw/dm/entity/EntityCaveFisher.java index 4badb72..4341e6e 100644 --- a/src/main/java/com/gw/dm/entity/EntityCaveFisher.java +++ b/src/main/java/com/gw/dm/entity/EntityCaveFisher.java @@ -1,11 +1,9 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.caveFisherIg; - -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.client.entity.EntityOtherPlayerMP; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -25,22 +23,23 @@ import net.minecraft.world.World; import net.minecraftforge.fml.client.FMLClientHandler; -import com.gw.dm.DungeonMobs; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import java.util.Iterator; +import java.util.List; +import java.util.StringTokenizer; +import static com.gw.dm.util.ConfigHandler.caveFisherIg; -public class EntityCaveFisher extends EntitySpider { +public class EntityCaveFisher extends EntitySpider { + protected static String mobName = DungeonMobs.MODID + ":" + "dmcavefisher"; public boolean ignoreHeight; public float myAngles[] = new float[4]; private int stringTimer; private int grabTimer; private EntityPlayer myTarget; - - + + public EntityCaveFisher(World par1World) { super(par1World); setSize(1.4F, 0.9F); @@ -48,230 +47,227 @@ public EntityCaveFisher(World par1World) { stringTimer = 0; grabTimer = 0; ignoreHeight = false; - + for (int i = 0; i < 4; i++) { myAngles[i] = 0.0F; } } - - + + @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D - * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D * ConfigHandler.healthx); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.6D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D * ConfigHandler.damagex + ConfigHandler.damageplus); getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); } - - - @Override - public int getTotalArmorValue() { - return 8; - } - - - public int getAttackStrength(Entity entity) { - return 4; - } - - + @Override protected SoundEvent getAmbientSound() { return AudioHandler.entityCaveFisherAmbient; } - - + @Override protected SoundEvent getHurtSound(DamageSource src) { return AudioHandler.entityCaveFisherHurt; } - - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityCaveFisherDeath; } - - @Override - public int getTalkInterval() { - return 60; - } - + @Override public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.ARTHROPOD; } - - + @Override - public boolean getCanSpawnHere() { - if (caveFisherIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { - return false; - } - if (posY > 48.0D && !ignoreHeight) { - return false; - } - return super.getCanSpawnHere(); + public int getTotalArmorValue() { + return 8; } - - + + public int getAttackStrength(Entity entity) { + return 4; + } + + @Override + public int getTalkInterval() { + return 60; + } + @Override protected void dropFewItems(boolean par1, int par2) { int var3; int var4; - + var3 = rand.nextInt(5) + 1; - + for (var4 = 0; var4 < var3; var4++) { dropItem(Items.STRING, 1); } } - - + + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + super.writeEntityToNBT(par1NBTTagCompound); + + par1NBTTagCompound.setInteger("StringTimer", stringTimer); + par1NBTTagCompound.setInteger("GrabTimer", grabTimer); + } + + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + + stringTimer = par1NBTTagCompound.getInteger("StringTimer"); + grabTimer = par1NBTTagCompound.getInteger("GrabTimer"); + } + protected Entity findPlayerToAttack() { double var2 = 16.0D; - + EntityPlayer foo = world.getClosestPlayerToEntity(this, var2); - + if (foo == null) { - List bar = world.getEntitiesWithinAABB(EntityBat.class, - getEntityBoundingBox().expand(16.0F, 8.0F, 16.0F)); + List bar = world.getEntitiesWithinAABB(EntityBat.class, getEntityBoundingBox().expand(16.0F, 8.0F, 16.0F)); Iterator iter = bar.iterator(); - - if (iter.hasNext()) - return (Entity) iter.next(); - + + if (iter.hasNext()) return (Entity) iter.next(); + bar = null; } - + return foo; } - - + public void onLivingUpdate() { stringTimer++; - + int foo = 160 - (DungeonMobsHelper.getDifficulty(world) * 20); - + if (stringTimer - foo > 0) { if (getAttackTarget() != null && canEntityBeSeen(getAttackTarget())) { int tarX = (int) getAttackTarget().posX; int tarY = (int) (getAttackTarget().posY + 0.5); int tarZ = (int) getAttackTarget().posZ; - + if (world.isAirBlock(new BlockPos(tarX, tarY, tarZ))) { - world.setBlockState(new BlockPos(tarX, tarY, tarZ), - Blocks.WEB.getDefaultState(), 3); - + world.setBlockState(new BlockPos(tarX, tarY, tarZ), Blocks.WEB.getDefaultState(), 3); + if (DungeonMobsHelper.getDifficulty(world) > 2) { if (world.isAirBlock(new BlockPos(tarX - 1, tarY, tarZ))) { - world.setBlockState(new BlockPos(tarX - 1, tarY, tarZ), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX - 1, tarY, tarZ), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX + 1, tarY, tarZ))) { - world.setBlockState(new BlockPos(tarX + 1, tarY, tarZ), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX + 1, tarY, tarZ), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX, tarY, tarZ - 1))) { - world.setBlockState(new BlockPos(tarX, tarY, tarZ - 1), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX, tarY, tarZ - 1), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX, tarY, tarZ + 1))) { - world.setBlockState(new BlockPos(tarX, tarY, tarZ + 1), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX, tarY, tarZ + 1), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX, tarY + 1, tarZ))) { - world.setBlockState(new BlockPos(tarX, tarY + 1, tarZ), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX, tarY + 1, tarZ), Blocks.WEB.getDefaultState(), 3); } } } - } else { + } + else { int tarX = (int) posX; int tarY = (int) (posY + 0.5); int tarZ = (int) posZ; - + if (world.isAirBlock(new BlockPos(tarX, tarY, tarZ))) { - world.setBlockState(new BlockPos(tarX, tarY, tarZ), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX, tarY, tarZ), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX - 1, tarY, tarZ))) { - world.setBlockState(new BlockPos(tarX - 1, tarY, tarZ), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX - 1, tarY, tarZ), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX + 1, tarY, tarZ))) { - world.setBlockState(new BlockPos(tarX + 1, tarY, tarZ), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX + 1, tarY, tarZ), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX, tarY, tarZ - 1))) { - world.setBlockState(new BlockPos(tarX, tarY, tarZ - 1), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX, tarY, tarZ - 1), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX, tarY, tarZ + 1))) { - world.setBlockState(new BlockPos(tarX, tarY, tarZ + 1), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX, tarY, tarZ + 1), Blocks.WEB.getDefaultState(), 3); } if (world.isAirBlock(new BlockPos(tarX, tarY + 1, tarZ))) { - world.setBlockState(new BlockPos(tarX, tarY + 1, tarZ), - Blocks.WEB.getDefaultState(), 3); + world.setBlockState(new BlockPos(tarX, tarY + 1, tarZ), Blocks.WEB.getDefaultState(), 3); } } - + stringTimer = 0; } - + if (getAttackTarget() != null && canEntityBeSeen(getAttackTarget())) { grabTimer++; - + int bork = rand.nextInt(4 - DungeonMobsHelper.getDifficulty(world)); - + if (grabTimer >= (foo * 3)) { if (bork == 0) { double difX = getAttackTarget().posX - posX; double difZ; - for (difZ = getAttackTarget().posZ - posZ; - difX * difX + difZ * difZ < 1.0E-4D; - difZ = (Math.random() - Math.random()) * 0.01D) { - difX = (Math.random() - Math.random()) * 0.01D; + for (difZ = getAttackTarget().posZ - posZ; difX * difX + difZ * difZ < 1.0E-4D; difZ = (Math.random() - Math.random()) * 0.01D) { + difX = (Math.random() - Math.random()) * 0.01D; } - + if (!(getAttackTarget() instanceof EntityPlayer)) { grabTarget(getAttackTarget(), difX, difZ); - } else { + } + else { EntityPlayer player = (EntityPlayer) getAttackTarget(); - + if (!player.capabilities.isCreativeMode) { //if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) if (!(getAttackTarget() instanceof EntityPlayerMP)) { int playerID = FMLClientHandler.instance().getClient().player.getEntityId(); int targetID = getAttackTarget().getEntityId(); - + if (playerID == targetID) { - grabTarget(FMLClientHandler.instance().getClient().player, - difX, difZ); + grabTarget(FMLClientHandler.instance().getClient().player, difX, difZ); } - } else { - DungeonMobsHelper.sendKnockBackPacket((EntityPlayerMP) getAttackTarget(), - difX, difZ); + } + else { + DungeonMobsHelper.sendKnockBackPacket((EntityPlayerMP) getAttackTarget(), difX, difZ); } } } } - + grabTimer = 0; } } - + super.onLivingUpdate(); } - - + + @Override + public boolean attackEntityFrom(DamageSource src, float amount) { + if (src.getTrueSource() instanceof EntityLivingBase) { + setAttackTarget((EntityLivingBase) src.getTrueSource()); + } + return super.attackEntityFrom(src, amount); + } + + @Override + public boolean getCanSpawnHere() { + if (caveFisherIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { + return false; + } + if (posY > 48.0D && !ignoreHeight) { + return false; + } + return super.getCanSpawnHere(); + } + public void grabTarget(EntityOtherPlayerMP ent, double x, double z) { ent.isAirBorne = true; float var7 = MathHelper.sqrt(x * x + z * z); @@ -282,13 +278,12 @@ public void grabTarget(EntityOtherPlayerMP ent, double x, double z) { ent.motionX -= x / (double) var7 * (double) var8; ent.motionY += (double) var8; ent.motionZ -= z / (double) var7 * (double) var8; - + if (ent.motionY > 0.4000000059604645D) { ent.motionY = 0.4000000059604645D; } } - - + public void grabTarget(EntityPlayerMP ent, double x, double z) { // PURE! ent.isAirBorne = true; @@ -300,13 +295,12 @@ public void grabTarget(EntityPlayerMP ent, double x, double z) { ent.motionX -= x / (double) var7 * (double) var8; ent.motionY += (double) var8; ent.motionZ -= z / (double) var7 * (double) var8; - + if (ent.motionY > 0.4000000059604645D) { ent.motionY = 0.4000000059604645D; } } - - + public void grabTarget(Entity ent, double x, double z) { ent.isAirBorne = true; float var7 = MathHelper.sqrt(x * x + z * z); @@ -317,56 +311,28 @@ public void grabTarget(Entity ent, double x, double z) { ent.motionX -= x / (double) var7 * (double) var8; ent.motionY += (double) var8; ent.motionZ -= z / (double) var7 * (double) var8; - + if (ent.motionY > 0.4000000059604645D) { ent.motionY = 0.4000000059604645D; } } - - - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - par1NBTTagCompound.setInteger("StringTimer", stringTimer); - par1NBTTagCompound.setInteger("GrabTimer", grabTimer); - } - - - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - stringTimer = par1NBTTagCompound.getInteger("StringTimer"); - grabTimer = par1NBTTagCompound.getInteger("GrabTimer"); - } - - - @Override - public boolean attackEntityFrom(DamageSource src, float amount) { - if (src.getTrueSource() instanceof EntityLivingBase) { - setAttackTarget((EntityLivingBase) src.getTrueSource()); - } - return super.attackEntityFrom(src, amount); - } - - + public String getRegistryName() { if (mobName == null) fixNameIfNull(); return mobName; } - - + + public void setRegistryName(String name) { mobName = (DungeonMobs.MODID + ":" + name).trim().toLowerCase(); } - - + + private void fixNameIfNull() { - StringTokenizer fixer = new StringTokenizer(this.getName() - .trim().toLowerCase(), "."); + StringTokenizer fixer = new StringTokenizer(this.getName().trim().toLowerCase(), "."); do { mobName = fixer.nextToken(); - } while (fixer.hasMoreTokens()); + } + while (fixer.hasMoreTokens()); } } diff --git a/src/main/java/com/gw/dm/entity/EntityCockatrice.java b/src/main/java/com/gw/dm/entity/EntityCockatrice.java index f5b78c5..d3feaf9 100644 --- a/src/main/java/com/gw/dm/entity/EntityCockatrice.java +++ b/src/main/java/com/gw/dm/entity/EntityCockatrice.java @@ -1,18 +1,14 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.cockatriceIg; - -import java.util.StringTokenizer; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.DungeonMobsDamageSource; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -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.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -21,12 +17,9 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.DungeonMobsDamageSource; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import java.util.StringTokenizer; + +import static com.gw.dm.util.ConfigHandler.cockatriceIg; public class EntityCockatrice extends EntityDungeonMob { private static String mobName; @@ -35,176 +28,158 @@ public class EntityCockatrice extends EntityDungeonMob { private EntityPetrified stonedPlayer; private boolean incoming; private boolean waitTick; - + public EntityCockatrice(World par1World) { super(par1World); experienceValue = 15; ignoreHeight = false; setSize(1.2F, 1.5F); - - if (world != null) - stoneChance = 6 * DungeonMobsHelper.getDifficulty(world); - else - stoneChance = 15; - + + if (world != null) stoneChance = 6 * DungeonMobsHelper.getDifficulty(world); + else stoneChance = 15; + incoming = false; stonedPlayer = null; waitTick = false; - + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackMelee(this, 1.0F, false)); tasks.addTask(3, new EntityAIWander(this, 1.0F)); tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(4, new EntityAILookIdle(this)); targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); + targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(25.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - - + @Override public int getTotalArmorValue() { return 2; } - - + @Override - public boolean getCanSpawnHere() { - if (cockatriceIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); + public int getTalkInterval() { + return 80; + } + + @Override + public void onEntityUpdate() { + super.onEntityUpdate(); + + if (incoming && !world.isRemote) { + if (waitTick) { + waitTick = false; + } + else { + world.spawnEntity(stonedPlayer); + + incoming = false; + stonedPlayer = null; + } } - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) - return false; - - if (posY > 64.0D && !ignoreHeight) - return false; - - return super.getCanSpawnHere(); } - - + + @Override + protected SoundEvent getAmbientSound() { + return AudioHandler.entityCockatriceAmbient; + } + @Override protected void dropFewItems(boolean par1, int par2) { int var3; int var5; - + var3 = rand.nextInt(3); - + for (var5 = 0; var5 < var3; var5++) { dropItem(Items.FEATHER, 1); } } - - + + @Override + protected SoundEvent getHurtSound(DamageSource src) { + return AudioHandler.entityCockatriceHurt; + } + + @Override + protected SoundEvent getDeathSound() { + return AudioHandler.entityCockatriceDeath; + } + @Override public boolean attackEntityAsMob(Entity ent) { int moo = world.rand.nextInt(100) + 1; - - if ((moo < stoneChance) - && (ent instanceof EntityPlayer) - && (!world.isRemote) - && (ent.ticksExisted > 100)) { + + if ((moo < stoneChance) && (ent instanceof EntityPlayer) && (!world.isRemote) && (ent.ticksExisted > 100)) { EntityPlayer cow = (EntityPlayer) ent; - + if (!cow.capabilities.isCreativeMode) { super.playSound(AudioHandler.entityCockatriceStone, 1.0f, 1.0f); - + EntityPetrified foo = new EntityPetrified(world); EntityPlayer bar = (EntityPlayer) ent; - + foo.setLocationAndAngles(bar.posX, bar.posY, bar.posZ, bar.rotationYaw, bar.rotationPitch); - + foo.setStuff(bar); - + bar.attackEntityFrom(DungeonMobsDamageSource.PETRIFIED, 1024); - + incoming = true; waitTick = true; stonedPlayer = foo; } - } else if (moo < stoneChance && !world.isRemote) { + } + else if (moo < stoneChance && !world.isRemote) { int a = (int) ent.posX; int b = (int) ent.getEntityBoundingBox().minY; int c = (int) ent.posZ; - + ent.setDead(); super.playSound(AudioHandler.entityCockatriceStone, 1.0f, 1.0f); - + world.setBlockState(new BlockPos(a, b, c), Blocks.STONE.getDefaultState()); world.setBlockState(new BlockPos(a, b + 1, c), Blocks.STONE.getDefaultState()); } return super.attackEntityAsMob(ent); } - - - @Override - public int getTalkInterval() { - return 80; - } - - + @Override - protected SoundEvent getAmbientSound() { - return AudioHandler.entityCockatriceAmbient; - } - - - @Override - protected SoundEvent getHurtSound(DamageSource src) { - return AudioHandler.entityCockatriceHurt; - } - - - @Override - protected SoundEvent getDeathSound() { - return AudioHandler.entityCockatriceDeath; + public boolean getCanSpawnHere() { + if (cockatriceIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) return false; + + if (posY > 64.0D && !ignoreHeight) return false; + + return super.getCanSpawnHere(); } - + @Override - public void onEntityUpdate() { - super.onEntityUpdate(); - - if (incoming && !world.isRemote) { - if (waitTick) { - waitTick = false; - } else { - world.spawnEntity(stonedPlayer); - - incoming = false; - stonedPlayer = null; - } - } + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(25.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); } - - + public String getRegistryName() { if (mobName == null) fixNameIfNull(); return mobName; } - - + + public void setRegistryName(String name) { mobName = (DungeonMobs.MODID + ":" + name).trim().toLowerCase(); } - - + + private void fixNameIfNull() { - StringTokenizer fixer = new StringTokenizer(this.getName() - .trim().toLowerCase(), "."); + StringTokenizer fixer = new StringTokenizer(this.getName().trim().toLowerCase(), "."); do { mobName = fixer.nextToken(); - } while (fixer.hasMoreTokens()); + } + while (fixer.hasMoreTokens()); } } diff --git a/src/main/java/com/gw/dm/entity/EntityDestrachan.java b/src/main/java/com/gw/dm/entity/EntityDestrachan.java index b8ae1cb..3777ba7 100644 --- a/src/main/java/com/gw/dm/entity/EntityDestrachan.java +++ b/src/main/java/com/gw/dm/entity/EntityDestrachan.java @@ -1,22 +1,13 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.destrachanIg; - -import java.util.StringTokenizer; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -import net.minecraft.entity.ai.EntityAIAttackRanged; -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 com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.projectile.EntitySonicBoom; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.potion.PotionEffect; @@ -25,12 +16,9 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.projectile.EntitySonicBoom; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import java.util.StringTokenizer; + +import static com.gw.dm.util.ConfigHandler.destrachanIg; public class EntityDestrachan extends EntityDungeonMob implements IRangedAttackMob { private static String mobName = DungeonMobs.MODID + ":dmdestrachan"; @@ -41,104 +29,108 @@ public class EntityDestrachan extends EntityDungeonMob implements IRangedAttackM public boolean isRanged; public boolean ignoreHeight; private int resetAttackTimer; - + public EntityDestrachan(World par1World) { super(par1World); experienceValue = 35; resetAttackTimer = 0; setSize(1.9F, 1.7F); ignoreHeight = false; - + isRanged = true; - + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, rangedAttack); tasks.addTask(3, new EntityAIWander(this, 1.0D)); tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 12.0F)); tasks.addTask(4, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); + targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(24.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - - + protected boolean isAIEnabled() { return true; } - - + + public int getAttackStrength(Entity par1Entity) { + return 4; + } + + @Override + public boolean isPotionApplicable(PotionEffect par1PotionEffect) { + return par1PotionEffect.getEffectName().equals("blindness") ? false : super.isPotionApplicable(par1PotionEffect); + } + @Override public int getTotalArmorValue() { return 6; } - - - public int getAttackStrength(Entity par1Entity) { - return 4; + + public void resetAttackType() { + tasks.removeTask(rangedAttack); + tasks.removeTask(meleeAttack); + + EntityLivingBase theTarget = getAttackTarget(); + if (theTarget == null) { + tasks.addTask(2, rangedAttack); + isRanged = true; + } + else { + double chkX = theTarget.posX - posX; + double chkY = theTarget.posY - posY; + double chkZ = theTarget.posZ - posZ; + + if (((chkX * chkX) + (chkY * chkY) + (chkZ * chkZ)) < 12.0D) { + tasks.addTask(2, meleeAttack); + isRanged = false; + } + else { + tasks.addTask(2, rangedAttack); + isRanged = true; + } + } } - - + @Override - public int getTalkInterval() { - return 100; + public void attackEntityWithRangedAttack(EntityLivingBase target, float lol) { + double vx = target.posX + target.motionX - posX; + double vy = target.getEntityBoundingBox().minY + target.motionY + target.height - getEntityBoundingBox().maxY; + double vz = target.posZ + target.motionZ - posZ; + + EntitySonicBoom sonicBoom = new EntitySonicBoom(world, (EntityLiving) this, vx, vy, vz); + world.spawnEntity(sonicBoom); + playSound(AudioHandler.entityDestrachanStep, 1.0f, 1.0f); } - - + @Override - protected SoundEvent getAmbientSound() { - if (rand.nextInt(4) == 0) { - return AudioHandler.entityDestrachanDeath; - } - return AudioHandler.entityDestrachanAmbient; + public void setSwingingArms(boolean swingingArms) { } - - + @Override - protected SoundEvent getHurtSound(DamageSource src) { - return AudioHandler.entityDestrachanHurt; + public boolean canAttackClass(Class par1Class) { + return EntityDestrachan.class != par1Class; } - - + @Override - protected SoundEvent getDeathSound() { - return AudioHandler.entityDestrachanDeath; + public int getTalkInterval() { + return 100; } - - + @Override - public boolean getCanSpawnHere() { - if (destrachanIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { - return false; - } - if (posY > 36.0D && !ignoreHeight) { - return false; + protected SoundEvent getAmbientSound() { + if (rand.nextInt(4) == 0) { + return AudioHandler.entityDestrachanDeath; } - return super.getCanSpawnHere(); + return AudioHandler.entityDestrachanAmbient; } - - + @Override protected void dropFewItems(boolean par1, int par2) { int var3; int var4; - + var3 = rand.nextInt(2); - + for (var4 = 0; var4 < var3; var4++) { switch (rand.nextInt(2)) { case (0): @@ -152,87 +144,64 @@ protected void dropFewItems(boolean par1, int par2) { } } } - - + @Override - public boolean isPotionApplicable(PotionEffect par1PotionEffect) { - return par1PotionEffect.getEffectName().equals("blindness") ? false : - super.isPotionApplicable(par1PotionEffect); - } - - - public void resetAttackType() { - tasks.removeTask(rangedAttack); - tasks.removeTask(meleeAttack); - - EntityLivingBase theTarget = getAttackTarget(); - if (theTarget == null) { - tasks.addTask(2, rangedAttack); - isRanged = true; - } else { - double chkX = theTarget.posX - posX; - double chkY = theTarget.posY - posY; - double chkZ = theTarget.posZ - posZ; - - if (((chkX * chkX) + (chkY * chkY) + (chkZ * chkZ)) < 12.0D) { - tasks.addTask(2, meleeAttack); - isRanged = false; - } else { - tasks.addTask(2, rangedAttack); - isRanged = true; - } + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.isExplosion()) { + return false; } + return super.attackEntityFrom(source, amount); } - - + @Override - public void attackEntityWithRangedAttack(EntityLivingBase target, float lol) { - double vx = target.posX + target.motionX - posX; - double vy = target.getEntityBoundingBox().minY + target.motionY + target.height - - getEntityBoundingBox().maxY; - double vz = target.posZ + target.motionZ - posZ; - - EntitySonicBoom sonicBoom = new EntitySonicBoom(world, (EntityLiving) this, vx, vy, vz); - world.spawnEntity(sonicBoom); - playSound(AudioHandler.entityDestrachanStep, 1.0f, 1.0f); + protected SoundEvent getHurtSound(DamageSource src) { + return AudioHandler.entityDestrachanHurt; } - - + @Override - public boolean canAttackClass(Class par1Class) { - return EntityDestrachan.class != par1Class; + protected SoundEvent getDeathSound() { + return AudioHandler.entityDestrachanDeath; } - - + @Override - public boolean attackEntityFrom(DamageSource source, float amount) { - if (source.isExplosion()) { + public boolean getCanSpawnHere() { + if (destrachanIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { return false; } - return super.attackEntityFrom(source, amount); + if (posY > 36.0D && !ignoreHeight) { + return false; + } + return super.getCanSpawnHere(); } - + @Override - public void setSwingingArms(boolean swingingArms) { + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(24.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); } - - + public String getRegistryName() { if (mobName == null) fixNameIfNull(); return mobName; } - - + + public void setRegistryName(String name) { mobName = (DungeonMobs.MODID + ":" + name).trim().toLowerCase(); } - - + + private void fixNameIfNull() { - StringTokenizer fixer = new StringTokenizer(this.getName() - .trim().toLowerCase(), "."); + StringTokenizer fixer = new StringTokenizer(this.getName().trim().toLowerCase(), "."); do { mobName = fixer.nextToken(); - } while (fixer.hasMoreTokens()); + } + while (fixer.hasMoreTokens()); } } diff --git a/src/main/java/com/gw/dm/entity/EntityEldermob.java b/src/main/java/com/gw/dm/entity/EntityEldermob.java index 280a88a..11d4f4f 100644 --- a/src/main/java/com/gw/dm/entity/EntityEldermob.java +++ b/src/main/java/com/gw/dm/entity/EntityEldermob.java @@ -1,7 +1,14 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.outerThingIg; -import static com.gw.dm.util.ConfigHandler.outerThingEI; +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonFlying; +import com.gw.dm.ai.AIEldermobMove; +import com.gw.dm.projectile.EntityCloudGenerator; +import com.gw.dm.projectile.EntityEldermobBall; +import com.gw.dm.projectile.EntityFireCloudGenerator; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; @@ -28,26 +35,16 @@ import net.minecraft.world.World; import net.minecraft.world.WorldProviderEnd; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonFlying; -import com.gw.dm.ai.AIEldermobMove; -import com.gw.dm.projectile.EntityCloudGenerator; -import com.gw.dm.projectile.EntityEldermobBall; -import com.gw.dm.projectile.EntityFireCloudGenerator; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.outerThingEI; +import static com.gw.dm.util.ConfigHandler.outerThingIg; -public class EntityEldermob extends EntityDungeonFlying - implements IMob, IRangedAttackMob, IBeMagicMob { +public class EntityEldermob extends EntityDungeonFlying implements IMob, IRangedAttackMob, IBeMagicMob { private static final int SD = 1024 * 1024; - + private static String mobName = DungeonMobs.MODID + ":dmeldermob"; - - private static PotionEffect poison - = new PotionEffect((Potion) Potion.REGISTRY - .getObject(new ResourceLocation("poison")), 300, 0); - + + private static PotionEffect poison = new PotionEffect((Potion) Potion.REGISTRY.getObject(new ResourceLocation("poison")), 300, 0); + public EntityEldermob(World worldIn) { super(worldIn); moveHelper = new AIEldermobMove.EldermobMover(this); @@ -55,8 +52,8 @@ public EntityEldermob(World worldIn) { experienceValue = 65; isImmuneToFire = true; } - - + + @Override public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { if (!world.isRemote) { @@ -66,18 +63,19 @@ public void attackEntityWithRangedAttack(EntityLivingBase target, float distance EntityThrowable ball; int which; - if(ConfigHandler.fireClouds) { + if (ConfigHandler.fireClouds) { which = rand.nextInt(3); - } else { - which = rand.nextInt(2); } - if((which == 2) && (target.isImmuneToFire())) { + else { + which = rand.nextInt(2); + } + if ((which == 2) && (target.isImmuneToFire())) { which--; } - if((which == 1) && target.isEntityUndead()) { + if ((which == 1) && target.isEntityUndead()) { which--; } - switch(which) { + switch (which) { case 0: ball = new EntityEldermobBall(world, this); ball.shoot(dx, dy, dz, 1.2f, 0.0f); @@ -102,92 +100,69 @@ public void attackEntityWithRangedAttack(EntityLivingBase target, float distance } } } - - - @Override - public boolean canBreatheUnderwater() { - return true; - } - - - @Override - public boolean isInLava() { - return false; - } - - - @Override - public boolean isBurning() { - return false; - } - - + @Override - public boolean canBeHitWithPotion() { - return false; - } - - + public void setSwingingArms(boolean swingingArms) {/*The tenticals always writhe...*/} + @Override - protected boolean canDespawn() { + public boolean canBreatheUnderwater() { return true; } - - + @Override - protected SoundEvent getAmbientSound() { - if (rand.nextBoolean()) { - return AudioHandler.entityEldermobA1; - } else { - return AudioHandler.entityEldermobA2; + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.isFireDamage() || source.isMagicDamage()) { + return false; } + Entity entity = source.getTrueSource(); + if (entity == this) { + return false; + } + if ((entity != null) && (entity instanceof EntityLivingBase) && !(entity instanceof EntityEldermob)) { + if ((getAttackTarget() == null) || (rand.nextInt(20) < amount) || (!canEntityBeSeen(getAttackTarget()))) { + setAttackTarget((EntityLivingBase) entity); + } + } + return super.attackEntityFrom(source, amount); } - - + @Override protected SoundEvent getHurtSound(DamageSource src) { return AudioHandler.entityEldermobA3; } - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityEldermobA3; } - - - public int getTalkInterval() { - return 100; + + @Override + protected void damageEntity(DamageSource source, float damageAmount) { + if (source.isFireDamage() || source.isMagicDamage() || (source.getTrueSource() == this)) { + return; + } + super.damageEntity(source, damageAmount); } - - + protected float getSoundVolume() { return 2.5f; } - - + @Override - public void onUpdate() { - if(world.getDifficulty() == EnumDifficulty.PEACEFUL) { - setDead(); - } - if((getAttackTarget() != null) && getAttackTarget().isDead) { - setAttackTarget(null); - } - super.onUpdate(); + public boolean canBeHitWithPotion() { + return false; } - - + @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(32.0d); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(66.0d - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(6.0d); - getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).setBaseValue(1.0d); + public boolean isInLava() { + return false; } - - + + @Override + public boolean isBurning() { + return false; + } + @Override protected void initEntityAI() { // TODO: Movement and attacks @@ -197,88 +172,51 @@ protected void initEntityAI() { tasks.addTask(6, new EntityAILookIdle(this)); targetTasks.addTask(3, new EntityAIFindEntityNearestPlayer(this)); } - - - @Override - public void setSwingingArms(boolean swingingArms) {/*The tenticals always writhe...*/} - - + @Override - public boolean getCanSpawnHere() { - if (world.provider instanceof WorldProviderEnd - && deepEnoughInEnd() && (rand.nextInt(24) == 0)) { - return super.getCanSpawnHere(); - } else if(outerThingIg && !(world.provider instanceof WorldProviderEnd)) { - return super.getCanSpawnHere(); - } - if (DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { - return false; - } - if (posY > 32.0D && !ignoreHeight) { - return false; - } - return super.getCanSpawnHere(); - } - - - /** - * This is too keep them from spawning on the main end island, - * i.e., from interfering with the dragon fight. - * - * @return - */ - private boolean deepEnoughInEnd() { - return outerThingEI || (((posX * posX) + (posZ * posZ)) > SD); + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(32.0d); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(66.0d * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(6.0d); + getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).setBaseValue(1.0d); } + public int getTalkInterval() { + return 100; + } @Override - protected void damageEntity(DamageSource source, float damageAmount) { - if (source.isFireDamage() || source.isMagicDamage() - || (source.getTrueSource() == this)) { - return; + public void onUpdate() { + if (world.getDifficulty() == EnumDifficulty.PEACEFUL) { + setDead(); } - super.damageEntity(source, damageAmount); + if ((getAttackTarget() != null) && getAttackTarget().isDead) { + setAttackTarget(null); + } + super.onUpdate(); } - - @Override - public boolean attackEntityFrom(DamageSource source, float amount) { - if (source.isFireDamage() || source.isMagicDamage()) { - return false; - } - Entity entity = source.getTrueSource(); - if(entity == this) { - return false; + protected SoundEvent getAmbientSound() { + if (rand.nextBoolean()) { + return AudioHandler.entityEldermobA1; } - if ((entity != null) && (entity instanceof EntityLivingBase) - && !(entity instanceof EntityEldermob)) { - if ((getAttackTarget() == null) - || (rand.nextInt(20) < amount) - || (!canEntityBeSeen(getAttackTarget()))) { - setAttackTarget((EntityLivingBase) entity); - } + else { + return AudioHandler.entityEldermobA2; } - return super.attackEntityFrom(source, amount); } - @Override /** * Drop a randomly enchanted book. * * Unlike for many other mobs, this will not be replaced with * the JSON based system, as its needs its own special logic, - * notable for enchanting (unless there is more I don't know + * notable for enchanting (unless there is more I don't know * about the new system, or they enhance it). - */ - protected void dropFewItems(boolean par1, int par2) { - dropItem(Item.getItemFromBlock(Blocks.SLIME_BLOCK), - rand.nextInt(2) + par2); + */ protected void dropFewItems(boolean par1, int par2) { + dropItem(Item.getItemFromBlock(Blocks.SLIME_BLOCK), rand.nextInt(2) + par2); dropItem(Items.ENDER_EYE, rand.nextInt(2) + par2); if (par1) { int var2 = rand.nextInt(DungeonMobsHelper.getDifficulty(world) + 2); @@ -291,6 +229,41 @@ protected void dropFewItems(boolean par1, int par2) { } } } - - + + @Override + protected boolean canDespawn() { + return true; + } + + @Override + public boolean getCanSpawnHere() { + if (world.provider instanceof WorldProviderEnd && deepEnoughInEnd() && (rand.nextInt(24) == 0)) { + return super.getCanSpawnHere(); + } + else if (outerThingIg && !(world.provider instanceof WorldProviderEnd)) { + return super.getCanSpawnHere(); + } + if (DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { + return false; + } + if (posY > 32.0D && !ignoreHeight) { + return false; + } + return super.getCanSpawnHere(); + } + + /** + * This is too keep them from spawning on the main end island, + * i.e., from interfering with the dragon fight. + * + * @return + */ + private boolean deepEnoughInEnd() { + return outerThingEI || (((posX * posX) + (posZ * posZ)) > SD); + } + + } diff --git a/src/main/java/com/gw/dm/entity/EntityFallenAngel.java b/src/main/java/com/gw/dm/entity/EntityFallenAngel.java index a695c21..eb37f04 100644 --- a/src/main/java/com/gw/dm/entity/EntityFallenAngel.java +++ b/src/main/java/com/gw/dm/entity/EntityFallenAngel.java @@ -1,9 +1,14 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.fallenAngelIg; - -import javax.annotation.Nullable; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonFlying; +import com.gw.dm.ai.AIAngelAttack; +import com.gw.dm.ai.AIAngelWander; +import com.gw.dm.ai.TaskAngelAgroOnPlayer; +import com.gw.dm.projectile.EntityLightball; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -27,27 +32,17 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; import net.minecraft.world.WorldProviderHell; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonFlying; -import com.gw.dm.ai.AIAngelAttack; -import com.gw.dm.ai.AIAngelWander; -import com.gw.dm.ai.TaskAngelAgroOnPlayer; -import com.gw.dm.projectile.EntityLightball; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import javax.annotation.Nullable; -public class EntityFallenAngel extends EntityDungeonFlying - implements IMob, IRangedAttackMob, IBeMagicMob { +import static com.gw.dm.util.ConfigHandler.fallenAngelIg; - private static final DataParameter SWINGING_ARMS - = EntityDataManager.createKey(EntityFallenAngel.class, DataSerializers.BOOLEAN); +public class EntityFallenAngel extends EntityDungeonFlying implements IMob, IRangedAttackMob, IBeMagicMob { + + private static final DataParameter SWINGING_ARMS = EntityDataManager.createKey(EntityFallenAngel.class, DataSerializers.BOOLEAN); private static String mobName = DungeonMobs.MODID + ":dmfallenangel"; - - + + public EntityFallenAngel(World worldIn) { super(worldIn); setSize(0.75f, 1.95f); @@ -55,8 +50,8 @@ public EntityFallenAngel(World worldIn) { experienceValue = 65; isImmuneToFire = true; } - - + + @Override protected void initEntityAI() { AIAngelWander motion = new AIAngelWander(this, 1.0); @@ -67,80 +62,39 @@ protected void initEntityAI() { targetTasks.addTask(2, new TaskAngelAgroOnPlayer(this, 24.0d)); targetTasks.addTask(3, new EntityAIFindEntityNearestPlayer(this)); } - - - @Override - protected void entityInit() { - dataManager.register(SWINGING_ARMS, Boolean.valueOf(false)); - super.entityInit(); - } - - + @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(32.0d); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(72.0d - * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(72.0d * ConfigHandler.healthx); getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(12.0d); getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).setBaseValue(7.0d); } - - + @Override - public SoundCategory getSoundCategory() { - return SoundCategory.HOSTILE; + public boolean canAttackClass(Class cls) { + return true; } - - + @Override - public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { - if (!world.isRemote) { - double dx = target.posX - posX; - double dy = (target.posY + (target.height / 2)) - (posY + (height / 2)); - double dz = target.posZ - posZ; - EntityLightball ball = new EntityLightball(world, this); - ball.shoot(dx, dy, dz, 1.2f, 0.0f); - world.spawnEntity(ball); - } + protected void entityInit() { + dataManager.register(SWINGING_ARMS, Boolean.valueOf(false)); + super.entityInit(); } - - + + public int getTalkInterval() { + return 60; + } + @Override public void onUpdate() { - if (!world.isRemote && - (world.getDifficulty() == EnumDifficulty.PEACEFUL)) { + if (!world.isRemote && (world.getDifficulty() == EnumDifficulty.PEACEFUL)) { setDead(); } super.onUpdate(); } - - - @Override - public boolean attackEntityFrom(DamageSource source, float amount) { - Entity entity = source.getTrueSource(); - if ((entity != null) && (entity instanceof EntityLivingBase)) { - if ((getAttackTarget() == null) - || (rand.nextInt(20) < amount) - || (!canEntityBeSeen(getAttackTarget()))) { - setAttackTarget((EntityLivingBase) entity); - } - } - return super.attackEntityFrom(source, amount); - } - - - @Override - public boolean canAttackClass(Class cls) { - return true; - } - - - public int getTalkInterval() { - return 60; - } - - + @Override protected SoundEvent getAmbientSound() { switch (rand.nextInt(4)) { @@ -156,36 +110,53 @@ protected SoundEvent getAmbientSound() { return AudioHandler.entityFallenSing1; } } - - + @Override - protected SoundEvent getHurtSound(DamageSource src) { - return null; + @Nullable + protected Item getDropItem() { + return Item.getByNameOrId("gold_ingot"); // Item.getByNameOrId("diamond"); } - + @Override - protected SoundEvent getDeathSound() { - return null; + public void dropFewItems(boolean wasRecentlyHit, int lootingModifier) { + Item item = Item.getByNameOrId("glowstone_dust"); + int n = rand.nextInt(5) + 3 + lootingModifier; + for (int i = 0; i < n; i++) { + dropItem(item, 1); + } + if (rand.nextInt(DungeonMobsHelper.getDifficulty(world)) == 0) { + ItemStack sword = new ItemStack(Items.GOLDEN_SWORD); + Enchantment ench; + sword.addEnchantment(Enchantment.getEnchantmentByLocation("smite"), rand.nextInt(3) + rand.nextInt(3) + 1); + } + super.dropFewItems(wasRecentlyHit, lootingModifier); } - - - protected float getSoundVolume() { - return 2.5f; + + @Override + public SoundCategory getSoundCategory() { + return SoundCategory.HOSTILE; } - - + @Override - @Nullable - protected Item getDropItem() { - return Item.getByNameOrId("gold_ingot"); // Item.getByNameOrId("diamond"); + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { + if (!world.isRemote) { + double dx = target.posX - posX; + double dy = (target.posY + (target.height / 2)) - (posY + (height / 2)); + double dz = target.posZ - posZ; + EntityLightball ball = new EntityLightball(world, this); + ball.shoot(dx, dy, dz, 1.2f, 0.0f); + world.spawnEntity(ball); + } } - - + + @Override + public void setSwingingArms(boolean swingingArms) { + dataManager.set(SWINGING_ARMS, Boolean.valueOf(swingingArms)); + } + @Override public boolean getCanSpawnHere() { - if(fallenAngelIg - || (world.provider instanceof WorldProviderHell) - || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + if (fallenAngelIg || (world.provider instanceof WorldProviderHell) || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { return super.getCanSpawnHere(); } if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { @@ -196,47 +167,47 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + @Override - public void dropFewItems(boolean wasRecentlyHit, int lootingModifier) { - Item item = Item.getByNameOrId("glowstone_dust"); - int n = rand.nextInt(5) + 3 + lootingModifier; - for (int i = 0; i < n; i++) { - dropItem(item, 1); - } - if (rand.nextInt(DungeonMobsHelper.getDifficulty(world)) == 0) { - ItemStack sword = new ItemStack(Items.GOLDEN_SWORD); - Enchantment ench; - sword.addEnchantment(Enchantment.getEnchantmentByLocation("smite"), - rand.nextInt(3) + rand.nextInt(3) + 1); + public boolean canBreatheUnderwater() { + return true; + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + Entity entity = source.getTrueSource(); + if ((entity != null) && (entity instanceof EntityLivingBase)) { + if ((getAttackTarget() == null) || (rand.nextInt(20) < amount) || (!canEntityBeSeen(getAttackTarget()))) { + setAttackTarget((EntityLivingBase) entity); + } } - super.dropFewItems(wasRecentlyHit, lootingModifier); + return super.attackEntityFrom(source, amount); } - - + @Override - public boolean canBreatheUnderwater() { - return true; + protected SoundEvent getHurtSound(DamageSource src) { + return null; } - - + @Override - public void setSwingingArms(boolean swingingArms) { - dataManager.set(SWINGING_ARMS, Boolean.valueOf(swingingArms)); + protected SoundEvent getDeathSound() { + return null; } - - + + protected float getSoundVolume() { + return 2.5f; + } + public boolean areArmsUp() { return ((Boolean) dataManager.get(SWINGING_ARMS)).booleanValue(); } - - -// @SideOnly(Side.CLIENT) -// @Override -// public int getBrightnessForRender() { -// return 0xf000f0; -// } - - + + + // @SideOnly(Side.CLIENT) + // @Override + // public int getBrightnessForRender() { + // return 0xf000f0; + // } + + } diff --git a/src/main/java/com/gw/dm/entity/EntityGhost.java b/src/main/java/com/gw/dm/entity/EntityGhost.java index 6eca51a..1daf2b5 100644 --- a/src/main/java/com/gw/dm/entity/EntityGhost.java +++ b/src/main/java/com/gw/dm/entity/EntityGhost.java @@ -1,19 +1,16 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.ghostIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.DungeonMobsDamageSource; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; -import net.minecraft.entity.ai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWanderAvoidWater; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.boss.EntityWither; -import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -27,181 +24,172 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import com.gw.dm.DungeonMobs; -import com.gw.dm.DungeonMobsDamageSource; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.ghostIg; -public class EntityGhost extends EntityDungeonMob implements IBeMagicMob { +public class EntityGhost extends EntityDungeonMob implements IBeMagicMob { private static String mobName = DungeonMobs.MODID + ":dmghost"; - + public EntityGhost(World worldIn) { super(worldIn); experienceValue = 20; } - - + + protected void initEntityAI() { + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWanderAvoidWater(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.applyEntityAI(); + } + @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(35.0d - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4d); - getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(8.0d); - getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS); - getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(16.0d); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0d - * ConfigHandler.damagex + ConfigHandler.damageplus); + protected SoundEvent getAmbientSound() { + if (rand.nextBoolean()) { + return AudioHandler.entityGhostAmbient1; + } + else { + return AudioHandler.entityGhostAmbient2; + } + } + + @Override + protected void dropFewItems(boolean par1, int par2) { + entityDropItem(new ItemStack(Items.DYE, rand.nextInt(4) + par2, 0xf), 0.0f); + if (par1) { + if (par2 > 2) { + dropItem(Items.GLOWSTONE_DUST, rand.nextInt(2)); + dropItem(Items.GHAST_TEAR, rand.nextInt(par2)); + } + else { + dropItem(Items.GHAST_TEAR, rand.nextInt(2)); + } + } + else { + dropItem(Items.GHAST_TEAR, rand.nextInt(2)); + } + } + + protected void applyEntityAI() { + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); } - - protected void initEntityAI() { - this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false)); - this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWanderAvoidWater(this, 1.0D)); - this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(8, new EntityAILookIdle(this)); - this.applyEntityAI(); - } - - - protected void applyEntityAI() { - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, true)); - } - - @SideOnly(Side.CLIENT) @Override public int getBrightnessForRender() { return 0xf000f0; } - @Override public boolean canBreatheUnderwater() { return true; } - - - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - - @Override - public boolean getCanSpawnHere() { - if (world.canSeeSky(new BlockPos(posX, posY, posZ))) { - return false; - } - if (ghostIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - if (posY > 36.0D && !ignoreHeight) { - return false; - } - return super.getCanSpawnHere(); - } - @Override protected void damageEntity(DamageSource damageSrc, float damageAmount) { - if(damageSrc.isMagicDamage() || damageSrc.isCreativePlayer() - || (damageSrc == DungeonMobsDamageSource.LIGHT_BALL)) { + if (damageSrc.isMagicDamage() || damageSrc.isCreativePlayer() || (damageSrc == DungeonMobsDamageSource.LIGHT_BALL)) { super.damageEntity(damageSrc, damageAmount); return; } - if(damageSrc.isFireDamage() || - (damageSrc.getTrueSource() instanceof IBeMagicMob)) { - super.damageEntity(damageSrc, damageAmount / 2); + if (damageSrc.isFireDamage() || (damageSrc.getTrueSource() instanceof IBeMagicMob)) { + super.damageEntity(damageSrc, damageAmount / 2); return; } Entity attacker = damageSrc.getTrueSource(); - if(attacker instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)attacker; + if (attacker instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) attacker; ItemStack equipt = player.inventory.mainInventory.get(player.inventory.currentItem); - if(equipt.isItemEnchanted()) { + if (equipt.isItemEnchanted()) { int highest = 0; NBTTagList enchants = equipt.getEnchantmentTagList(); - for(NBTBase tag : enchants) { - NBTTagCompound compound = (NBTTagCompound)tag; - if(compound.getShort("id") == 17) { + for (NBTBase tag : enchants) { + NBTTagCompound compound = (NBTTagCompound) tag; + if (compound.getShort("id") == 17) { super.damageEntity(damageSrc, damageAmount); return; - } else { + } + else { int tmp = compound.getShort("lvl"); - if(tmp > highest) { + if (tmp > highest) { highest = tmp; } } } - super.damageEntity(damageSrc, Math.min(damageAmount - + rand.nextInt(2), highest)); + super.damageEntity(damageSrc, Math.min(damageAmount + rand.nextInt(2), highest)); } } } - + + @Override + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } @Override public boolean attackEntityFrom(DamageSource source, float amount) { Entity attacker = source.getTrueSource(); EntityLivingBase target = getAttackTarget(); - if(((target == null) || target.isDead) - && (attacker instanceof EntityLivingBase)) { - setAttackTarget((EntityLivingBase)attacker); + if (((target == null) || target.isDead) && (attacker instanceof EntityLivingBase)) { + setAttackTarget((EntityLivingBase) attacker); } - if(canHarmGhost(source)) { + if (canHarmGhost(source)) { return super.attackEntityFrom(source, amount); } return false; } + @Override + protected SoundEvent getHurtSound(DamageSource src) { + return AudioHandler.entityGhostHurt; + } + + @Override + protected SoundEvent getDeathSound() { + return AudioHandler.entityGhostDeath; + } + + @Override + public boolean getCanSpawnHere() { + if (world.canSeeSky(new BlockPos(posX, posY, posZ))) { + return false; + } + if (ghostIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + if (posY > 36.0D && !ignoreHeight) { + return false; + } + return super.getCanSpawnHere(); + } + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(35.0d * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4d); + getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(8.0d); + getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS); + getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(16.0d); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0d * ConfigHandler.damagex + ConfigHandler.damageplus); + } public boolean canHarmGhost(DamageSource damageSrc) { Entity attacker = damageSrc.getTrueSource(); - if(damageSrc.isMagicDamage() || damageSrc.isCreativePlayer() - || (damageSrc == DungeonMobsDamageSource.LIGHT_BALL) - || damageSrc.isFireDamage() - || (attacker instanceof IBeMagicMob)) { + if (damageSrc.isMagicDamage() || damageSrc.isCreativePlayer() || (damageSrc == DungeonMobsDamageSource.LIGHT_BALL) || damageSrc.isFireDamage() || (attacker instanceof IBeMagicMob)) { return true; - } else if(attacker instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)attacker; + } + else if (attacker instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) attacker; ItemStack equipt = player.inventory.mainInventory.get(player.inventory.currentItem); - if(equipt.isItemEnchanted()) { + if (equipt.isItemEnchanted()) { return true; } - } + } return false; } - - @Override - protected SoundEvent getAmbientSound() { - if(rand.nextBoolean()) { - return AudioHandler.entityGhostAmbient1; - } else { - return AudioHandler.entityGhostAmbient2; - } - } - - - @Override - protected SoundEvent getHurtSound(DamageSource src) { - return AudioHandler.entityGhostHurt; - } - - - @Override - protected SoundEvent getDeathSound() { - return AudioHandler.entityGhostDeath; - } - - @Override public void onLivingUpdate() { if (!world.isRemote) { @@ -211,22 +199,6 @@ public void onLivingUpdate() { } super.onLivingUpdate(); } - - - @Override - protected void dropFewItems(boolean par1, int par2) { - entityDropItem(new ItemStack(Items.DYE, rand.nextInt(4) + par2, 0xf), 0.0f); - if (par1) { - if(par2 > 2) { - dropItem(Items.GLOWSTONE_DUST, rand.nextInt(2)); - dropItem(Items.GHAST_TEAR, rand.nextInt(par2)); - } else { - dropItem(Items.GHAST_TEAR, rand.nextInt(2)); - } - } else { - dropItem(Items.GHAST_TEAR, rand.nextInt(2)); - } - } - + } diff --git a/src/main/java/com/gw/dm/entity/EntityGhoul.java b/src/main/java/com/gw/dm/entity/EntityGhoul.java index 4e7b20a..80a3776 100644 --- a/src/main/java/com/gw/dm/entity/EntityGhoul.java +++ b/src/main/java/com/gw/dm/entity/EntityGhoul.java @@ -1,6 +1,9 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.ghoulIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.EntityZombie; @@ -11,55 +14,46 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.ghoulIg; public class EntityGhoul extends EntityZombie { - + private static String mobName = DungeonMobs.MODID + ":dmghoul"; public boolean ignoreHeight; - + public EntityGhoul(World par1World) { super(par1World); experienceValue = 10; ignoreHeight = false; } - - + + protected void applyEntityAttributes() { super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(25.0d - * ConfigHandler.healthx); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(25.0d * ConfigHandler.healthx); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.27f); } - - + + public boolean attackEntityAsMob(Entity par1) { + getAttackTarget().addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("slowness"), 40, 5)); + return super.attackEntityAsMob(par1); + } + @Override protected SoundEvent getAmbientSound() { return AudioHandler.entityGhoulAmbient; } - - + @Override protected SoundEvent getHurtSound(DamageSource ds) { return AudioHandler.entityGhoulHurt; } - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityGhoulDeath; } - - - public boolean attackEntityAsMob(Entity par1) { - getAttackTarget().addPotionEffect( - new PotionEffect(Potion.getPotionFromResourceLocation("slowness"), 40, 5)); - return super.attackEntityAsMob(par1); - } - - + public boolean getCanSpawnHere() { if (ghoulIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { return super.getCanSpawnHere(); @@ -72,8 +66,8 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + + public void setIgnoreHeight(boolean par1) { ignoreHeight = par1; } diff --git a/src/main/java/com/gw/dm/entity/EntityHookHorror.java b/src/main/java/com/gw/dm/entity/EntityHookHorror.java index 30d67dc..e846a89 100644 --- a/src/main/java/com/gw/dm/entity/EntityHookHorror.java +++ b/src/main/java/com/gw/dm/entity/EntityHookHorror.java @@ -1,17 +1,15 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.hookHorrorIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -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.ai.*; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -24,164 +22,83 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.hookHorrorIg; public class EntityHookHorror extends EntityDungeonMob { private static String mobName = DungeonMobs.MODID + ":dmhookhorror"; private boolean ignoreHeight; - + public EntityHookHorror(World par1World) { super(par1World); this.experienceValue = 35; this.ignoreHeight = false; - + this.setSize(1.0F, 2.8F); - + this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0F, false)); this.tasks.addTask(3, new EntityAIWander(this, 1.0F)); this.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(4, new EntityAILookIdle(this)); this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - + + protected boolean isAIEnabled() { return true; } - - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(35.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.28D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(9.0D); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - - - @Override - protected SoundEvent getAmbientSound() { - switch (rand.nextInt(5)) { - case 0: - return AudioHandler.dmbts; - case 1: - case 2: - return AudioHandler.entityHookHorrorA2; - case 3: - case 4: - default: - return AudioHandler.entityHookHorrorA1; - } - } - - + @Override protected SoundEvent getHurtSound(DamageSource ds) { return AudioHandler.entityHookHorrorHurt; } - - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityHookHorrorHurt; } - - + @Override protected SoundEvent getFallSound(int heightIn) { return AudioHandler.dmbts; } - - - public int getTalkInterval() { - return 60; - } - - - // TODO: Fix this when moving to the new (JSON based) drop system - @Override - protected Item getDropItem() { - return Item.getItemFromBlock(Blocks.TRIPWIRE_HOOK); - } - - - @Override - protected void dropFewItems(boolean par1, int par2) { - int var3; - int var4; - int var5; - - var3 = this.rand.nextInt(4); - - for (var5 = 0; var5 < var3; var5++) { - this.dropItem(Items.BONE, 1); - } - } - - - @Override - public boolean getCanSpawnHere() { - if(hookHorrorIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { - return false; - } - - if (this.posY > 45.0D && !this.ignoreHeight) { - return false; - } - - return super.getCanSpawnHere(); - } - - + @Override public boolean attackEntityAsMob(Entity entity) { if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; - + for (ItemStack armorPiece : player.getArmorInventoryList()) { if (armorPiece != null) { int lawlz; if (armorPiece.isItemEnchanted()) { lawlz = rand.nextInt(6) + 5; - } else { + } + else { lawlz = rand.nextInt(6) + 25; } armorPiece.damageItem(lawlz, this); } } - + int moo = 3; - + if (world.getDifficulty() == EnumDifficulty.NORMAL) { moo -= 1; - } else if (world.getDifficulty() == EnumDifficulty.HARD) { + } + else if (world.getDifficulty() == EnumDifficulty.HARD) { moo -= 2; } - + int bar = rand.nextInt(4 - moo); - + if (bar == 0) { ItemStack weapon = player.inventory.getStackInSlot(player.inventory.currentItem); - + if (weapon != null) { - EntityItem drop = player.dropItem(player.inventory - .decrStackSize(player.inventory.currentItem, 1), false); - + EntityItem drop = player.dropItem(player.inventory.decrStackSize(player.inventory.currentItem, 1), false); + if (drop != null) { drop.setPickupDelay(60); } @@ -190,28 +107,87 @@ public boolean attackEntityAsMob(Entity entity) { } return super.attackEntityAsMob(entity); } - - + + @Override + public boolean getCanSpawnHere() { + if (hookHorrorIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { + return false; + } + + if (this.posY > 45.0D && !this.ignoreHeight) { + return false; + } + + return super.getCanSpawnHere(); + } + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(35.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.28D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(9.0D); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } + + public int getTalkInterval() { + return 60; + } + @Override public void onEntityUpdate() { if (hurtTime > 0) { int moo = 0; - - if (world.getDifficulty() == EnumDifficulty.EASY) - moo = 1; - if (world.getDifficulty() == EnumDifficulty.NORMAL) - moo = 2; - if (world.getDifficulty() == EnumDifficulty.HARD) - moo = 3; - - if (this.rand.nextInt(5) < moo) - hurtTime -= (moo * 3); + + if (world.getDifficulty() == EnumDifficulty.EASY) moo = 1; + if (world.getDifficulty() == EnumDifficulty.NORMAL) moo = 2; + if (world.getDifficulty() == EnumDifficulty.HARD) moo = 3; + + if (this.rand.nextInt(5) < moo) hurtTime -= (moo * 3); } - + super.onEntityUpdate(); } - + @Override + protected SoundEvent getAmbientSound() { + switch (rand.nextInt(5)) { + case 0: + return AudioHandler.dmbts; + case 1: + case 2: + return AudioHandler.entityHookHorrorA2; + case 3: + case 4: + default: + return AudioHandler.entityHookHorrorA1; + } + } + + // TODO: Fix this when moving to the new (JSON based) drop system + @Override + protected Item getDropItem() { + return Item.getItemFromBlock(Blocks.TRIPWIRE_HOOK); + } + + @Override + protected void dropFewItems(boolean par1, int par2) { + int var3; + int var4; + int var5; + + var3 = this.rand.nextInt(4); + + for (var5 = 0; var5 < var3; var5++) { + this.dropItem(Items.BONE, 1); + } + } + @Override public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.ARTHROPOD; diff --git a/src/main/java/com/gw/dm/entity/EntityIllithid.java b/src/main/java/com/gw/dm/entity/EntityIllithid.java index 5f28e32..e759723 100644 --- a/src/main/java/com/gw/dm/entity/EntityIllithid.java +++ b/src/main/java/com/gw/dm/entity/EntityIllithid.java @@ -1,24 +1,14 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.illithidIg; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -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.ai.EntityAIWatchClosest2; +import net.minecraft.entity.ai.*; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.player.EntityPlayer; @@ -36,11 +26,9 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import java.util.*; + +import static com.gw.dm.util.ConfigHandler.illithidIg; public class EntityIllithid extends EntityDungeonMob { private static String mobName = DungeonMobs.MODID + ":dmillithid"; @@ -53,23 +41,23 @@ public class EntityIllithid extends EntityDungeonMob { private List dominatedEntities; private Map ownerIDs; private EntityAIAttackMelee grapple = new EntityAIAttackMelee(this, 1.0F, false); - + public EntityIllithid(World par1World) { super(par1World); ignoreHeight = false; - + experienceValue = 50; tentacleCounter = 0; - + setSize(1.1F, 2.9F); - + stunnedEntity = null; stunDuration = 0; mindBlastTicks = 0; - + dominatedEntities = new LinkedList(); ownerIDs = new HashMap(); - + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(3, new EntityAIWander(this, 1.0F)); tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); @@ -77,66 +65,59 @@ public EntityIllithid(World par1World) { tasks.addTask(5, new EntityAIWatchClosest2(this, EntityRakshasa.class, 5.0F, 0.02F)); tasks.addTask(5, new EntityAILookIdle(this)); targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); + targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(45.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - - - @Override - public int getTotalArmorValue() { - return 5; - } - - + @Override public int getTalkInterval() { return 180; } - - + @Override protected SoundEvent getAmbientSound() { return AudioHandler.entityIllithidAmbient; } - - + + @Override + protected void dropFewItems(boolean par1, int par2) { + int var3; + int var4; + + var3 = rand.nextInt(4); + + for (var4 = 0; var4 < var3; var4++) { + dropItem(Items.SLIME_BALL, 1); + } + } + @Override protected SoundEvent getHurtSound(DamageSource src) { return SoundEvents.ENTITY_ZOMBIE_HURT; } - - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityIllithidDeath; } - - + @Override - protected void dropFewItems(boolean par1, int par2) { - int var3; - int var4; - - var3 = rand.nextInt(4); - - for (var4 = 0; var4 < var3; var4++) { - dropItem(Items.SLIME_BALL, 1); + public boolean attackEntityAsMob(Entity ent) { + if (ent instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) ent; + + if (!player.capabilities.isCreativeMode) { + if (player.inventory.armorInventory.get(3) != null) { + if (world.rand.nextInt(4 - DungeonMobsHelper.getDifficulty(world)) == 0) { + this.playSound(AudioHandler.entityIllithidPower, 1.0F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F)); + EntityItem helm = ent.entityDropItem(player.getItemStackFromSlot(EntityEquipmentSlot.HEAD), 1.5F); + player.setItemStackToSlot(EntityEquipmentSlot.HEAD, ItemStack.EMPTY); + } + } + } } + return super.attackEntityAsMob(ent); } - - + @Override public boolean getCanSpawnHere() { if (illithidIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { @@ -150,61 +131,69 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(45.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } + @Override public void onLivingUpdate() { if (getAttackTarget() == null) { Iterator thralls = dominatedEntities.iterator(); - + while (thralls.hasNext()) { EntityTameable winner = (EntityTameable) thralls.next(); winner.setAttackTarget(getAttackTarget()); } } - + mindBlastTicks++; - + if (mindBlastTicks >= (60 - ((DungeonMobsHelper.getDifficulty(world) - 1) * 20))) { - List tameables = world.getEntitiesWithinAABB(EntityTameable.class, - getEntityBoundingBox().expand(24.0F, 24.0F, 24.0F)); + List tameables = world.getEntitiesWithinAABB(EntityTameable.class, getEntityBoundingBox().expand(24.0F, 24.0F, 24.0F)); List want = new LinkedList(); - + for (int i = 0; i < tameables.size(); i++) { EntityTameable thrall = (EntityTameable) tameables.get(i); - + if (thrall.isTamed() && canEntityBeSeen(thrall)) { - if (thrall.getOwner() != null) - want.add(thrall); + if (thrall.getOwner() != null) want.add(thrall); } } - + Iterator iter = want.iterator(); - + if (iter.hasNext()) { EntityTameable target = (EntityTameable) iter.next(); - + if (getAttackTarget() != null && getAttackTarget().equals((EntityLivingBase) target)) { setAttackTarget(null); } - + int ownerID = target.getOwner().getEntityId(); - + EntityLivingBase victim = target.getOwner(); - + target.setTamed(false); - + target.setRevengeTarget(getAttackTarget()); - + if (getAttackTarget() == null) { target.setAttackTarget((EntityLivingBase) world.getEntityByID(ownerID)); - } else { + } + else { target.setAttackTarget(getAttackTarget()); } - + dominatedEntities.add(target); ownerIDs.put(target, victim); - } else { + } + else { if (getAttackTarget() != null) { Potion mf = MobEffects.MINING_FATIGUE; if (!getAttackTarget().isPotionActive(mf)) { @@ -214,33 +203,31 @@ public void onLivingUpdate() { if (!getAttackTarget().isPotionActive(slow)) { getAttackTarget().addPotionEffect(new PotionEffect(slow, 240, 3)); } - if (getAttackTarget() instanceof EntityPlayer) - stunnedEntity = getAttackTarget(); + if (getAttackTarget() instanceof EntityPlayer) stunnedEntity = getAttackTarget(); } } mindBlastTicks = 0; } - + if (getAttackTarget() == null) { stunnedEntity = null; } - + if (stunnedEntity != null) { tasks.addTask(2, grapple); - - if (!stunnedEntity.isPotionActive(MobEffects.MINING_FATIGUE) - && !stunnedEntity.isPotionActive(MobEffects.SLOWNESS)) { + + if (!stunnedEntity.isPotionActive(MobEffects.MINING_FATIGUE) && !stunnedEntity.isPotionActive(MobEffects.SLOWNESS)) { tasks.removeTask(grapple); stunnedEntity = null; - } else if (stunnedEntity instanceof EntityPlayer) { + } + else if (stunnedEntity instanceof EntityPlayer) { EntityPlayer foo = (EntityPlayer) stunnedEntity; - - if (getEntityBoundingBox().expand(2.0F, 2.0F, 2.0F) - .intersects(foo.getEntityBoundingBox())) { - + + if (getEntityBoundingBox().expand(2.0F, 2.0F, 2.0F).intersects(foo.getEntityBoundingBox())) { + isGrappling = true; stunDuration++; - + ItemStack hat = null; Iterable armors = foo.getArmorInventoryList(); for (ItemStack slot : armors) { @@ -252,91 +239,74 @@ public void onLivingUpdate() { } } } - + if (stunDuration % 30 == 0 && hat == null) { tentacleCounter++; - + if (tentacleCounter > 4) { tentacleCounter = 4; } } - } else { + } + else { tentacleCounter = 0; stunDuration = 0; isGrappling = false; } - + if (tentacleCounter == 4) { getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(100.0D); - } else { + } + else { getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D); } } } super.onLivingUpdate(); } - - + @Override - public boolean attackEntityAsMob(Entity ent) { - if (ent instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) ent; - - if (!player.capabilities.isCreativeMode) { - if (player.inventory.armorInventory.get(3) != null) { - if (world.rand.nextInt(4 - DungeonMobsHelper.getDifficulty(world)) == 0) { - this.playSound(AudioHandler.entityIllithidPower, - 1.0F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F)); - EntityItem helm = ent.entityDropItem(player.getItemStackFromSlot(EntityEquipmentSlot.HEAD), 1.5F); - player.setItemStackToSlot(EntityEquipmentSlot.HEAD, ItemStack.EMPTY); - } - } - } - } - return super.attackEntityAsMob(ent); + public void writeEntityToNBT(NBTTagCompound nbt) { + super.writeEntityToNBT(nbt); + + nbt.setInteger("TentacleCounter", tentacleCounter); + nbt.setInteger("MindBlast", mindBlastTicks); } - - + + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + + tentacleCounter = par1NBTTagCompound.getInteger("TentacleCounter"); + mindBlastTicks = par1NBTTagCompound.getInteger("MindBlast"); + } + public void stunTarget(EntityPlayer bar) { bar.motionX *= 0.0D; bar.motionY *= 0.0D; bar.motionZ *= 0.0D; } - - + @Override public void onDeath(DamageSource par1DamageSource) { Iterator iter1 = dominatedEntities.iterator(); - + while (iter1.hasNext()) { EntityTameable thrall = (EntityTameable) iter1.next(); - + EntityLivingBase bar = (EntityLivingBase) ownerIDs.get(thrall); - + thrall.setOwnerId(bar.getUniqueID()); thrall.setTamed(true); - + thrall.setAttackTarget(null); } - + super.onDeath(par1DamageSource); } - - - @Override - public void writeEntityToNBT(NBTTagCompound nbt) { - super.writeEntityToNBT(nbt); - - nbt.setInteger("TentacleCounter", tentacleCounter); - nbt.setInteger("MindBlast", mindBlastTicks); - } - - + @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - tentacleCounter = par1NBTTagCompound.getInteger("TentacleCounter"); - mindBlastTicks = par1NBTTagCompound.getInteger("MindBlast"); + public int getTotalArmorValue() { + return 5; } } diff --git a/src/main/java/com/gw/dm/entity/EntityLizalfos.java b/src/main/java/com/gw/dm/entity/EntityLizalfos.java index 6a4718f..1d032e1 100644 --- a/src/main/java/com/gw/dm/entity/EntityLizalfos.java +++ b/src/main/java/com/gw/dm/entity/EntityLizalfos.java @@ -1,26 +1,18 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.lizalfosIg; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.ai.EntityAIFollowTwin; +import com.gw.dm.ai.EntityAIMonsterPanic; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -import net.minecraft.entity.ai.EntityAIAvoidEntity; -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.ai.*; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -37,13 +29,13 @@ import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.ai.EntityAIFollowTwin; -import com.gw.dm.ai.EntityAIMonsterPanic; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import static com.gw.dm.util.ConfigHandler.lizalfosIg; public class EntityLizalfos extends EntityDungeonMob { private static final List locations = new ArrayList<>(); @@ -67,7 +59,7 @@ public class EntityLizalfos extends EntityDungeonMob { private boolean newSpawn; private EntityAIHurtByTarget revenge; private EntityAINearestAttackableTarget target; - + /** * The primary (and public) constructor, for creating the first * of each pair -- i.e., the normal constructor for core spawning. @@ -82,36 +74,35 @@ public EntityLizalfos(World par1World) { myTwin = null; myTwinIsDead = false; goodToGo = false; - + newSpawn = true; - + isRetreating = false; hasRetreated = false; - + setSize(1.4F, 2.5F); experienceValue = 30; - + runTimer = 0; - + followTwin = new EntityAIFollowTwin(this, 1.0F); attack = new EntityAIAttackMelee(this, 1.0F, false); retreat = new EntityAIAvoidEntity(this, EntityPlayer.class, 24.0F, 1.0F, 0.5F); panic = new EntityAIMonsterPanic(this, 1.0F); - + revenge = new EntityAIHurtByTarget(this, false); - target = new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null); - + target = new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null); + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, attack); - + tasks.addTask(4, new EntityAIWander(this, 1.0F)); tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(5, new EntityAILookIdle(this)); targetTasks.addTask(0, revenge); targetTasks.addTask(1, target); } - + /** * A special private constructor, just for creating the twin. * @@ -121,25 +112,24 @@ public EntityLizalfos(World par1World) { * @param z * @param w */ - private EntityLizalfos(World world, EntityLizalfos twin, - double x, double y, double z) { + private EntityLizalfos(World world, EntityLizalfos twin, double x, double y, double z) { this(world); newSpawn = false; - + twin.setTwin(this); setTwin(twin); - + isTwin = true; - + twinEntityID = twin.getEntityId(); twin.twinEntityID = getEntityId(); - + setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch); - + setIsTwin(true); setTwinID(this.twinID); } - + public static void initLocations() { for (int i = -2; i < 3; i++) for (int j = -2; j < 3; j++) { @@ -148,122 +138,124 @@ public static void initLocations() { } } } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.35D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(7.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(10.0D); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - - + @Override public int getTalkInterval() { return 80; } - - + @Override protected SoundEvent getAmbientSound() { if (isTwin()) { return AudioHandler.entityLizalfosAmbient1; - } else { + } + else { return AudioHandler.entityLizalfosAmbient2; } } - - - @Override - protected SoundEvent getHurtSound(DamageSource src) { - return AudioHandler.entityLizalfosHurt; - } - - + @Override - protected SoundEvent getDeathSound() { - return AudioHandler.entityLizalfosDeath; + protected void dropFewItems(boolean par1, int par2) { + if (DungeonMobsHelper.getDifficulty(world) > 0) { + int var2 = rand.nextInt(DungeonMobsHelper.getDifficulty(world) + 1); + + if (var2 == 0) { + Item aSword = Items.IRON_SWORD; + ItemStack mySword = new ItemStack(aSword); + EnchantmentHelper.addRandomEnchantment(world.rand, mySword, 15, true); + + EntityItem itemEnt = new EntityItem(world, posX, posY, posZ, mySword); + world.spawnEntity(itemEnt); + } + } } - - + public int getTwinID() { return twinID; } - - + + public void setTwinID(int i) { + twinID = i; + } + public boolean isTwin() { return isTwin; } - - + public void setIsTwin(boolean foo) { isTwin = foo; } - - - public void setTwinID(int i) { - twinID = i; - } - - - public void setTwin(EntityLizalfos foo) { - myTwinWeak = new WeakReference(foo); - } - - + public EntityLizalfos getTwin() { if (myTwinWeak != null) { return myTwinWeak.get(); - } else return null; + } + else return null; } - - + + public void setTwin(EntityLizalfos foo) { + myTwinWeak = new WeakReference(foo); + } + public void killTwin() { myTwinIsDead = true; myTwinWeak = null; } - - - @Override - public boolean getCanSpawnHere() { - if (isTwin()) { - return world.checkNoEntityCollision(getEntityBoundingBox()) - && world.getEntitiesInAABBexcluding(this, getEntityBoundingBox(), null).isEmpty() - && !world.containsAnyLiquid(getEntityBoundingBox()); - } - if (lizalfosIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { - return false; - } - if (posY > 32.0D && !ignoreHeight) { - return false; - } - return super.getCanSpawnHere(); - } - - + public boolean isTwinDead() { return myTwinIsDead; } - - + public void setDead() { - if (this.myTwin != null && myTwinWeak != null && !isTwinDead()) - myTwinWeak.get().killTwin(); + if (this.myTwin != null && myTwinWeak != null && !isTwinDead()) myTwinWeak.get().killTwin(); super.setDead(); } - - + + // FIXME: This should probably by in onUpdate(), not onLivingUpdate()...? + public void onLivingUpdate() { + if (newSpawn) { + spawnTwin(); + } + + if (!goodToGo && !isTwinDead()) { + findTwin(); + goodToGo = true; + } + + if (runTimer > 0) { + runTimer--; + + if (runTimer < 1) cancelRetreat(); + + if (isTwinDead()) { + runTimer = 0; + cancelRetreat(); + } + } + + if (getAttackTarget() != null) { + tasks.removeTask(followTwin); + } + else if (isTwin() && !isRetreating && !isTwinDead()) { + tasks.addTask(3, followTwin); + } + if (!isTwinDead()/* && !world.isRemote*/ && !(myTwin == null)) { + if (getAttackTarget() != null && myTwinWeak.get().getAttackTarget() == null) myTwinWeak.get().setAttackTarget(getAttackTarget()); + } + + if (getHealth() < (getMaxHealth() / 2) && !hasRetreated && !isRetreating && !isTwinDead()) { + runAway(); + + if (!isTwinDead() && myTwin != null) myTwinWeak.get().cancelRetreat(); + } + + super.onLivingUpdate(); + } + @Override public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); - + par1NBTTagCompound.setInteger("twinID", twinID); par1NBTTagCompound.setBoolean("isTwin", isTwin); par1NBTTagCompound.setBoolean("twinDead", myTwinIsDead); @@ -272,12 +264,11 @@ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.setInteger("runTimer", runTimer); par1NBTTagCompound.setBoolean("newSpawn", newSpawn); } - - + @Override public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); - + twinID = par1NBTTagCompound.getInteger("twinID"); isTwin = par1NBTTagCompound.getBoolean("isTwin"); myTwinIsDead = par1NBTTagCompound.getBoolean("twinDead"); @@ -285,228 +276,194 @@ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { isRetreating = par1NBTTagCompound.getBoolean("isRunning"); runTimer = par1NBTTagCompound.getInteger("runTimer"); newSpawn = par1NBTTagCompound.getBoolean("newSpawn"); - + if (isRetreating) { retreat = new EntityAIAvoidEntity(this, EntityPlayer.class, 12.0F, 1.0F, 0.4F); - + tasks.removeTask(attack); tasks.removeTask(followTwin); - + tasks.addTask(3, retreat); } } - - - // FIXME: This should probably by in onUpdate(), not onLivingUpdate()...? - public void onLivingUpdate() { - if (newSpawn) { - spawnTwin(); - } - - if (!goodToGo && !isTwinDead()) { - findTwin(); - goodToGo = true; - } - - if (runTimer > 0) { - runTimer--; - - if (runTimer < 1) - cancelRetreat(); - - if (isTwinDead()) { - runTimer = 0; - cancelRetreat(); - } - } - - if (getAttackTarget() != null) { - tasks.removeTask(followTwin); - } else if (isTwin() && !isRetreating && !isTwinDead()) { - tasks.addTask(3, followTwin); - } - if (!isTwinDead()/* && !world.isRemote*/ && !(myTwin == null)) { - if (getAttackTarget() != null && myTwinWeak.get().getAttackTarget() == null) - myTwinWeak.get().setAttackTarget(getAttackTarget()); - } - - if (getHealth() < (getMaxHealth() / 2) - && !hasRetreated && !isRetreating && !isTwinDead()) { - runAway(); - - if (!isTwinDead() && myTwin != null) - myTwinWeak.get().cancelRetreat(); - } - - super.onLivingUpdate(); - } - - + @Override public boolean attackEntityFrom(DamageSource src, float amount) { if (src == DamageSource.FALL) { return false; - } else if (src.isProjectile()) { - playSound(AudioHandler.entityLizalfosBlock, - 1.0F, (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F); + } + else if (src.isProjectile()) { + playSound(AudioHandler.entityLizalfosBlock, 1.0F, (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F); return false; - } else { + } + else { return super.attackEntityFrom(src, amount); } } - - + @Override - protected void jump() { - motionY = 0.5D; - - Potion jump = Potion.getPotionFromResourceLocation("jump_boost"); - if (isPotionActive(jump)) - motionY += (double) ((float) (getActivePotionEffect(jump) - .getAmplifier() + 1) * 0.1F); - - if (isSprinting()) { - float var1 = rotationYaw * 0.017453292F; - motionX -= (double) (MathHelper.sin(var1) * 0.2F); - motionZ += (double) (MathHelper.cos(var1) * 0.2F); + protected SoundEvent getHurtSound(DamageSource src) { + return AudioHandler.entityLizalfosHurt; + } + + @Override + protected SoundEvent getDeathSound() { + return AudioHandler.entityLizalfosDeath; + } + + @Override + public boolean getCanSpawnHere() { + if (isTwin()) { + return world.checkNoEntityCollision(getEntityBoundingBox()) && world.getEntitiesInAABBexcluding(this, getEntityBoundingBox(), null).isEmpty() && !world.containsAnyLiquid(getEntityBoundingBox()); } - - isAirBorne = true; - ForgeHooks.onLivingJump(this); + if (lizalfosIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { + return false; + } + if (posY > 32.0D && !ignoreHeight) { + return false; + } + return super.getCanSpawnHere(); } - - + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.35D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(7.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(10.0D); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } + private void findTwin() { boolean skipFlag = false; - + Entity foo = world.getEntityByID(twinEntityID); - + if (foo instanceof EntityLizalfos) { EntityLizalfos bar = (EntityLizalfos) foo; - + if (bar.getTwinID() == twinID && !bar.equals(this)) { setTwin(bar); bar.setTwin(this); skipFlag = true; } } - + if (!world.isRemote && !skipFlag) { List allEntities; - + try { allEntities = world.getLoadedEntityList(); - } catch (NoSuchMethodError e) { - allEntities = world.getEntitiesWithinAABB(EntityLizalfos.class, - getEntityBoundingBox().expand(48.0F, 48.0F, 48.0F)); } - + catch (NoSuchMethodError e) { + allEntities = world.getEntitiesWithinAABB(EntityLizalfos.class, getEntityBoundingBox().expand(48.0F, 48.0F, 48.0F)); + } + Iterator iter = allEntities.iterator(); - + boolean foundFlag = false; - + while (iter.hasNext() && !foundFlag) { foo = (Entity) iter.next(); - + if (foo instanceof EntityLizalfos && !foo.equals(this)) { EntityLizalfos bar = (EntityLizalfos) foo; - + if (twinID == bar.getTwinID()) { setTwin(bar); bar.setTwin(this); - + twinEntityID = getTwin().getEntityId(); getTwin().twinEntityID = getEntityId(); - + foundFlag = true; } } } - + if (isTwin()) { tasks.addTask(3, followTwin); } allEntities = null; } } - - + + public void cancelRetreat() { if (isRetreating) { tasks.removeTask(retreat); tasks.removeTask(panic); - + tasks.addTask(2, attack); - + targetTasks.addTask(0, revenge); targetTasks.addTask(1, target); - + isRetreating = false; hasRetreated = true; runTimer = 0; } } - - + + public void runAway() { isRetreating = true; - + tasks.removeTask(followTwin); tasks.removeTask(attack); - + targetTasks.removeTask(revenge); targetTasks.removeTask(target); - + tasks.addTask(2, panic); tasks.addTask(3, retreat); runTimer = 480; - - addPotionEffect(new PotionEffect(Potion - .getPotionFromResourceLocation("regeneration"), 240, 1)); + + addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("regeneration"), 240, 1)); } - - - @Override - protected void dropFewItems(boolean par1, int par2) { - if (DungeonMobsHelper.getDifficulty(world) > 0) { - int var2 = rand.nextInt(DungeonMobsHelper.getDifficulty(world) + 1); - - if (var2 == 0) { - Item aSword = Items.IRON_SWORD; - ItemStack mySword = new ItemStack(aSword); - EnchantmentHelper.addRandomEnchantment(world.rand, mySword, 15, true); - - EntityItem itemEnt = new EntityItem(world, posX, posY, posZ, mySword); - world.spawnEntity(itemEnt); - } - } - } - - + @Override public void fall(float dist, float multiplier) { dist = ForgeHooks.onLivingFall(this, dist, multiplier)[0]; - + if (dist <= 0) { return; } int var2 = MathHelper.ceil(dist - 3.0F); - + if (var2 > 0) { - BlockPos where = new BlockPos(MathHelper.floor(posX), - MathHelper.floor(posY - 0.20000000298023224D), - MathHelper.floor(posZ)); + BlockPos where = new BlockPos(MathHelper.floor(posX), MathHelper.floor(posY - 0.20000000298023224D), MathHelper.floor(posZ)); Block block = world.getBlockState(where).getBlock(); - + if (block != Blocks.AIR) { SoundType sound = block.getSoundType(); - + playSound(sound.getFallSound(), sound.getVolume() * 0.5F, sound.getPitch() * 0.75F); } } } - - + + @Override + protected void jump() { + motionY = 0.5D; + + Potion jump = Potion.getPotionFromResourceLocation("jump_boost"); + if (isPotionActive(jump)) motionY += (double) ((float) (getActivePotionEffect(jump).getAmplifier() + 1) * 0.1F); + + if (isSprinting()) { + float var1 = rotationYaw * 0.017453292F; + motionX -= (double) (MathHelper.sin(var1) * 0.2F); + motionZ += (double) (MathHelper.cos(var1) * 0.2F); + } + + isAirBorne = true; + ForgeHooks.onLivingJump(this); + } + private void spawnTwin() { newSpawn = false; if (world.isRemote) { @@ -516,8 +473,7 @@ private void spawnTwin() { Collections.shuffle(locations); EntityLizalfos twin = new EntityLizalfos(world, this, posX, posY, posZ); for (LocOffset offset : locations) { - twin.setLocationAndAngles(posX + offset.x, posY, posZ + offset.z, - rotationYaw, rotationPitch); + twin.setLocationAndAngles(posX + offset.x, posY, posZ + offset.z, rotationYaw, rotationPitch); if (twin.isNotColliding()) { world.spawnEntity(twin); twinEntityID = twin.getEntityId(); @@ -531,10 +487,10 @@ private void spawnTwin() { setDead(); } } - + private static class LocOffset { public double x, z; - + public LocOffset(int x, int z) { this.x = (double) x; this.z = (double) x; diff --git a/src/main/java/com/gw/dm/entity/EntityManticore.java b/src/main/java/com/gw/dm/entity/EntityManticore.java index 7cd11c8..c7d71b8 100644 --- a/src/main/java/com/gw/dm/entity/EntityManticore.java +++ b/src/main/java/com/gw/dm/entity/EntityManticore.java @@ -1,17 +1,14 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.manticoreIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -import net.minecraft.entity.ai.EntityAIAttackRanged; -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.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityTippedArrow; @@ -22,108 +19,76 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.manticoreIg; public class EntityManticore extends EntityDungeonMob implements IRangedAttackMob { - + private static String mobName = DungeonMobs.MODID + ":dmmanticore"; - + public EntityManticore(World par1World) { super(par1World); experienceValue = 32; - + setSize(1.6F, 1.4F); - + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackRanged(this, 0.3F, 10, 50, 40.0F)); tasks.addTask(3, new EntityAIAttackMelee(this, 1.0F, false)); tasks.addTask(4, new EntityAIWander(this, 1.0F)); tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(5, new EntityAILookIdle(this)); - + targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); + targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - + + @Override public void attackEntityWithRangedAttack(EntityLivingBase entityliving, float f) { int foo = rand.nextInt(6 - DungeonMobsHelper.getDifficulty(world)); foo += (DungeonMobsHelper.getDifficulty(world) * 2); - + for (int i = 0; i < foo; i++) { EntityTippedArrow entityarrow = new EntityTippedArrow(this.world, this); - + entityarrow.posX += ((this.getRNG().nextFloat() - 0.5) / 2); entityarrow.posY += ((this.getRNG().nextFloat() - 0.5) / 2); entityarrow.posZ += ((this.getRNG().nextFloat() - 0.5) / 2); - + entityarrow.setDamage(Math.max(2, DungeonMobsHelper.getDifficulty(world) * 3)); - + targetArrow(entityarrow); - + world.spawnEntity(entityarrow); } playSound(AudioHandler.entityManticoreAttack, 1.0f, 1.0f); } - - + + @Override + public void setSwingingArms(boolean swingingArms) {/*Do Nothing*/} + protected void targetArrow(EntityArrow entityarrow) { EntityLivingBase target = getAttackTarget(); if (target == null) { return; } double vx = target.posX + (rand.nextFloat() - 0.5) - posX; - double vy = target.getEntityBoundingBox().minY - + (double) (target.height / 2.0F) - + (rand.nextFloat() - 0.5) - - entityarrow.posY; + double vy = target.getEntityBoundingBox().minY + (double) (target.height / 2.0F) + (rand.nextFloat() - 0.5) - entityarrow.posY; double vz = target.posZ + (rand.nextFloat() - 0.5) - posZ; double dist = (double) MathHelper.sqrt((vx * vx) + (vz * vz)); - entityarrow.shoot(vx, vy + (dist / 5), vz, 1.6F, - (16 - world.getDifficulty().getDifficultyId() * 4)); + entityarrow.shoot(vx, vy + (dist / 5), vz, 1.6F, (16 - world.getDifficulty().getDifficultyId() * 4)); } - - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D - * ConfigHandler.healthx); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); - this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(6.0D); - this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - - - @Override - protected SoundEvent getAmbientSound() { - if (rand.nextInt(2) == 0) { - return AudioHandler.entityManticoreA1; - } else { - return AudioHandler.entityManticoreA2; - } - } - - + @Override protected SoundEvent getHurtSound(DamageSource ds) { return AudioHandler.entityManticoreHurt; } - - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityManticoreDeath; } - - + @Override public boolean getCanSpawnHere() { if (manticoreIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { @@ -137,28 +102,38 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D * ConfigHandler.healthx); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); + this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(6.0D); + this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } + public int getTalkInterval() { return 100; } - - + + @Override + protected SoundEvent getAmbientSound() { + if (rand.nextInt(2) == 0) { + return AudioHandler.entityManticoreA1; + } + else { + return AudioHandler.entityManticoreA2; + } + } + protected void dropFewItems(boolean par1, int par2) { this.dropItem(Items.ARROW, this.rand.nextInt(12) + this.rand.nextInt(12)); this.dropItem(Items.LEATHER, this.rand.nextInt(3)); } - - + public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { - if ((par1DamageSource.getTrueSource() != null) - && (par1DamageSource.getTrueSource().equals(this))) - return false; - + if ((par1DamageSource.getTrueSource() != null) && (par1DamageSource.getTrueSource().equals(this))) return false; + return super.attackEntityFrom(par1DamageSource, par2); } - - - @Override - public void setSwingingArms(boolean swingingArms) {/*Do Nothing*/} } diff --git a/src/main/java/com/gw/dm/entity/EntityNetherHound.java b/src/main/java/com/gw/dm/entity/EntityNetherHound.java index 7b0986e..1c26dbd 100644 --- a/src/main/java/com/gw/dm/entity/EntityNetherHound.java +++ b/src/main/java/com/gw/dm/entity/EntityNetherHound.java @@ -1,15 +1,13 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.hellHoundIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -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.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -23,18 +21,14 @@ import net.minecraft.world.World; import net.minecraft.world.WorldProviderHell; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.hellHoundIg; public class EntityNetherHound extends EntityDungeonMob { private static String mobName = DungeonMobs.MODID + ":dmnetherhound"; public boolean ignoreHeight; private int flameTimer; private int jumpTimer; - + public EntityNetherHound(World par1World) { super(par1World); flameTimer = 0; @@ -42,65 +36,47 @@ public EntityNetherHound(World par1World) { ignoreHeight = false; experienceValue = 32; isImmuneToFire = true; - + setSize(1.2F, 1.1F); - + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackMelee(this, 1.0F, false)); tasks.addTask(3, new EntityAIWander(this, 1.0F)); tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(4, new EntityAILookIdle(this)); targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); + targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(28.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.42D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - - + @Override public int getTotalArmorValue() { return 5; } - - + public int getAttackStrength(Entity par1Entity) { return 5; } - - - @Override - protected SoundEvent getAmbientSound() { - return AudioHandler.entityNetherHoundAmbient; - } - - + @Override protected SoundEvent getHurtSound(DamageSource src) { return AudioHandler.entityNetherHoundHurt; } - + @Override protected SoundEvent getDeathSound() { return null; } - - + + @Override + public boolean attackEntityAsMob(Entity ent) { + ent.setFire(8 + (DungeonMobsHelper.getDifficulty(world) * 2)); + + return super.attackEntityAsMob(ent); + } + @Override public boolean getCanSpawnHere() { - if (hellHoundIg - || (world.provider instanceof WorldProviderHell) - || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + if (hellHoundIg || (world.provider instanceof WorldProviderHell) || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { return super.getCanSpawnHere(); } if (world.canBlockSeeSky(new BlockPos((int) posX, (int) posY, (int) posZ))) { @@ -111,267 +87,285 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(28.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.42D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } + @Override public int getTalkInterval() { return 80; } - - + + @Override + protected SoundEvent getAmbientSound() { + return AudioHandler.entityNetherHoundAmbient; + } + @Override protected void dropFewItems(boolean par1, int par2) { int var3; int var4; - + var3 = rand.nextInt(2); - + for (var4 = 0; var4 < var3; var4++) { dropItem(Items.BLAZE_POWDER, 1); } } - - - @Override - public boolean attackEntityAsMob(Entity ent) { - ent.setFire(8 + (DungeonMobsHelper.getDifficulty(world) * 2)); - - return super.attackEntityAsMob(ent); - } - - + @Override public void onLivingUpdate() { - if (getAttackTarget() != null - && canEntityBeSeen(getAttackTarget())) { + if (getAttackTarget() != null && canEntityBeSeen(getAttackTarget())) { double barX = getAttackTarget().posX - posX; double barY = getAttackTarget().posY - posY; double barZ = getAttackTarget().posZ - posZ; - + double fooX = barX * barX; double fooY = barY * barY; double fooZ = barZ * barZ; - + if (fooX + fooY + fooZ <= 16.0D) { flameTimer++; - - if (flameTimer >= (170 - (40 * DungeonMobsHelper.getDifficulty(world)))) - playSound(AudioHandler.entityNetherHoundFire, 1.0f, 1.0f); - + + if (flameTimer >= (170 - (40 * DungeonMobsHelper.getDifficulty(world)))) playSound(AudioHandler.entityNetherHoundFire, 1.0f, 1.0f); + if (flameTimer >= (200 - (40 * DungeonMobsHelper.getDifficulty(world)))) { breatheFire(); flameTimer = 0; } } } - + super.onLivingUpdate(); } - - + + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + super.writeEntityToNBT(par1NBTTagCompound); + + par1NBTTagCompound.setInteger("StoneStatus", flameTimer); + } + + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + + flameTimer = par1NBTTagCompound.getInteger("flameTimer"); + } + public void breatheFire() { int dir = MathHelper.floor((double) ((rotationYaw * 4F) / 360F) + 0.5D) & 3; - + boolean onAngle; - + float angle = (float) ((rotationYaw * 4F) / 360F) + 0.5F; - + while (angle > 1.0F) { angle -= 1.0; } - + if (angle <= 0.75F && angle >= 0.25F) { onAngle = true; - } else { + } + else { onAngle = false; } - + int myX = (int) posX; int myY = (int) posY; int myZ = (int) posZ; - + if (!onAngle) { if (dir == 0) { // SOUTH, +Z makeFire(myX, myY, myZ + 1); - + makeFire(myX - 1, myY - 1, myZ + 2); makeFire(myX, myY - 1, myZ + 2); makeFire(myX + 1, myY - 1, myZ + 2); - + makeFire(myX - 1, myY, myZ + 2); makeFire(myX, myY, myZ + 2); makeFire(myX + 1, myY, myZ + 2); - + makeFire(myX - 1, myY + 1, myZ + 2); makeFire(myX, myY + 1, myZ + 2); makeFire(myX + 1, myY + 1, myZ + 2); - + makeFire(myX - 2, myY - 2, myZ + 3); makeFire(myX - 1, myY - 2, myZ + 3); makeFire(myX, myY - 2, myZ + 3); makeFire(myX + 1, myY - 2, myZ + 3); makeFire(myX + 2, myY - 2, myZ + 3); - + makeFire(myX - 2, myY - 1, myZ + 3); makeFire(myX - 1, myY - 1, myZ + 3); makeFire(myX, myY - 1, myZ + 3); makeFire(myX + 1, myY - 1, myZ + 3); makeFire(myX + 2, myY - 1, myZ + 3); - + makeFire(myX - 2, myY, myZ + 3); makeFire(myX - 1, myY, myZ + 3); makeFire(myX, myY, myZ + 3); makeFire(myX + 1, myY, myZ + 3); makeFire(myX + 2, myY, myZ + 3); - + makeFire(myX - 2, myY + 1, myZ + 3); makeFire(myX - 1, myY + 1, myZ + 3); makeFire(myX, myY + 1, myZ + 3); makeFire(myX + 1, myY + 1, myZ + 3); makeFire(myX + 2, myY + 1, myZ + 3); - + makeFire(myX - 2, myY + 2, myZ + 3); makeFire(myX - 1, myY + 2, myZ + 3); makeFire(myX, myY + 2, myZ + 3); makeFire(myX + 1, myY + 2, myZ + 3); makeFire(myX + 2, myY + 2, myZ + 3); - - } else if (dir == 1) { // WEST, -X + + } + else if (dir == 1) { // WEST, -X makeFire(myX - 1, myY, myZ); - + makeFire(myX - 2, myY - 1, myZ - 1); makeFire(myX - 2, myY - 1, myZ); makeFire(myX - 2, myY - 1, myZ + 1); - + makeFire(myX - 2, myY, myZ - 1); makeFire(myX - 2, myY, myZ); makeFire(myX - 2, myY, myZ + 1); - + makeFire(myX - 2, myY + 1, myZ - 1); makeFire(myX - 2, myY + 1, myZ); makeFire(myX - 2, myY + 1, myZ + 1); - + makeFire(myX - 3, myY - 2, myZ - 2); makeFire(myX - 3, myY - 2, myZ - 1); makeFire(myX - 3, myY - 2, myZ); makeFire(myX - 3, myY - 2, myZ + 1); makeFire(myX - 3, myY - 2, myZ + 2); - + makeFire(myX - 3, myY - 1, myZ - 2); makeFire(myX - 3, myY - 1, myZ - 1); makeFire(myX - 3, myY - 1, myZ); makeFire(myX - 3, myY - 1, myZ + 1); makeFire(myX - 3, myY - 1, myZ + 2); - + makeFire(myX - 3, myY, myZ - 2); makeFire(myX - 3, myY, myZ - 1); makeFire(myX - 3, myY, myZ); makeFire(myX - 3, myY, myZ + 1); makeFire(myX - 3, myY, myZ + 2); - + makeFire(myX - 3, myY + 1, myZ - 2); makeFire(myX - 3, myY + 1, myZ - 1); makeFire(myX - 3, myY + 1, myZ); makeFire(myX - 3, myY + 1, myZ + 1); makeFire(myX - 3, myY + 1, myZ + 2); - + makeFire(myX - 3, myY + 2, myZ - 2); makeFire(myX - 3, myY + 2, myZ - 1); makeFire(myX - 3, myY + 2, myZ); makeFire(myX - 3, myY + 2, myZ + 1); makeFire(myX - 3, myY + 2, myZ + 2); - - } else if (dir == 2) { // NORTH, -Z + + } + else if (dir == 2) { // NORTH, -Z makeFire(myX, myY, myZ - 1); - + makeFire(myX - 1, myY - 1, myZ - 2); makeFire(myX, myY - 1, myZ - 2); makeFire(myX + 1, myY - 1, myZ - 2); - + makeFire(myX - 1, myY, myZ - 2); makeFire(myX, myY, myZ - 2); makeFire(myX + 1, myY, myZ - 2); - + makeFire(myX - 1, myY + 1, myZ - 2); makeFire(myX, myY + 1, myZ - 2); makeFire(myX + 1, myY + 1, myZ - 2); - + makeFire(myX - 2, myY - 2, myZ - 3); makeFire(myX - 1, myY - 2, myZ - 3); makeFire(myX, myY - 2, myZ - 3); makeFire(myX + 1, myY - 2, myZ - 3); makeFire(myX + 2, myY - 2, myZ - 3); - + makeFire(myX - 2, myY - 1, myZ - 3); makeFire(myX - 1, myY - 1, myZ - 3); makeFire(myX, myY - 1, myZ - 3); makeFire(myX + 1, myY - 1, myZ - 3); makeFire(myX + 2, myY - 1, myZ - 3); - + makeFire(myX - 2, myY, myZ - 3); makeFire(myX - 1, myY, myZ - 3); makeFire(myX, myY, myZ - 3); makeFire(myX + 1, myY, myZ - 3); makeFire(myX + 2, myY, myZ - 3); - + makeFire(myX - 2, myY + 1, myZ - 3); makeFire(myX - 1, myY + 1, myZ - 3); makeFire(myX, myY + 1, myZ - 3); makeFire(myX + 1, myY + 1, myZ - 3); makeFire(myX + 2, myY + 1, myZ - 3); - + makeFire(myX - 2, myY + 2, myZ - 3); makeFire(myX - 1, myY + 2, myZ - 3); makeFire(myX, myY + 2, myZ - 3); makeFire(myX + 1, myY + 2, myZ - 3); makeFire(myX + 2, myY + 2, myZ - 3); - - } else {// EAST, +X + + } + else {// EAST, +X makeFire(myX + 1, myY, myZ); - + makeFire(myX + 2, myY - 1, myZ - 1); makeFire(myX + 2, myY - 1, myZ); makeFire(myX + 2, myY - 1, myZ + 1); - + makeFire(myX + 2, myY, myZ - 1); makeFire(myX + 2, myY, myZ); makeFire(myX + 2, myY, myZ + 1); - + makeFire(myX + 2, myY + 1, myZ - 1); makeFire(myX + 2, myY + 1, myZ); makeFire(myX + 2, myY + 1, myZ + 1); - + makeFire(myX + 3, myY - 2, myZ - 2); makeFire(myX + 3, myY - 2, myZ - 1); makeFire(myX + 3, myY - 2, myZ); makeFire(myX + 3, myY - 2, myZ + 1); makeFire(myX + 3, myY - 2, myZ + 2); - + makeFire(myX + 3, myY - 1, myZ - 2); makeFire(myX + 3, myY - 1, myZ - 1); makeFire(myX + 3, myY - 1, myZ); makeFire(myX + 3, myY - 1, myZ + 1); makeFire(myX + 3, myY - 1, myZ + 2); - + makeFire(myX + 3, myY, myZ - 2); makeFire(myX + 3, myY, myZ - 1); makeFire(myX + 3, myY, myZ); makeFire(myX + 3, myY, myZ + 1); makeFire(myX + 3, myY, myZ + 2); - + makeFire(myX + 3, myY + 1, myZ - 2); makeFire(myX + 3, myY + 1, myZ - 1); makeFire(myX + 3, myY + 1, myZ); makeFire(myX + 3, myY + 1, myZ + 1); makeFire(myX + 3, myY + 1, myZ + 2); - + makeFire(myX + 3, myY + 2, myZ - 2); makeFire(myX + 3, myY + 2, myZ - 1); makeFire(myX + 3, myY + 2, myZ); makeFire(myX + 3, myY + 2, myZ + 1); makeFire(myX + 3, myY + 2, myZ + 2); } - } else { + } + else { // H'okay, so we're on an angle... // Let's get some basic math here. // SOUTHWEST: - X, + Z @@ -381,272 +375,273 @@ public void breatheFire() { if (dir == 0) { // SOUTHWEST makeFire(myX - 1, myY, myZ + 1); - + makeFire(myX - 1, myY - 1, myZ + 2); makeFire(myX - 2, myY - 1, myZ + 1); - + makeFire(myX - 1, myY, myZ + 2); makeFire(myX - 2, myY, myZ + 1); - + makeFire(myX - 1, myY + 1, myZ + 2); makeFire(myX - 2, myY + 1, myZ + 1); - + makeFire(myX - 1, myY - 2, myZ + 3); makeFire(myX - 2, myY - 2, myZ + 2); makeFire(myX - 3, myY - 2, myZ + 1); - + makeFire(myX - 1, myY - 1, myZ + 3); makeFire(myX - 2, myY - 1, myZ + 2); makeFire(myX - 3, myY - 1, myZ + 1); - + makeFire(myX - 1, myY, myZ + 3); makeFire(myX - 2, myY, myZ + 2); makeFire(myX - 3, myY, myZ + 1); - + makeFire(myX - 1, myY + 1, myZ + 3); makeFire(myX - 2, myY + 1, myZ + 2); makeFire(myX - 3, myY + 1, myZ + 1); - + makeFire(myX - 1, myY + 2, myZ + 3); makeFire(myX - 2, myY + 2, myZ + 2); makeFire(myX - 3, myY + 2, myZ + 1); - + makeFire(myX - 1, myY - 3, myZ + 4); makeFire(myX - 2, myY - 3, myZ + 3); makeFire(myX - 3, myY - 3, myZ + 2); makeFire(myX - 4, myY - 3, myZ + 1); - + makeFire(myX - 1, myY - 2, myZ + 4); makeFire(myX - 2, myY - 2, myZ + 3); makeFire(myX - 3, myY - 2, myZ + 2); makeFire(myX - 4, myY - 2, myZ + 1); - + makeFire(myX - 1, myY - 1, myZ + 4); makeFire(myX - 2, myY - 1, myZ + 3); makeFire(myX - 3, myY - 1, myZ + 2); makeFire(myX - 4, myY - 1, myZ + 1); - + makeFire(myX - 1, myY, myZ + 4); makeFire(myX - 2, myY, myZ + 3); makeFire(myX - 3, myY, myZ + 2); makeFire(myX - 4, myY, myZ + 1); - + makeFire(myX - 1, myY + 1, myZ + 4); makeFire(myX - 2, myY + 1, myZ + 3); makeFire(myX - 3, myY + 1, myZ + 2); makeFire(myX - 4, myY + 1, myZ + 1); - + makeFire(myX - 1, myY + 2, myZ + 4); makeFire(myX - 2, myY + 2, myZ + 3); makeFire(myX - 3, myY + 2, myZ + 2); makeFire(myX - 4, myY + 2, myZ + 1); - + makeFire(myX - 1, myY + 3, myZ + 4); makeFire(myX - 2, myY + 3, myZ + 3); makeFire(myX - 3, myY + 3, myZ + 2); makeFire(myX - 4, myY + 3, myZ + 1); - + } if (dir == 1) { // NORTHWEST makeFire(myX - 1, myY, myZ - 1); - + makeFire(myX - 1, myY - 1, myZ - 2); makeFire(myX - 2, myY - 1, myZ - 1); - + makeFire(myX - 1, myY, myZ - 2); makeFire(myX - 2, myY, myZ - 1); - + makeFire(myX - 1, myY + 1, myZ - 2); makeFire(myX - 2, myY + 1, myZ - 1); - + makeFire(myX - 1, myY - 2, myZ - 3); makeFire(myX - 2, myY - 2, myZ - 2); makeFire(myX - 3, myY - 2, myZ - 1); - + makeFire(myX - 1, myY - 1, myZ - 3); makeFire(myX - 2, myY - 1, myZ - 2); makeFire(myX - 3, myY - 1, myZ - 1); - + makeFire(myX - 1, myY, myZ - 3); makeFire(myX - 2, myY, myZ - 2); makeFire(myX - 3, myY, myZ - 1); - + makeFire(myX - 1, myY + 1, myZ - 3); makeFire(myX - 2, myY + 1, myZ - 2); makeFire(myX - 3, myY + 1, myZ - 1); - + makeFire(myX - 1, myY + 2, myZ - 3); makeFire(myX - 2, myY + 2, myZ - 2); makeFire(myX - 3, myY + 2, myZ - 1); - + makeFire(myX - 1, myY - 3, myZ - 4); makeFire(myX - 2, myY - 3, myZ - 3); makeFire(myX - 3, myY - 3, myZ - 2); makeFire(myX - 4, myY - 3, myZ - 1); - + makeFire(myX - 1, myY - 2, myZ - 4); makeFire(myX - 2, myY - 2, myZ - 3); makeFire(myX - 3, myY - 2, myZ - 2); makeFire(myX - 4, myY - 2, myZ - 1); - + makeFire(myX - 1, myY - 1, myZ - 4); makeFire(myX - 2, myY - 1, myZ - 3); makeFire(myX - 3, myY - 1, myZ - 2); makeFire(myX - 4, myY - 1, myZ - 1); - + makeFire(myX - 1, myY, myZ - 4); makeFire(myX - 2, myY, myZ - 3); makeFire(myX - 3, myY, myZ - 2); makeFire(myX - 4, myY, myZ - 1); - + makeFire(myX - 1, myY + 1, myZ - 4); makeFire(myX - 2, myY + 1, myZ - 3); makeFire(myX - 3, myY + 1, myZ - 2); makeFire(myX - 4, myY + 1, myZ - 1); - + makeFire(myX - 1, myY + 2, myZ - 4); makeFire(myX - 2, myY + 2, myZ - 3); makeFire(myX - 3, myY + 2, myZ - 2); makeFire(myX - 4, myY + 2, myZ - 1); - + makeFire(myX - 1, myY + 3, myZ - 4); makeFire(myX - 2, myY + 3, myZ - 3); makeFire(myX - 3, myY + 3, myZ - 2); makeFire(myX - 4, myY + 3, myZ - 1); - + } if (dir == 2) { // NORTHEAST makeFire(myX + 1, myY, myZ - 1); - + makeFire(myX + 1, myY - 1, myZ - 2); makeFire(myX + 2, myY - 1, myZ - 1); - + makeFire(myX + 1, myY, myZ - 2); makeFire(myX + 2, myY, myZ - 1); - + makeFire(myX + 1, myY + 1, myZ - 2); makeFire(myX + 2, myY + 1, myZ - 1); - + makeFire(myX + 1, myY - 2, myZ - 3); makeFire(myX + 2, myY - 2, myZ - 2); makeFire(myX + 3, myY - 2, myZ - 1); - + makeFire(myX + 1, myY - 1, myZ - 3); makeFire(myX + 2, myY - 1, myZ - 2); makeFire(myX + 3, myY - 1, myZ - 1); - + makeFire(myX + 1, myY, myZ - 3); makeFire(myX + 2, myY, myZ - 2); makeFire(myX + 3, myY, myZ - 1); - + makeFire(myX + 1, myY + 1, myZ - 3); makeFire(myX + 2, myY + 1, myZ - 2); makeFire(myX + 3, myY + 1, myZ - 1); - + makeFire(myX + 1, myY + 2, myZ - 3); makeFire(myX + 2, myY + 2, myZ - 2); makeFire(myX + 3, myY + 2, myZ - 1); - + makeFire(myX + 1, myY - 3, myZ - 4); makeFire(myX + 2, myY - 3, myZ - 3); makeFire(myX + 3, myY - 3, myZ - 2); makeFire(myX + 4, myY - 3, myZ - 1); - + makeFire(myX + 1, myY - 2, myZ - 4); makeFire(myX + 2, myY - 2, myZ - 3); makeFire(myX + 3, myY - 2, myZ - 2); makeFire(myX + 4, myY - 2, myZ - 1); - + makeFire(myX + 1, myY - 1, myZ - 4); makeFire(myX + 2, myY - 1, myZ - 3); makeFire(myX + 3, myY - 1, myZ - 2); makeFire(myX + 4, myY - 1, myZ - 1); - + makeFire(myX + 1, myY, myZ - 4); makeFire(myX + 2, myY, myZ - 3); makeFire(myX + 3, myY, myZ - 2); makeFire(myX + 4, myY, myZ - 1); - + makeFire(myX + 1, myY + 1, myZ - 4); makeFire(myX + 2, myY + 1, myZ - 3); makeFire(myX + 3, myY + 1, myZ - 2); makeFire(myX + 4, myY + 1, myZ - 1); - + makeFire(myX + 1, myY + 2, myZ - 4); makeFire(myX + 2, myY + 2, myZ - 3); makeFire(myX + 3, myY + 2, myZ - 2); makeFire(myX + 4, myY + 2, myZ - 1); - + makeFire(myX + 1, myY + 3, myZ - 4); makeFire(myX + 2, myY + 3, myZ - 3); makeFire(myX + 3, myY + 3, myZ - 2); makeFire(myX + 4, myY + 3, myZ - 1); - - } else { + + } + else { // SOUTHEAST makeFire(myX + 1, myY, myZ + 1); - + makeFire(myX + 1, myY - 1, myZ + 2); makeFire(myX + 2, myY - 1, myZ + 1); - + makeFire(myX + 1, myY, myZ + 2); makeFire(myX + 2, myY, myZ + 1); - + makeFire(myX + 1, myY + 1, myZ + 2); makeFire(myX + 2, myY + 1, myZ + 1); - + makeFire(myX + 1, myY - 2, myZ + 3); makeFire(myX + 2, myY - 2, myZ + 2); makeFire(myX + 3, myY - 2, myZ + 1); - + makeFire(myX + 1, myY - 1, myZ + 3); makeFire(myX + 2, myY - 1, myZ + 2); makeFire(myX + 3, myY - 1, myZ + 1); - + makeFire(myX + 1, myY, myZ + 3); makeFire(myX + 2, myY, myZ + 2); makeFire(myX + 3, myY, myZ + 1); - + makeFire(myX + 1, myY + 1, myZ + 3); makeFire(myX + 2, myY + 1, myZ + 2); makeFire(myX + 3, myY + 1, myZ + 1); - + makeFire(myX + 1, myY + 2, myZ + 3); makeFire(myX + 2, myY + 2, myZ + 2); makeFire(myX + 3, myY + 2, myZ + 1); - + makeFire(myX + 1, myY - 3, myZ + 4); makeFire(myX + 2, myY - 3, myZ + 3); makeFire(myX + 3, myY - 3, myZ + 2); makeFire(myX + 4, myY - 3, myZ + 1); - + makeFire(myX + 1, myY - 2, myZ + 4); makeFire(myX + 2, myY - 2, myZ + 3); makeFire(myX + 3, myY - 2, myZ + 2); makeFire(myX + 4, myY - 2, myZ + 1); - + makeFire(myX + 1, myY - 1, myZ + 4); makeFire(myX + 2, myY - 1, myZ + 3); makeFire(myX + 3, myY - 1, myZ + 2); makeFire(myX + 4, myY - 1, myZ + 1); - + makeFire(myX + 1, myY, myZ + 4); makeFire(myX + 2, myY, myZ + 3); makeFire(myX + 3, myY, myZ + 2); makeFire(myX + 4, myY, myZ + 1); - + makeFire(myX + 1, myY + 1, myZ + 4); makeFire(myX + 2, myY + 1, myZ + 3); makeFire(myX + 3, myY + 1, myZ + 2); makeFire(myX + 4, myY + 1, myZ + 1); - + makeFire(myX + 1, myY + 2, myZ + 4); makeFire(myX + 2, myY + 2, myZ + 3); makeFire(myX + 3, myY + 2, myZ + 2); makeFire(myX + 4, myY + 2, myZ + 1); - + makeFire(myX + 1, myY + 3, myZ + 4); makeFire(myX + 2, myY + 3, myZ + 3); makeFire(myX + 3, myY + 3, myZ + 2); @@ -654,40 +649,23 @@ public void breatheFire() { } } } - - + private void makeFire(int x, int y, int z) { double foo = world.rand.nextFloat() - 0.5F; double bar = world.rand.nextFloat() - 0.5F; double cow = world.rand.nextFloat() - 0.5F; world.spawnParticle(EnumParticleTypes.FLAME, x + foo, y + bar, z + cow, 0.0D, 0.0D, 0.0D); - + foo = world.rand.nextFloat() - 0.5F; bar = world.rand.nextFloat() - 0.5F; cow = world.rand.nextFloat() - 0.5F; world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + foo, y + bar, z + cow, 0.0D, 0.0D, 0.0D); - + BlockPos where = new BlockPos(x, y, z); - if (world.isAirBlock(where)) - world.setBlockState(where, Blocks.FIRE.getDefaultState()); + if (world.isAirBlock(where)) world.setBlockState(where, Blocks.FIRE.getDefaultState()); else if (world.getBlockState(where).getBlock() == Blocks.WATER) { playSound(SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 1.0f); world.setBlockState(where, Blocks.AIR.getDefaultState()); } } - - - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - par1NBTTagCompound.setInteger("StoneStatus", flameTimer); - } - - - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - flameTimer = par1NBTTagCompound.getInteger("flameTimer"); - } } diff --git a/src/main/java/com/gw/dm/entity/EntityPetrified.java b/src/main/java/com/gw/dm/entity/EntityPetrified.java index 5a0603c..65acf4b 100644 --- a/src/main/java/com/gw/dm/entity/EntityPetrified.java +++ b/src/main/java/com/gw/dm/entity/EntityPetrified.java @@ -18,15 +18,15 @@ public class EntityPetrified extends EntityLiving { public ItemStack[] stuff; - + public EntityPetrified(World par1World) { super(par1World); experienceValue = 0; stuff = null; isImmuneToFire = true; } - - + + @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); @@ -34,54 +34,12 @@ protected void applyEntityAttributes() { getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.0D); getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(100.0D); } - - - @Override - public void jump() {/*Do Nothing*/} - - - @Override - public int getTotalArmorValue() { - return 0; - } - - - @Override - public boolean getCanSpawnHere() { - return super.getCanSpawnHere(); - } - - - @Override - protected SoundEvent getHurtSound(DamageSource src) { - return SoundEvents.BLOCK_STONE_HIT; - } - - + @Override protected SoundEvent getAmbientSound() { return null; } - - - @Override - protected SoundEvent getDeathSound() { - return SoundEvents.BLOCK_STONE_BREAK; - } - - - public void setStuff(EntityPlayer player) { - stuff = new ItemStack[40]; - - for (int i = 0; i < 40; i++) { - if (player.inventory.getStackInSlot(i) != null) - stuff[i] = player.inventory.getStackInSlot(i); - } - - player.inventory = new InventoryPlayer(player); - } - - + @Override protected void dropFewItems(boolean par1, int par2) { if (stuff != null) { @@ -93,53 +51,13 @@ protected void dropFewItems(boolean par1, int par2) { } } } - - - @Override - public boolean canBreatheUnderwater() { - return true; - } - - - @Override - protected boolean canDespawn() { - return false; - } - - - @Override - public void faceEntity(Entity par1Entity, float par2, float par3) {/*Do Nothing*/} - - - public boolean isPotionApplicable(PotionEffect par1PotionEffect) { - return false; - } - - - public void knockBack(Entity par1Entity, int par2, - double par3, double par5) {/*Do Nothing*/} - - - @Override - public boolean attackEntityFrom(DamageSource src, float amount) { - if (src.getTrueSource() instanceof EntityPlayer) { - if (((EntityPlayer) src.getTrueSource()) - .getHeldItemMainhand() - .getItem() - .canHarvestBlock(Blocks.STONE.getDefaultState())) { - return super.attackEntityFrom(src, amount); - } - } - return super.attackEntityFrom(src, amount / 10); - } - - + @Override public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); - + NBTTagList nbttaglist = new NBTTagList(); - + for (int i = 0; i < stuff.length; ++i) { if (stuff[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); @@ -148,25 +66,86 @@ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { nbttaglist.appendTag(nbttagcompound1); } } - + par1NBTTagCompound.setTag("Items", nbttaglist); } - - + @Override public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); - + NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 10); stuff = new ItemStack[40]; - + for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); int j = nbttagcompound1.getByte("slot") & 255; - + if (j >= 0 && j < stuff.length) { stuff[j] = new ItemStack(nbttagcompound1); } } } + + @Override + protected boolean canDespawn() { + return false; + } + + @Override + public void faceEntity(Entity par1Entity, float par2, float par3) {/*Do Nothing*/} + + @Override + public boolean getCanSpawnHere() { + return super.getCanSpawnHere(); + } + + public void setStuff(EntityPlayer player) { + stuff = new ItemStack[40]; + + for (int i = 0; i < 40; i++) { + if (player.inventory.getStackInSlot(i) != null) stuff[i] = player.inventory.getStackInSlot(i); + } + + player.inventory = new InventoryPlayer(player); + } + + @Override + public boolean canBreatheUnderwater() { + return true; + } + + public boolean isPotionApplicable(PotionEffect par1PotionEffect) { + return false; + } + + @Override + public boolean attackEntityFrom(DamageSource src, float amount) { + if (src.getTrueSource() instanceof EntityPlayer) { + if (((EntityPlayer) src.getTrueSource()).getHeldItemMainhand().getItem().canHarvestBlock(Blocks.STONE.getDefaultState())) { + return super.attackEntityFrom(src, amount); + } + } + return super.attackEntityFrom(src, amount / 10); + } + + @Override + protected SoundEvent getHurtSound(DamageSource src) { + return SoundEvents.BLOCK_STONE_HIT; + } + + @Override + protected SoundEvent getDeathSound() { + return SoundEvents.BLOCK_STONE_BREAK; + } + + @Override + public int getTotalArmorValue() { + return 0; + } + + @Override + public void jump() {/*Do Nothing*/} + + public void knockBack(Entity par1Entity, int par2, double par3, double par5) {/*Do Nothing*/} } diff --git a/src/main/java/com/gw/dm/entity/EntityRakshasa.java b/src/main/java/com/gw/dm/entity/EntityRakshasa.java index f6ad78c..7195d7b 100644 --- a/src/main/java/com/gw/dm/entity/EntityRakshasa.java +++ b/src/main/java/com/gw/dm/entity/EntityRakshasa.java @@ -1,23 +1,15 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.rakshasaIg; - -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.projectile.EntityMagicMissile; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -import net.minecraft.entity.ai.EntityAIAttackRanged; -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.ai.EntityAIWatchClosest2; +import net.minecraft.entity.ai.*; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; @@ -33,17 +25,15 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.projectile.EntityMagicMissile; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; -public class EntityRakshasa extends EntityDungeonMob implements IRangedAttackMob, IBeMagicMob { +import static com.gw.dm.util.ConfigHandler.rakshasaIg; - private static final ResourceLocation rakshasaTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Rakshasa.png"); +public class EntityRakshasa extends EntityDungeonMob implements IRangedAttackMob, IBeMagicMob { + + private static final ResourceLocation rakshasaTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Rakshasa.png"); private static String mobName = DungeonMobs.MODID + ":dmrakshasa"; public boolean ignoreHeight; public String currentName; @@ -53,19 +43,17 @@ public class EntityRakshasa extends EntityDungeonMob implements IRangedAttackMob private int hasteTimer; private int illusionTimer; private int imageTimer; - private EntityAIAttackRanged rangeAttack - = new EntityAIAttackRanged(this, 0.3F, 5, 40, 24.0F); - private EntityAIAttackMelee meleeAttack - = new EntityAIAttackMelee(this, 0.3F, false); + private EntityAIAttackRanged rangeAttack = new EntityAIAttackRanged(this, 0.3F, 5, 40, 24.0F); + private EntityAIAttackMelee meleeAttack = new EntityAIAttackMelee(this, 0.3F, false); private List myImages; - - + + public EntityRakshasa(World par1World) { super(par1World); - + ignoreHeight = false; experienceValue = 60; - + castingTimer = 0; hasteTimer = 0; illusionTimer = 0; @@ -74,7 +62,7 @@ public EntityRakshasa(World par1World) { currentSkin = rakshasaTextures; hasIllusion = false; myImages = new LinkedList(); - + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, rangeAttack); tasks.addTask(3, new EntityAIWander(this, 1.0F)); @@ -83,68 +71,28 @@ public EntityRakshasa(World par1World) { tasks.addTask(5, new EntityAIWatchClosest2(this, EntityIllithid.class, 5.0F, 0.02F)); tasks.addTask(5, new EntityAILookIdle(this)); targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); - } - - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(42.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(8.0D); - getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).setBaseValue(1.0D); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - + @Override public int getTalkInterval() { return 80; } - - + @Override protected SoundEvent getAmbientSound() { return AudioHandler.entityRakshasaAmbient; } - - - @Override - protected SoundEvent getHurtSound(DamageSource src) { - return AudioHandler.entityRakshasaHurt; - } - - @Override - protected SoundEvent getDeathSound() { - return AudioHandler.entityRakshasaHurt; - } - - - public ResourceLocation getTexture() { - return currentSkin; - } - - - public String getEntityName() { - return currentName; - } - - + @Override /** * Drop a randomly enchanted book. * * Unlike for many other mobs, this will not be replaced with * the JSON based system, as its needs its own special logic, - * notable for enchanting (unless there is more I don't know + * notable for enchanting (unless there is more I don't know * about the new system, or they enhance it). - */ - protected void dropFewItems(boolean par1, int par2) { + */ protected void dropFewItems(boolean par1, int par2) { int var2 = rand.nextInt(DungeonMobsHelper.getDifficulty(world)); if (var2 == 0) { ItemStack myBook = new ItemStack(Items.ENCHANTED_BOOK, 1); @@ -154,8 +102,17 @@ protected void dropFewItems(boolean par1, int par2) { world.spawnEntity(itemEnt); } } - - + + @Override + protected SoundEvent getHurtSound(DamageSource src) { + return AudioHandler.entityRakshasaHurt; + } + + @Override + protected SoundEvent getDeathSound() { + return AudioHandler.entityRakshasaHurt; + } + @Override public boolean getCanSpawnHere() { if (rakshasaIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { @@ -169,65 +126,79 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(42.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(8.0D); + getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).setBaseValue(1.0D); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } + + public ResourceLocation getTexture() { + return currentSkin; + } + + public String getEntityName() { + return currentName; + } + @Override public void attackEntityWithRangedAttack(EntityLivingBase var1, float lol) { double var11 = var1.posX + var1.motionX - posX; - double var13 = var1.getEntityBoundingBox().minY + var1.motionY - + var1.height - getEntityBoundingBox().maxY; + double var13 = var1.getEntityBoundingBox().minY + var1.motionY + var1.height - getEntityBoundingBox().maxY; double var15 = var1.posZ + var1.motionZ - posZ; - + EntityMagicMissile mm = new EntityMagicMissile(world, this, ConfigHandler.rakshasaPtLvl); targetArrow(mm); world.spawnEntity(mm); } - - + + @Override + public void setSwingingArms(boolean swingingArms) {/*Do Nothing*/} + protected void targetArrow(EntityArrow entityarrow) { EntityLivingBase target = getAttackTarget(); if (target == null) { return; } double vx = target.posX - posX; - double vy = target.getEntityBoundingBox().minY - + (double) (target.height / 2.0F) - + (rand.nextFloat() - 0.5) - - entityarrow.posY; + double vy = target.getEntityBoundingBox().minY + (double) (target.height / 2.0F) + (rand.nextFloat() - 0.5) - entityarrow.posY; double vz = target.posZ - posZ; double dist = (double) MathHelper.sqrt((vx * vx) + (vz * vz)); entityarrow.shoot(vx, vy + (dist / 5), vz, 1.6F, 0.0f); } - - + @Override public void onLivingUpdate() { castingTimer++; - + if (imageTimer > 0) { imageTimer--; if (imageTimer % 40 == 0) { switchPosition(); } } - + if (hasteTimer > 0) { if (hasteTimer % 4 == 0) { castingTimer++; } hasteTimer--; } - + if (castingTimer >= 120 && !world.isRemote) { - playSound(AudioHandler.entityRakshasael, 1.0F, - 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F)); - + playSound(AudioHandler.entityRakshasael, 1.0F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F)); + boolean castFlag = false; int castSelect; int castAttempts = 0; - + Potion spell; - + do { castSelect = world.rand.nextInt(5); switch (castSelect) { @@ -236,7 +207,8 @@ public void onLivingUpdate() { if (!isPotionActive(spell)) { addPotionEffect(new PotionEffect(spell, 240, 1)); castFlag = true; - } else { + } + else { castAttempts++; } break; @@ -245,7 +217,8 @@ public void onLivingUpdate() { if (!isPotionActive(spell)) { addPotionEffect(new PotionEffect(spell, 240, 3)); castFlag = true; - } else { + } + else { castAttempts++; } break; @@ -255,7 +228,8 @@ public void onLivingUpdate() { addPotionEffect(new PotionEffect(spell, 240, 2)); hasteTimer = 240; castFlag = true; - } else { + } + else { castAttempts++; } break; @@ -263,7 +237,8 @@ public void onLivingUpdate() { if (imageTimer < 30) { createImages(); castFlag = true; - } else { + } + else { castAttempts++; } break; @@ -272,10 +247,12 @@ public void onLivingUpdate() { if (canEntityBeSeen(getAttackTarget())) { attackEntityWithRangedAttack(getAttackTarget(), 0F); castFlag = true; - } else { + } + else { castAttempts++; } - } else { + } + else { castAttempts++; } break; @@ -283,70 +260,83 @@ public void onLivingUpdate() { castAttempts++; break; } - } while (!castFlag && castAttempts < 6); - + } + while (!castFlag && castAttempts < 6); + castingTimer -= 120; } - + super.onLivingUpdate(); } - - + + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + super.writeEntityToNBT(par1NBTTagCompound); + + par1NBTTagCompound.setInteger("CastTimer", castingTimer); + par1NBTTagCompound.setInteger("HasteTimer", hasteTimer); + par1NBTTagCompound.setInteger("ImageTimer", imageTimer); + } + + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + castingTimer = par1NBTTagCompound.getInteger("CastTimer"); + hasteTimer = par1NBTTagCompound.getInteger("HasteTimer"); + imageTimer = par1NBTTagCompound.getInteger("ImageTimer"); + } + private void createImages() { imageTimer = 240; - + int imageAttempts = 0; - + int imageCount = world.rand.nextInt(3) + DungeonMobsHelper.getDifficulty(world); - + for (int i = 0; i < imageCount && imageAttempts < 3 + imageCount; i++) { double imageX = posX + (world.rand.nextFloat() * 4.0F); double imageY = posY; double imageZ = posZ + (world.rand.nextFloat() * 4.0F); - + EntityRakshasaImage bar = new EntityRakshasaImage(world, (EntityLivingBase) getAttackTarget(), this); bar.setLocationAndAngles(imageX, imageY, imageZ, rotationYaw, rotationPitch); - + if (bar.getCanSpawnHere() && !world.isRemote) { if (!world.isRemote) { world.spawnEntity(bar); myImages.add(bar); - if (getAttackTarget() != null) - bar.setAttackTarget(getAttackTarget()); - } else { + if (getAttackTarget() != null) bar.setAttackTarget(getAttackTarget()); + } + else { imageCount--; imageAttempts++; } - } else { + } + else { imageCount--; imageAttempts++; } } } - - + private void switchPosition() { if (!world.isRemote) { if (!myImages.isEmpty()) { - EntityRakshasaImage foo = (EntityRakshasaImage) myImages - .get(world.rand.nextInt(myImages.size())); - + EntityRakshasaImage foo = (EntityRakshasaImage) myImages.get(world.rand.nextInt(myImages.size())); + double prevX = posX; double prevY = posY; double prevZ = posZ; - + posX = foo.posX; posY = foo.posY; posZ = foo.posZ; - + foo.posX = prevX; foo.posY = prevY; foo.posZ = prevZ; } } } - - + public void destroyImage(EntityRakshasaImage foo) { Iterator iter = myImages.iterator(); while (iter.hasNext()) { @@ -356,25 +346,4 @@ public void destroyImage(EntityRakshasaImage foo) { } } } - - - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - par1NBTTagCompound.setInteger("CastTimer", castingTimer); - par1NBTTagCompound.setInteger("HasteTimer", hasteTimer); - par1NBTTagCompound.setInteger("ImageTimer", imageTimer); - } - - - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - castingTimer = par1NBTTagCompound.getInteger("CastTimer"); - hasteTimer = par1NBTTagCompound.getInteger("HasteTimer"); - imageTimer = par1NBTTagCompound.getInteger("ImageTimer"); - } - - - @Override - public void setSwingingArms(boolean swingingArms) {/*Do Nothing*/} } diff --git a/src/main/java/com/gw/dm/entity/EntityRakshasaImage.java b/src/main/java/com/gw/dm/entity/EntityRakshasaImage.java index d9782dd..14ef8e3 100644 --- a/src/main/java/com/gw/dm/entity/EntityRakshasaImage.java +++ b/src/main/java/com/gw/dm/entity/EntityRakshasaImage.java @@ -1,7 +1,6 @@ package com.gw.dm.entity; import com.gw.dm.util.ConfigHandler; - import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; @@ -18,138 +17,119 @@ public class EntityRakshasaImage extends EntityCreature implements IRangedAttackMob { public EntityRakshasa owner; private int timeToLive; - + public EntityRakshasaImage(World par1World) { super(par1World); experienceValue = 0; timeToLive = 240; owner = null; - + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackRanged(this, 1.0F, 40, 16.0F)); tasks.addTask(3, new EntityAIWander(this, 1.0F)); tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(5, new EntityAILookIdle(this)); targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); + targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - + + public EntityRakshasaImage(World par1World, int par2) { this(par1World); timeToLive = par2; } - - + + public EntityRakshasaImage(World par1World, EntityLivingBase foo) { this(par1World); setAttackTarget(foo); } - - + + public EntityRakshasaImage(World par1World, EntityLivingBase foo, EntityRakshasa bar) { this(par1World); setAttackTarget(foo); owner = bar; } - - + + protected void applyEntityAttributes() { super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(42.0D - * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(42.0D * ConfigHandler.healthx); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); } - - - @Override - public boolean getCanSpawnHere() { - return super.getCanSpawnHere(); - } - - + @Override protected SoundEvent getAmbientSound() { return null; } - - + @Override - protected SoundEvent getHurtSound(DamageSource src) { - return null; + protected void dropFewItems(boolean par1, int par2) {/*Do NOthing*/} + + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("timeToLive", timeToLive); } - - + @Override - protected SoundEvent getDeathSound() { - return null; + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + timeToLive = par1NBTTagCompound.getInteger("timeToLive"); } - - + @Override public void onLivingUpdate() { timeToLive--; - - if (timeToLive == 0) - setDead(); - + + if (timeToLive == 0) setDead(); + super.onLivingUpdate(); } - - + + @Override + public boolean getCanSpawnHere() { + return super.getCanSpawnHere(); + } + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { setDead(); return false; } - - + @Override - protected void dropFewItems(boolean par1, int par2) {/*Do NOthing*/} - - + protected SoundEvent getHurtSound(DamageSource src) { + return null; + } + @Override - public void attackEntityWithRangedAttack(EntityLivingBase var1, - float lol) {/*Do NOthing*/} - - + protected SoundEvent getDeathSound() { + return null; + } + + @Override + public void attackEntityWithRangedAttack(EntityLivingBase var1, float lol) {/*Do NOthing*/} + + @Override + public void setSwingingArms(boolean swingingArms) {/*DO Nothing*/} + @Override public void setDead() { - world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, - posX, posY + 1.5D, posZ, 0.0D, 0.0D, 0.0D); - + world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, posX, posY + 1.5D, posZ, 0.0D, 0.0D, 0.0D); + for (int i = 0; i < 8; i++) { double foo = world.rand.nextDouble() - world.rand.nextDouble(); - - world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, - posX + foo, posY + 1.0D + foo, posZ + foo, 0.0D, 0.0D, 0.0D); + + world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, posX + foo, posY + 1.0D + foo, posZ + foo, 0.0D, 0.0D, 0.0D); } - - playSound(SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, - 1.0F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F)); - + + playSound(SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F)); + if (owner != null) { owner.destroyImage(this); } super.setDead(); } - - - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("timeToLive", timeToLive); - } - - - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - timeToLive = par1NBTTagCompound.getInteger("timeToLive"); - } - - - @Override - public void setSwingingArms(boolean swingingArms) {/*DO Nothing*/} } diff --git a/src/main/java/com/gw/dm/entity/EntityRevenant.java b/src/main/java/com/gw/dm/entity/EntityRevenant.java index 88d18aa..ec4424f 100644 --- a/src/main/java/com/gw/dm/entity/EntityRevenant.java +++ b/src/main/java/com/gw/dm/entity/EntityRevenant.java @@ -1,18 +1,12 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.revenantIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIFleeSun; -import net.minecraft.entity.ai.EntityAILeapAtTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; -import net.minecraft.entity.ai.EntityAIRestrictSun; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.ai.EntityAIZombieAttack; +import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; @@ -21,11 +15,9 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.revenantIg; -public class EntityRevenant extends EntityZombie implements IBeMagicMob { +public class EntityRevenant extends EntityZombie implements IBeMagicMob { private static double HEALTH = 30.0; private static String mobName = DungeonMobs.MODID + ":dmrevenant"; public boolean ignoreHeight; @@ -33,7 +25,7 @@ public class EntityRevenant extends EntityZombie implements IBeMagicMob { private boolean newspawn; private Potion buff; private Potion regen; - + public EntityRevenant(World worldIn) { super(worldIn); regen = Potion.getPotionFromResourceLocation("regeneration"); @@ -41,36 +33,7 @@ public EntityRevenant(World worldIn) { darkspawn = true; newspawn = true; } - - - public boolean attackEntityAsMob(Entity victim) { - if (super.attackEntityAsMob(victim)) { - if (!isChild() && (victim instanceof EntityLivingBase)) { - switch (world.getDifficulty()) { - case EASY: - ((EntityLivingBase) victim) - .addPotionEffect(new PotionEffect(MobEffects.WITHER, 80, 1)); - break; - case HARD: - ((EntityLivingBase) victim) - .addPotionEffect(new PotionEffect(MobEffects.WITHER, 120, 1)); - break; - case NORMAL: - ((EntityLivingBase) victim) - .addPotionEffect(new PotionEffect(MobEffects.WITHER, 100, 1)); - break; - case PEACEFUL: - default: - break; - - } - } - return true; - } - return false; - } - - + protected void initEntityAI() { tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(1, new EntityAIRestrictSun(this)); @@ -83,22 +46,42 @@ protected void initEntityAI() { tasks.addTask(8, new EntityAILookIdle(this)); applyEntityAI(); } - - + protected void applyEntityAttributes() { super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(HEALTH - * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(HEALTH * ConfigHandler.healthx); getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4d); getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(10.0d); getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0d - * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0d * ConfigHandler.damagex + ConfigHandler.damageplus); getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(24.0d); } - - + + public boolean attackEntityAsMob(Entity victim) { + if (super.attackEntityAsMob(victim)) { + if (!isChild() && (victim instanceof EntityLivingBase)) { + switch (world.getDifficulty()) { + case EASY: + ((EntityLivingBase) victim).addPotionEffect(new PotionEffect(MobEffects.WITHER, 80, 1)); + break; + case HARD: + ((EntityLivingBase) victim).addPotionEffect(new PotionEffect(MobEffects.WITHER, 120, 1)); + break; + case NORMAL: + ((EntityLivingBase) victim).addPotionEffect(new PotionEffect(MobEffects.WITHER, 100, 1)); + break; + case PEACEFUL: + default: + break; + + } + } + return true; + } + return false; + } + public void addBuff() { if (isChild() || ((rand.nextInt(16) + 24) < posY)) { buff = null; @@ -126,25 +109,7 @@ public void addBuff() { return; } } - - - @Override - public boolean getCanSpawnHere() { - if (revenantIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - darkspawn = false; - return super.getCanSpawnHere(); - } - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ)) - || (!world.isRemote && world.isDaytime())) { - return false; - } - if (this.posY > 42.0D && !ignoreHeight) { - return false; - } - return super.getCanSpawnHere(); - } - - + @Override public void onUpdate() { // "Hacky" and inefficient, but its the option the vanilla code leaves @@ -159,31 +124,45 @@ public void onUpdate() { if (buff != null) { if (buff == regen) { regenerate(); - } else if (!isPotionActive(buff)) { + } + else if (!isPotionActive(buff)) { addPotionEffect(new PotionEffect(buff, 60, 1)); } } super.onUpdate(); } - - + + @Override + public boolean getCanSpawnHere() { + if (revenantIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + darkspawn = false; + return super.getCanSpawnHere(); + } + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ)) || (!world.isRemote && world.isDaytime())) { + return false; + } + if (this.posY > 42.0D && !ignoreHeight) { + return false; + } + return super.getCanSpawnHere(); + } + public boolean isInDay() { return (darkspawn && !world.isRemote && world.isDaytime()); } - - + + @Override protected void jump() { super.jump(); // TODO: More forward } - - + + private void regenerate() { - if (!isDead && (getHealth() > 0) - && (getHealth() < HEALTH) && !isBurning()) { + if (!isDead && (getHealth() > 0) && (getHealth() < HEALTH) && !isBurning()) { setHealth(getHealth() + 0.05f); } } - + } diff --git a/src/main/java/com/gw/dm/entity/EntityRustMonster.java b/src/main/java/com/gw/dm/entity/EntityRustMonster.java index a82d8cb..3488de9 100644 --- a/src/main/java/com/gw/dm/entity/EntityRustMonster.java +++ b/src/main/java/com/gw/dm/entity/EntityRustMonster.java @@ -1,13 +1,13 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.rustMonsterIg; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.StringTokenizer; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.ai.EntityAIAttackAnythingWanted; +import com.gw.dm.ai.EntityAIFindItem; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; +import com.gw.dm.util.RMFoodItem; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; @@ -28,65 +28,21 @@ import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.ai.EntityAIAttackAnythingWanted; -import com.gw.dm.ai.EntityAIFindItem; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; -import com.gw.dm.util.RMFoodItem; +import java.util.*; -public class EntityRustMonster extends EntityDungeonMob { +import static com.gw.dm.util.ConfigHandler.rustMonsterIg; +public class EntityRustMonster extends EntityDungeonMob { + private static String mobName = DungeonMobs.MODID + ":dmrustmonster"; - - private static Set foods = new HashSet(((List) - Arrays.asList(new RMFoodItem[]{ - new RMFoodItem(Item.getItemFromBlock(Blocks.GOLD_ORE)), - new RMFoodItem(Item.getItemFromBlock(Blocks.IRON_ORE)), - new RMFoodItem(Item.getItemFromBlock(Blocks.RAIL)), - new RMFoodItem(Item.getItemFromBlock(Blocks.GOLDEN_RAIL)), - new RMFoodItem(Item.getItemFromBlock(Blocks.PISTON)), - new RMFoodItem(Item.getItemFromBlock(Blocks.GOLD_BLOCK)), - new RMFoodItem(Item.getItemFromBlock(Blocks.IRON_BLOCK)), - new RMFoodItem(Item.getItemFromBlock(Blocks.IRON_BARS)), - new RMFoodItem(Item.getItemFromBlock(Blocks.TRIPWIRE_HOOK)), - new RMFoodItem(Item.getItemFromBlock(Blocks.ACTIVATOR_RAIL)), - new RMFoodItem(Items.IRON_AXE), - new RMFoodItem(Items.IRON_DOOR), - new RMFoodItem(Items.IRON_HOE), - new RMFoodItem(Items.IRON_HORSE_ARMOR), - new RMFoodItem(Items.IRON_INGOT), - new RMFoodItem(Items.IRON_NUGGET), - new RMFoodItem(Items.IRON_PICKAXE), - new RMFoodItem(Items.IRON_SHOVEL), - new RMFoodItem(Items.IRON_SWORD), - new RMFoodItem(Items.IRON_BOOTS), - new RMFoodItem(Items.IRON_CHESTPLATE), - new RMFoodItem(Items.IRON_HELMET), - new RMFoodItem(Items.IRON_LEGGINGS), - new RMFoodItem(Items.GOLDEN_AXE), - new RMFoodItem(Items.GOLDEN_CARROT), - new RMFoodItem(Items.GOLDEN_APPLE), - new RMFoodItem(Items.GOLDEN_HOE), - new RMFoodItem(Items.GOLDEN_HORSE_ARMOR), - new RMFoodItem(Items.GOLD_INGOT), - new RMFoodItem(Items.GOLD_NUGGET), - new RMFoodItem(Items.GOLDEN_PICKAXE), - new RMFoodItem(Items.GOLDEN_SHOVEL), - new RMFoodItem(Items.GOLDEN_SWORD), - new RMFoodItem(Items.GOLDEN_BOOTS), - new RMFoodItem(Items.GOLDEN_CHESTPLATE), - new RMFoodItem(Items.GOLDEN_HELMET), - new RMFoodItem(Items.GOLDEN_LEGGINGS) - }))); - + + private static Set foods = new HashSet(((List) Arrays.asList(new RMFoodItem[]{new RMFoodItem(Item.getItemFromBlock(Blocks.GOLD_ORE)), new RMFoodItem(Item.getItemFromBlock(Blocks.IRON_ORE)), new RMFoodItem(Item.getItemFromBlock(Blocks.RAIL)), new RMFoodItem(Item.getItemFromBlock(Blocks.GOLDEN_RAIL)), new RMFoodItem(Item.getItemFromBlock(Blocks.PISTON)), new RMFoodItem(Item.getItemFromBlock(Blocks.GOLD_BLOCK)), new RMFoodItem(Item.getItemFromBlock(Blocks.IRON_BLOCK)), new RMFoodItem(Item.getItemFromBlock(Blocks.IRON_BARS)), new RMFoodItem(Item.getItemFromBlock(Blocks.TRIPWIRE_HOOK)), new RMFoodItem(Item.getItemFromBlock(Blocks.ACTIVATOR_RAIL)), new RMFoodItem(Items.IRON_AXE), new RMFoodItem(Items.IRON_DOOR), new RMFoodItem(Items.IRON_HOE), new RMFoodItem(Items.IRON_HORSE_ARMOR), new RMFoodItem(Items.IRON_INGOT), new RMFoodItem(Items.IRON_NUGGET), new RMFoodItem(Items.IRON_PICKAXE), new RMFoodItem(Items.IRON_SHOVEL), new RMFoodItem(Items.IRON_SWORD), new RMFoodItem(Items.IRON_BOOTS), new RMFoodItem(Items.IRON_CHESTPLATE), new RMFoodItem(Items.IRON_HELMET), new RMFoodItem(Items.IRON_LEGGINGS), new RMFoodItem(Items.GOLDEN_AXE), new RMFoodItem(Items.GOLDEN_CARROT), new RMFoodItem(Items.GOLDEN_APPLE), new RMFoodItem(Items.GOLDEN_HOE), new RMFoodItem(Items.GOLDEN_HORSE_ARMOR), new RMFoodItem(Items.GOLD_INGOT), new RMFoodItem(Items.GOLD_NUGGET), new RMFoodItem(Items.GOLDEN_PICKAXE), new RMFoodItem(Items.GOLDEN_SHOVEL), new RMFoodItem(Items.GOLDEN_SWORD), new RMFoodItem(Items.GOLDEN_BOOTS), new RMFoodItem(Items.GOLDEN_CHESTPLATE), new RMFoodItem(Items.GOLDEN_HELMET), new RMFoodItem(Items.GOLDEN_LEGGINGS)}))); + private Entity myTarget; private boolean pissed; private boolean ignoreHeight; - - + + public EntityRustMonster(World par1World) { super(par1World); setSize(1.4F, 1.4F); @@ -99,138 +55,79 @@ public EntityRustMonster(World par1World) { targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); targetTasks.addTask(2, new EntityAIFindItem(this, 24, foods)); } - + public static void setFoods(List list) { foods = new HashSet<>(); appendToFoods(list); } - + public static void appendToFoods(List list) { for (String rl : list) { StringTokenizer tokens = new StringTokenizer(rl, ":"); - Item item = Item.REGISTRY.getObject(new ResourceLocation(tokens.nextToken(), - tokens.nextToken())); + Item item = Item.REGISTRY.getObject(new ResourceLocation(tokens.nextToken(), tokens.nextToken())); if (tokens.hasMoreTokens()) { foods.add(new RMFoodItem(item, Integer.parseInt(tokens.nextToken()))); - } else { + } + else { foods.add(new RMFoodItem(item)); } } } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - + @Override public int getTotalArmorValue() { return 9; } - + @Override public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.ARTHROPOD; } - - @Override - protected SoundEvent getAmbientSound() { - return AudioHandler.entityRustMonsterAmbient; - } - - @Override - protected SoundEvent getHurtSound(DamageSource src) { - return AudioHandler.entityRustMonsterHurt; - } - - @Override - protected SoundEvent getDeathSound() { - return AudioHandler.entityRustMonsterDeath; - } - - protected void dropFewItems(boolean par1, int par2) { - if (par1) { - dropItem(Items.COAL, rand.nextInt(2) + par2); - } - } - - @Override - public boolean getCanSpawnHere() { - if (rustMonsterIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { - return false; - } - - if (!ignoreHeight) { - for (int i = -24; i < 24; i++) - for (int j = -24; j < 24; j++) - for (int k = -24; k < 24; k++) { - int checkX = (int) posX + i; - int checkY = (int) posY + j; - int checkZ = (int) posZ + k; - - if (checkY < 1) - checkY = 1; - - BlockPos where = new BlockPos(checkX, checkY, checkZ); - if (world.getBlockState(where).getBlock() == Blocks.IRON_ORE) - return super.getCanSpawnHere(); - - if (world.getBlockState(where).getBlock() == Blocks.GOLD_ORE) - return super.getCanSpawnHere(); - } - return false; - } else return super.getCanSpawnHere(); - } - - @Override - public int getTalkInterval() { - return 120; - } - + @Override protected void jump() { motionY = 0.4D; - - if (isPotionActive(Potion.getPotionFromResourceLocation("jump_boost"))) - motionY += (double) ((float) (getActivePotionEffect(Potion - .getPotionFromResourceLocation("jump_boost")) - .getAmplifier() + 1) * 0.1F); - + + if (isPotionActive(Potion.getPotionFromResourceLocation("jump_boost"))) motionY += (double) ((float) (getActivePotionEffect(Potion.getPotionFromResourceLocation("jump_boost")).getAmplifier() + 1) * 0.1F); + if (isSprinting()) { float var1 = rotationYaw * 0.017453292F; motionX -= (double) (MathHelper.sin(var1) * 0.2F); motionZ += (double) (MathHelper.cos(var1) * 0.2F); } - + isAirBorne = true; ForgeHooks.onLivingJump(this); } - - - // Manipulate food list with strings - + + @Override + public int getTalkInterval() { + return 120; + } + + @Override + protected SoundEvent getAmbientSound() { + return AudioHandler.entityRustMonsterAmbient; + } + + protected void dropFewItems(boolean par1, int par2) { + if (par1) { + dropItem(Items.COAL, rand.nextInt(2) + par2); + } + } + @Override public boolean attackEntityFrom(DamageSource src, float amount) { if (src.getTrueSource() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) src.getTrueSource(); ItemStack stack = player.getHeldItemMainhand(); - - if ((stack != null) && (stack.getItem() != null) - && foods.contains(new RMFoodItem(stack.getItem(), - stack.getItemDamage()))) { + + if ((stack != null) && (stack.getItem() != null) && foods.contains(new RMFoodItem(stack.getItem(), stack.getItemDamage()))) { if (player.getHeldItemMainhand().isItemStackDamageable()) { int yar = rand.nextInt(11) + 15; player.getHeldItemMainhand().damageItem(yar, this); - } else { + } + else { int numToDestroy = getRNG().nextInt(6) + 1; for (int m = 0; m < numToDestroy; m++) { if (stack.getCount() == 1) { @@ -243,13 +140,23 @@ public boolean attackEntityFrom(DamageSource src, float amount) { } return super.attackEntityFrom(src, amount); } - + + @Override + protected SoundEvent getHurtSound(DamageSource src) { + return AudioHandler.entityRustMonsterHurt; + } + + @Override + protected SoundEvent getDeathSound() { + return AudioHandler.entityRustMonsterDeath; + } + @Override public boolean attackEntityAsMob(Entity ent) { if (ent instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) ent; Iterable armors = player.getArmorInventoryList(); - + for (ItemStack armorPiece : armors) { if ((armorPiece != null) && (armorPiece.getItem() != null)) { if (foods.contains(new RMFoodItem(armorPiece.getItem()))) { @@ -261,19 +168,61 @@ public boolean attackEntityAsMob(Entity ent) { } return super.attackEntityAsMob(ent); } - + + + // Manipulate food list with strings + + @Override + public boolean getCanSpawnHere() { + if (rustMonsterIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { + return false; + } + + if (!ignoreHeight) { + for (int i = -24; i < 24; i++) + for (int j = -24; j < 24; j++) + for (int k = -24; k < 24; k++) { + int checkX = (int) posX + i; + int checkY = (int) posY + j; + int checkZ = (int) posZ + k; + + if (checkY < 1) checkY = 1; + + BlockPos where = new BlockPos(checkX, checkY, checkZ); + if (world.getBlockState(where).getBlock() == Blocks.IRON_ORE) return super.getCanSpawnHere(); + + if (world.getBlockState(where).getBlock() == Blocks.GOLD_ORE) return super.getCanSpawnHere(); + } + return false; + } + else return super.getCanSpawnHere(); + } + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } + public Entity getTarget() { if (pissed) { return this.getAttackTarget(); } if (getAttackTarget() == null) { return this.myTarget; - } else { + } + else { return this.getAttackTarget(); } } - - + + public void setTarget(Entity targetEntity, boolean livingFlag) { myTarget = targetEntity; } diff --git a/src/main/java/com/gw/dm/entity/EntityShrieker.java b/src/main/java/com/gw/dm/entity/EntityShrieker.java index c1388b4..87fb1ff 100644 --- a/src/main/java/com/gw/dm/entity/EntityShrieker.java +++ b/src/main/java/com/gw/dm/entity/EntityShrieker.java @@ -1,13 +1,11 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.shriekerIg; - -import java.util.List; -import java.util.StringTokenizer; -import java.util.logging.Level; -import java.util.logging.Logger; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; @@ -22,29 +20,22 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import java.util.List; +import java.util.StringTokenizer; +import java.util.logging.Level; +import java.util.logging.Logger; + +import static com.gw.dm.util.ConfigHandler.shriekerIg; public class EntityShrieker extends EntityMob { - private static ResourceLocation[] entityNames = { - new ResourceLocation("minecraft", "zombie"), - new ResourceLocation("minecraft", "skeleton"), - new ResourceLocation("minecraft", "spider"), - new ResourceLocation("minecraft", "cave_spider"), - new ResourceLocation("minecraft", "creeper"), - new ResourceLocation("minecraft", "witch"), - new ResourceLocation("minecraft", "enderman") - }; + private static ResourceLocation[] entityNames = {new ResourceLocation("minecraft", "zombie"), new ResourceLocation("minecraft", "skeleton"), new ResourceLocation("minecraft", "spider"), new ResourceLocation("minecraft", "cave_spider"), new ResourceLocation("minecraft", "creeper"), new ResourceLocation("minecraft", "witch"), new ResourceLocation("minecraft", "enderman")}; private static String mobName = DungeonMobs.MODID + ":shrieker"; private int screamTicks; private boolean hasScreamed; private int maxSummoned; private int cooldown; - - + + public EntityShrieker(World par1World) { super(par1World); experienceValue = 15; @@ -53,123 +44,115 @@ public EntityShrieker(World par1World) { maxSummoned = 5; cooldown = 0; } - + public static void appendToSummonList(String location) { StringTokenizer tokens = new StringTokenizer(location, ":"); String modid = tokens.nextToken(), name; if (tokens.hasMoreTokens()) { name = tokens.nextToken(); - } else { - String msg = "Could not add mob " - + location + "; name malformed."; + } + else { + String msg = "Could not add mob " + location + "; name malformed."; System.err.println(msg); Logger.getLogger("Error").log(Level.WARNING, msg); return; } - ResourceLocation[] newlist - = new ResourceLocation[entityNames.length + 1]; + ResourceLocation[] newlist = new ResourceLocation[entityNames.length + 1]; int ctr; - + for (ctr = 0; ctr < entityNames.length; ctr++) { newlist[ctr] = entityNames[ctr]; } - + newlist[ctr] = new ResourceLocation(modid, name); - + entityNames = null; entityNames = newlist; } - + private static void appendToSummonListNoGrow(String location, int index) { StringTokenizer tokens = new StringTokenizer(location, ":"); String modid = tokens.nextToken(), name; if (tokens.hasMoreTokens()) { name = tokens.nextToken(); - } else { - String msg = "Could not add mob " - + location + "; name malformed."; + } + else { + String msg = "Could not add mob " + location + "; name malformed."; System.err.println(msg); Logger.getLogger("Error").log(Level.WARNING, msg); return; } - + entityNames[index] = new ResourceLocation(modid, name); } - + public static void appendToSummonList(List locations) { - ResourceLocation[] newlist - = new ResourceLocation[entityNames.length + locations.size()]; - + ResourceLocation[] newlist = new ResourceLocation[entityNames.length + locations.size()]; + int ctr; - + for (ctr = 0; ctr < entityNames.length; ctr++) { newlist[ctr] = entityNames[ctr]; } - + entityNames = newlist; - + for (String location : locations) { appendToSummonListNoGrow(location, ctr++); } } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.0D); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1.0D); - } - + @Override public int getTotalArmorValue() { return 0; } - - + + @Override + protected void collideWithEntity(Entity par1Entity) {/*Do Nothing*/} + @Override public boolean canBePushed() { return false; } - - + + @Override public void onLivingUpdate() { if (world.isAirBlock(new BlockPos(posX, posY - 1, posZ))) { setDead(); - } else { + } + else { float light = getBrightness(); hasScreamed = false; - + if (light > 0.08F) { screamTicks++; - + if (screamTicks % 70 == 0) { playSound(AudioHandler.entityShrieker, 1.0f, 1.0f); hasScreamed = true; } - + if (screamTicks % 150 == 0) { - if (world.getClosestPlayerToEntity(this, 32.0D) != null) - summonMobs(); + if (world.getClosestPlayerToEntity(this, 32.0D) != null) summonMobs(); screamTicks = 0; } } } super.onLivingUpdate(); } - - + + @Override public boolean attackEntityFrom(DamageSource src, float amount) { if (src.getTrueSource() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) src.getTrueSource(); - + if (!player.capabilities.isCreativeMode) { playSound(AudioHandler.entityShrieker, 1.0f, 1.0f); - + int var = 0; - + switch (world.getDifficulty()) { case EASY: var = 1; @@ -184,44 +167,12 @@ public boolean attackEntityFrom(DamageSource src, float amount) { default: break; } - if (rand.nextInt(4 - var) == 0) - summonMobs(); + if (rand.nextInt(4 - var) == 0) summonMobs(); } } return super.attackEntityFrom(src, amount); } - - - @Override - protected void collideWithEntity(Entity par1Entity) {/*Do Nothing*/} - - - @Override - public void onCollideWithPlayer(EntityPlayer ent) { - if (!ent.capabilities.isCreativeMode) { - playSound(AudioHandler.entityShrieker, 1.0f, 1.0f); - summonMobs(); - } - } - - - @Override - public void faceEntity(Entity par1Entity, float par2, float par3) {/*Nothing*/} - - - @Override - protected void dropFewItems(boolean par1, int par2) { - int var3; - int var4; - - var3 = rand.nextInt(2 + par2); - - for (var4 = 0; var4 < var3; var4++) { - dropItem(Items.NETHER_WART, 1); - } - } - - + @Override public boolean getCanSpawnHere() { if (shriekerIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { @@ -239,12 +190,26 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.0D); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1.0D); + } + + @Override + public void onCollideWithPlayer(EntityPlayer ent) { + if (!ent.capabilities.isCreativeMode) { + playSound(AudioHandler.entityShrieker, 1.0f, 1.0f); + summonMobs(); + } + } + protected void summonMobs() { - + int numMobs = rand.nextInt(4) + 1; - + if (world.getDifficulty() == EnumDifficulty.NORMAL) { numMobs++; cooldown -= 5; @@ -256,43 +221,37 @@ protected void summonMobs() { if (!world.isRemote) { for (int i = 0; i < numMobs; i++) { int fubar = rand.nextInt(entityNames.length); - - EntityLiving attracted = (EntityLiving) EntityList - .createEntityByIDFromName(entityNames[fubar], world); - + + EntityLiving attracted = (EntityLiving) EntityList.createEntityByIDFromName(entityNames[fubar], world); + if (attracted == null) { return; } - + double spawnx = posX + (rand.nextDouble() * 8.0D) - (rand.nextDouble() * 8.0D); double spawny = posY - 1.0 + (rand.nextDouble() * 3); double spawnz = posZ + (rand.nextDouble() * 8.0D) - (rand.nextDouble() * 8.0D); - + if (Math.abs(Math.abs(spawnx) - Math.abs(posX)) < 2) { - if (spawnx < 0) - spawnx -= 2.0D; - else - spawnx += 2.0D; + if (spawnx < 0) spawnx -= 2.0D; + else spawnx += 2.0D; } - + if (Math.abs(Math.abs(spawnz) - Math.abs(posZ)) < 2) { - if (spawnz < 0) - spawnz -= 2.0D; - else - spawnz += 2.0D; + if (spawnz < 0) spawnz -= 2.0D; + else spawnz += 2.0D; } - + makeSummonIgnoreHeight(attracted); - - attracted.setLocationAndAngles(spawnx, spawny + 1, spawnz, - MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F); + + attracted.setLocationAndAngles(spawnx, spawny + 1, spawnz, MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F); attracted.rotationYawHead = attracted.rotationYaw; attracted.renderYawOffset = attracted.rotationYaw; - + //FIXME: Mostly spawns mobs into walls! if (attracted.getCanSpawnHere() && !world.isRemote && attracted.isNotColliding()) { world.spawnEntity(attracted); - + // FIXME: Lizalfos //if(attracted instanceof EntityLizalfos) // ((EntityLizalfos)attracted).forceTwinSpawn(); @@ -300,18 +259,32 @@ protected void summonMobs() { } } } - - + public boolean canAttackClass(Class par1Class) { return false; } - - + + @Override + protected void dropFewItems(boolean par1, int par2) { + int var3; + int var4; + + var3 = rand.nextInt(2 + par2); + + for (var4 = 0; var4 < var3; var4++) { + dropItem(Items.NETHER_WART, 1); + } + } + + @Override + public void faceEntity(Entity par1Entity, float par2, float par3) {/*Nothing*/} + private void makeSummonIgnoreHeight(EntityLiving ent) { if (ent instanceof EntityDungeonMob) { EntityDungeonMob foo = (EntityDungeonMob) ent; foo.setIgnoreHeight(true); - } else if (ent instanceof EntityGhoul) { + } + else if (ent instanceof EntityGhoul) { EntityGhoul foo = (EntityGhoul) ent; foo.setIgnoreHeight(true); } diff --git a/src/main/java/com/gw/dm/entity/EntityThoqqua.java b/src/main/java/com/gw/dm/entity/EntityThoqqua.java index 875ab4c..3a9b1ff 100644 --- a/src/main/java/com/gw/dm/entity/EntityThoqqua.java +++ b/src/main/java/com/gw/dm/entity/EntityThoqqua.java @@ -1,18 +1,14 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.thoqquaIg; - -import java.util.ArrayList; -import java.util.List; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; +import com.gw.dm.util.MiscRegistrar; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIWanderAvoidWater; -import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -27,11 +23,10 @@ import net.minecraft.world.World; import net.minecraft.world.WorldProviderHell; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; -import com.gw.dm.util.MiscRegistrar; +import java.util.ArrayList; +import java.util.List; + +import static com.gw.dm.util.ConfigHandler.thoqquaIg; public class EntityThoqqua extends EntityDungeonMob { @@ -39,7 +34,7 @@ public class EntityThoqqua extends EntityDungeonMob { public List blocksConverted; public int setShitOnFire; public int attackTime; - + public EntityThoqqua(World par1World) { super(par1World); blocksConverted = new ArrayList<>(); @@ -50,37 +45,7 @@ public EntityThoqqua(World par1World) { setShitOnFire = 0; attackTime = 0; } - - - @Override - public boolean getCanSpawnHere() { - if (thoqquaIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - if (world.provider instanceof WorldProviderHell) - return super.getCanSpawnHere(); - - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) - return false; - - if (posY > 32.0D && !ignoreHeight) - return false; - - return super.getCanSpawnHere(); - } - - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(25.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - + protected void initEntityAI() { tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, true)); tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); @@ -88,67 +53,56 @@ protected void initEntityAI() { tasks.addTask(7, new EntityAILookIdle(this)); targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0])); } - - - @Override - public int getTotalArmorValue() { - return 8; - } - - + @Override protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_SILVERFISH_AMBIENT; } - - - @Override - protected SoundEvent getHurtSound(DamageSource src) { - return SoundEvents.ENTITY_SILVERFISH_HURT; - } - - - @Override - protected SoundEvent getDeathSound() { - return SoundEvents.ENTITY_SILVERFISH_DEATH; - } - - + @Override protected void dropFewItems(boolean par1, int par2) { int var3; int var4; - + var3 = rand.nextInt(3); - + for (var4 = 0; var4 < var3; var4++) { dropItem(Items.FIRE_CHARGE, 1); } } - - + + @Override + public int getTotalArmorValue() { + return 8; + } + + @Override + protected void damageEntity(DamageSource source, float damageAmount) { + if (immune(source)) { + return; + } + super.damageEntity(source, damageAmount); + } + @Override public void onLivingUpdate() { super.onLivingUpdate(); changeLavaToMagma(false); - if(inWater) { + if (inWater) { damageEntity(DamageSource.DROWN, 1); } - + setShitOnFire++; attackTime--; - + int foo; - - if (DungeonMobsHelper.getDifficulty(world) < 1) - foo = 0; - else if (DungeonMobsHelper.getDifficulty(world) < 3) - foo = 1; - else - foo = 2; - + + if (DungeonMobsHelper.getDifficulty(world) < 1) foo = 0; + else if (DungeonMobsHelper.getDifficulty(world) < 3) foo = 1; + else foo = 2; + if (setShitOnFire > 39) { for (int a = (int) posX - foo; a < (int) posX + foo; a++) for (int b = (int) posY - foo; b < (int) posY + foo; b++) @@ -159,150 +113,130 @@ else if (DungeonMobsHelper.getDifficulty(world) < 3) } updateEntityGnomeState(); } - - + + public void writeEntityToNBT(NBTTagCompound nbt) { + super.writeEntityToNBT(nbt); + nbt.setInteger("FireTimer", setShitOnFire); + + int n = blocksConverted.size(); + + nbt.setInteger("BlockCount", n); + + for (int i = 0; i < n; i++) { + nbt.setIntArray("Block[" + i + "]", BlockPosToArray(blocksConverted.get(i))); + } + } + + @Override + public void readEntityFromNBT(NBTTagCompound nbt) { + super.readEntityFromNBT(nbt); + setShitOnFire = nbt.getInteger("FireTimer"); + + int n = nbt.getInteger("BlockCount"); + + for (int i = 0; i < n; i++) { + this.blocksConverted.add(BlockPosFromArray(nbt.getIntArray("Block[" + i + "]"))); + } + } + private void makeFire(int x, int y, int z) { double foo = world.rand.nextFloat() - 0.5F; double bar = world.rand.nextFloat() - 0.5F; double cow = world.rand.nextFloat() - 0.5F; - world.spawnParticle(EnumParticleTypes.FLAME, - x + foo, y + bar, z + cow, 0.0D, 0.0D, 0.0D); - + world.spawnParticle(EnumParticleTypes.FLAME, x + foo, y + bar, z + cow, 0.0D, 0.0D, 0.0D); + foo = world.rand.nextFloat() - 0.5F; bar = world.rand.nextFloat() - 0.5F; cow = world.rand.nextFloat() - 0.5F; - world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, - x + foo, y + bar, z + cow, 0.0D, 0.0D, 0.0D); - + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + foo, y + bar, z + cow, 0.0D, 0.0D, 0.0D); + BlockPos where = new BlockPos(x, y, z); - if (world.isAirBlock(where) - && world.isSideSolid(new BlockPos(x, y - 1, z), EnumFacing.UP)) { + if (world.isAirBlock(where) && world.isSideSolid(new BlockPos(x, y - 1, z), EnumFacing.UP)) { world.setBlockState(where, Blocks.FIRE.getDefaultState()); - } else if (world.getBlockState(where).getBlock() == Blocks.WATER) { - world.playSound(x + 0.5D, y + 0.5D, z + 0.5D, - SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, - null, 1.0F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F), false); + } + else if (world.getBlockState(where).getBlock() == Blocks.WATER) { + world.playSound(x + 0.5D, y + 0.5D, z + 0.5D, SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, null, 1.0F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F), false); world.setBlockState(where, Blocks.COBBLESTONE.getDefaultState()); } } - - + protected void updateEntityGnomeState() { super.updateEntityActionState(); - + if (!world.isRemote) { if (getAttackTarget() == null && !hasPath()) { int i; int j; int k; Block l; - + i = MathHelper.floor(posX); j = MathHelper.floor(posY + 0.5D); k = MathHelper.floor(posZ); - + for (int l1 = 0; l1 < 6; l1++) { // Pretty sure this is not a faithful update of the original logic... :( BlockPos bp = new BlockPos(i + motionX, j + motionY, k + motionZ); l = world.getBlockState(bp).getBlock(); - + if (l == Blocks.STONE) { - if(ConfigHandler.hardcoreThoqqua) { - world.setBlockState(bp, Blocks.FLOWING_LAVA.getDefaultState(), 3); - blocksConverted.add(bp); - } else { + if (ConfigHandler.hardcoreThoqqua) { + world.setBlockState(bp, Blocks.FLOWING_LAVA.getDefaultState(), 3); + blocksConverted.add(bp); + } + else { world.setBlockState(bp, MiscRegistrar.blockLavarock.getDefaultState(), 3); } } } - } else if (getAttackTarget() != null && !hasPath()) - setAttackTarget(null); + } + else if (getAttackTarget() != null && !hasPath()) setAttackTarget(null); } } - private int[] BlockPosToArray(BlockPos pos) { return new int[]{pos.getX(), pos.getY(), pos.getZ()}; } - private BlockPos BlockPosFromArray(int[] nums) { return new BlockPos(nums[0], nums[1], nums[2]); } - - - public void writeEntityToNBT(NBTTagCompound nbt) { - super.writeEntityToNBT(nbt); - nbt.setInteger("FireTimer", setShitOnFire); - - int n = blocksConverted.size(); - - nbt.setInteger("BlockCount", n); - - for(int i = 0; i < n; i++) { - nbt.setIntArray("Block[" + i + "]", - BlockPosToArray(blocksConverted.get(i))); - } - } - - - @Override - public void readEntityFromNBT(NBTTagCompound nbt) { - super.readEntityFromNBT(nbt); - setShitOnFire = nbt.getInteger("FireTimer"); - - int n = nbt.getInteger("BlockCount"); - - for(int i = 0; i < n; i++) { - this.blocksConverted.add(BlockPosFromArray(nbt.getIntArray("Block[" + i + "]"))); - } - } - - + protected Entity findPlayerToAttack() { double d0 = 16.0D; return world.getClosestPlayerToEntity(this, d0); } - - + protected void attackEntity(Entity par1Entity, float par2) { - if (attackTime <= 0 && par2 < 1.2F && getEntityBoundingBox().expand(1.5D, 1.5D, 1.5D) - .intersects(par1Entity.getEntityBoundingBox())) { + if (attackTime <= 0 && par2 < 1.2F && getEntityBoundingBox().expand(1.5D, 1.5D, 1.5D).intersects(par1Entity.getEntityBoundingBox())) { attackTime = 20; attackEntityAsMob(par1Entity); } } - - + public float getBlockPathWeight(int x, int y, int z) { BlockPos where = new BlockPos(x, y, z); - return world.getBlockState(where).getBlock() == Blocks.STONE - ? 10.0F : super.getBlockPathWeight(where); + return world.getBlockState(where).getBlock() == Blocks.STONE ? 10.0F : super.getBlockPathWeight(where); } - - - public boolean canRenderOnFire() { - return false; - } - private void changeLavaToMagma(boolean forced) { - if(forced) { - for(int i = 0; i < blocksConverted.size(); i++) { + if (forced) { + for (int i = 0; i < blocksConverted.size(); i++) { BlockPos pos = blocksConverted.get(i); System.err.println("Testing block " + pos); Block block = world.getBlockState(pos).getBlock(); - if((block == Blocks.LAVA) || (block == Blocks.FLOWING_LAVA)) { - System.err.println("Converting block " + pos); + if ((block == Blocks.LAVA) || (block == Blocks.FLOWING_LAVA)) { + System.err.println("Converting block " + pos); world.setBlockState(pos, MiscRegistrar.blockLavarock.getDefaultState(), 3); } } blocksConverted.clear(); - } else while(!blocksConverted.isEmpty() && (rand.nextInt(256) == 0)) { + } + else while (!blocksConverted.isEmpty() && (rand.nextInt(256) == 0)) { BlockPos pos = this.blocksConverted.get(0); Block block = world.getBlockState(pos).getBlock(); - if((block == Blocks.LAVA) || (block == Blocks.FLOWING_LAVA)) { + if ((block == Blocks.LAVA) || (block == Blocks.FLOWING_LAVA)) { world.setBlockState(pos, MiscRegistrar.blockLavarock.getDefaultState(), 3); } @@ -310,35 +244,59 @@ private void changeLavaToMagma(boolean forced) { } } - @Override public void setDead() { changeLavaToMagma(true); super.setDead(); } + public boolean canRenderOnFire() { + return false; + } @Override public boolean attackEntityFrom(DamageSource source, float amount) { - if(immune(source)) { + if (immune(source)) { return false; } return super.attackEntityFrom(source, amount); } + @Override + protected SoundEvent getHurtSound(DamageSource src) { + return SoundEvents.ENTITY_SILVERFISH_HURT; + } + + @Override + protected SoundEvent getDeathSound() { + return SoundEvents.ENTITY_SILVERFISH_DEATH; + } @Override - protected void damageEntity(DamageSource source, float damageAmount) { - if(immune(source)) { - return; + public boolean getCanSpawnHere() { + if (thoqquaIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); } - super.damageEntity(source, damageAmount); + if (world.provider instanceof WorldProviderHell) return super.getCanSpawnHere(); + + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) return false; + + if (posY > 32.0D && !ignoreHeight) return false; + + return super.getCanSpawnHere(); } + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(25.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } private boolean immune(DamageSource source) { - return source.isFireDamage() || (source == DamageSource.LAVA) || - (source == DamageSource.IN_WALL); + return source.isFireDamage() || (source == DamageSource.LAVA) || (source == DamageSource.IN_WALL); } diff --git a/src/main/java/com/gw/dm/entity/EntityTroll.java b/src/main/java/com/gw/dm/entity/EntityTroll.java index 0a9b88d..f91e439 100644 --- a/src/main/java/com/gw/dm/entity/EntityTroll.java +++ b/src/main/java/com/gw/dm/entity/EntityTroll.java @@ -1,25 +1,18 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.trollIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -import net.minecraft.entity.ai.EntityAIFleeSun; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAIRestrictSun; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.SoundEvent; @@ -28,24 +21,21 @@ import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; -import com.gw.dm.DungeonMobs; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.trollIg; public class EntityTroll extends EntityMob { + public static final float regen = (float) Math.max((0.3 + Math.log10(ConfigHandler.healthx)), 0.1); private static String mobName = DungeonMobs.MODID + ":dmtroll"; public int stoneStatus = 1; public int stoneCounter = 0; public int regenTimer = 0; - public static final float regen = (float)Math.max((0.3 + Math.log10(ConfigHandler.healthx)), 0.1); - + public EntityTroll(World par1World) { super(par1World); this.experienceValue = 40; - + this.setSize(1.3F, 2.5F); - + this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIRestrictSun(this)); this.tasks.addTask(2, new EntityAIFleeSun(this, 1.0F)); @@ -54,180 +44,155 @@ public EntityTroll(World par1World) { this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityAnimal.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, false, null)); - this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, - EntityAnimal.class, 0, true, false, null)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityAnimal.class, 0, true, false, null)); } - - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D - * ConfigHandler.healthx); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.22D); - this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); - } - - + protected boolean isAIEnabled() { return true; } - - + public int getTotalArmorValue() { return 6; } - - + public int getAttackStrength(Entity par1Entity) { return 5; } - - + + protected void playStepSound(int par1, int par2, int par3, int par4) { + playSound(AudioHandler.dmbts, 1.0f, 1.0f); + } + + public int getTalkInterval() { + return 80; + } + @Override protected SoundEvent getAmbientSound() { return AudioHandler.entityTrollAmbient; } - - + + protected void dropFewItems(boolean par1, int par2) { + int var3; + int var4; + + var3 = this.rand.nextInt(3); + + for (var4 = 0; var4 < var3; var4++) { + this.dropItem(Items.LEATHER, 1); + } + } + + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + super.writeEntityToNBT(par1NBTTagCompound); + + par1NBTTagCompound.setInteger("StoneStatus", this.stoneStatus); + par1NBTTagCompound.setInteger("StoneCounter", this.stoneCounter); + par1NBTTagCompound.setInteger("RegenTimer", this.regenTimer); + } + + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + + this.stoneStatus = par1NBTTagCompound.getInteger("StoneStatus"); + this.stoneCounter = par1NBTTagCompound.getInteger("StoneCounter"); + this.regenTimer = par1NBTTagCompound.getInteger("RegenTimer"); + } + + public void onLivingUpdate() { + // A much cleaner and simpler way to handle petrification and regen + if (!world.isRemote) { + if (world.isDaytime() && (getBrightness() > 0.5f) && world.canSeeSky(getPosition())) { + if (getRNG().nextInt((int) getHealth() + 2) < ++stoneCounter) { + playSound(AudioHandler.dmbts, 1.0f, 1.0f); + this.turnToStone(); + } + } + else if (!this.isDead && (getHealth() > 0) && !isBurning()) { + setHealth(getHealth() + regen); + } + } + super.onLivingUpdate(); + } + @Override protected SoundEvent getHurtSound(DamageSource ds) { return AudioHandler.entityTrollHurt; } - - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityTrollDeath; } - - - protected void playStepSound(int par1, int par2, int par3, int par4) { - playSound(AudioHandler.dmbts, 1.0f, 1.0f); - } - - - public int getTalkInterval() { - return 80; - } - - - public boolean getCanSpawnHere() { - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { - return false; - } - if (trollIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { - return super.getCanSpawnHere(); - } - if (!this.isValidLightLevel()) { - return false; - } - - return super.getCanSpawnHere(); - } - - + @Override protected boolean isValidLightLevel() { int var1 = MathHelper.floor(this.posX); int var2 = MathHelper.floor(this.getEntityBoundingBox().minY); int var3 = MathHelper.floor(this.posZ); - + if (world.getLightFor(EnumSkyBlock.SKY, new BlockPos(var1, var2, var3)) > rand.nextInt(32)) { return false; - } else { + } + else { int var4 = world.getLight(new BlockPos(var1, var2, var3)); - + if (this.world.isThundering()) { int var5 = world.getSkylightSubtracted(); world.setSkylightSubtracted(10); var4 = world.getSkylightSubtracted(); world.setSkylightSubtracted(var5); } - + return var4 <= this.rand.nextInt(5); } } - - - public void onLivingUpdate() { - // A much cleaner and simpler way to handle petrification and regen - if (!world.isRemote) { - if (world.isDaytime() && (getBrightness() > 0.5f) && world.canSeeSky(getPosition())) { - if(getRNG().nextInt((int)getHealth() + 2) < ++stoneCounter) { - playSound(AudioHandler.dmbts, 1.0f, 1.0f); - this.turnToStone(); - } - } else if (!this.isDead && (getHealth() > 0) && !isBurning()) { - setHealth(getHealth() + regen); - } + + public boolean getCanSpawnHere() { + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) { + return false; } - super.onLivingUpdate(); + if (trollIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { + return super.getCanSpawnHere(); + } + if (!this.isValidLightLevel()) { + return false; + } + + return super.getCanSpawnHere(); } - - + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D * ConfigHandler.healthx); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.22D); + this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + } + private void turnToStone() { if (!world.isRemote) { regenTimer = -1; - + setDead(); - int sx = (int)(getEntityBoundingBox().minX + - ((getEntityBoundingBox().maxX - getEntityBoundingBox().minX) / 2) - 0.5); - - int sz = (int)(getEntityBoundingBox().minZ + - ((getEntityBoundingBox().maxZ - getEntityBoundingBox().minZ) / 2) - 0.5); - - world.setBlockState(new BlockPos(sx, (int) getEntityBoundingBox().minY, sz), - Blocks.STONE.getDefaultState(), 3); - world.setBlockState(new BlockPos(sx, (int) getEntityBoundingBox().minY + 1, sz), - Blocks.STONE.getDefaultState(), 3); - this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, - this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); - this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, - this.posX, this.posY + 1, this.posZ, 0.0D, 0.0D, 0.0D); - } - } - - - protected void dropFewItems(boolean par1, int par2) { - int var3; - int var4; - - var3 = this.rand.nextInt(3); - - for (var4 = 0; var4 < var3; var4++) { - this.dropItem(Items.LEATHER, 1); + int sx = (int) (getEntityBoundingBox().minX + ((getEntityBoundingBox().maxX - getEntityBoundingBox().minX) / 2) - 0.5); + + int sz = (int) (getEntityBoundingBox().minZ + ((getEntityBoundingBox().maxZ - getEntityBoundingBox().minZ) / 2) - 0.5); + + world.setBlockState(new BlockPos(sx, (int) getEntityBoundingBox().minY, sz), Blocks.STONE.getDefaultState(), 3); + world.setBlockState(new BlockPos(sx, (int) getEntityBoundingBox().minY + 1, sz), Blocks.STONE.getDefaultState(), 3); + this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 1, this.posZ, 0.0D, 0.0D, 0.0D); } } - - - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - par1NBTTagCompound.setInteger("StoneStatus", this.stoneStatus); - par1NBTTagCompound.setInteger("StoneCounter", this.stoneCounter); - par1NBTTagCompound.setInteger("RegenTimer", this.regenTimer); - } - - - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - this.stoneStatus = par1NBTTagCompound.getInteger("StoneStatus"); - this.stoneCounter = par1NBTTagCompound.getInteger("StoneCounter"); - this.regenTimer = par1NBTTagCompound.getInteger("RegenTimer"); - } - - + public void setDead() { this.regenTimer = -1; - + super.setDead(); } } diff --git a/src/main/java/com/gw/dm/entity/EntityUmberHulk.java b/src/main/java/com/gw/dm/entity/EntityUmberHulk.java index d4768fe..a662138 100644 --- a/src/main/java/com/gw/dm/entity/EntityUmberHulk.java +++ b/src/main/java/com/gw/dm/entity/EntityUmberHulk.java @@ -1,18 +1,12 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.umberHulkIg; - -import java.util.Iterator; -import java.util.List; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -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.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.potion.Potion; @@ -24,73 +18,66 @@ import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import java.util.Iterator; +import java.util.List; + +import static com.gw.dm.util.ConfigHandler.umberHulkIg; public class EntityUmberHulk extends EntityDungeonMob { private static String mobName = DungeonMobs.MODID + ":dmumberhulk"; private boolean ignoreHeight; private int confuseTicks; - + public EntityUmberHulk(World par1World) { super(par1World); setSize(1.9F, 2.3F); experienceValue = 45; isImmuneToFire = true; ignoreHeight = false; - + confuseTicks = 0; - + tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackMelee(this, 1.0F, false)); tasks.addTask(3, new EntityAIWander(this, 1.0F)); tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(4, new EntityAILookIdle(this)); targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); + targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(60.0D - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.18D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(9.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1.0D); - } - - + @Override public int getTotalArmorValue() { return 12; } - - + @Override - protected SoundEvent getAmbientSound() { - return AudioHandler.entityUmberHulkAmbient; + protected void jump() { + motionY = 0.4D; + + Potion jump = Potion.getPotionFromResourceLocation("jump_boost"); + if (isPotionActive(jump)) motionY += (double) ((float) (getActivePotionEffect(jump).getAmplifier() + 1) * 0.1F); + + if (isSprinting()) { + float var1 = rotationYaw * 0.017453292F; + motionX -= (double) (MathHelper.sin(var1) * 0.2F); + motionZ += (double) (MathHelper.cos(var1) * 0.2F); + } + + isAirBorne = true; + ForgeHooks.onLivingJump(this); } - - + @Override protected SoundEvent getHurtSound(DamageSource src) { return AudioHandler.entityUmberHulkHurt; } - - + @Override protected SoundEvent getDeathSound() { return null; } - - + @Override public boolean getCanSpawnHere() { if (umberHulkIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { @@ -104,65 +91,53 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(60.0D * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.18D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(9.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1.0D); + } + @Override public int getTalkInterval() { return 240; } - - + + @Override + protected SoundEvent getAmbientSound() { + return AudioHandler.entityUmberHulkAmbient; + } + + @Override + protected void dropFewItems(boolean par1, int par2) { + int var3; + int var4; + var3 = rand.nextInt(4) + 2 + (2 * par2); + for (var4 = 0; var4 < var3; var4++) { + dropItem(Items.LEATHER, 1); + } + } + @Override public void onLivingUpdate() { confuseTicks++; - + if (confuseTicks % 20 == 0) { - List nearbyPlayers = world.getEntitiesWithinAABB(EntityPlayer.class, - getEntityBoundingBox().expand(16.0D, 4.0D, 16.0D)); + List nearbyPlayers = world.getEntitiesWithinAABB(EntityPlayer.class, getEntityBoundingBox().expand(16.0D, 4.0D, 16.0D)); Iterator iter = nearbyPlayers.iterator(); - + while (iter.hasNext()) { EntityPlayer foo = (EntityPlayer) iter.next(); - + if (canEntityBeSeen(foo) && !foo.capabilities.isCreativeMode) { - foo.addPotionEffect(new - PotionEffect(Potion - .getPotionFromResourceLocation("nausea"), 100, 1)); + foo.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("nausea"), 100, 1)); } } confuseTicks = 0; } super.onLivingUpdate(); } - - - @Override - protected void jump() { - motionY = 0.4D; - - Potion jump = Potion.getPotionFromResourceLocation("jump_boost"); - if (isPotionActive(jump)) - motionY += (double) ((float) (getActivePotionEffect(jump) - .getAmplifier() + 1) * 0.1F); - - if (isSprinting()) { - float var1 = rotationYaw * 0.017453292F; - motionX -= (double) (MathHelper.sin(var1) * 0.2F); - motionZ += (double) (MathHelper.cos(var1) * 0.2F); - } - - isAirBorne = true; - ForgeHooks.onLivingJump(this); - } - - - @Override - protected void dropFewItems(boolean par1, int par2) { - int var3; - int var4; - var3 = rand.nextInt(4) + 2 + (2 * par2); - for (var4 = 0; var4 < var3; var4++) { - dropItem(Items.LEATHER, 1); - } - } } diff --git a/src/main/java/com/gw/dm/entity/EntityVampire.java b/src/main/java/com/gw/dm/entity/EntityVampire.java index eb15a7c..9552c41 100644 --- a/src/main/java/com/gw/dm/entity/EntityVampire.java +++ b/src/main/java/com/gw/dm/entity/EntityVampire.java @@ -1,60 +1,52 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.vampireIg; +import com.gw.dm.DungeonMobs; +import com.gw.dm.DungeonMobsDamageSource; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.ai.AIVampireAttack; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIFleeSun; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIMoveThroughVillage; -import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; -import net.minecraft.entity.ai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAIRestrictSun; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityIronGolem; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import com.gw.dm.DungeonMobs; -import com.gw.dm.DungeonMobsDamageSource; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.ai.AIVampireAttack; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; +import static com.gw.dm.util.ConfigHandler.vampireIg; public class EntityVampire extends EntityDungeonMob implements IBeMagicMob { private static String mobName = DungeonMobs.MODID + ":dmvampire"; private boolean escaping; private boolean feelTrapped; - + public EntityVampire(World worldIn) { super(worldIn); - setSize(0.6F, 1.95F); - if(ConfigHandler.hardcoreVampire) { + setSize(0.6F, 1.95F); + if (ConfigHandler.hardcoreVampire) { experienceValue = 30; - } else { + } + else { experienceValue = 20; } feelTrapped = false; } - - + + @Override public boolean isEntityUndead() { return true; } - - + + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + @Override protected void initEntityAI() { tasks.addTask(0, new EntityAISwimming(this)); @@ -68,55 +60,42 @@ protected void initEntityAI() { tasks.addTask(8, new EntityAILookIdle(this)); applyEntityAI(); } - - + @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(40.0d - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.54d); - getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(12.0d); - getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0d - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(16.0d); + protected void dropFewItems(boolean par1, int par2) { + // They drop some cash, OK.... + dropItem(Items.GOLD_INGOT, rand.nextInt(2) + par2); + if (par1) { + dropItem(Items.EMERALD, rand.nextInt(2) + par2); + } } - - + protected void applyEntityAI() { targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityVillager.class, false)); targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true)); } - - + @Override public void onLivingUpdate() { if (!world.isRemote) { if (world.isDaytime() && (getBrightness() > 0.5f) && world.canSeeSky(getPosition())) { setFire(8); setHealth(getHealth() - 1.0f); - } else if (!this.isDead && (getHealth() > 0)) { + } + else if (!this.isDead && (getHealth() > 0)) { setHealth(getHealth() + 0.05f); } } super.onLivingUpdate(); } - - - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - + public boolean attackEntityAsMob(Entity victim) { if (escaping) { setTrapped(); } - if(super.attackEntityAsMob(victim)) { + if (super.attackEntityAsMob(victim)) { switch (world.getDifficulty()) { case EASY: energyDrain(victim, -1, 8); @@ -132,42 +111,12 @@ public boolean attackEntityAsMob(Entity victim) { break; } return true; - } else { + } + else { return false; } } - - private void energyDrain(Entity victim, int levels, float exhaustion) { - if(victim instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) victim; - player.addExhaustion(exhaustion); - if(ConfigHandler.hardcoreVampire) { - if(player.experienceLevel < (0 - levels)) { - player.attackEntityFrom(DungeonMobsDamageSource.ENERGY_DRAIN, 1024); - } - player.addExperienceLevel(levels); - } - heal(2.0f); - } else if(victim instanceof EntityLiving) { - EntityLiving mob = (EntityLiving)victim; - mob.attackEntityFrom(DungeonMobsDamageSource.ENERGY_DRAIN, - (exhaustion / 2) - levels); - heal(2.0f); - } - } - - - @Override - protected void dropFewItems(boolean par1, int par2) { - // They drop some cash, OK.... - dropItem(Items.GOLD_INGOT, rand.nextInt(2) + par2); - if (par1) { - dropItem(Items.EMERALD, rand.nextInt(2) + par2); - } - } - - @Override public boolean getCanSpawnHere() { if (world.canSeeSky(new BlockPos(posX, posY, posZ))) { @@ -181,23 +130,53 @@ public boolean getCanSpawnHere() { } return super.getCanSpawnHere(); } - - + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(40.0d * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.54d); + getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(12.0d); + getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0d * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(16.0d); + } + + private void energyDrain(Entity victim, int levels, float exhaustion) { + if (victim instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) victim; + player.addExhaustion(exhaustion); + if (ConfigHandler.hardcoreVampire) { + if (player.experienceLevel < (0 - levels)) { + player.attackEntityFrom(DungeonMobsDamageSource.ENERGY_DRAIN, 1024); + } + player.addExperienceLevel(levels); + } + heal(2.0f); + } + else if (victim instanceof EntityLiving) { + EntityLiving mob = (EntityLiving) victim; + mob.attackEntityFrom(DungeonMobsDamageSource.ENERGY_DRAIN, (exhaustion / 2) - levels); + heal(2.0f); + } + } + public void setRunning(boolean escape) { escaping = escape; } - - + + public void setTrapped() { feelTrapped = true; } - - + + public boolean isEscaping() { return escaping; } - - + + public boolean isTrapped() { return feelTrapped; } diff --git a/src/main/java/com/gw/dm/entity/EntityVescavor.java b/src/main/java/com/gw/dm/entity/EntityVescavor.java index cff6d47..d50d0ed 100644 --- a/src/main/java/com/gw/dm/entity/EntityVescavor.java +++ b/src/main/java/com/gw/dm/entity/EntityVescavor.java @@ -1,18 +1,14 @@ package com.gw.dm.entity; -import static com.gw.dm.util.ConfigHandler.vescavorIg; - -import java.util.Iterator; -import java.util.List; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.EntityDungeonMob; +import com.gw.dm.potion.PotionEffectAddled; +import com.gw.dm.util.AudioHandler; +import com.gw.dm.util.ConfigHandler; +import com.gw.dm.util.DungeonMobsHelper; +import com.gw.dm.util.MiscRegistrar; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackMelee; -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.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.potion.Potion; @@ -23,148 +19,130 @@ import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; -import com.gw.dm.DungeonMobs; -import com.gw.dm.EntityDungeonMob; -import com.gw.dm.potion.PotionEffectAddled; -import com.gw.dm.util.AudioHandler; -import com.gw.dm.util.ConfigHandler; -import com.gw.dm.util.DungeonMobsHelper; -import com.gw.dm.util.MiscRegistrar; +import java.util.Iterator; +import java.util.List; + +import static com.gw.dm.util.ConfigHandler.vescavorIg; public class EntityVescavor extends EntityDungeonMob { private static String mobName = DungeonMobs.MODID + ":dmvescavor"; private int confuseTicks; - + public EntityVescavor(World par1World) { super(par1World); setSize(0.8F, 0.9F); experienceValue = 20; ignoreHeight = false; confuseTicks = 0; - + tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(1, new EntityAIAttackMelee(this, 1.0F, false)); tasks.addTask(2, new EntityAIWander(this, 1.0F)); tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(4, new EntityAILookIdle(this)); - + targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); - targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, - EntityPlayer.class, 0, true, false, null)); - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(12.0d - * ConfigHandler.healthx); - getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D); - getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(2.0D - * ConfigHandler.damagex + ConfigHandler.damageplus); - getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); + targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, false, null)); } - - + @Override public int getTotalArmorValue() { return 0; } - - + @Override - protected SoundEvent getAmbientSound() { - if(rand.nextBoolean()) { - return AudioHandler.entityVescavorAmbient1; - } else { - return AudioHandler.entityVescavorAmbient2; + protected void jump() { + motionY = 0.7D; + + Potion jump = Potion.getPotionFromResourceLocation("jump_boost"); + if (isPotionActive(jump)) { + motionY += (double) ((float) (getActivePotionEffect(jump).getAmplifier() + 1) * 0.1F); + } + + if (isSprinting()) { + float var1 = rotationYaw * 0.017453292F; + motionX -= (double) (MathHelper.sin(var1) * 0.2F); + motionZ += (double) (MathHelper.cos(var1) * 0.2F); } + + isAirBorne = true; + ForgeHooks.onLivingJump(this); } - - + @Override protected SoundEvent getHurtSound(DamageSource src) { return AudioHandler.entityVescavorHurt; } - - + @Override protected SoundEvent getDeathSound() { return AudioHandler.entityVescavorDeath; } - - - public int getTalkInterval() { - return 100; - } - - + @Override public boolean getCanSpawnHere() { if (vescavorIg || DungeonMobsHelper.isNearSpawner(world, this, mobName)) { return super.getCanSpawnHere(); } - if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) - return false; - - if (posY > 36.0D && !ignoreHeight) - return false; - + if (world.canBlockSeeSky(new BlockPos(posX, posY, posZ))) return false; + + if (posY > 36.0D && !ignoreHeight) return false; + return super.getCanSpawnHere(); } - - - @Override - public void onLivingUpdate() { - confuseTicks++; - - if (confuseTicks % 20 == 0) { - List nearbyPlayers = world.getEntitiesWithinAABB(EntityPlayer.class, - getEntityBoundingBox().expand(16.0D, 4.0D, 16.0D)); - Iterator iter = nearbyPlayers.iterator(); - - while (iter.hasNext()) { - EntityPlayer foo = (EntityPlayer) iter.next(); - - if (canEntityBeSeen(foo) && !foo.capabilities.isCreativeMode) { - foo.addPotionEffect(new PotionEffectAddled(MiscRegistrar.potionAddle, 360, 0)); - } - } - confuseTicks = 0; - } - super.onLivingUpdate(); + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(12.0d * ConfigHandler.healthx); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D); + getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(2.0D * ConfigHandler.damagex + ConfigHandler.damageplus); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.0D); } - - + + public int getTalkInterval() { + return 100; + } + @Override - protected void jump() { - motionY = 0.7D; - - Potion jump = Potion.getPotionFromResourceLocation("jump_boost"); - if (isPotionActive(jump)) { - motionY += (double) ((float) (getActivePotionEffect(jump) - .getAmplifier() + 1) * 0.1F); + protected SoundEvent getAmbientSound() { + if (rand.nextBoolean()) { + return AudioHandler.entityVescavorAmbient1; } - - if (isSprinting()) { - float var1 = rotationYaw * 0.017453292F; - motionX -= (double) (MathHelper.sin(var1) * 0.2F); - motionZ += (double) (MathHelper.cos(var1) * 0.2F); + else { + return AudioHandler.entityVescavorAmbient2; } - - isAirBorne = true; - ForgeHooks.onLivingJump(this); } - - + @Override protected void dropFewItems(boolean par1, int par2) { int var3; int var4; int var5; - + var3 = rand.nextInt(4); - + for (var5 = 0; var5 < var3; var5++) { dropItem(Items.EMERALD, 1); } } + + @Override + public void onLivingUpdate() { + confuseTicks++; + + if (confuseTicks % 20 == 0) { + List nearbyPlayers = world.getEntitiesWithinAABB(EntityPlayer.class, getEntityBoundingBox().expand(16.0D, 4.0D, 16.0D)); + Iterator iter = nearbyPlayers.iterator(); + + while (iter.hasNext()) { + EntityPlayer foo = (EntityPlayer) iter.next(); + + if (canEntityBeSeen(foo) && !foo.capabilities.isCreativeMode) { + foo.addPotionEffect(new PotionEffectAddled(MiscRegistrar.potionAddle, 360, 0)); + } + } + confuseTicks = 0; + } + super.onLivingUpdate(); + } } diff --git a/src/main/java/com/gw/dm/model/ModelAhriman.java b/src/main/java/com/gw/dm/model/ModelAhriman.java index 55286a9..7b00ff2 100644 --- a/src/main/java/com/gw/dm/model/ModelAhriman.java +++ b/src/main/java/com/gw/dm/model/ModelAhriman.java @@ -38,221 +38,221 @@ public class ModelAhriman extends ModelBase { ModelRenderer StalkEye7; ModelRenderer Stalk4; ModelRenderer StalkEye5; - + public ModelAhriman() { textureWidth = 64; textureHeight = 32; - + BodyBottom2 = new ModelRenderer(this, 12, 11); BodyBottom2.addBox(-5F, -5F, -5F, 10, 10, 10); BodyBottom2.setRotationPoint(0F, 6F, -2F); BodyBottom2.setTextureSize(64, 32); BodyBottom2.mirror = true; setRotation(BodyBottom2, 0F, 0F, 0F); - + BodyBase = new ModelRenderer(this, 0, 0); BodyBase.addBox(-8F, -8F, -8F, 16, 16, 16); BodyBase.setRotationPoint(0F, 0F, 0F); BodyBase.setTextureSize(64, 32); BodyBase.mirror = true; setRotation(BodyBase, 0F, 0F, 0F); - + BodyBottom1 = new ModelRenderer(this, 12, 6); BodyBottom1.addBox(-6.5F, -6.5F, -6.5F, 13, 13, 13); BodyBottom1.setRotationPoint(0F, 3F, -1F); BodyBottom1.setTextureSize(64, 32); BodyBottom1.mirror = true; setRotation(BodyBottom1, 0F, 0F, 0F); - + BodyBack1 = new ModelRenderer(this, 12, 6); BodyBack1.addBox(-6.5F, -6.5F, -6.5F, 13, 13, 13); BodyBack1.setRotationPoint(0F, 0F, 3F); BodyBack1.setTextureSize(64, 32); BodyBack1.mirror = true; setRotation(BodyBack1, 0F, 0F, 0F); - + BodyBack2 = new ModelRenderer(this, 12, 12); BodyBack2.addBox(-5F, -5F, -5F, 10, 10, 10); BodyBack2.setRotationPoint(0F, 0F, 6F); BodyBack2.setTextureSize(64, 32); BodyBack2.mirror = true; setRotation(BodyBack2, 0F, 0F, 0F); - + BodyTop1 = new ModelRenderer(this, 12, 6); BodyTop1.addBox(-6.5F, -6.5F, -6.5F, 13, 13, 13); BodyTop1.setRotationPoint(0F, -3F, 1F); BodyTop1.setTextureSize(64, 32); BodyTop1.mirror = true; setRotation(BodyTop1, 0F, 0F, 0F); - + BodyTop2 = new ModelRenderer(this, 12, 12); BodyTop2.addBox(-5F, -5F, -5F, 10, 10, 10); BodyTop2.setRotationPoint(0F, -6F, 2F); BodyTop2.setTextureSize(64, 32); BodyTop2.mirror = true; setRotation(BodyTop2, 0F, 0F, 0F); - + BodyLeft1 = new ModelRenderer(this, 12, 6); BodyLeft1.addBox(-6.5F, -6.5F, -6.5F, 13, 13, 13); BodyLeft1.setRotationPoint(3F, 0F, 0F); BodyLeft1.setTextureSize(64, 32); BodyLeft1.mirror = true; setRotation(BodyLeft1, 0F, 0F, 0F); - + BodyLeft2 = new ModelRenderer(this, 12, 12); BodyLeft2.addBox(-5F, -5F, -5F, 10, 10, 10); BodyLeft2.setRotationPoint(6F, 0F, 0F); BodyLeft2.setTextureSize(64, 32); BodyLeft2.mirror = true; setRotation(BodyLeft2, 0F, 0F, 0F); - + BodyFront1 = new ModelRenderer(this, 7, 5); BodyFront1.addBox(-6.5F, -6.5F, -6.5F, 13, 14, 13); BodyFront1.setRotationPoint(0F, -1F, -3F); BodyFront1.setTextureSize(64, 32); BodyFront1.mirror = true; setRotation(BodyFront1, 0F, 0F, 0F); - + BodyFront2 = new ModelRenderer(this, 11, 10); BodyFront2.addBox(-5F, -5F, -5F, 10, 12, 10); BodyFront2.setRotationPoint(0F, -2F, -6F); BodyFront2.setTextureSize(64, 32); BodyFront2.mirror = true; setRotation(BodyFront2, 0F, 0F, 0F); - + BodyRight1 = new ModelRenderer(this, 12, 6); BodyRight1.addBox(-6.5F, -6.5F, -6.5F, 13, 13, 13); BodyRight1.setRotationPoint(-3F, 0F, 0F); BodyRight1.setTextureSize(64, 32); BodyRight1.mirror = true; setRotation(BodyRight1, 0F, 0F, 0F); - + BodyRight2 = new ModelRenderer(this, 12, 12); BodyRight2.addBox(-5F, -5F, -5F, 10, 10, 10); BodyRight2.setRotationPoint(-6F, 0F, 0F); BodyRight2.setTextureSize(64, 32); BodyRight2.mirror = true; setRotation(BodyRight2, 0F, 0F, 0F); - + Maw = new ModelRenderer(this, 0, 7); Maw.addBox(-3F, 0F, 0.5F, 6, 6, 3); Maw.setRotationPoint(0F, 2F, -13F); Maw.setTextureSize(64, 32); Maw.mirror = true; setRotation(Maw, 0.2792527F, 0F, 0F); - + Eye = new ModelRenderer(this, 0, 0); Eye.addBox(-3F, 0F, 0.5F, 6, 6, 2); Eye.setRotationPoint(0F, -6F, -12F); Eye.setTextureSize(64, 32); Eye.mirror = true; setRotation(Eye, 0F, 0F, 0F); - + Stalk3 = new ModelRenderer(this, 16, 16); Stalk3.addBox(-0.5F, -6F, -0.5F, 1, 6, 1); Stalk3.setRotationPoint(1F, -11F, -2F); Stalk3.setTextureSize(64, 32); Stalk3.mirror = true; setRotation(Stalk3, 0F, 0F, 0F); - + Stalk5 = new ModelRenderer(this, 15, 18); Stalk5.addBox(-0.5F, -6F, -0.5F, 1, 6, 1); Stalk5.setRotationPoint(-6F, -8F, -7F); Stalk5.setTextureSize(64, 32); Stalk5.mirror = true; setRotation(Stalk5, 0F, 0F, 0F); - + Stalk7 = new ModelRenderer(this, 15, 15); Stalk7.addBox(-0.5F, -6F, -0.5F, 1, 6, 1); Stalk7.setRotationPoint(9F, -6.5F, -4F); Stalk7.setTextureSize(64, 32); Stalk7.mirror = true; setRotation(Stalk7, 0F, 0F, 0F); - + StalkEye3 = new ModelRenderer(this, 56, 0); StalkEye3.addBox(-1F, -8F, -1F, 2, 2, 2); StalkEye3.setRotationPoint(1F, -11F, -2F); StalkEye3.setTextureSize(64, 32); StalkEye3.mirror = true; setRotation(StalkEye3, 0F, 0F, 0F); - + Stalk1 = new ModelRenderer(this, 33, 11); Stalk1.addBox(-0.5F, -6F, -0.5F, 1, 6, 1); Stalk1.setRotationPoint(-4F, -6.5F, 9F); Stalk1.setTextureSize(64, 32); Stalk1.mirror = true; setRotation(Stalk1, 0F, 0F, 0F); - + StalkEye8 = new ModelRenderer(this, 56, 0); StalkEye8.addBox(-1F, -8F, -1F, 2, 2, 2); StalkEye8.setRotationPoint(-10.5F, -5F, -1F); StalkEye8.setTextureSize(64, 32); StalkEye8.mirror = true; setRotation(StalkEye8, 0F, 0F, 0F); - + StalkEye6 = new ModelRenderer(this, 56, 0); StalkEye6.addBox(-1F, -8F, -1F, 2, 2, 2); StalkEye6.setRotationPoint(7F, -8F, 6F); StalkEye6.setTextureSize(64, 32); StalkEye6.mirror = true; setRotation(StalkEye6, 0F, 0F, 0F); - + StalkEye1 = new ModelRenderer(this, 56, 0); StalkEye1.addBox(-1F, -8F, -1F, 2, 2, 2); StalkEye1.setRotationPoint(-4F, -6.5F, 9F); StalkEye1.setTextureSize(64, 32); StalkEye1.mirror = true; setRotation(StalkEye1, 0F, 0F, 0F); - + Stalk8 = new ModelRenderer(this, 17, 17); Stalk8.addBox(-0.5F, -6F, -0.5F, 1, 6, 1); Stalk8.setRotationPoint(-10.5F, -5F, -1F); Stalk8.setTextureSize(64, 32); Stalk8.mirror = true; setRotation(Stalk8, 0F, 0F, 0F); - + StalkEye4 = new ModelRenderer(this, 56, 0); StalkEye4.addBox(-1F, -8F, -1F, 2, 2, 2); StalkEye4.setRotationPoint(-3F, -11F, 2F); StalkEye4.setTextureSize(64, 32); StalkEye4.mirror = true; setRotation(StalkEye4, 0F, 0F, 0F); - + Stalk2 = new ModelRenderer(this, 20, 5); Stalk2.addBox(-0.5F, -6F, -0.5F, 1, 6, 1); Stalk2.setRotationPoint(3F, -11F, 5F); Stalk2.setTextureSize(64, 32); Stalk2.mirror = true; setRotation(Stalk2, 0F, 0F, 0F); - + StalkEye2 = new ModelRenderer(this, 56, 0); StalkEye2.addBox(-1F, -8F, -1F, 2, 2, 2); StalkEye2.setRotationPoint(3F, -11F, 5F); StalkEye2.setTextureSize(64, 32); StalkEye2.mirror = true; setRotation(StalkEye2, 0F, 0F, 0F); - + Stalk6 = new ModelRenderer(this, 23, 23); Stalk6.addBox(-0.5F, -6F, -0.5F, 1, 6, 1); Stalk6.setRotationPoint(7F, -8F, 6F); Stalk6.setTextureSize(64, 32); Stalk6.mirror = true; setRotation(Stalk6, 0F, 0F, 0F); - + StalkEye7 = new ModelRenderer(this, 56, 0); StalkEye7.addBox(-1F, -8F, -1F, 2, 2, 2); StalkEye7.setRotationPoint(9F, -6.5F, -4F); StalkEye7.setTextureSize(64, 32); StalkEye7.mirror = true; setRotation(StalkEye7, 0F, 0F, 0F); - + Stalk4 = new ModelRenderer(this, 19, 11); Stalk4.addBox(-0.5F, -6F, -0.5F, 1, 6, 1); Stalk4.setRotationPoint(-3F, -11F, 2F); Stalk4.setTextureSize(64, 32); Stalk4.mirror = true; setRotation(Stalk4, 0F, 0F, 0F); - + StalkEye5 = new ModelRenderer(this, 56, 0); StalkEye5.addBox(-1F, -8F, -1F, 2, 2, 2); StalkEye5.setRotationPoint(-6F, -8F, -7F); @@ -260,10 +260,9 @@ public ModelAhriman() { StalkEye5.mirror = true; setRotation(StalkEye5, 0F, 0F, 0F); } - - - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); BodyBottom2.render(f5); @@ -298,131 +297,80 @@ public void render(Entity entity, float f, float f1, float f2, Stalk4.render(f5); StalkEye5.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5, Entity ent) { + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { float var8 = 0.1F; float moo = 6.5F; - - this.Stalk1.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + + this.Stalk1.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.Stalk1.rotateAngleY = MathHelper.cos((float)ent.ticksExisted * var8) * moo; - this.Stalk1.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.StalkEye1.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.Stalk1.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.StalkEye1.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.StalkEye1.rotateAngleY = MathHelper.cos((float)ent.ticksExisted * var8) * moo; - this.StalkEye1.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.Stalk2.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.StalkEye1.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.Stalk2.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.Stalk2.rotateAngleY = MathHelper.cos((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.Stalk2.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.StalkEye2.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.Stalk2.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.StalkEye2.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.StalkEye2.rotateAngleY = MathHelper.cos((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.StalkEye2.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.Stalk3.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.StalkEye2.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.Stalk3.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.Stalk3.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.Stalk3.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.StalkEye3.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.Stalk3.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.StalkEye3.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.StalkEye3.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.StalkEye3.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.Stalk4.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.StalkEye3.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.Stalk4.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.Stalk4.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.Stalk4.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.StalkEye4.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.Stalk4.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.StalkEye4.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.StalkEye4.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.StalkEye4.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.Stalk5.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.StalkEye4.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.Stalk5.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.Stalk5.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.Stalk5.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.StalkEye5.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.Stalk5.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.StalkEye5.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.StalkEye5.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.StalkEye5.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.Stalk6.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.StalkEye5.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.Stalk6.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.Stalk6.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.Stalk6.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.StalkEye6.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.Stalk6.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.StalkEye6.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.StalkEye6.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.StalkEye6.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.Stalk7.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.StalkEye6.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.Stalk7.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.Stalk7.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.Stalk7.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.StalkEye7.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.Stalk7.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.StalkEye7.rotateAngleX = (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.StalkEye7.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.StalkEye7.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.Stalk8.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted - * var8) * moo * (float) Math.PI / 180.0F); + this.StalkEye7.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.Stalk8.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.Stalk8.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.Stalk8.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; - - this.StalkEye8.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F); + this.Stalk8.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; + + this.StalkEye8.rotateAngleX = (MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F) - (MathHelper.sin((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F); //this.StalkEye8.rotateAngleY = MathHelper.sin((float)ent.ticksExisted * var8) * moo * (float)Math.PI / 180.0F; - this.StalkEye8.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * moo * (float) Math.PI / 180.0F; + this.StalkEye8.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * moo * (float) Math.PI / 180.0F; } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } \ No newline at end of file diff --git a/src/main/java/com/gw/dm/model/ModelBladeTrap.java b/src/main/java/com/gw/dm/model/ModelBladeTrap.java index 94404fa..48574fd 100644 --- a/src/main/java/com/gw/dm/model/ModelBladeTrap.java +++ b/src/main/java/com/gw/dm/model/ModelBladeTrap.java @@ -5,7 +5,7 @@ import net.minecraft.entity.Entity; public class ModelBladeTrap extends ModelBase { - + ModelRenderer Base; ModelRenderer BotSpikeB; ModelRenderer BotSpikeC; @@ -31,180 +31,180 @@ public class ModelBladeTrap extends ModelBase { ModelRenderer RitSpikeC; ModelRenderer RitSpikeA; ModelRenderer RitSpikeB; - - + + public ModelBladeTrap() { textureWidth = 64; textureHeight = 32; - + Base = new ModelRenderer(this, 0, 0); Base.addBox(-2.5F, -2.5F, -2.5F, 5, 5, 5); Base.setRotationPoint(0F, 16.5F, 0F); Base.setTextureSize(64, 32); Base.mirror = true; setRotation(Base, 0F, 0F, 0F); - + BotSpikeB = new ModelRenderer(this, 2, 12); BotSpikeB.addBox(-0.5F, 0F, -0.5F, 1, 4, 1); BotSpikeB.setRotationPoint(1.5F, 19F, -1.5F); BotSpikeB.setTextureSize(64, 32); BotSpikeB.mirror = true; setRotation(BotSpikeB, 0F, 0F, 0F); - + BotSpikeC = new ModelRenderer(this, 2, 12); BotSpikeC.addBox(-0.5F, 0F, -0.5F, 1, 4, 1); BotSpikeC.setRotationPoint(-1.5F, 19F, 1.5F); BotSpikeC.setTextureSize(64, 32); BotSpikeC.mirror = true; setRotation(BotSpikeC, 0F, 0F, 0F); - + BotSpikeD = new ModelRenderer(this, 2, 12); BotSpikeD.addBox(-0.5F, 0F, -0.5F, 1, 4, 1); BotSpikeD.setRotationPoint(-1.5F, 19F, -1.5F); BotSpikeD.setTextureSize(64, 32); BotSpikeD.mirror = true; setRotation(BotSpikeD, 0F, 0F, 0F); - + BotSpikeA = new ModelRenderer(this, 2, 12); BotSpikeA.addBox(-0.5F, 0F, -0.5F, 1, 4, 1); BotSpikeA.setRotationPoint(1.5F, 19F, 1.5F); BotSpikeA.setTextureSize(64, 32); BotSpikeA.mirror = true; setRotation(BotSpikeA, 0F, 0F, 0F); - + TopSpikeA = new ModelRenderer(this, 0, 11); TopSpikeA.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); TopSpikeA.setRotationPoint(1.5F, 14F, 1.5F); TopSpikeA.setTextureSize(64, 32); TopSpikeA.mirror = true; setRotation(TopSpikeA, 0F, 0F, 0F); - + TopSpikeC = new ModelRenderer(this, 0, 11); TopSpikeC.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); TopSpikeC.setRotationPoint(-1.5F, 14F, 1.5F); TopSpikeC.setTextureSize(64, 32); TopSpikeC.mirror = true; setRotation(TopSpikeC, 0F, 0F, 0F); - + TopSpikeD = new ModelRenderer(this, 0, 11); TopSpikeD.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); TopSpikeD.setRotationPoint(-1.5F, 14F, -1.5F); TopSpikeD.setTextureSize(64, 32); TopSpikeD.mirror = true; setRotation(TopSpikeD, 0F, 0F, 0F); - + TopSpikeB = new ModelRenderer(this, 0, 11); TopSpikeB.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); TopSpikeB.setRotationPoint(1.5F, 14F, -1.5F); TopSpikeB.setTextureSize(64, 32); TopSpikeB.mirror = true; setRotation(TopSpikeB, 0F, 0F, 0F); - + RerSpikeB = new ModelRenderer(this, 2, 12); RerSpikeB.addBox(-4F, -0.5F, -0.5F, 4, 1, 1); RerSpikeB.setRotationPoint(-2F, 18F, 1.5F); RerSpikeB.setTextureSize(64, 32); RerSpikeB.mirror = true; setRotation(RerSpikeB, 0F, 0F, 0F); - + RerSpikeC = new ModelRenderer(this, 2, 12); RerSpikeC.addBox(-4F, -0.5F, -0.5F, 4, 1, 1); RerSpikeC.setRotationPoint(-2F, 15F, -1.5F); RerSpikeC.setTextureSize(64, 32); RerSpikeC.mirror = true; setRotation(RerSpikeC, 0F, 0F, 0F); - + RerSpikeD = new ModelRenderer(this, 2, 12); RerSpikeD.addBox(-4F, -0.5F, -0.5F, 4, 1, 1); RerSpikeD.setRotationPoint(-2F, 18F, -1.5F); RerSpikeD.setTextureSize(64, 32); RerSpikeD.mirror = true; setRotation(RerSpikeD, 0F, 0F, 0F); - + RerSpikeA = new ModelRenderer(this, 2, 12); RerSpikeA.addBox(-4F, -0.5F, -0.5F, 4, 1, 1); RerSpikeA.setRotationPoint(-2F, 15F, 1.5F); RerSpikeA.setTextureSize(64, 32); RerSpikeA.mirror = true; setRotation(RerSpikeA, 0F, 0F, 0F); - + FrnSpikeA = new ModelRenderer(this, 2, 12); FrnSpikeA.addBox(0F, -0.5F, -0.5F, 4, 1, 1); FrnSpikeA.setRotationPoint(2F, 15F, 1.5F); FrnSpikeA.setTextureSize(64, 32); FrnSpikeA.mirror = true; setRotation(FrnSpikeA, 0F, 0F, 0F); - + FrnSpikeC = new ModelRenderer(this, 2, 12); FrnSpikeC.addBox(0F, -0.5F, -0.5F, 4, 1, 1); FrnSpikeC.setRotationPoint(2F, 15F, -1.5F); FrnSpikeC.setTextureSize(64, 32); FrnSpikeC.mirror = true; setRotation(FrnSpikeC, 0F, 0F, 0F); - + FrnSpikeD = new ModelRenderer(this, 2, 12); FrnSpikeD.addBox(0F, -0.5F, -0.5F, 4, 1, 1); FrnSpikeD.setRotationPoint(2F, 18F, -1.5F); FrnSpikeD.setTextureSize(64, 32); FrnSpikeD.mirror = true; setRotation(FrnSpikeD, 0F, 0F, 0F); - + FrnSpikeB = new ModelRenderer(this, 2, 12); FrnSpikeB.addBox(0F, -0.5F, -0.5F, 4, 1, 1); FrnSpikeB.setRotationPoint(2F, 18F, 1.5F); FrnSpikeB.setTextureSize(64, 32); FrnSpikeB.mirror = true; setRotation(FrnSpikeB, 0F, 0F, 0F); - + LftSpikeB = new ModelRenderer(this, 2, 12); LftSpikeB.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); LftSpikeB.setRotationPoint(1.5F, 15F, -2F); LftSpikeB.setTextureSize(64, 32); LftSpikeB.mirror = true; setRotation(LftSpikeB, 0F, 0F, 0F); - + LftSpikeC = new ModelRenderer(this, 2, 12); LftSpikeC.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); LftSpikeC.setRotationPoint(-1.5F, 18F, -2F); LftSpikeC.setTextureSize(64, 32); LftSpikeC.mirror = true; setRotation(LftSpikeC, 0F, 0F, 0F); - + LftSpikeD = new ModelRenderer(this, 2, 12); LftSpikeD.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); LftSpikeD.setRotationPoint(1.5F, 18F, -2F); LftSpikeD.setTextureSize(64, 32); LftSpikeD.mirror = true; setRotation(LftSpikeD, 0F, 0F, 0F); - + LftSpikeA = new ModelRenderer(this, 2, 12); LftSpikeA.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); LftSpikeA.setRotationPoint(-1.5F, 15F, -2F); LftSpikeA.setTextureSize(64, 32); LftSpikeA.mirror = true; setRotation(LftSpikeA, 0F, 0F, 0F); - + RitSpikeD = new ModelRenderer(this, 2, 12); RitSpikeD.addBox(-0.5F, -0.5F, 0F, 1, 1, 4); RitSpikeD.setRotationPoint(1.5F, 18F, 2F); RitSpikeD.setTextureSize(64, 32); RitSpikeD.mirror = true; setRotation(RitSpikeD, 0F, 0F, 0F); - + RitSpikeC = new ModelRenderer(this, 2, 12); RitSpikeC.addBox(-0.5F, -0.5F, 0F, 1, 1, 4); RitSpikeC.setRotationPoint(-1.5F, 18F, 2F); RitSpikeC.setTextureSize(64, 32); RitSpikeC.mirror = true; setRotation(RitSpikeC, 0F, 0F, 0F); - + RitSpikeA = new ModelRenderer(this, 2, 12); RitSpikeA.addBox(-0.5F, -0.5F, 0F, 1, 1, 4); RitSpikeA.setRotationPoint(-1.5F, 15F, 2F); RitSpikeA.setTextureSize(64, 32); RitSpikeA.mirror = true; setRotation(RitSpikeA, 0F, 0F, 0F); - + RitSpikeB = new ModelRenderer(this, 2, 12); RitSpikeB.addBox(-0.5F, -0.5F, 0F, 1, 1, 4); RitSpikeB.setRotationPoint(1.5F, 15F, 2F); @@ -212,15 +212,12 @@ public ModelBladeTrap() { RitSpikeB.mirror = true; setRotation(RitSpikeB, 0F, 0F, 0F); } - - + + @Override - public void render(Entity entity, float limbSwing, float limbSwingAmount, - float ageInTicks, float netHeadYaw, float headPitch, float scale) { - super.render(entity, limbSwing, limbSwingAmount, ageInTicks, - netHeadYaw, headPitch, scale); - setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, - netHeadYaw, headPitch, scale, entity); + public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); + setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entity); Base.render(scale); BotSpikeB.render(scale); BotSpikeC.render(scale); @@ -247,21 +244,18 @@ public void render(Entity entity, float limbSwing, float limbSwingAmount, RitSpikeA.render(scale); RitSpikeB.render(scale); } - - + + @Override + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); + } + private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } - - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); - } - - + public void renderAllTE(float scale) { Base.render(scale); BotSpikeB.render(scale); @@ -289,5 +283,5 @@ public void renderAllTE(float scale) { RitSpikeA.render(scale); RitSpikeB.render(scale); } - + } diff --git a/src/main/java/com/gw/dm/model/ModelCaveFisher.java b/src/main/java/com/gw/dm/model/ModelCaveFisher.java index 70d862b..fe61b7b 100644 --- a/src/main/java/com/gw/dm/model/ModelCaveFisher.java +++ b/src/main/java/com/gw/dm/model/ModelCaveFisher.java @@ -7,7 +7,7 @@ import net.minecraft.util.math.MathHelper; public class ModelCaveFisher extends ModelBase { - + ModelRenderer Nose; ModelRenderer EyeLeft; ModelRenderer HeadMid; @@ -83,529 +83,529 @@ public class ModelCaveFisher extends ModelBase { ModelRenderer LMLeg3; ModelRenderer LMLeg5; ModelRenderer LMLeg6; - + public ModelCaveFisher() { textureWidth = 64; textureHeight = 32; - + Nose = new ModelRenderer(this, 0, 0); Nose.addBox(-0.5F, -0.5F, -12F, 1, 1, 6); Nose.setRotationPoint(0F, 19F, -4F); Nose.setTextureSize(64, 32); Nose.mirror = true; setRotation(Nose, 0F, 0F, 0F); - + EyeLeft = new ModelRenderer(this, 0, 28); EyeLeft.addBox(0.5F, -2.5F, -2.5F, 3, 2, 2); EyeLeft.setRotationPoint(0F, 19F, -4F); EyeLeft.setTextureSize(64, 32); EyeLeft.mirror = true; setRotation(EyeLeft, 0F, 0F, 0F); - + HeadMid = new ModelRenderer(this, 0, 0); HeadMid.addBox(-2.5F, -1.5F, -5F, 5, 3, 2); HeadMid.setRotationPoint(0F, 19F, -4F); HeadMid.setTextureSize(64, 32); HeadMid.mirror = true; setRotation(HeadMid, 0F, 0F, 0F); - + HeadEnd = new ModelRenderer(this, 0, 0); HeadEnd.addBox(-2F, -1F, -6F, 4, 2, 1); HeadEnd.setRotationPoint(0F, 19F, -4F); HeadEnd.setTextureSize(64, 32); HeadEnd.mirror = true; setRotation(HeadEnd, 0F, 0F, 0F); - + TailTuft = new ModelRenderer(this, 0, 23); TailTuft.addBox(-2F, -1F, 3F, 4, 1, 2); TailTuft.setRotationPoint(0F, 19F, 10F); TailTuft.setTextureSize(64, 32); TailTuft.mirror = true; setRotation(TailTuft, 0F, 0F, 0F); - + EyeRight = new ModelRenderer(this, 0, 28); EyeRight.addBox(-3.5F, -2.5F, -2.5F, 3, 2, 2); EyeRight.setRotationPoint(0F, 19F, -4F); EyeRight.setTextureSize(64, 32); EyeRight.mirror = true; setRotation(EyeRight, 0F, 0F, 0F); - + BodyTopLeft4 = new ModelRenderer(this, 0, 0); BodyTopLeft4.addBox(0F, 0F, 0F, 6, 3, 4); BodyTopLeft4.setRotationPoint(0F, 16.2F, 7F); BodyTopLeft4.setTextureSize(64, 32); BodyTopLeft4.mirror = true; setRotation(BodyTopLeft4, 0.1047198F, 0.1047198F, 0.1047198F); - + BodyTopRight4 = new ModelRenderer(this, 0, 0); BodyTopRight4.addBox(-5F, 0F, 0F, 6, 3, 4); BodyTopRight4.setRotationPoint(-1F, 16.2F, 7F); BodyTopRight4.setTextureSize(64, 32); BodyTopRight4.mirror = true; setRotation(BodyTopRight4, 0.1047198F, -0.1047198F, -0.1047198F); - + BodyTopLeft1 = new ModelRenderer(this, 0, 0); BodyTopLeft1.addBox(0F, 0F, 0F, 5, 3, 4); BodyTopLeft1.setRotationPoint(0F, 16F, -4F); BodyTopLeft1.setTextureSize(64, 32); BodyTopLeft1.mirror = true; setRotation(BodyTopLeft1, 0.1745329F, 0.1745329F, 0.1047198F); - + BodyTopRight1 = new ModelRenderer(this, 0, 0); BodyTopRight1.addBox(-5F, 0F, 0F, 5, 3, 4); BodyTopRight1.setRotationPoint(0F, 16F, -4F); BodyTopRight1.setTextureSize(64, 32); BodyTopRight1.mirror = true; setRotation(BodyTopRight1, 0.1745329F, -0.1745329F, -0.1047198F); - + BodyTopRight2 = new ModelRenderer(this, 0, 0); BodyTopRight2.addBox(-5F, 0F, 0F, 7, 3, 4); BodyTopRight2.setRotationPoint(-1F, 16F, -1F); BodyTopRight2.setTextureSize(64, 32); BodyTopRight2.mirror = true; setRotation(BodyTopRight2, 0.2094395F, -0.1745329F, -0.1047198F); - + BodyTopLeft2 = new ModelRenderer(this, 0, 0); BodyTopLeft2.addBox(-1F, 0F, 0F, 7, 3, 4); BodyTopLeft2.setRotationPoint(0F, 16F, -1F); BodyTopLeft2.setTextureSize(64, 32); BodyTopLeft2.mirror = true; setRotation(BodyTopLeft2, 0.2094395F, 0.1745329F, 0.1047198F); - + BodyTopRight3 = new ModelRenderer(this, 0, 0); BodyTopRight3.addBox(-5F, 0F, 0F, 6, 3, 4); BodyTopRight3.setRotationPoint(-1F, 16F, 3F); BodyTopRight3.setTextureSize(64, 32); BodyTopRight3.mirror = true; setRotation(BodyTopRight3, 0.1396263F, -0.1396263F, -0.1047198F); - + BodyTopLeft3 = new ModelRenderer(this, 0, 0); BodyTopLeft3.addBox(0F, 0F, 0F, 6, 3, 4); BodyTopLeft3.setRotationPoint(0F, 16F, 3F); BodyTopLeft3.setTextureSize(64, 32); BodyTopLeft3.mirror = true; setRotation(BodyTopLeft3, 0.1396263F, 0.1396263F, 0.1047198F); - + HeadBase = new ModelRenderer(this, 0, 0); HeadBase.addBox(-3F, -2F, -3F, 6, 4, 3); HeadBase.setRotationPoint(0F, 19F, -4F); HeadBase.setTextureSize(64, 32); HeadBase.mirror = true; setRotation(HeadBase, 0F, 0F, 0F); - + TailBase = new ModelRenderer(this, 0, 0); TailBase.addBox(-3F, -2F, 0F, 6, 3, 3); TailBase.setRotationPoint(0F, 19F, 10F); TailBase.setTextureSize(64, 32); TailBase.mirror = true; setRotation(TailBase, 0F, 0F, 0F); - + BodyLow2 = new ModelRenderer(this, 34, 0); BodyLow2.addBox(0F, 0F, 0F, 8, 2, 7); BodyLow2.setRotationPoint(-4F, 18.3F, 3F); BodyLow2.setTextureSize(64, 32); BodyLow2.mirror = true; setRotation(BodyLow2, 0F, 0F, 0F); - + BodyLow1 = new ModelRenderer(this, 34, 0); BodyLow1.addBox(0F, 0F, 0F, 8, 2, 7); BodyLow1.setRotationPoint(-4F, 18.7F, -4F); BodyLow1.setTextureSize(64, 32); BodyLow1.mirror = true; setRotation(BodyLow1, 0F, 0F, 0F); - + Spine5 = new ModelRenderer(this, 0, 0); Spine5.addBox(-0.5F, 0F, 0F, 1, 1, 4); Spine5.setRotationPoint(0F, 16F, 8.6F); Spine5.setTextureSize(64, 32); Spine5.mirror = true; setRotation(Spine5, 0F, 0F, 0F); - + Spine1 = new ModelRenderer(this, 0, 0); Spine1.addBox(-0.5F, 0F, 0F, 1, 1, 4); Spine1.setRotationPoint(0F, 16F, -4.2F); Spine1.setTextureSize(64, 32); Spine1.mirror = true; setRotation(Spine1, 0.2443461F, 0F, 0F); - + Spine2 = new ModelRenderer(this, 0, 0); Spine2.addBox(-0.5F, 0F, 0F, 1, 1, 5); Spine2.setRotationPoint(0F, 16F, -1.2F); Spine2.setTextureSize(64, 32); Spine2.mirror = true; setRotation(Spine2, 0.3141593F, 0F, 0F); - + Spine3 = new ModelRenderer(this, 0, 0); Spine3.addBox(-0.5F, 0F, 0F, 1, 1, 6); Spine3.setRotationPoint(0F, 16F, 1.8F); Spine3.setTextureSize(64, 32); Spine3.mirror = true; setRotation(Spine3, 0.2792527F, 0F, 0F); - + Spine4 = new ModelRenderer(this, 0, 0); Spine4.addBox(-0.5F, 0F, 0F, 1, 1, 8); Spine4.setRotationPoint(0F, 16F, 3.8F); Spine4.setTextureSize(64, 32); Spine4.mirror = true; setRotation(Spine4, 0.1745329F, 0F, 0F); - + RightArmSeg4 = new ModelRenderer(this, 0, 0); RightArmSeg4.addBox(-3.2F, -1F, -10.5F, 2, 2, 4); RightArmSeg4.setRotationPoint(-4.7F, 17.5F, -3F); RightArmSeg4.setTextureSize(64, 32); RightArmSeg4.mirror = true; setRotation(RightArmSeg4, 0F, 0.0872665F, 0F); - + LeftArmSeg1 = new ModelRenderer(this, 0, 13); LeftArmSeg1.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); LeftArmSeg1.setRotationPoint(4.7F, 17.5F, -3F); LeftArmSeg1.setTextureSize(64, 32); LeftArmSeg1.mirror = true; setRotation(LeftArmSeg1, 0F, -0.5235988F, 0F); - + LeftArmSeg3 = new ModelRenderer(this, 0, 13); LeftArmSeg3.addBox(1F, -0.5F, -8F, 1, 1, 3); LeftArmSeg3.setRotationPoint(4.7F, 17.5F, -3F); LeftArmSeg3.setTextureSize(64, 32); LeftArmSeg3.mirror = true; setRotation(LeftArmSeg3, 0F, -0.1745329F, 0F); - + RightArmSeg2 = new ModelRenderer(this, 0, 0); RightArmSeg2.addBox(-1.5F, -1F, -6F, 2, 2, 4); RightArmSeg2.setRotationPoint(-4.7F, 17.5F, -3F); RightArmSeg2.setTextureSize(64, 32); RightArmSeg2.mirror = true; setRotation(RightArmSeg2, 0F, 0.3490659F, 0F); - + RightArmSeg1 = new ModelRenderer(this, 0, 13); RightArmSeg1.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); RightArmSeg1.setRotationPoint(-4.7F, 17.5F, -3F); RightArmSeg1.setTextureSize(64, 32); RightArmSeg1.mirror = true; setRotation(RightArmSeg1, 0F, 0.5235988F, 0F); - + LeftArmSeg5 = new ModelRenderer(this, 0, 13); LeftArmSeg5.addBox(2.4F, -0.5F, -12F, 1, 1, 3); LeftArmSeg5.setRotationPoint(4.7F, 17.5F, -3F); LeftArmSeg5.setTextureSize(64, 32); LeftArmSeg5.mirror = true; setRotation(LeftArmSeg5, 0F, 0F, 0F); - + LeftArmSeg2 = new ModelRenderer(this, 0, 0); LeftArmSeg2.addBox(-0.5F, -1F, -6F, 2, 2, 4); LeftArmSeg2.setRotationPoint(4.7F, 17.5F, -3F); LeftArmSeg2.setTextureSize(64, 32); LeftArmSeg2.mirror = true; setRotation(LeftArmSeg2, 0F, -0.3490659F, 0F); - + LeftClawTop = new ModelRenderer(this, 15, 15); LeftClawTop.addBox(1.8F, 4.7F, -15F, 2, 2, 5); LeftClawTop.setRotationPoint(4.7F, 17.5F, -3F); LeftClawTop.setTextureSize(64, 32); LeftClawTop.mirror = true; setRotation(LeftClawTop, -0.5410521F, 0F, 0F); - + RightArmSeg3 = new ModelRenderer(this, 0, 13); RightArmSeg3.addBox(-2F, -0.5F, -8F, 1, 1, 3); RightArmSeg3.setRotationPoint(-4.7F, 17.5F, -3F); RightArmSeg3.setTextureSize(64, 32); RightArmSeg3.mirror = true; setRotation(RightArmSeg3, 0F, 0.1745329F, 0F); - + RightArmSeg5 = new ModelRenderer(this, 0, 13); RightArmSeg5.addBox(-3.6F, -0.5F, -12F, 1, 1, 3); RightArmSeg5.setRotationPoint(-4.7F, 17.5F, -3F); RightArmSeg5.setTextureSize(64, 32); RightArmSeg5.mirror = true; setRotation(RightArmSeg5, 0F, 0F, 0F); - + LeftArmSeg4 = new ModelRenderer(this, 0, 0); LeftArmSeg4.addBox(1.1F, -1F, -10.5F, 2, 2, 4); LeftArmSeg4.setRotationPoint(4.7F, 17.5F, -3F); LeftArmSeg4.setTextureSize(64, 32); LeftArmSeg4.mirror = true; setRotation(LeftArmSeg4, 0F, -0.0872665F, 0F); - + LeftClawBase = new ModelRenderer(this, 0, 0); LeftClawBase.addBox(1.8F, -1F, -13F, 2, 2, 2); LeftClawBase.setRotationPoint(4.7F, 17.5F, -3F); LeftClawBase.setTextureSize(64, 32); LeftClawBase.mirror = true; setRotation(LeftClawBase, 0F, 0F, 0F); - + RightClawBase = new ModelRenderer(this, 0, 0); RightClawBase.addBox(-4.2F, -1F, -13F, 2, 2, 2); RightClawBase.setRotationPoint(-4.7F, 17.5F, -3F); RightClawBase.setTextureSize(64, 32); RightClawBase.mirror = true; setRotation(RightClawBase, 0F, 0F, 0F); - + LeftClawLow = new ModelRenderer(this, 25, 25); LeftClawLow.addBox(1.8F, -4.3F, -15F, 2, 1, 4); LeftClawLow.setRotationPoint(4.7F, 17.5F, -3F); LeftClawLow.setTextureSize(64, 32); LeftClawLow.mirror = true; setRotation(LeftClawLow, 0.3490659F, 0F, 0F); - + RightClawTop = new ModelRenderer(this, 15, 15); RightClawTop.addBox(-4.2F, 4.7F, -15F, 2, 2, 5); RightClawTop.setRotationPoint(-4.7F, 17.5F, -3F); RightClawTop.setTextureSize(64, 32); RightClawTop.mirror = true; setRotation(RightClawTop, -0.5410521F, 0F, 0F); - + RightClawLow = new ModelRenderer(this, 25, 25); RightClawLow.addBox(-4.2F, -4.3F, -15F, 2, 1, 4); RightClawLow.setRotationPoint(-4.7F, 17.5F, -3F); RightClawLow.setTextureSize(64, 32); RightClawLow.mirror = true; setRotation(RightClawLow, 0.3490659F, 0F, 0F); - + LBLeg1 = new ModelRenderer(this, 0, 13); LBLeg1.addBox(0.5F, -0.5F, -0.5F, 3, 1, 1); LBLeg1.setRotationPoint(5F, 18F, 8.5F); LBLeg1.setTextureSize(64, 32); LBLeg1.mirror = true; setRotation(LBLeg1, 0F, 0F, -0.4363323F); - + LBLeg3 = new ModelRenderer(this, 2, 0); LBLeg3.addBox(5.1F, -1.5F, -1F, 3, 1, 2); LBLeg3.setRotationPoint(5F, 18F, 8.5F); LBLeg3.setTextureSize(64, 32); LBLeg3.mirror = true; setRotation(LBLeg3, 0F, 0F, -0.5759587F); - + RBLeg1 = new ModelRenderer(this, 0, 13); RBLeg1.addBox(-3.5F, -0.5F, -0.5F, 3, 1, 1); RBLeg1.setRotationPoint(-5F, 18F, 8.5F); RBLeg1.setTextureSize(64, 32); RBLeg1.mirror = true; setRotation(RBLeg1, 0F, 0F, 0.4363323F); - + RBLeg3 = new ModelRenderer(this, 2, 0); RBLeg3.addBox(-8.1F, -1.5F, -1F, 3, 1, 2); RBLeg3.setRotationPoint(-5F, 18F, 8.5F); RBLeg3.setTextureSize(64, 32); RBLeg3.mirror = true; setRotation(RBLeg3, 0F, 0F, 0.5759587F); - + LBLeg2 = new ModelRenderer(this, 0, 0); LBLeg2.addBox(2.5F, 0.5F, -1F, 3, 2, 2); LBLeg2.setRotationPoint(5F, 18F, 8.5F); LBLeg2.setTextureSize(64, 32); LBLeg2.mirror = true; setRotation(LBLeg2, 0F, 0F, -0.9599311F); - + RBLeg2 = new ModelRenderer(this, 0, 0); RBLeg2.addBox(-5.5F, 0.5F, -1F, 3, 2, 2); RBLeg2.setRotationPoint(-5F, 18F, 8.5F); RBLeg2.setTextureSize(64, 32); RBLeg2.mirror = true; setRotation(RBLeg2, 0F, 0F, 0.9599311F); - + LBLeg4 = new ModelRenderer(this, 0, 13); LBLeg4.addBox(5F, -3F, -0.5F, 1, 3, 1); LBLeg4.setRotationPoint(5F, 18F, 8.5F); LBLeg4.setTextureSize(64, 32); LBLeg4.mirror = true; setRotation(LBLeg4, 0F, 0F, -0.2094395F); - + RBLeg4 = new ModelRenderer(this, 0, 13); RBLeg4.addBox(-6F, -3F, -0.5F, 1, 3, 1); RBLeg4.setRotationPoint(-5F, 18F, 8.5F); RBLeg4.setTextureSize(64, 32); RBLeg4.mirror = true; setRotation(RBLeg4, 0F, 0F, 0.2094395F); - + RBLeg5 = new ModelRenderer(this, 0, 0); RBLeg5.addBox(-6.4F, -1F, -1F, 2, 6, 2); RBLeg5.setRotationPoint(-5F, 18F, 8.5F); RBLeg5.setTextureSize(64, 32); RBLeg5.mirror = true; setRotation(RBLeg5, 0F, 0F, 0.1047198F); - + LBLeg6 = new ModelRenderer(this, 0, 13); LBLeg6.addBox(5.5F, 3F, -0.5F, 1, 3, 1); LBLeg6.setRotationPoint(5F, 18F, 8.5F); LBLeg6.setTextureSize(64, 32); LBLeg6.mirror = true; setRotation(LBLeg6, 0F, 0F, 0F); - + RBLeg6 = new ModelRenderer(this, 0, 13); RBLeg6.addBox(-6.5F, 3F, -0.5F, 1, 3, 1); RBLeg6.setRotationPoint(-5F, 18F, 8.5F); RBLeg6.setTextureSize(64, 32); RBLeg6.mirror = true; setRotation(RBLeg6, 0F, 0F, 0F); - + LBLeg5 = new ModelRenderer(this, 0, 0); LBLeg5.addBox(4.6F, -1F, -1F, 2, 6, 2); LBLeg5.setRotationPoint(5F, 18F, 8.5F); LBLeg5.setTextureSize(64, 32); LBLeg5.mirror = true; setRotation(LBLeg5, 0F, 0F, -0.1047198F); - + RFLeg1 = new ModelRenderer(this, 0, 13); RFLeg1.addBox(-3.5F, -0.5F, -0.5F, 3, 1, 1); RFLeg1.setRotationPoint(-5F, 18F, 0.5F); RFLeg1.setTextureSize(64, 32); RFLeg1.mirror = true; setRotation(RFLeg1, 0F, 0F, 0.4363323F); - + RFLeg2 = new ModelRenderer(this, 0, 0); RFLeg2.addBox(-5.5F, 0.5F, -1F, 3, 2, 2); RFLeg2.setRotationPoint(-5F, 18F, 0.5F); RFLeg2.setTextureSize(64, 32); RFLeg2.mirror = true; setRotation(RFLeg2, 0F, 0F, 0.9599311F); - + RFLeg3 = new ModelRenderer(this, 2, 0); RFLeg3.addBox(-8.1F, -1.5F, -1F, 3, 1, 2); RFLeg3.setRotationPoint(-5F, 18F, 0.5F); RFLeg3.setTextureSize(64, 32); RFLeg3.mirror = true; setRotation(RFLeg3, 0F, 0F, 0.5759587F); - + RFLeg4 = new ModelRenderer(this, 0, 13); RFLeg4.addBox(-6F, -3F, -0.5F, 1, 3, 1); RFLeg4.setRotationPoint(-5F, 18F, 0.5F); RFLeg4.setTextureSize(64, 32); RFLeg4.mirror = true; setRotation(RFLeg4, 0F, 0F, 0.2094395F); - + RFLeg5 = new ModelRenderer(this, 0, 0); RFLeg5.addBox(-6.4F, -1F, -1F, 2, 6, 2); RFLeg5.setRotationPoint(-5F, 18F, 0.5F); RFLeg5.setTextureSize(64, 32); RFLeg5.mirror = true; setRotation(RFLeg5, 0F, 0F, 0.1047198F); - + RFLeg6 = new ModelRenderer(this, 0, 13); RFLeg6.addBox(-6.5F, 3F, -0.5F, 1, 3, 1); RFLeg6.setRotationPoint(-5F, 18F, 0.5F); RFLeg6.setTextureSize(64, 32); RFLeg6.mirror = true; setRotation(RFLeg6, 0F, 0F, 0F); - + RMLeg1 = new ModelRenderer(this, 0, 13); RMLeg1.addBox(-3.5F, -0.5F, -0.5F, 3, 1, 1); RMLeg1.setRotationPoint(-5F, 18F, 4.5F); RMLeg1.setTextureSize(64, 32); RMLeg1.mirror = true; setRotation(RMLeg1, 0F, 0F, 0.4363323F); - + RMLeg2 = new ModelRenderer(this, 0, 0); RMLeg2.addBox(-5.5F, 0.5F, -1F, 3, 2, 2); RMLeg2.setRotationPoint(-5F, 18F, 4.5F); RMLeg2.setTextureSize(64, 32); RMLeg2.mirror = true; setRotation(RMLeg2, 0F, 0F, 0.9599311F); - + RMLeg3 = new ModelRenderer(this, 2, 0); RMLeg3.addBox(-8.1F, -1.5F, -1F, 3, 1, 2); RMLeg3.setRotationPoint(-5F, 18F, 4.5F); RMLeg3.setTextureSize(64, 32); RMLeg3.mirror = true; setRotation(RMLeg3, 0F, 0F, 0.5759587F); - + RMLeg4 = new ModelRenderer(this, 0, 13); RMLeg4.addBox(-6F, -3F, -0.5F, 1, 3, 1); RMLeg4.setRotationPoint(-5F, 18F, 4.5F); RMLeg4.setTextureSize(64, 32); RMLeg4.mirror = true; setRotation(RMLeg4, 0F, 0F, 0.2094395F); - + RMLeg5 = new ModelRenderer(this, 0, 0); RMLeg5.addBox(-6.4F, -1F, -1F, 2, 6, 2); RMLeg5.setRotationPoint(-5F, 18F, 4.5F); RMLeg5.setTextureSize(64, 32); RMLeg5.mirror = true; setRotation(RMLeg5, 0F, 0F, 0.1047198F); - + RMLeg6 = new ModelRenderer(this, 0, 13); RMLeg6.addBox(-6.5F, 3F, -0.5F, 1, 3, 1); RMLeg6.setRotationPoint(-5F, 18F, 4.5F); RMLeg6.setTextureSize(64, 32); RMLeg6.mirror = true; setRotation(RMLeg6, 0F, 0F, 0F); - + LFLeg1 = new ModelRenderer(this, 0, 13); LFLeg1.addBox(0.5F, -0.5F, -0.5F, 3, 1, 1); LFLeg1.setRotationPoint(5F, 18F, 0.5F); LFLeg1.setTextureSize(64, 32); LFLeg1.mirror = true; setRotation(LFLeg1, 0F, 0F, -0.4363323F); - + LFLeg2 = new ModelRenderer(this, 0, 0); LFLeg2.addBox(2.5F, 0.5F, -1F, 3, 2, 2); LFLeg2.setRotationPoint(5F, 18F, 0.5F); LFLeg2.setTextureSize(64, 32); LFLeg2.mirror = true; setRotation(LFLeg2, 0F, 0F, -0.9599311F); - + LFLeg3 = new ModelRenderer(this, 2, 0); LFLeg3.addBox(5.1F, -1.5F, -1F, 3, 1, 2); LFLeg3.setRotationPoint(5F, 18F, 0.5F); LFLeg3.setTextureSize(64, 32); LFLeg3.mirror = true; setRotation(LFLeg3, 0F, 0F, -0.5759587F); - + LFLeg4 = new ModelRenderer(this, 0, 13); LFLeg4.addBox(5F, -3F, -0.5F, 1, 3, 1); LFLeg4.setRotationPoint(5F, 18F, 0.5F); LFLeg4.setTextureSize(64, 32); LFLeg4.mirror = true; setRotation(LFLeg4, 0F, 0F, -0.2094395F); - + LFLeg5 = new ModelRenderer(this, 0, 0); LFLeg5.addBox(4.6F, -1F, -1F, 2, 6, 2); LFLeg5.setRotationPoint(5F, 18F, 0.5F); LFLeg5.setTextureSize(64, 32); LFLeg5.mirror = true; setRotation(LFLeg5, 0F, 0F, -0.1047198F); - + LFLeg6 = new ModelRenderer(this, 0, 13); LFLeg6.addBox(5.5F, 3F, -0.5F, 1, 3, 1); LFLeg6.setRotationPoint(5F, 18F, 0.5F); LFLeg6.setTextureSize(64, 32); LFLeg6.mirror = true; setRotation(LFLeg6, 0F, 0F, 0F); - + LMLeg1 = new ModelRenderer(this, 0, 13); LMLeg1.addBox(0.5F, -0.5F, -0.5F, 3, 1, 1); LMLeg1.setRotationPoint(5F, 18F, 4.5F); LMLeg1.setTextureSize(64, 32); LMLeg1.mirror = true; setRotation(LMLeg1, 0F, 0F, -0.4363323F); - + LMLeg2 = new ModelRenderer(this, 0, 0); LMLeg2.addBox(2.5F, 0.5F, -1F, 3, 2, 2); LMLeg2.setRotationPoint(5F, 18F, 4.5F); LMLeg2.setTextureSize(64, 32); LMLeg2.mirror = true; setRotation(LMLeg2, 0F, 0F, -0.9599311F); - + LMLeg4 = new ModelRenderer(this, 0, 13); LMLeg4.addBox(5F, -3F, -0.5F, 1, 3, 1); LMLeg4.setRotationPoint(5F, 18F, 4.5F); LMLeg4.setTextureSize(64, 32); LMLeg4.mirror = true; setRotation(LMLeg4, 0F, 0F, -0.2094395F); - + LMLeg3 = new ModelRenderer(this, 2, 0); LMLeg3.addBox(5.1F, -1.5F, -1F, 3, 1, 2); LMLeg3.setRotationPoint(5F, 18F, 4.5F); LMLeg3.setTextureSize(64, 32); LMLeg3.mirror = true; setRotation(LMLeg3, 0F, 0F, -0.5759587F); - + LMLeg5 = new ModelRenderer(this, 0, 0); LMLeg5.addBox(4.6F, -1F, -1F, 2, 6, 2); LMLeg5.setRotationPoint(5F, 18F, 4.5F); LMLeg5.setTextureSize(64, 32); LMLeg5.mirror = true; setRotation(LMLeg5, 0F, 0F, -0.1047198F); - + LMLeg6 = new ModelRenderer(this, 0, 13); LMLeg6.addBox(5.5F, 3F, -0.5F, 1, 3, 1); LMLeg6.setRotationPoint(5F, 18F, 4.5F); @@ -613,8 +613,8 @@ public ModelCaveFisher() { LMLeg6.mirror = true; setRotation(LMLeg6, 0F, 0F, 0F); } - - + + @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); @@ -695,19 +695,10 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f LMLeg5.render(f5); LMLeg6.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override - public void setRotationAngles(float f, float f1, float f2, - float f3, float f4, float f5, Entity ent) { - + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { + HeadBase.rotateAngleX = f4 / 57.29578F; HeadBase.rotateAngleY = f3 / 57.29578F; HeadMid.rotateAngleX = f4 / 57.29578F; @@ -720,61 +711,67 @@ public void setRotationAngles(float f, float f1, float f2, EyeRight.rotateAngleY = f3 / 57.29578F; Nose.rotateAngleX = f4 / 57.29578F; Nose.rotateAngleY = f3 / 57.29578F; - + // leg movement // going to move them up and down, so... yeah. // rotate all leg pieces ON THE Z AXIS! EntityCaveFisher foo = (EntityCaveFisher) ent; float[] thisAngles = foo.myAngles; - + LFLeg1.rotateAngleZ = -0.4363323F - MathHelper.cos(f * 0.7662F) * 1.4F * f1; LFLeg2.rotateAngleZ = -0.9599311F - MathHelper.cos(f * 0.7662F) * 1.4F * f1; LFLeg3.rotateAngleZ = -0.5759587F - MathHelper.cos(f * 0.7662F) * 1.4F * f1; LFLeg4.rotateAngleZ = -0.2094395F - MathHelper.cos(f * 0.7662F) * 1.4F * f1; LFLeg5.rotateAngleZ = -0.1047198F - MathHelper.cos(f * 0.7662F) * 1.4F * f1; LFLeg6.rotateAngleZ = (MathHelper.cos(f * 0.3662F) * 1.4F * f1) * -1; - + RFLeg1.rotateAngleZ = 0.4363323F + MathHelper.cos(f * 0.7662F + (float) Math.PI) * 1.4F * f1; RFLeg2.rotateAngleZ = 0.9599311F + MathHelper.cos(f * 0.7662F + (float) Math.PI) * 1.4F * f1; RFLeg3.rotateAngleZ = 0.5759587F + MathHelper.cos(f * 0.7662F + (float) Math.PI) * 1.4F * f1; RFLeg4.rotateAngleZ = 0.2094395F + MathHelper.cos(f * 0.7662F + (float) Math.PI) * 1.4F * f1; RFLeg5.rotateAngleZ = 0.1047198F + MathHelper.cos(f * 0.7662F + (float) Math.PI) * 1.4F * f1; RFLeg6.rotateAngleZ = MathHelper.cos(f * 0.3662F + (float) Math.PI) * 1.4F * f1; - + LMLeg1.rotateAngleZ = -0.4363323F - thisAngles[1]; LMLeg2.rotateAngleZ = -0.9599311F - thisAngles[1]; LMLeg3.rotateAngleZ = -0.5759587F - thisAngles[1]; LMLeg4.rotateAngleZ = -0.2094395F - thisAngles[1]; LMLeg5.rotateAngleZ = -0.1047198F - thisAngles[1]; LMLeg6.rotateAngleZ = thisAngles[1]; - + RMLeg1.rotateAngleZ = 0.4363323F + thisAngles[0]; RMLeg2.rotateAngleZ = 0.9599311F + thisAngles[0]; RMLeg3.rotateAngleZ = 0.5759587F + thisAngles[0]; RMLeg4.rotateAngleZ = 0.2094395F + thisAngles[0]; RMLeg5.rotateAngleZ = 0.1047198F + thisAngles[0]; RMLeg6.rotateAngleZ = thisAngles[0] * -1; - + LBLeg1.rotateAngleZ = -0.4363323F - thisAngles[2]; LBLeg2.rotateAngleZ = -0.9599311F - thisAngles[2]; LBLeg3.rotateAngleZ = -0.5759587F - thisAngles[2]; LBLeg4.rotateAngleZ = -0.2094395F - thisAngles[2]; LBLeg5.rotateAngleZ = -0.1047198F - thisAngles[2]; LBLeg6.rotateAngleZ = thisAngles[2] * -1; - + RBLeg1.rotateAngleZ = 0.4363323F + thisAngles[3]; RBLeg2.rotateAngleZ = 0.9599311F + thisAngles[3]; RBLeg3.rotateAngleZ = 0.5759587F + thisAngles[3]; RBLeg4.rotateAngleZ = 0.2094395F + thisAngles[3]; RBLeg5.rotateAngleZ = 0.1047198F + thisAngles[3]; RBLeg6.rotateAngleZ = thisAngles[3]; - + foo.myAngles[3] = foo.myAngles[1]; foo.myAngles[2] = foo.myAngles[0]; foo.myAngles[1] = MathHelper.cos(f * 0.7662F + (float) Math.PI) * 1.4F * f1; foo.myAngles[0] = MathHelper.cos(f * 0.7662F) * 1.4F * f1; - + //super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } \ No newline at end of file diff --git a/src/main/java/com/gw/dm/model/ModelCockatrice.java b/src/main/java/com/gw/dm/model/ModelCockatrice.java index 1900b38..c39c031 100644 --- a/src/main/java/com/gw/dm/model/ModelCockatrice.java +++ b/src/main/java/com/gw/dm/model/ModelCockatrice.java @@ -38,7 +38,7 @@ public class ModelCockatrice extends ModelBase { ModelRenderer Tail2; ModelRenderer RightWing; ModelRenderer LeftWing; - + public ModelCockatrice() { textureWidth = 64; textureHeight = 32; @@ -228,11 +228,10 @@ public ModelCockatrice() { LeftWing.mirror = true; setRotation(LeftWing, 0.1047198F, -0.1047198F, -0.4363323F); } - - + + @Override - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); //LeftClawBack.render(f5); @@ -266,29 +265,26 @@ public void render(Entity entity, float f, float f1, float f2, RightWing.render(f5); LeftWing.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override - public void setRotationAngles(float f, float f1, float f2, - float f3, float f4, float f5, Entity ent) { + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { // Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); - + HeadBase.rotateAngleY = f3 / 57.29578F; BeakBase.rotateAngleY = 0.7853982F + f3 / 57.29578F; BeakNose.rotateAngleY = f3 / 57.29578F; - + LeftLegTop.rotateAngleX = 0.4363323F + Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); LeftLegLow.rotateAngleX = -0.5235988F + Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); - + RightLegTop.rotateAngleX = 0.4363323F + Math.abs(MathHelper.sin(f * 0.5662F) * 1.4F * f1); RightLegLow.rotateAngleX = -0.5235988F + Math.abs(MathHelper.sin(f * 0.5662F) * 1.4F * f1); } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } diff --git a/src/main/java/com/gw/dm/model/ModelDestrachan.java b/src/main/java/com/gw/dm/model/ModelDestrachan.java index f7a629b..4e02f4e 100644 --- a/src/main/java/com/gw/dm/model/ModelDestrachan.java +++ b/src/main/java/com/gw/dm/model/ModelDestrachan.java @@ -7,7 +7,7 @@ import net.minecraft.util.math.MathHelper; public class ModelDestrachan extends ModelBase { - + ModelRenderer LeftFootBigClaw; ModelRenderer LeftLegLow; ModelRenderer LeftLegMid; @@ -83,530 +83,530 @@ public class ModelDestrachan extends ModelBase { ModelRenderer LeftFingerLtl; ModelRenderer RightFingerBig; ModelRenderer LeftFingerBig; - - + + public ModelDestrachan() { textureWidth = 64; textureHeight = 32; - + LeftFootBigClaw = new ModelRenderer(this, 0, 28); LeftFootBigClaw.addBox(-1.3F, 11F, -14F, 1, 1, 3); LeftFootBigClaw.setRotationPoint(6F, 12F, 11F); LeftFootBigClaw.setTextureSize(64, 32); LeftFootBigClaw.mirror = true; setRotation(LeftFootBigClaw, 0F, 0F, 0F); - + LeftLegLow = new ModelRenderer(this, 0, 0); LeftLegLow.addBox(-1.5F, 1F, -14F, 3, 2, 6); LeftLegLow.setRotationPoint(6F, 12F, 11F); LeftLegLow.setTextureSize(64, 32); LeftLegLow.mirror = true; setRotation(LeftLegLow, 0.7853982F, 0F, 0F); - + LeftLegMid = new ModelRenderer(this, 0, 0); LeftLegMid.addBox(-1F, 8F, -3.6F, 2, 2, 6); LeftLegMid.setRotationPoint(6F, 12F, 11F); LeftLegMid.setTextureSize(64, 32); LeftLegMid.mirror = true; setRotation(LeftLegMid, -0.7504916F, 0F, 0F); - + LeftLegCalf = new ModelRenderer(this, 0, 0); LeftLegCalf.addBox(-0.5F, 7F, -2.6F, 1, 1, 3); LeftLegCalf.setRotationPoint(6F, 12F, 11F); LeftLegCalf.setTextureSize(64, 32); LeftLegCalf.mirror = true; setRotation(LeftLegCalf, -0.7504916F, 0F, 0F); - + LeftLegHighTop = new ModelRenderer(this, 0, 0); LeftLegHighTop.addBox(-2F, -1F, -8.7F, 3, 2, 8); LeftLegHighTop.setRotationPoint(6F, 12F, 11F); LeftLegHighTop.setTextureSize(64, 32); LeftLegHighTop.mirror = true; setRotation(LeftLegHighTop, 0.5235988F, 0F, 0F); - + LeftFoot = new ModelRenderer(this, 0, 0); LeftFoot.addBox(-2F, 10F, -11F, 4, 2, 4); LeftFoot.setRotationPoint(6F, 12F, 11F); LeftFoot.setTextureSize(64, 32); LeftFoot.mirror = true; setRotation(LeftFoot, 0F, 0F, 0F); - + LeftFootLtlClaw = new ModelRenderer(this, 0, 28); LeftFootLtlClaw.addBox(0.3F, 11F, -13F, 1, 1, 2); LeftFootLtlClaw.setRotationPoint(6F, 12F, 11F); LeftFootLtlClaw.setTextureSize(64, 32); LeftFootLtlClaw.mirror = true; setRotation(LeftFootLtlClaw, 0F, 0F, 0F); - + RightFootBigClaw = new ModelRenderer(this, 0, 28); RightFootBigClaw.addBox(0.3F, 11F, -14F, 1, 1, 3); RightFootBigClaw.setRotationPoint(-6F, 12F, 11F); RightFootBigClaw.setTextureSize(64, 32); RightFootBigClaw.mirror = true; setRotation(RightFootBigClaw, 0F, 0F, 0F); - + RightFootLtlClaw = new ModelRenderer(this, 0, 28); RightFootLtlClaw.addBox(-1.3F, 11F, -13F, 1, 1, 2); RightFootLtlClaw.setRotationPoint(-6F, 12F, 11F); RightFootLtlClaw.setTextureSize(64, 32); RightFootLtlClaw.mirror = true; setRotation(RightFootLtlClaw, 0F, 0F, 0F); - + RightFoot = new ModelRenderer(this, 0, 0); RightFoot.addBox(-2F, 10F, -11F, 4, 2, 4); RightFoot.setRotationPoint(-6F, 12F, 11F); RightFoot.setTextureSize(64, 32); RightFoot.mirror = true; setRotation(RightFoot, 0F, 0F, 0F); - + RightLegLow = new ModelRenderer(this, 0, 0); RightLegLow.addBox(-1.5F, 1F, -14F, 3, 2, 6); RightLegLow.setRotationPoint(-6F, 12F, 11F); RightLegLow.setTextureSize(64, 32); RightLegLow.mirror = true; setRotation(RightLegLow, 0.7853982F, 0F, 0F); - + LeftThighHigh = new ModelRenderer(this, 0, 0); LeftThighHigh.addBox(-3F, -1F, -8.7F, 4, 4, 8); LeftThighHigh.setRotationPoint(6.2F, 10F, 13F); LeftThighHigh.setTextureSize(64, 32); LeftThighHigh.mirror = true; setRotation(LeftThighHigh, 0.5235988F, 0F, 0F); - + RightLegCalf = new ModelRenderer(this, 0, 0); RightLegCalf.addBox(-0.5F, 7F, -2.6F, 1, 1, 3); RightLegCalf.setRotationPoint(-6F, 12F, 11F); RightLegCalf.setTextureSize(64, 32); RightLegCalf.mirror = true; setRotation(RightLegCalf, -0.7504916F, 0F, 0F); - + RightLegMid = new ModelRenderer(this, 0, 0); RightLegMid.addBox(-1F, 8F, -3.6F, 2, 2, 6); RightLegMid.setRotationPoint(-6F, 12F, 11F); RightLegMid.setTextureSize(64, 32); RightLegMid.mirror = true; setRotation(RightLegMid, -0.7504916F, 0F, 0F); - + RightLegHighTop = new ModelRenderer(this, 0, 0); RightLegHighTop.addBox(-1F, -1F, -8.7F, 3, 2, 8); RightLegHighTop.setRotationPoint(-6F, 12F, 11F); RightLegHighTop.setTextureSize(64, 32); RightLegHighTop.mirror = true; setRotation(RightLegHighTop, 0.5235988F, 0F, 0F); - + LeftThighLow = new ModelRenderer(this, 16, 23); LeftThighLow.addBox(-2F, -1F, -8.4F, 3, 2, 7); LeftThighLow.setRotationPoint(5.6F, 12.3F, 14.3F); LeftThighLow.setTextureSize(64, 32); LeftThighLow.mirror = true; setRotation(LeftThighLow, 0.5235988F, 0F, 0F); - + RightThighHigh = new ModelRenderer(this, 0, 0); RightThighHigh.addBox(-1F, -1F, -8.7F, 4, 4, 8); RightThighHigh.setRotationPoint(-6.2F, 10F, 13F); RightThighHigh.setTextureSize(64, 32); RightThighHigh.mirror = true; setRotation(RightThighHigh, 0.5235988F, 0F, 0F); - + RightThighLow = new ModelRenderer(this, 16, 23); RightThighLow.addBox(-1F, -1F, -8.4F, 3, 2, 7); RightThighLow.setRotationPoint(-5.7F, 12.3F, 14.3F); RightThighLow.setTextureSize(64, 32); RightThighLow.mirror = true; setRotation(RightThighLow, 0.5235988F, 0F, 0F); - + LeftBodyBackBase = new ModelRenderer(this, 0, 0); LeftBodyBackBase.addBox(0F, -1.5F, -2F, 6, 3, 4); LeftBodyBackBase.setRotationPoint(5F, 12F, 11F); LeftBodyBackBase.setTextureSize(64, 32); LeftBodyBackBase.mirror = true; setRotation(LeftBodyBackBase, 0F, 0F, -2.268928F); - + RightBodyBackBase = new ModelRenderer(this, 0, 0); RightBodyBackBase.addBox(0F, -1.5F, -2F, 6, 3, 4); RightBodyBackBase.setRotationPoint(-5F, 12F, 11F); RightBodyBackBase.setTextureSize(64, 32); RightBodyBackBase.mirror = true; setRotation(RightBodyBackBase, 0F, 0F, -0.8726646F); - + HeadLeft1 = new ModelRenderer(this, 42, 0); HeadLeft1.addBox(0.5F, 0F, -10F, 2, 3, 9); HeadLeft1.setRotationPoint(0F, 3.8F, -13F); HeadLeft1.setTextureSize(64, 32); HeadLeft1.mirror = true; setRotation(HeadLeft1, 0F, 0F, 0.2268928F); - + SpineBase = new ModelRenderer(this, 0, 0); SpineBase.addBox(-2.5F, 0F, 0F, 5, 2, 4); SpineBase.setRotationPoint(0F, 6.4F, 9F); SpineBase.setTextureSize(64, 32); SpineBase.mirror = true; setRotation(SpineBase, 0F, 0F, 0F); - + SpineFront1 = new ModelRenderer(this, 0, 0); SpineFront1.addBox(-2F, 0F, 0F, 4, 2, 8); SpineFront1.setRotationPoint(0F, 3.4F, 3F); SpineFront1.setTextureSize(64, 32); SpineFront1.mirror = true; setRotation(SpineFront1, -0.4363323F, 0F, 0F); - + SpineFront2 = new ModelRenderer(this, 0, 0); SpineFront2.addBox(-2.5F, 0F, 0F, 5, 2, 8); SpineFront2.setRotationPoint(0F, -0.6F, -1F); SpineFront2.setTextureSize(64, 32); SpineFront2.mirror = true; setRotation(SpineFront2, -0.6806784F, 0F, 0F); - + SpineFront3 = new ModelRenderer(this, 0, 0); SpineFront3.addBox(-3F, 0F, 0F, 6, 2, 5); SpineFront3.setRotationPoint(0F, -1.1F, -6F); SpineFront3.setTextureSize(64, 32); SpineFront3.mirror = true; setRotation(SpineFront3, -0.1064651F, 0F, 0F); - + SpineFront4 = new ModelRenderer(this, 0, 0); SpineFront4.addBox(-2F, 0F, 0F, 4, 2, 5); SpineFront4.setRotationPoint(0F, 1.9F, -10F); SpineFront4.setTextureSize(64, 32); SpineFront4.mirror = true; setRotation(SpineFront4, 0.6108652F, 0F, 0F); - + SpineLow4 = new ModelRenderer(this, 0, 0); SpineLow4.addBox(-2F, -0.2F, 0F, 4, 2, 8); SpineLow4.setRotationPoint(0F, 10.3F, 0.7F); SpineLow4.setTextureSize(64, 32); SpineLow4.mirror = true; setRotation(SpineLow4, -0.1570796F, 0F, 0F); - + HeadMid = new ModelRenderer(this, 27, 0); HeadMid.addBox(-2.5F, -2F, -9.6F, 5, 1, 5); HeadMid.setRotationPoint(0F, 3.8F, -13F); HeadMid.setTextureSize(64, 32); HeadMid.mirror = true; setRotation(HeadMid, 0.2094395F, 0F, 0F); - + HeadLow1 = new ModelRenderer(this, 0, 0); HeadLow1.addBox(-0.5F, 0F, -11F, 1, 2, 10); HeadLow1.setRotationPoint(0F, 3.8F, -13F); HeadLow1.setTextureSize(64, 32); HeadLow1.mirror = true; setRotation(HeadLow1, 0.3141593F, 0F, 0F); - + MouthLipBot = new ModelRenderer(this, 0, 24); MouthLipBot.addBox(-2.5F, 3F, -10.8F, 5, 1, 1); MouthLipBot.setRotationPoint(0F, 3.8F, -13F); MouthLipBot.setTextureSize(64, 32); MouthLipBot.mirror = true; setRotation(MouthLipBot, 0F, 0F, 0F); - + HeadLeft2 = new ModelRenderer(this, 58, 0); HeadLeft2.addBox(1.4F, -0.4F, -7F, 1, 1, 2); HeadLeft2.setRotationPoint(0F, 3.8F, -13F); HeadLeft2.setTextureSize(64, 32); HeadLeft2.mirror = true; setRotation(HeadLeft2, 0F, 0F, 0.1745329F); - + LeftEarLipBot = new ModelRenderer(this, 46, 21); LeftEarLipBot.addBox(-1.5F, 1F, -3.3F, 8, 1, 1); LeftEarLipBot.setRotationPoint(0F, 3.8F, -13F); LeftEarLipBot.setTextureSize(64, 32); LeftEarLipBot.mirror = true; setRotation(LeftEarLipBot, 0F, -0.9599311F, -0.4363323F); - + MouthLipLeft = new ModelRenderer(this, 0, 20); MouthLipLeft.addBox(1.5F, 1F, -10.8F, 1, 2, 1); MouthLipLeft.setRotationPoint(0F, 3.8F, -13F); MouthLipLeft.setTextureSize(64, 32); MouthLipLeft.mirror = true; setRotation(MouthLipLeft, 0F, 0F, 0F); - + MouthLipTop = new ModelRenderer(this, 0, 24); MouthLipTop.addBox(-2.5F, 0F, -10.8F, 5, 1, 1); MouthLipTop.setRotationPoint(0F, 3.8F, -13F); MouthLipTop.setTextureSize(64, 32); MouthLipTop.mirror = true; setRotation(MouthLipTop, 0F, 0F, 0F); - + MouthBase = new ModelRenderer(this, 0, 15); MouthBase.addBox(-2.5F, 0F, -10.5F, 5, 4, 1); MouthBase.setRotationPoint(0F, 3.8F, -13F); MouthBase.setTextureSize(64, 32); MouthBase.mirror = true; setRotation(MouthBase, 0F, 0F, 0F); - + MouthLipRight = new ModelRenderer(this, 0, 20); MouthLipRight.addBox(-2.5F, 1F, -10.8F, 1, 2, 1); MouthLipRight.setRotationPoint(0F, 3.8F, -13F); MouthLipRight.setTextureSize(64, 32); MouthLipRight.mirror = true; setRotation(MouthLipRight, 0F, 0F, 0F); - + HeadRight1 = new ModelRenderer(this, 52, 0); HeadRight1.addBox(-2.5F, 0F, -10F, 2, 3, 9); HeadRight1.setRotationPoint(0F, 3.8F, -13F); HeadRight1.setTextureSize(64, 32); HeadRight1.mirror = true; setRotation(HeadRight1, 0F, 0F, -0.2268928F); - + HeadRight2 = new ModelRenderer(this, 57, 0); HeadRight2.addBox(-2.4F, -0.4F, -7F, 1, 1, 2); HeadRight2.setRotationPoint(0F, 3.8F, -13F); HeadRight2.setTextureSize(64, 32); HeadRight2.mirror = true; setRotation(HeadRight2, 0F, 0F, -0.1745329F); - + HeadBase = new ModelRenderer(this, 0, 0); HeadBase.addBox(-2.5F, -1F, -5F, 5, 2, 5); HeadBase.setRotationPoint(0F, 3.8F, -13F); HeadBase.setTextureSize(64, 32); HeadBase.mirror = true; setRotation(HeadBase, 0F, 0F, 0F); - + RightEarLipBot = new ModelRenderer(this, 46, 21); RightEarLipBot.addBox(-6.5F, 1F, -3.3F, 8, 1, 1); RightEarLipBot.setRotationPoint(0F, 3.8F, -13F); RightEarLipBot.setTextureSize(64, 32); RightEarLipBot.mirror = true; setRotation(RightEarLipBot, 0F, 0.9599311F, 0.4363323F); - + RightEarLipBack = new ModelRenderer(this, 42, 29); RightEarLipBack.addBox(-6.5F, -1F, -3.3F, 1, 2, 1); RightEarLipBack.setRotationPoint(0F, 3.8F, -13F); RightEarLipBack.setTextureSize(64, 32); RightEarLipBack.mirror = true; setRotation(RightEarLipBack, 0F, 0.9599311F, 0.4363323F); - + RightEarLipTop = new ModelRenderer(this, 46, 21); RightEarLipTop.addBox(-6.5F, -2F, -3.3F, 8, 1, 1); RightEarLipTop.setRotationPoint(0F, 3.8F, -13F); RightEarLipTop.setTextureSize(64, 32); RightEarLipTop.mirror = true; setRotation(RightEarLipTop, 0F, 0.9599311F, 0.4363323F); - + RightEarBase = new ModelRenderer(this, 48, 27); RightEarBase.addBox(-6.5F, -2F, -3F, 8, 4, 1); RightEarBase.setRotationPoint(0F, 3.8F, -13F); RightEarBase.setTextureSize(64, 32); RightEarBase.mirror = true; setRotation(RightEarBase, 0F, 0.9599311F, 0.4363323F); - + LeftEarLipBack = new ModelRenderer(this, 42, 29); LeftEarLipBack.addBox(5.5F, -1F, -3.3F, 1, 2, 1); LeftEarLipBack.setRotationPoint(0F, 3.8F, -13F); LeftEarLipBack.setTextureSize(64, 32); LeftEarLipBack.mirror = true; setRotation(LeftEarLipBack, 0F, -0.9599311F, -0.4363323F); - + LeftEarLipTop = new ModelRenderer(this, 46, 21); LeftEarLipTop.addBox(-1.5F, -2F, -3.3F, 8, 1, 1); LeftEarLipTop.setRotationPoint(0F, 3.8F, -13F); LeftEarLipTop.setTextureSize(64, 32); LeftEarLipTop.mirror = true; setRotation(LeftEarLipTop, 0F, -0.9599311F, -0.4363323F); - + LeftEarBase = new ModelRenderer(this, 48, 27); LeftEarBase.addBox(-1.5F, -2F, -3F, 8, 4, 1); LeftEarBase.setRotationPoint(0F, 3.8F, -13F); LeftEarBase.setTextureSize(64, 32); LeftEarBase.mirror = true; setRotation(LeftEarBase, 0F, -0.9599311F, -0.4363323F); - + TailBaseTop = new ModelRenderer(this, 0, 0); TailBaseTop.addBox(-2F, 0F, 0F, 4, 1, 2); TailBaseTop.setRotationPoint(0F, 7F, 12F); TailBaseTop.setTextureSize(64, 32); TailBaseTop.mirror = true; setRotation(TailBaseTop, 0F, 0F, 0F); - + SpineFront5 = new ModelRenderer(this, 0, 0); SpineFront5.addBox(-2F, 0F, 0F, 4, 2, 5); SpineFront5.setRotationPoint(0F, 2.9F, -14F); SpineFront5.setTextureSize(64, 32); SpineFront5.mirror = true; setRotation(SpineFront5, 0.2617994F, 0F, 0F); - + SpineLow1 = new ModelRenderer(this, 0, 0); SpineLow1.addBox(-2F, 0F, 0F, 4, 2, 5); SpineLow1.setRotationPoint(0F, 4.9F, -13.8F); SpineLow1.setTextureSize(64, 32); SpineLow1.mirror = true; setRotation(SpineLow1, -0.0872665F, 0F, 0F); - + BodyPart2 = new ModelRenderer(this, 0, 0); BodyPart2.addBox(0.9F, -3.6F, 0F, 2, 6, 7); BodyPart2.setRotationPoint(0F, 8.5F, 2.7F); BodyPart2.setTextureSize(64, 32); BodyPart2.mirror = true; setRotation(BodyPart2, -0.296706F, 0F, 0F); - + SpineLow3 = new ModelRenderer(this, 0, 0); SpineLow3.addBox(-2F, -0.2F, 0F, 4, 2, 6); SpineLow3.setRotationPoint(0F, 7.2F, -3.5F); SpineLow3.setTextureSize(64, 32); SpineLow3.mirror = true; setRotation(SpineLow3, -0.6108652F, 0F, 0F); - + BodyBotBase = new ModelRenderer(this, 0, 0); BodyBotBase.addBox(-5F, 0F, 0F, 10, 3, 2); BodyBotBase.setRotationPoint(0F, 10F, 10F); BodyBotBase.setTextureSize(64, 32); BodyBotBase.mirror = true; setRotation(BodyBotBase, 0F, 0F, 0F); - + TailBaseMidHigh = new ModelRenderer(this, 0, 0); TailBaseMidHigh.addBox(-3F, 0F, 0F, 6, 1, 2); TailBaseMidHigh.setRotationPoint(0F, 8F, 12F); TailBaseMidHigh.setTextureSize(64, 32); TailBaseMidHigh.mirror = true; setRotation(TailBaseMidHigh, 0F, 0F, 0F); - + TailBase = new ModelRenderer(this, 0, 0); TailBase.addBox(-5F, 0F, 0F, 10, 2, 2); TailBase.setRotationPoint(0F, 11F, 12F); TailBase.setTextureSize(64, 32); TailBase.mirror = true; setRotation(TailBase, 0F, 0F, 0F); - + TailPart2 = new ModelRenderer(this, 0, 0); TailPart2.addBox(-1.5F, -1.5F, 4F, 3, 3, 5); TailPart2.setRotationPoint(0F, 10.5F, 14F); TailPart2.setTextureSize(64, 32); TailPart2.mirror = true; setRotation(TailPart2, 0F, 0F, 0F); - + SpineLow2 = new ModelRenderer(this, 0, 0); SpineLow2.addBox(-2F, -0.2F, 0F, 4, 2, 6); SpineLow2.setRotationPoint(0F, 5.5F, -9.3F); SpineLow2.setTextureSize(64, 32); SpineLow2.mirror = true; setRotation(SpineLow2, -0.296706F, 0F, 0F); - + BodyPart4 = new ModelRenderer(this, 0, 0); BodyPart4.addBox(0.9F, -5.6F, 0F, 2, 6, 8); BodyPart4.setRotationPoint(0.3F, 6.5F, -4.4F); BodyPart4.setTextureSize(64, 32); BodyPart4.mirror = true; setRotation(BodyPart4, -0.5235988F, 0F, 0F); - + BodyPart1 = new ModelRenderer(this, 0, 0); BodyPart1.addBox(-2.9F, -3.6F, 0F, 2, 6, 7); BodyPart1.setRotationPoint(0F, 8.5F, 2.7F); BodyPart1.setTextureSize(64, 32); BodyPart1.mirror = true; setRotation(BodyPart1, -0.296706F, 0F, 0F); - + BodyPart6 = new ModelRenderer(this, 0, 0); BodyPart6.addBox(-3.5F, -6.4F, 0F, 2, 7, 5); BodyPart6.setRotationPoint(4.7F, 5.5F, -8.4F); BodyPart6.setTextureSize(64, 32); BodyPart6.mirror = true; setRotation(BodyPart6, -0.3665191F, 0F, 0F); - + BodyPart3 = new ModelRenderer(this, 0, 0); BodyPart3.addBox(-2.9F, -5.6F, 0F, 2, 6, 8); BodyPart3.setRotationPoint(-0.3F, 6.5F, -4.4F); BodyPart3.setTextureSize(64, 32); BodyPart3.mirror = true; setRotation(BodyPart3, -0.5235988F, 0F, 0F); - + BodyPartLast = new ModelRenderer(this, 0, 0); BodyPartLast.addBox(-2.25F, -6.4F, 0F, 5, 4, 8); BodyPartLast.setRotationPoint(-0.3F, 9F, -13.4F); BodyPartLast.setTextureSize(64, 32); BodyPartLast.mirror = true; setRotation(BodyPartLast, 0.2094395F, 0F, 0F); - + LeftArmBase = new ModelRenderer(this, 0, 0); LeftArmBase.addBox(0F, -3F, -3F, 3, 6, 6); LeftArmBase.setRotationPoint(1.7F, 5.5F, -4.4F); LeftArmBase.setTextureSize(64, 32); LeftArmBase.mirror = true; setRotation(LeftArmBase, -0.2617994F, 0F, 0F); - + TailBaseMidLow = new ModelRenderer(this, 0, 0); TailBaseMidLow.addBox(-4F, 0F, 0F, 8, 2, 2); TailBaseMidLow.setRotationPoint(0F, 9F, 12F); TailBaseMidLow.setTextureSize(64, 32); TailBaseMidLow.mirror = true; setRotation(TailBaseMidLow, 0F, 0F, 0F); - + TailPart3 = new ModelRenderer(this, 0, 0); TailPart3.addBox(-1F, -1F, 9F, 2, 2, 6); TailPart3.setRotationPoint(0F, 10.5F, 14F); TailPart3.setTextureSize(64, 32); TailPart3.mirror = true; setRotation(TailPart3, 0F, 0F, 0F); - + TailPart1 = new ModelRenderer(this, 0, 0); TailPart1.addBox(-2F, -2F, 0F, 4, 4, 4); TailPart1.setRotationPoint(0F, 10.5F, 14F); TailPart1.setTextureSize(64, 32); TailPart1.mirror = true; setRotation(TailPart1, 0F, 0F, 0F); - + BodyPart5 = new ModelRenderer(this, 0, 0); BodyPart5.addBox(-2.9F, -6.4F, 0F, 2, 7, 5); BodyPart5.setRotationPoint(-0.3F, 5.5F, -8.4F); BodyPart5.setTextureSize(64, 32); BodyPart5.mirror = true; setRotation(BodyPart5, -0.3665191F, 0F, 0F); - + RightArmBase = new ModelRenderer(this, 0, 0); RightArmBase.addBox(-3F, -3F, -3F, 3, 6, 6); RightArmBase.setRotationPoint(-1.8F, 5.5F, -4.4F); RightArmBase.setTextureSize(64, 32); RightArmBase.mirror = true; setRotation(RightArmBase, -0.2617994F, 0F, 0F); - + LeftArmLow = new ModelRenderer(this, 0, 0); LeftArmLow.addBox(1.5F, 4.2F, -0.1F, 2, 7, 3); LeftArmLow.setRotationPoint(1.7F, 5.5F, -4.4F); LeftArmLow.setTextureSize(64, 32); LeftArmLow.mirror = true; setRotation(LeftArmLow, -0.7853982F, 0F, -0.1570796F); - + LeftArmHigh = new ModelRenderer(this, 0, 0); LeftArmHigh.addBox(1F, -1.8F, -2.6F, 3, 8, 4); LeftArmHigh.setRotationPoint(1.7F, 5.5F, -4.4F); LeftArmHigh.setTextureSize(64, 32); LeftArmHigh.mirror = true; setRotation(LeftArmHigh, -0.2617994F, 0F, -0.1570796F); - + RightArmHigh = new ModelRenderer(this, 0, 0); RightArmHigh.addBox(-5F, -1.8F, -2.6F, 3, 8, 4); RightArmHigh.setRotationPoint(-1.8F, 5.5F, -4.4F); RightArmHigh.setTextureSize(64, 32); RightArmHigh.mirror = true; setRotation(RightArmHigh, -0.2617994F, 0F, 0.1570796F); - + RightFingerLtl = new ModelRenderer(this, 0, 28); RightFingerLtl.addBox(-4.4F, 11.2F, 1.4F, 1, 2, 1); RightFingerLtl.setRotationPoint(-1.8F, 5.5F, -4.4F); RightFingerLtl.setTextureSize(64, 32); RightFingerLtl.mirror = true; setRotation(RightFingerLtl, -0.7853982F, 0F, 0.1570796F); - + RightArmLow = new ModelRenderer(this, 0, 0); RightArmLow.addBox(-4.5F, 4.2F, -0.1F, 2, 7, 3); RightArmLow.setRotationPoint(-1.8F, 5.5F, -4.4F); RightArmLow.setTextureSize(64, 32); RightArmLow.mirror = true; setRotation(RightArmLow, -0.7853982F, 0F, 0.1570796F); - + LeftFingerLtl = new ModelRenderer(this, 0, 28); LeftFingerLtl.addBox(2.4F, 11.2F, 1.4F, 1, 2, 1); LeftFingerLtl.setRotationPoint(1.7F, 5.5F, -4.4F); LeftFingerLtl.setTextureSize(64, 32); LeftFingerLtl.mirror = true; setRotation(LeftFingerLtl, -0.7853982F, 0F, -0.1570796F); - + RightFingerBig = new ModelRenderer(this, 0, 28); RightFingerBig.addBox(-4.4F, 11.2F, 0.1F, 1, 3, 1); RightFingerBig.setRotationPoint(-1.8F, 5.5F, -4.4F); RightFingerBig.setTextureSize(64, 32); RightFingerBig.mirror = true; setRotation(RightFingerBig, -0.7853982F, 0F, 0.1570796F); - + LeftFingerBig = new ModelRenderer(this, 0, 28); LeftFingerBig.addBox(2.4F, 11.2F, 0.1F, 1, 3, 1); LeftFingerBig.setRotationPoint(1.7F, 5.5F, -4.4F); @@ -614,11 +614,10 @@ public ModelDestrachan() { LeftFingerBig.mirror = true; setRotation(LeftFingerBig, -0.7853982F, 0F, -0.1570796F); } - - + + @Override - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); LeftFootBigClaw.render(f5); @@ -697,20 +696,11 @@ public void render(Entity entity, float f, float f1, float f2, RightFingerBig.render(f5); LeftFingerBig.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override - public void setRotationAngles(float f, float f1, float f2, float - f3, float f4, float f5, Entity ent) { + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { EntityDestrachan d = (EntityDestrachan) ent; - + // left is ranged, right is melee if (d.isRanged) { RightArmHigh.rotateAngleX = -0.2617994F; @@ -721,7 +711,8 @@ public void setRotationAngles(float f, float f1, float f2, float LeftArmHigh.rotateAngleX = -0.2617994F; LeftFingerLtl.rotateAngleX = -0.7853982F; LeftFingerBig.rotateAngleX = -0.7853982F; - } else { + } + else { RightArmHigh.rotateAngleX = -0.8726646F; RightFingerLtl.rotateAngleX = -1.22173F; RightArmLow.rotateAngleX = -1.22173F; @@ -731,7 +722,7 @@ public void setRotationAngles(float f, float f1, float f2, float LeftFingerLtl.rotateAngleX = -1.22173F; LeftFingerBig.rotateAngleX = -1.22173F; } - + HeadBase.rotateAngleY = f3 / 57.29578F; HeadBase.rotateAngleX = f4 / 57.29578F; HeadLeft1.rotateAngleY = f3 / 57.29578F; @@ -772,7 +763,7 @@ public void setRotationAngles(float f, float f1, float f2, float LeftEarLipBack.rotateAngleX = f4 / 57.29578F / 2; LeftEarBase.rotateAngleY = -0.9599311F - ((f3 / 57.29578F) / 2); LeftEarBase.rotateAngleX = f4 / 57.29578F / 2; - + LeftFootBigClaw.rotateAngleX = 0 - Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); LeftFoot.rotateAngleX = 0 - Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); LeftFootLtlClaw.rotateAngleX = 0 - Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); @@ -780,7 +771,7 @@ public void setRotationAngles(float f, float f1, float f2, float LeftLegMid.rotateAngleX = -0.7504916F - Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); LeftLegCalf.rotateAngleX = -0.7504916F - Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); LeftLegHighTop.rotateAngleX = 0.5235988F - Math.abs(MathHelper.cos(f * 0.5662F) * 1.4F * f1); - + RightFootBigClaw.rotateAngleX = 0 - Math.abs(MathHelper.sin(f * 0.5662F) * 1.4F * f1); RightFoot.rotateAngleX = 0 - Math.abs(MathHelper.sin(f * 0.5662F) * 1.4F * f1); RightFootLtlClaw.rotateAngleX = 0 - Math.abs(MathHelper.sin(f * 0.5662F) * 1.4F * f1); @@ -789,5 +780,11 @@ public void setRotationAngles(float f, float f1, float f2, float RightLegCalf.rotateAngleX = -0.7504916F - Math.abs(MathHelper.sin(f * 0.5662F) * 1.4F * f1); RightLegHighTop.rotateAngleX = 0.5235988F - Math.abs(MathHelper.sin(f * 0.5662F) * 1.4F * f1); } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } diff --git a/src/main/java/com/gw/dm/model/ModelEldermob.java b/src/main/java/com/gw/dm/model/ModelEldermob.java index 1d81435..73631d1 100644 --- a/src/main/java/com/gw/dm/model/ModelEldermob.java +++ b/src/main/java/com/gw/dm/model/ModelEldermob.java @@ -14,54 +14,53 @@ public class ModelEldermob extends ModelBase { public float[][][] tenticlePos; public float[][] tenticleMove; private Random tenticleRandom; - + public ModelEldermob() { textureWidth = 128; textureHeight = 96; body = new ModelRenderer(this, 0, 0); body.addBox(-16f, -8f, -16f, 32, 32, 32); body.setRotationPoint(0.0f, 0.0f, 0.0f); - + tenticleRandom = new Random(System.nanoTime()); - + tenticles = new ModelRenderer[24][]; tenticlePos = new float[24][4][3]; tenticleMove = new float[24][13]; - + tenticles[0] = makeTenticle(-14f, -6f, 16f, 0, 0, 1, tenticlePos[0], tenticleMove[0]); tenticles[1] = makeTenticle(6f, -6f, 16f, 0, 0, 1, tenticlePos[1], tenticleMove[1]); tenticles[2] = makeTenticle(6f, 14f, 16f, 0, 0, 1, tenticlePos[2], tenticleMove[2]); tenticles[3] = makeTenticle(-14f, 14f, 16f, 0, 0, 1, tenticlePos[3], tenticleMove[3]); - + tenticles[4] = makeTenticle(-14f, -6f, -22f, 0, 0, -1, tenticlePos[4], tenticleMove[4]); tenticles[5] = makeTenticle(6f, -6f, -22f, 0, 0, -1, tenticlePos[5], tenticleMove[5]); tenticles[6] = makeTenticle(6f, 14f, -22f, 0, 0, -1, tenticlePos[6], tenticleMove[6]); tenticles[7] = makeTenticle(-14f, 14f, -22f, 0, 0, -1, tenticlePos[7], tenticleMove[7]); - + tenticles[8] = makeTenticle(16f, -6f, -14f, 1, 0, 0, tenticlePos[8], tenticleMove[8]); tenticles[9] = makeTenticle(16f, 14f, -14f, 1, 0, 0, tenticlePos[9], tenticleMove[9]); tenticles[10] = makeTenticle(16f, 14f, 6f, 1, 0, 0, tenticlePos[10], tenticleMove[10]); tenticles[11] = makeTenticle(16f, -6f, 6f, 1, 0, 0, tenticlePos[11], tenticleMove[11]); - + tenticles[12] = makeTenticle(-22f, -6f, -14f, -1, 0, 0, tenticlePos[12], tenticleMove[12]); tenticles[13] = makeTenticle(-22f, 14f, -14f, -1, 0, 0, tenticlePos[13], tenticleMove[13]); tenticles[14] = makeTenticle(-22f, 14f, 6f, -1, 0, 0, tenticlePos[14], tenticleMove[14]); tenticles[15] = makeTenticle(-22f, -6f, 6f, -1, 0, 0, tenticlePos[15], tenticleMove[15]); - + tenticles[16] = makeTenticle(-14f, 22f, -14f, 0, 1, 0, tenticlePos[16], tenticleMove[16]); tenticles[17] = makeTenticle(6f, 22f, -14f, 0, 1, 0, tenticlePos[17], tenticleMove[17]); tenticles[18] = makeTenticle(6f, 22f, 6f, 0, 1, 0, tenticlePos[18], tenticleMove[18]); tenticles[19] = makeTenticle(-14f, 22f, 6f, 0, 1, 0, tenticlePos[19], tenticleMove[19]); - + tenticles[20] = makeTenticle(-14f, -16f, -14f, 0, -1, 0, tenticlePos[20], tenticleMove[20]); tenticles[21] = makeTenticle(6f, -16f, -14f, 0, -1, 0, tenticlePos[21], tenticleMove[21]); tenticles[22] = makeTenticle(6f, -16f, 6f, 0, -1, 0, tenticlePos[22], tenticleMove[22]); tenticles[23] = makeTenticle(-14f, -16f, 6f, 0, -1, 0, tenticlePos[23], tenticleMove[23]); } - - - private ModelRenderer[] makeTenticle(float x, float y, float z, float xf, float yf, float zf, - float[][] pos, float[] move) { + + + private ModelRenderer[] makeTenticle(float x, float y, float z, float xf, float yf, float zf, float[][] pos, float[] move) { move[0] = tenticleRandom.nextFloat() + 1f; move[0] -= move[0] * xf; move[1] = tenticleRandom.nextFloat() * (float) Math.PI; @@ -112,11 +111,10 @@ private ModelRenderer[] makeTenticle(float x, float y, float z, float xf, float out[3].setRotationPoint(0.0f, 0.0f, 0.0f); return out; } - - + + @Override - public void render(Entity entity, float limbSwing, float limbSwingAmount, - float age, float headYaw, float headPitch, float scale) { + public void render(Entity entity, float limbSwing, float limbSwingAmount, float age, float headYaw, float headPitch, float scale) { GlStateManager.pushMatrix(); GlStateManager.scale(0.8, 0.8, 0.8); body.render(scale); @@ -146,42 +144,38 @@ public void render(Entity entity, float limbSwing, float limbSwingAmount, renderTenticle(tenticles[23], scale); GlStateManager.popMatrix(); } - - - private void renderTenticle(ModelRenderer[] tenticle, float scale) { - tenticle[0].render(scale); - tenticle[1].render(scale); - tenticle[2].render(scale); - tenticle[3].render(scale); - } - - + @Override - public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, - float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { float age = (ageInTicks + tenticleRandom.nextFloat()) / 6f; for (int i = 0; i < tenticles.length; i++) { moveTenticle(tenticles[i], tenticlePos[i], tenticleMove[i], age); } } - - + + private void renderTenticle(ModelRenderer[] tenticle, float scale) { + tenticle[0].render(scale); + tenticle[1].render(scale); + tenticle[2].render(scale); + tenticle[3].render(scale); + } + private void moveTenticle(ModelRenderer[] tenticle, float[][] initPos, float[] moveDat, float age) { tenticle[0].offsetX = (float) (moveDat[6] * moveDat[10] * Math.sin(age * moveDat[0] + moveDat[1])); tenticle[0].offsetY = (float) (moveDat[6] * moveDat[11] * Math.sin(age * moveDat[2] + moveDat[3])); tenticle[0].offsetZ = (float) (moveDat[6] * moveDat[12] * Math.sin(age * moveDat[4] + moveDat[5])); - + tenticle[1].offsetX = (float) (moveDat[7] * moveDat[10] * Math.sin(age * moveDat[0] + moveDat[1])); tenticle[1].offsetY = (float) (moveDat[7] * moveDat[11] * Math.sin(age * moveDat[2] + moveDat[3])); tenticle[1].offsetZ = (float) (moveDat[7] * moveDat[12] * Math.sin(age * moveDat[4] + moveDat[5])); - + tenticle[2].offsetX = (float) (moveDat[8] * moveDat[10] * Math.sin(age * moveDat[0] + moveDat[1])); tenticle[2].offsetY = (float) (moveDat[8] * moveDat[11] * Math.sin(age * moveDat[2] + moveDat[3])); tenticle[2].offsetZ = (float) (moveDat[8] * moveDat[12] * Math.sin(age * moveDat[4] + moveDat[5])); - + tenticle[3].offsetX = (float) (moveDat[9] * moveDat[10] * Math.sin(age * moveDat[0] + moveDat[1])); tenticle[3].offsetY = (float) (moveDat[9] * moveDat[11] * Math.sin(age * moveDat[2] + moveDat[3])); tenticle[3].offsetZ = (float) (moveDat[9] * moveDat[12] * Math.sin(age * moveDat[4] + moveDat[5])); } - + } diff --git a/src/main/java/com/gw/dm/model/ModelEyeRay.java b/src/main/java/com/gw/dm/model/ModelEyeRay.java index ae076d0..bace01d 100644 --- a/src/main/java/com/gw/dm/model/ModelEyeRay.java +++ b/src/main/java/com/gw/dm/model/ModelEyeRay.java @@ -12,11 +12,11 @@ public class ModelEyeRay extends ModelBase { ModelRenderer Shape1; - + public ModelEyeRay() { textureWidth = 64; textureHeight = 32; - + Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(-2F, -2F, -2F, 4, 4, 4); Shape1.setRotationPoint(0F, 0F, 0F); @@ -24,27 +24,23 @@ public ModelEyeRay() { Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); } - - - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Shape1.render(f5); } - - + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { + this.Shape1.rotateAngleY = f3 / 57.29578F; + this.Shape1.rotateAngleX = f4 / 57.29578F; + } + private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } - - - public void setRotationAngles(float f, float f1, float f2, - float f3, float f4, float f5, Entity ent) { - this.Shape1.rotateAngleY = f3 / 57.29578F; - this.Shape1.rotateAngleX = f4 / 57.29578F; - } } diff --git a/src/main/java/com/gw/dm/model/ModelFallenAngel.java b/src/main/java/com/gw/dm/model/ModelFallenAngel.java index 0f2e8ab..5451d49 100644 --- a/src/main/java/com/gw/dm/model/ModelFallenAngel.java +++ b/src/main/java/com/gw/dm/model/ModelFallenAngel.java @@ -10,10 +10,10 @@ public class ModelFallenAngel extends ModelBase { private static final float WINGRX = (float) Math.PI / 3; private static final float WINGRY = (float) Math.PI / 4; private static final float WINGRZ = (float) Math.PI / 6; - + private static final float R_UP = (float) ((Math.PI * 135.0) / 180); private static final float L_UP = (float) ((Math.PI * 225.0) / 180); - + public ModelRenderer head; public ModelRenderer torso; public ModelRenderer rightArm; @@ -24,51 +24,51 @@ public class ModelFallenAngel extends ModelBase { public ModelRenderer base2; // Bottom of skirt public ModelRenderer base3; - + public ModelRenderer rightWing; public ModelRenderer leftWing; - - + + public ModelFallenAngel() { textureWidth = 64; textureHeight = 68; - + head = new ModelRenderer(this, 0, 0); head.addBox(-4.0f, -8.0f, -4.0f, 8, 8, 8); head.setRotationPoint(0.0f, 0.0f, 0.0f); - + torso = new ModelRenderer(this, 16, 16); torso.addBox(-4.0f, 0.0f, -2.0f, 8, 12, 4); torso.setRotationPoint(0.0f, 0.0f, 0.0f); - + rightArm = new ModelRenderer(this, 40, 16); rightArm.addBox(-3.0f, -2.0f, -2.0f, 4, 12, 4); rightArm.setRotationPoint(-5.0f, 2.0f, 0.0f); - + leftArm = new ModelRenderer(this, 40, 16); leftArm.addBox(-1.0f, -2.0f, -2.0f, 4, 12, 4); leftArm.setRotationPoint(5.0f, 2.0f, 0.0f); leftArm.mirror = true; - + base1 = new ModelRenderer(this, 0, 32); base1.addBox(-5.0f, 0.0f, -3.0f, 10, 4, 6); base1.setRotationPoint(0.0f, 12.0f, 0.0f); - + base2 = new ModelRenderer(this, 0, 42); base2.addBox(-6.0f, 0.0f, -4.0f, 12, 4, 8); base2.setRotationPoint(0.0f, 16.0f, 0.0f); - + base3 = new ModelRenderer(this, 0, 54); base3.addBox(-7.0f, 0.0f, -5.0f, 14, 4, 10); base3.setRotationPoint(0.0f, 20.0f, 0.0f); - + rightWing = new ModelRenderer(this, 42, 32); rightWing.addBox(0.0f, 0.0f, 0.0f, 1, 6, 10); rightWing.setRotationPoint(-4.0f, 2.0f, 2.0f); rightWing.rotateAngleX = (float) WINGRX; rightWing.rotateAngleY = (float) -WINGRY; rightWing.rotateAngleZ = (float) -WINGRZ; - + leftWing = new ModelRenderer(this, 42, 32); leftWing.mirror = true; leftWing.addBox(0.0f, 0.0f, 0.0f, 1, 6, 10); @@ -77,11 +77,10 @@ public ModelFallenAngel() { leftWing.rotateAngleY = (float) WINGRY; leftWing.rotateAngleZ = (float) WINGRZ; } - - + + @Override - public void render(Entity entity, float limbSwing, float limbSwingAmount, - float age, float headYaw, float headPitch, float scale) { + public void render(Entity entity, float limbSwing, float limbSwingAmount, float age, float headYaw, float headPitch, float scale) { GlStateManager.pushMatrix(); head.render(scale); torso.render(scale); @@ -94,16 +93,15 @@ public void render(Entity entity, float limbSwing, float limbSwingAmount, leftWing.render(scale); GlStateManager.popMatrix(); } - - + + @Override - public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, - float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { head.rotateAngleY = netHeadYaw * 0.017453292F; head.rotateAngleX = headPitch * 0.017453292F; - + EntityFallenAngel angel = (EntityFallenAngel) entityIn; - + float wingMovement1 = (float) Math.toRadians(Math.sin(ageInTicks * 0.2) * 15.0); float wingMovement2 = wingMovement1 * 2; rightWing.rotateAngleX = (float) WINGRX - wingMovement2; @@ -112,17 +110,18 @@ public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageI leftWing.rotateAngleX = (float) WINGRX - wingMovement2; leftWing.rotateAngleY = (float) WINGRY + wingMovement2; leftWing.rotateAngleZ = (float) WINGRZ - wingMovement1; - + if (angel.areArmsUp()) { rightArm.rotateAngleZ = R_UP; leftArm.rotateAngleZ = L_UP; - } else { + } + else { rightArm.rotateAngleZ = 0.0f; leftArm.rotateAngleZ = 0.0f; } - - + + } - - + + } diff --git a/src/main/java/com/gw/dm/model/ModelGhoul.java b/src/main/java/com/gw/dm/model/ModelGhoul.java index 2b97550..3e45af9 100644 --- a/src/main/java/com/gw/dm/model/ModelGhoul.java +++ b/src/main/java/com/gw/dm/model/ModelGhoul.java @@ -6,7 +6,7 @@ public class ModelGhoul extends ModelBiped { public ModelGhoul() { super(0.0F); - + this.bipedHead = null; this.bipedHead = new ModelRenderer(this, 0, 0); this.bipedHead.addBox(-4.0F, -4.0F, -7.0F, 8, 8, 8, 0.0F); diff --git a/src/main/java/com/gw/dm/model/ModelHookHorror.java b/src/main/java/com/gw/dm/model/ModelHookHorror.java index 710bad8..4dafcce 100644 --- a/src/main/java/com/gw/dm/model/ModelHookHorror.java +++ b/src/main/java/com/gw/dm/model/ModelHookHorror.java @@ -6,7 +6,7 @@ import net.minecraft.util.math.MathHelper; public class ModelHookHorror extends ModelBase { - + ModelRenderer LeftLegLow; ModelRenderer LeftFoot; ModelRenderer RightLegLow; @@ -40,235 +40,235 @@ public class ModelHookHorror extends ModelBase { ModelRenderer LeftClawLow; ModelRenderer RightClawMid; ModelRenderer RightClawLow; - + public ModelHookHorror() { textureWidth = 64; textureHeight = 32; - + LeftLegLow = new ModelRenderer(this, 0, 0); LeftLegLow.addBox(-1.5F, 4.2F, -5.7F, 3, 9, 3); LeftLegLow.setRotationPoint(-4F, 9.5F, -0.4F); LeftLegLow.setTextureSize(64, 32); LeftLegLow.mirror = true; setRotation(LeftLegLow, 0.3490659F, 0F, 0F); - + LeftFoot = new ModelRenderer(this, 0, 0); LeftFoot.addBox(-2F, 12.5F, -4F, 4, 2, 6); LeftFoot.setRotationPoint(4F, 9.5F, -0.4F); LeftFoot.setTextureSize(64, 32); LeftFoot.mirror = true; setRotation(LeftFoot, 0F, 0F, 0F); - + RightLegLow = new ModelRenderer(this, 0, 0); RightLegLow.addBox(-1.5F, 0F, -1.5F, 3, 8, 3); RightLegLow.setRotationPoint(4F, 15F, -3F); RightLegLow.setTextureSize(64, 32); RightLegLow.mirror = true; setRotation(RightLegLow, 0.3490659F, 0F, 0F); - + RightLegTop = new ModelRenderer(this, 0, 0); RightLegTop.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); RightLegTop.setRotationPoint(-4F, 9.5F, -0.4F); RightLegTop.setTextureSize(64, 32); RightLegTop.mirror = true; setRotation(RightLegTop, -0.3839724F, 0F, 0F); - + LeftLegTop = new ModelRenderer(this, 0, 0); LeftLegTop.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); LeftLegTop.setRotationPoint(4F, 9.5F, -0.4F); LeftLegTop.setTextureSize(64, 32); LeftLegTop.mirror = true; setRotation(LeftLegTop, -0.3839724F, 0F, 0F); - + RightBackToe = new ModelRenderer(this, 0, 29); RightBackToe.addBox(-0.5F, 13F, 1F, 1, 1, 2); RightBackToe.setRotationPoint(-4F, 9.5F, -0.4F); RightBackToe.setTextureSize(64, 32); RightBackToe.mirror = true; setRotation(RightBackToe, 0F, 0F, 0F); - + BodyTop = new ModelRenderer(this, 0, 0); BodyTop.addBox(-6F, 0F, 0F, 12, 12, 4); BodyTop.setRotationPoint(0F, -7F, -8F); BodyTop.setTextureSize(64, 32); BodyTop.mirror = true; setRotation(BodyTop, 0.418879F, 0F, 0F); - + BodyLow = new ModelRenderer(this, 0, 0); BodyLow.addBox(-6F, 0F, 0F, 12, 10, 4); BodyLow.setRotationPoint(0F, 1F, -4F); BodyLow.setTextureSize(64, 32); BodyLow.mirror = true; setRotation(BodyLow, 0.2094395F, 0F, 0F); - + BackRight = new ModelRenderer(this, 0, 0); BackRight.addBox(-4F, 0F, 0F, 8, 14, 2); BackRight.setRotationPoint(-4F, -7F, -4F); BackRight.setTextureSize(64, 32); BackRight.mirror = true; setRotation(BackRight, 0.3490659F, -0.1745329F, 0F); - + BackLeft = new ModelRenderer(this, 0, 0); BackLeft.addBox(-4F, 0F, 0F, 8, 14, 2); BackLeft.setRotationPoint(4F, -7F, -4F); BackLeft.setTextureSize(64, 32); BackLeft.mirror = true; setRotation(BackLeft, 0.3490659F, 0.1745329F, 0F); - + Spine = new ModelRenderer(this, 0, 0); Spine.addBox(-1F, 0F, 0F, 2, 13, 1); Spine.setRotationPoint(0F, -4F, -2F); Spine.setTextureSize(64, 32); Spine.mirror = true; setRotation(Spine, 0.2443461F, 0F, 0F); - + Chest = new ModelRenderer(this, 44, 19); Chest.addBox(-4F, 0F, 0F, 8, 11, 2); Chest.setRotationPoint(0F, -4F, -8F); Chest.setTextureSize(64, 32); Chest.mirror = true; setRotation(Chest, 0.4886922F, 0F, 0F); - + RightFoot = new ModelRenderer(this, 0, 0); RightFoot.addBox(-2F, 12.5F, -4F, 4, 2, 6); RightFoot.setRotationPoint(-4F, 9.5F, -0.4F); RightFoot.setTextureSize(64, 32); RightFoot.mirror = true; setRotation(RightFoot, 0F, 0F, 0F); - + RightToes = new ModelRenderer(this, 0, 29); RightToes.addBox(-1.5F, 13F, -5F, 3, 1, 2); RightToes.setRotationPoint(-4F, 9.5F, -0.4F); RightToes.setTextureSize(64, 32); RightToes.mirror = true; setRotation(RightToes, 0F, 0F, 0F); - + Neck = new ModelRenderer(this, 0, 0); Neck.addBox(-2F, 0F, -2F, 4, 4, 5); Neck.setRotationPoint(0F, -8F, -8F); Neck.setTextureSize(64, 32); Neck.mirror = true; setRotation(Neck, 0F, 0F, 0F); - + Crest = new ModelRenderer(this, 38, 0); Crest.addBox(-0.5F, -5F, -7F, 1, 2, 6); Crest.setRotationPoint(0F, -6F, -9F); Crest.setTextureSize(64, 32); Crest.mirror = true; setRotation(Crest, 0F, 0F, 0F); - + BeakLow = new ModelRenderer(this, 4, 21); BeakLow.addBox(-2F, -2F, -12F, 4, 2, 5); BeakLow.setRotationPoint(0F, -6F, -9F); BeakLow.setTextureSize(64, 32); BeakLow.mirror = true; setRotation(BeakLow, 0.4363323F, 0F, 0F); - + BeakTop = new ModelRenderer(this, 0, 23); BeakTop.addBox(-2F, 0F, -12F, 4, 2, 5); BeakTop.setRotationPoint(0F, -6F, -9F); BeakTop.setTextureSize(64, 32); BeakTop.mirror = true; setRotation(BeakTop, 0F, 0F, 0F); - + Head = new ModelRenderer(this, 38, 0); Head.addBox(-3F, -3F, -7F, 6, 6, 7); Head.setRotationPoint(0F, -6F, -9F); Head.setTextureSize(64, 32); Head.mirror = true; setRotation(Head, 0F, 0F, 0F); - + LeftShoulder = new ModelRenderer(this, 0, 0); LeftShoulder.addBox(-6F, 0F, 0F, 6, 5, 5); LeftShoulder.setRotationPoint(9F, -6F, -8F); LeftShoulder.setTextureSize(64, 32); LeftShoulder.mirror = true; setRotation(LeftShoulder, 0.3490659F, 0F, 0F); - + RightShoulder = new ModelRenderer(this, 0, 0); RightShoulder.addBox(0F, 0F, 0F, 6, 5, 5); RightShoulder.setRotationPoint(-9F, -6F, -8F); RightShoulder.setTextureSize(64, 32); RightShoulder.mirror = true; setRotation(RightShoulder, 0.3490659F, 0F, 0F); - + LeftArmHigh = new ModelRenderer(this, 0, 0); LeftArmHigh.addBox(-2F, -2F, -9F, 4, 4, 9); LeftArmHigh.setRotationPoint(6.5F, -4F, -6F); LeftArmHigh.setTextureSize(64, 32); LeftArmHigh.mirror = true; setRotation(LeftArmHigh, 0.3490659F, 0F, 0F); - + LeftArmMid = new ModelRenderer(this, 0, 21); LeftArmMid.addBox(-1.5F, -1.5F, -17F, 3, 3, 8); LeftArmMid.setRotationPoint(6.5F, -4F, -6F); LeftArmMid.setTextureSize(64, 32); LeftArmMid.mirror = true; setRotation(LeftArmMid, 0.3490659F, 0F, 0F); - + RightArmHigh = new ModelRenderer(this, 0, 0); RightArmHigh.addBox(-2F, -2F, -9F, 4, 4, 9); RightArmHigh.setRotationPoint(-6.5F, -4F, -6F); RightArmHigh.setTextureSize(64, 32); RightArmHigh.mirror = true; setRotation(RightArmHigh, 0.3490659F, 0F, 0F); - + LeftClawHigh = new ModelRenderer(this, 0, 21); LeftClawHigh.addBox(-1F, 10F, -17F, 2, 2, 6); LeftClawHigh.setRotationPoint(6.5F, -4F, -6F); LeftClawHigh.setTextureSize(64, 32); LeftClawHigh.mirror = true; setRotation(LeftClawHigh, -0.4363323F, 0F, 0F); - + LeftToes = new ModelRenderer(this, 0, 29); LeftToes.addBox(-1.5F, 13F, -5F, 3, 1, 2); LeftToes.setRotationPoint(4F, 9.5F, -0.4F); LeftToes.setTextureSize(64, 32); LeftToes.mirror = true; setRotation(LeftToes, 0F, 0F, 0F); - + LeftBackToe = new ModelRenderer(this, 0, 29); LeftBackToe.addBox(-0.5F, 13F, 1F, 1, 1, 2); LeftBackToe.setRotationPoint(4F, 9.5F, -0.4F); LeftBackToe.setTextureSize(64, 32); LeftBackToe.mirror = true; setRotation(LeftBackToe, 0F, 0F, 0F); - + LeftClawMid = new ModelRenderer(this, 0, 21); LeftClawMid.addBox(-1F, -11.7F, -23F, 2, 2, 7); LeftClawMid.setRotationPoint(6.5F, -4F, -6F); LeftClawMid.setTextureSize(64, 32); LeftClawMid.mirror = true; setRotation(LeftClawMid, 0.7330383F, 0F, 0F); - + RightClawHigh = new ModelRenderer(this, 0, 21); RightClawHigh.addBox(-1F, 10F, -17F, 2, 2, 6); RightClawHigh.setRotationPoint(-6.5F, -4F, -6F); RightClawHigh.setTextureSize(64, 32); RightClawHigh.mirror = true; setRotation(RightClawHigh, -0.4363323F, 0F, 0F); - + RightArmMid = new ModelRenderer(this, 0, 21); RightArmMid.addBox(-1.5F, -1.5F, -17F, 3, 3, 8); RightArmMid.setRotationPoint(-6.5F, -4F, -6F); RightArmMid.setTextureSize(64, 32); RightArmMid.mirror = true; setRotation(RightArmMid, 0.3490659F, 0F, 0F); - + LeftClawLow = new ModelRenderer(this, 0, 21); LeftClawLow.addBox(-1F, 23.3F, -7F, 2, 2, 7); LeftClawLow.setRotationPoint(6.5F, -4F, -6F); LeftClawLow.setTextureSize(64, 32); LeftClawLow.mirror = true; setRotation(LeftClawLow, -1.047198F, 0F, 0F); - + RightClawMid = new ModelRenderer(this, 0, 21); RightClawMid.addBox(-1F, -11.7F, -23F, 2, 2, 7); RightClawMid.setRotationPoint(-6.5F, -4F, -6F); RightClawMid.setTextureSize(64, 32); RightClawMid.mirror = true; setRotation(RightClawMid, 0.7330383F, 0F, 0F); - + RightClawLow = new ModelRenderer(this, 0, 21); RightClawLow.addBox(-1F, 23.3F, -7F, 2, 2, 7); RightClawLow.setRotationPoint(-6.5F, -4F, -6F); @@ -276,11 +276,10 @@ public ModelHookHorror() { RightClawLow.mirror = true; setRotation(RightClawLow, -1.047198F, 0F, 0F); } - - + + @Override - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); LeftLegLow.render(f5); @@ -317,15 +316,7 @@ public void render(Entity entity, float f, float f1, float f2, RightClawMid.render(f5); RightClawLow.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { this.Head.rotateAngleY = f3 / 57.29578F; @@ -336,26 +327,26 @@ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, f this.BeakTop.rotateAngleX = f4 / 57.29578F; this.BeakLow.rotateAngleY = f3 / 57.29578F; this.BeakLow.rotateAngleX = 0.4363323F + (f4 / 57.29578F); - + this.LeftLegLow.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.LeftLegTop.rotateAngleX = -0.3839724F + MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.LeftFoot.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.LeftBackToe.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.LeftToes.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; - + this.RightLegLow.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; this.RightLegTop.rotateAngleX = -0.3839724F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; this.RightFoot.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; this.RightBackToe.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; this.RightToes.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; - + this.RightArmHigh.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.RightArmMid.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.RightClawHigh.rotateAngleX = -0.4363323F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.RightClawMid.rotateAngleX = 0.7330383F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.RightClawLow.rotateAngleX = -1.047198F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.RightShoulder.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; - + this.LeftArmHigh.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; this.LeftArmMid.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; this.LeftClawHigh.rotateAngleX = -0.4363323F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; @@ -363,5 +354,11 @@ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, f this.LeftClawLow.rotateAngleX = -1.047198F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; this.LeftShoulder.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } diff --git a/src/main/java/com/gw/dm/model/ModelIlithid.java b/src/main/java/com/gw/dm/model/ModelIlithid.java new file mode 100644 index 0000000..9a2cc25 --- /dev/null +++ b/src/main/java/com/gw/dm/model/ModelIlithid.java @@ -0,0 +1,173 @@ +package com.gw.dm.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +@SuppressWarnings({"WeakerAccess", "NullableProblems"}) +public class ModelIlithid extends ModelBiped { + public ModelRenderer bipedBody; + public ModelRenderer bipedHead; + public ModelRenderer BipedLeftLeg; + public ModelRenderer bipedRightArm; + public ModelRenderer bipedRightLeg; + public ModelRenderer bipedLeftArm; + public ModelRenderer capeA; + public ModelRenderer bipedHeadwear; + public ModelRenderer faceTentacleA1; + public ModelRenderer faceTentacleB1; + public ModelRenderer faceTentacleC1; + public ModelRenderer faceTentacleA2; + public ModelRenderer faceTentacleA3; + public ModelRenderer faceTentacleB2; + public ModelRenderer faceTentacleB3; + public ModelRenderer faceTentacleC2; + public ModelRenderer faceTentacleC3; + public ModelRenderer shoulderPad; + public ModelRenderer shoulderPad2; + public ModelRenderer capeB; + public ModelRenderer capeB1; + public ModelRenderer capeB2; + public ModelRenderer capeC; + public ModelRenderer capeB4; + public ModelRenderer capeB3; + + public ModelIlithid() { + this.textureWidth = 128; + this.textureHeight = 128; + this.bipedRightLeg = new ModelRenderer(this, 92, 0); + this.bipedRightLeg.setRotationPoint(2.0F, 9.5F, 0.0F); + this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 15, 4, 0.0F); + this.faceTentacleA1 = new ModelRenderer(this, 100, 65); + this.faceTentacleA1.setRotationPoint(0.0F, -2.5F, -2.5F); + this.faceTentacleA1.addBox(-1.5F, -1.5F, -5.0F, 3, 3, 5, 0.0F); + this.setRotateAngle(faceTentacleA1, 0.7853981633974483F, 0.0F, 0.0F); + this.capeA = new ModelRenderer(this, 5, 45); + this.capeA.setRotationPoint(0.0F, -6.0F, 3.0F); + this.capeA.addBox(-5.0F, 0.0F, 0.0F, 10, 5, 0, 0.0F); + this.setRotateAngle(capeA, 0.5235987755982988F, 0.0F, 0.0F); + this.bipedHead = new ModelRenderer(this, 30, 0); + this.bipedHead.setRotationPoint(0.0F, -5.5F, 0.0F); + this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); + this.faceTentacleC3 = new ModelRenderer(this, 77, 100); + this.faceTentacleC3.setRotationPoint(0.0F, 0.0F, -4.1F); + this.faceTentacleC3.addBox(-0.5F, -0.5F, -4.0F, 1, 1, 4, 0.0F); + this.setRotateAngle(faceTentacleC3, 0.3490658503988659F, 0.0F, 0.0F); + this.shoulderPad = new ModelRenderer(this, 57, 19); + this.shoulderPad.setRotationPoint(-2.0F, -2.0F, 0.0F); + this.shoulderPad.addBox(0.0F, -1.0F, -3.5F, 6, 3, 7, 0.0F); + this.setRotateAngle(shoulderPad, 0.0F, 0.0F, 0.08726646259971647F); + this.capeB2 = new ModelRenderer(this, 60, 45); + this.capeB2.setRotationPoint(3.5F, 0.0F, 0.0F); + this.capeB2.addBox(0.0F, 0.0F, 0.0F, 5, 9, 0, 0.0F); + this.setRotateAngle(capeB2, 0.0F, 0.36425021489121656F, 0.0F); + this.capeB3 = new ModelRenderer(this, 50, 75); + this.capeB3.setRotationPoint(0.0F, 9.0F, 0.0F); + this.capeB3.addBox(0.0F, 0.0F, 0.0F, 6, 10, 0, 0.0F); + this.bipedHeadwear = new ModelRenderer(this, 21, 16); + this.bipedHeadwear.setRotationPoint(0.0F, 0.5F, 0.0F); + this.bipedHeadwear.addBox(-4.5F, -9.0F, -4.5F, 9, 9, 9, 0.0F); + this.faceTentacleB2 = new ModelRenderer(this, 77, 80); + this.faceTentacleB2.mirror = true; + this.faceTentacleB2.setRotationPoint(0.0F, 0.0F, -4.0F); + this.faceTentacleB2.addBox(-0.5F, -1.0F, -5.0F, 1, 2, 5, 0.0F); + this.setRotateAngle(faceTentacleB2, 0.5235987755982988F, 0.0F, 0.0F); + this.faceTentacleC1 = new ModelRenderer(this, 90, 60); + this.faceTentacleC1.setRotationPoint(-2.5F, -2.5F, -2.5F); + this.faceTentacleC1.addBox(-1.0F, -1.0F, -5.0F, 2, 2, 5, 0.0F); + this.setRotateAngle(faceTentacleC1, 0.7853981633974483F, 0.2617993877991494F, 0.0F); + this.shoulderPad2 = new ModelRenderer(this, 83, 19); + this.shoulderPad2.setRotationPoint(2.0F, -2.0F, 0.0F); + this.shoulderPad2.addBox(-6.0F, -1.0F, -3.5F, 6, 3, 7, 0.0F); + this.setRotateAngle(shoulderPad2, 0.0F, 0.0F, -0.08726646259971647F); + this.capeB4 = new ModelRenderer(this, 30, 75); + this.capeB4.setRotationPoint(0.0F, 9.0F, 0.0F); + this.capeB4.addBox(-6.0F, 0.0F, 0.0F, 6, 10, 0, 0.0F); + this.faceTentacleA3 = new ModelRenderer(this, 100, 100); + this.faceTentacleA3.setRotationPoint(0.0F, 0.0F, -4.1F); + this.faceTentacleA3.addBox(-0.5F, -0.5F, -4.0F, 1, 1, 4, 0.0F); + this.setRotateAngle(faceTentacleA3, 0.3490658503988659F, 0.0F, 0.0F); + this.faceTentacleC2 = new ModelRenderer(this, 77, 80); + this.faceTentacleC2.setRotationPoint(0.0F, 0.0F, -4.0F); + this.faceTentacleC2.addBox(-0.5F, -1.0F, -5.0F, 1, 2, 5, 0.0F); + this.setRotateAngle(faceTentacleC2, 0.5235987755982988F, 0.0F, 0.0F); + this.BipedLeftLeg = new ModelRenderer(this, 62, 0); + this.BipedLeftLeg.mirror = true; + this.BipedLeftLeg.setRotationPoint(-2.0F, 9.5F, 0.0F); + this.BipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 15, 4, 0.0F); + this.capeB1 = new ModelRenderer(this, 30, 45); + this.capeB1.setRotationPoint(-3.5F, 0.0F, 0.0F); + this.capeB1.addBox(-5.0F, 0.0F, 0.0F, 5, 9, 0, 0.0F); + this.setRotateAngle(capeB1, 0.0F, -0.5462880558742251F, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 108, 0); + this.bipedLeftArm.setRotationPoint(-5.5F, -3.0F, 0.0F); + this.bipedLeftArm.addBox(-2.0F, -2.0F, -2.0F, 3, 15, 4, 0.0F); + this.bipedBody = new ModelRenderer(this, 0, 0); + this.bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F); + this.bipedBody.addBox(-4.5F, -5.5F, -3.0F, 9, 16, 6, 0.0F); + this.faceTentacleB3 = new ModelRenderer(this, 77, 100); + this.faceTentacleB3.mirror = true; + this.faceTentacleB3.setRotationPoint(0.0F, 0.0F, -4.1F); + this.faceTentacleB3.addBox(-0.5F, -0.5F, -4.0F, 1, 1, 4, 0.0F); + this.setRotateAngle(faceTentacleB3, 0.3490658503988659F, 0.0F, 0.0F); + this.capeB = new ModelRenderer(this, 5, 70); + this.capeB.setRotationPoint(0.0F, 5.0F, 0.0F); + this.capeB.addBox(-3.5F, 0.0F, 0.0F, 7, 9, 0, 0.0F); + this.setRotateAngle(capeB, -0.22759093446006054F, 0.0F, 0.0F); + this.capeC = new ModelRenderer(this, 5, 100); + this.capeC.setRotationPoint(0.0F, 9.0F, 0.0F); + this.capeC.addBox(-3.5F, 0.0F, 0.0F, 7, 14, 0, 0.0F); + this.setRotateAngle(capeC, -0.18203784098300857F, 0.0F, 0.0F); + this.faceTentacleA2 = new ModelRenderer(this, 100, 80); + this.faceTentacleA2.setRotationPoint(0.0F, 0.0F, -4.0F); + this.faceTentacleA2.addBox(-1.0F, -1.0F, -5.0F, 2, 2, 5, 0.0F); + this.setRotateAngle(faceTentacleA2, 0.5235987755982988F, 0.0F, 0.0F); + this.faceTentacleB1 = new ModelRenderer(this, 90, 60); + this.faceTentacleB1.setRotationPoint(2.5F, -2.5F, -2.5F); + this.faceTentacleB1.addBox(-1.0F, -1.0F, -5.0F, 2, 2, 5, 0.0F); + this.setRotateAngle(faceTentacleB1, 0.7853981633974483F, -0.2617993877991494F, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 78, 0); + this.bipedRightArm.mirror = true; + this.bipedRightArm.setRotationPoint(5.5F, -3.0F, 0.0F); + this.bipedRightArm.addBox(-1.0F, -2.0F, -2.0F, 3, 15, 4, 0.0F); + this.bipedBody.addChild(this.bipedRightLeg); + this.bipedHead.addChild(this.faceTentacleA1); + this.bipedBody.addChild(this.capeA); + this.bipedBody.addChild(this.bipedHead); + this.faceTentacleC2.addChild(this.faceTentacleC3); + this.bipedRightArm.addChild(this.shoulderPad); + this.capeB.addChild(this.capeB2); + this.capeB2.addChild(this.capeB3); + this.bipedHead.addChild(this.bipedHeadwear); + this.faceTentacleB1.addChild(this.faceTentacleB2); + this.bipedHead.addChild(this.faceTentacleC1); + this.bipedLeftArm.addChild(this.shoulderPad2); + this.capeB1.addChild(this.capeB4); + this.faceTentacleA2.addChild(this.faceTentacleA3); + this.faceTentacleC1.addChild(this.faceTentacleC2); + this.bipedBody.addChild(this.BipedLeftLeg); + this.capeB.addChild(this.capeB1); + this.bipedBody.addChild(this.bipedLeftArm); + this.faceTentacleB2.addChild(this.faceTentacleB3); + this.capeA.addChild(this.capeB); + this.capeB.addChild(this.capeC); + this.faceTentacleA1.addChild(this.faceTentacleA2); + this.bipedHead.addChild(this.faceTentacleB1); + this.bipedBody.addChild(this.bipedRightArm); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + this.bipedBody.render(f5); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/com/gw/dm/model/ModelIllithid.java b/src/main/java/com/gw/dm/model/ModelIllithid.java deleted file mode 100644 index 545b2a5..0000000 --- a/src/main/java/com/gw/dm/model/ModelIllithid.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.gw.dm.model; - -import com.gw.dm.entity.EntityIllithid; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.math.MathHelper; - -public class ModelIllithid extends ModelBase { - - ModelRenderer HeadBack; - ModelRenderer HeadMid; - ModelRenderer LFBodyMid; - ModelRenderer Tentacle2; - ModelRenderer TentacleBase; - ModelRenderer MawBase; - ModelRenderer Tentacle4; - ModelRenderer Tentacle1; - ModelRenderer Tentacle3; - ModelRenderer EyeLeft; - ModelRenderer RFBodyMid; - ModelRenderer RBBodyMid; - ModelRenderer LBBodyMid; - ModelRenderer Head; - ModelRenderer EyeRight; - ModelRenderer RBBodyTop; - ModelRenderer RFBodyTop; - ModelRenderer LBBodyTop; - ModelRenderer LFBodyTop; - ModelRenderer LLegB; - ModelRenderer LLegT; - ModelRenderer LArmT; - ModelRenderer LArmB; - ModelRenderer RLegT; - ModelRenderer RLegB; - ModelRenderer RArmT; - ModelRenderer RArmB; - - - public ModelIllithid() { - textureWidth = 64; - textureHeight = 32; - - HeadBack = new ModelRenderer(this, 24, 0); - HeadBack.addBox(-4.5F, -12F, 1F, 9, 6, 9); - HeadBack.setRotationPoint(0F, -12F, -2F); - HeadBack.setTextureSize(64, 32); - HeadBack.mirror = true; - setRotation(HeadBack, 0F, 0F, 0F); - - HeadMid = new ModelRenderer(this, 20, 0); - HeadMid.addBox(-6.5F, -11F, -3F, 13, 8, 9); - HeadMid.setRotationPoint(0F, -12F, -2F); - HeadMid.setTextureSize(64, 32); - HeadMid.mirror = true; - setRotation(HeadMid, 0F, 0F, 0F); - - LFBodyMid = new ModelRenderer(this, 22, 20); - LFBodyMid.addBox(-7F, -8F, -6F, 6, 9, 3); - LFBodyMid.setRotationPoint(7F, 5F, 1F); - LFBodyMid.setTextureSize(64, 32); - LFBodyMid.mirror = true; - setRotation(LFBodyMid, 0F, 0F, 0F); - - Tentacle2 = new ModelRenderer(this, 0, 15); - Tentacle2.addBox(0.8F, 6F, -10.4F, 1, 6, 1); - Tentacle2.setRotationPoint(0F, -12F, -2F); - Tentacle2.setTextureSize(64, 32); - Tentacle2.mirror = true; - setRotation(Tentacle2, -0.3141593F, 0F, 0F); - - TentacleBase = new ModelRenderer(this, 24, 0); - TentacleBase.addBox(-2F, -2F, -8F, 4, 6, 2); - TentacleBase.setRotationPoint(0F, -12F, -2F); - TentacleBase.setTextureSize(64, 32); - TentacleBase.mirror = true; - setRotation(TentacleBase, -0.5759587F, 0F, 0F); - - MawBase = new ModelRenderer(this, 0, 22); - MawBase.addBox(-2.5F, 3.5F, -9F, 5, 6, 4); - MawBase.setRotationPoint(0F, -12F, -2F); - MawBase.setTextureSize(64, 32); - MawBase.mirror = true; - setRotation(MawBase, -0.5759587F, 0F, 0F); - - Tentacle4 = new ModelRenderer(this, 0, 15); - Tentacle4.addBox(0.8F, 5F, -9.5F, 1, 6, 1); - Tentacle4.setRotationPoint(0F, -12F, -2F); - Tentacle4.setTextureSize(64, 32); - Tentacle4.mirror = true; - setRotation(Tentacle4, -0.0872665F, 0F, 0F); - - Tentacle1 = new ModelRenderer(this, 0, 15); - Tentacle1.addBox(-2.2F, 6F, -10.4F, 1, 6, 1); - Tentacle1.setRotationPoint(0F, -12F, -2F); - Tentacle1.setTextureSize(64, 32); - Tentacle1.mirror = true; - setRotation(Tentacle1, -0.3141593F, 0F, 0F); - - Tentacle3 = new ModelRenderer(this, 0, 15); - Tentacle3.addBox(-2.2F, 5F, -9.5F, 1, 6, 1); - Tentacle3.setRotationPoint(0F, -12F, -2F); - Tentacle3.setTextureSize(64, 32); - Tentacle3.mirror = true; - setRotation(Tentacle3, -0.0872665F, 0F, 0F); - - EyeLeft = new ModelRenderer(this, 4, 15); - EyeLeft.addBox(3.9F, -7F, -1.9F, 3, 3, 4); - EyeLeft.setRotationPoint(0F, -12F, -2F); - EyeLeft.setTextureSize(64, 32); - EyeLeft.mirror = true; - setRotation(EyeLeft, 0F, 0.715585F, 0F); - - RFBodyMid = new ModelRenderer(this, 22, 20); - RFBodyMid.addBox(-7F, -8F, -6F, 6, 9, 3); - RFBodyMid.setRotationPoint(1F, 5F, 1F); - RFBodyMid.setTextureSize(64, 32); - RFBodyMid.mirror = true; - setRotation(RFBodyMid, 0F, 0F, 0F); - - RBBodyMid = new ModelRenderer(this, 21, 20); - RBBodyMid.addBox(-7F, -8F, -6F, 6, 9, 3); - RBBodyMid.setRotationPoint(1F, 5F, 4F); - RBBodyMid.setTextureSize(64, 32); - RBBodyMid.mirror = true; - setRotation(RBBodyMid, 0F, 0F, 0F); - - LBBodyMid = new ModelRenderer(this, 21, 20); - LBBodyMid.addBox(-7F, -8F, -6F, 6, 9, 3); - LBBodyMid.setRotationPoint(7F, 5F, 4F); - LBBodyMid.setTextureSize(64, 32); - LBBodyMid.mirror = true; - setRotation(LBBodyMid, 0F, 0F, 0F); - - Head = new ModelRenderer(this, 32, 0); - Head.addBox(-4F, -8F, -6F, 8, 8, 8); - Head.setRotationPoint(0F, -12F, -2F); - Head.setTextureSize(64, 32); - Head.mirror = true; - setRotation(Head, 0F, 0F, 0F); - - EyeRight = new ModelRenderer(this, 4, 15); - EyeRight.addBox(-6.9F, -7F, -1.9F, 3, 3, 4); - EyeRight.setRotationPoint(0F, -12F, -2F); - EyeRight.setTextureSize(64, 32); - EyeRight.mirror = true; - setRotation(EyeRight, 0F, -0.715585F, 0F); - - RBBodyTop = new ModelRenderer(this, 0, 0); - RBBodyTop.addBox(-7F, -8F, -6F, 7, 9, 3); - RBBodyTop.setRotationPoint(0F, -4F, 4F); - RBBodyTop.setTextureSize(64, 32); - RBBodyTop.mirror = true; - setRotation(RBBodyTop, 0F, 0F, 0F); - - RFBodyTop = new ModelRenderer(this, 0, 0); - RFBodyTop.addBox(-7F, -8F, -6F, 7, 9, 3); - RFBodyTop.setRotationPoint(0F, -4F, 1F); - RFBodyTop.setTextureSize(64, 32); - RFBodyTop.mirror = true; - setRotation(RFBodyTop, 0F, 0F, 0F); - - LBBodyTop = new ModelRenderer(this, 0, 0); - LBBodyTop.addBox(-7F, -8F, -6F, 7, 9, 3); - LBBodyTop.setRotationPoint(7F, -4F, 4F); - LBBodyTop.setTextureSize(64, 32); - LBBodyTop.mirror = true; - setRotation(LBBodyTop, 0F, 0F, 0F); - - LFBodyTop = new ModelRenderer(this, 0, 0); - LFBodyTop.addBox(-7F, -8F, -6F, 7, 9, 3); - LFBodyTop.setRotationPoint(7F, -4F, 1F); - LFBodyTop.setTextureSize(64, 32); - LFBodyTop.mirror = true; - setRotation(LFBodyTop, 0F, 0F, 0F); - - LLegB = new ModelRenderer(this, 39, 20); - LLegB.addBox(-1.5F, 9F, -1.5F, 3, 9, 3); - LLegB.setRotationPoint(4F, 6F, -2F); - LLegB.setTextureSize(64, 32); - LLegB.mirror = true; - setRotation(LLegB, 0F, 0F, 0F); - - LLegT = new ModelRenderer(this, 52, 20); - LLegT.addBox(-1.5F, 0F, -1.5F, 3, 9, 3); - LLegT.setRotationPoint(4F, 6F, -2F); - LLegT.setTextureSize(64, 32); - LLegT.mirror = true; - setRotation(LLegT, 0F, 0F, 0F); - - LArmT = new ModelRenderer(this, 52, 20); - LArmT.addBox(0F, -1F, -1.5F, 3, 9, 3); - LArmT.setRotationPoint(7F, -10F, -2F); - LArmT.setTextureSize(64, 32); - LArmT.mirror = true; - setRotation(LArmT, 0F, 0F, 0F); - - LArmB = new ModelRenderer(this, 39, 20); - LArmB.addBox(0F, 8F, -1.5F, 3, 9, 3); - LArmB.setRotationPoint(7F, -10F, -2F); - LArmB.setTextureSize(64, 32); - LArmB.mirror = true; - setRotation(LArmB, 0F, 0F, 0F); - - RLegT = new ModelRenderer(this, 52, 20); - RLegT.addBox(-1.5F, 0F, -1.5F, 3, 9, 3); - RLegT.setRotationPoint(-4F, 6F, -2F); - RLegT.setTextureSize(64, 32); - RLegT.mirror = true; - setRotation(RLegT, 0F, 0F, 0F); - - RLegB = new ModelRenderer(this, 39, 20); - RLegB.addBox(-1.5F, 9F, -1.5F, 3, 9, 3); - RLegB.setRotationPoint(-4F, 6F, -2F); - RLegB.setTextureSize(64, 32); - RLegB.mirror = true; - setRotation(RLegB, 0F, 0F, 0F); - - RArmT = new ModelRenderer(this, 52, 20); - RArmT.addBox(-3F, -1F, -1.5F, 3, 9, 3); - RArmT.setRotationPoint(-7F, -10F, -2F); - RArmT.setTextureSize(64, 32); - RArmT.mirror = true; - setRotation(RArmT, 0F, 0F, 0F); - - RArmB = new ModelRenderer(this, 39, 20); - RArmB.addBox(-3F, 8F, -1.5F, 3, 9, 3); - RArmB.setRotationPoint(-7F, -10F, -2F); - RArmB.setTextureSize(64, 32); - RArmB.mirror = true; - setRotation(RArmB, 0F, 0F, 0F); - } - - - @Override - public void render(Entity entity, float f, float f1, - float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - HeadBack.render(f5); - HeadMid.render(f5); - LFBodyMid.render(f5); - Tentacle2.render(f5); - TentacleBase.render(f5); - MawBase.render(f5); - Tentacle4.render(f5); - Tentacle1.render(f5); - Tentacle3.render(f5); - EyeLeft.render(f5); - RFBodyMid.render(f5); - RBBodyMid.render(f5); - LBBodyMid.render(f5); - Head.render(f5); - EyeRight.render(f5); - RBBodyTop.render(f5); - RFBodyTop.render(f5); - LBBodyTop.render(f5); - LFBodyTop.render(f5); - LLegB.render(f5); - LLegT.render(f5); - LArmT.render(f5); - LArmB.render(f5); - RLegT.render(f5); - RLegB.render(f5); - RArmT.render(f5); - RArmB.render(f5); - } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - @Override - public void setRotationAngles(float f, float f1, - float f2, float f3, float f4, float f5, Entity ent) { - Head.rotateAngleX = f4 / 57.29578F; - Head.rotateAngleY = f3 / 57.29578F; - HeadBack.rotateAngleX = f4 / 57.29578F; - HeadBack.rotateAngleY = f3 / 57.29578F; - HeadMid.rotateAngleX = f4 / 57.29578F; - HeadMid.rotateAngleY = f3 / 57.29578F; - MawBase.rotateAngleX = -0.5759587F + f4 / 57.29578F; - MawBase.rotateAngleY = f3 / 57.29578F; - TentacleBase.rotateAngleX = -0.5759587F + f4 / 57.29578F; - TentacleBase.rotateAngleY = f3 / 57.29578F; - EyeLeft.rotateAngleX = f4 / 57.29578F; - EyeLeft.rotateAngleY = 0.715585F + f3 / 57.29578F; - EyeRight.rotateAngleX = f4 / 57.29578F; - EyeRight.rotateAngleY = -0.715585F + f3 / 57.29578F; - - float var8 = 0.01F * (float) (ent.getEntityId() % 10); - - Tentacle1.rotateAngleX = -0.3141593F + (MathHelper.sin((float) ent.ticksExisted * var8) * 4.5F * (float) Math.PI / 180.0F);// + f4 / 57.29578F; - Tentacle1.rotateAngleY = f3 / 57.29578F; - Tentacle1.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * 2.5F * (float) Math.PI / 180.0F; - Tentacle2.rotateAngleX = -0.3141593F + (MathHelper.sin((float) ent.ticksExisted * var8) * 4.5F * (float) Math.PI / 180.0F);// + f4 / 57.29578F; - Tentacle2.rotateAngleY = f3 / 57.29578F; - Tentacle2.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * 2.5F * (float) Math.PI / 180.0F; - Tentacle3.rotateAngleX = -0.0872665F + (MathHelper.sin((float) ent.ticksExisted * var8) * 4.5F * (float) Math.PI / 180.0F);// + f4 / 57.29578F; - Tentacle3.rotateAngleY = f3 / 57.29578F; - Tentacle3.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * 2.5F * (float) Math.PI / 180.0F; - Tentacle4.rotateAngleX = -0.0872665F + (MathHelper.sin((float) ent.ticksExisted * var8) * 4.5F * (float) Math.PI / 180.0F);// + f4 / 57.29578F; - Tentacle4.rotateAngleY = f3 / 57.29578F; - Tentacle4.rotateAngleZ = MathHelper.sin((float) ent.ticksExisted * var8) * 2.5F * (float) Math.PI / 180.0F; - - EntityIllithid foo = (EntityIllithid) ent; - - if (!foo.isGrappling) { - LLegB.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; - LLegT.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; - RLegB.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; - RLegT.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; - - RArmB.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; - RArmT.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; - LArmB.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; - LArmT.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; - } else { - RArmB.rotateAngleX = -0.87266F; - RArmT.rotateAngleX = -0.87266F; - LArmB.rotateAngleX = -0.87266F; - LArmT.rotateAngleX = -0.87266F; - } - } - -} \ No newline at end of file diff --git a/src/main/java/com/gw/dm/model/ModelLizalfos.java b/src/main/java/com/gw/dm/model/ModelLizalfos.java index e692c9a..0fd4bf5 100644 --- a/src/main/java/com/gw/dm/model/ModelLizalfos.java +++ b/src/main/java/com/gw/dm/model/ModelLizalfos.java @@ -7,7 +7,7 @@ import net.minecraft.util.math.MathHelper; public class ModelLizalfos extends ModelBase { - + ModelRenderer ChestOutTop; ModelRenderer LegLeftMid; ModelRenderer TailMid; @@ -50,348 +50,348 @@ public class ModelLizalfos extends ModelBase { ModelRenderer ChestLow; ModelRenderer ChestOutLow; ModelRenderer Head3; - + ModelRenderer SwordBladeTop; ModelRenderer SwordHilt; ModelRenderer SwordCrossbar; ModelRenderer SwordBladeBase; ModelRenderer SwordBladeMid; ModelRenderer SwordBladePoint; - - + + public ModelLizalfos() { textureWidth = 64; textureHeight = 32; - + ChestOutTop = new ModelRenderer(this, 35, 23); ChestOutTop.addBox(0F, 0.5F, 0.5F, 7, 5, 4); ChestOutTop.setRotationPoint(-3.5F, -7.9F, -2.3F); ChestOutTop.setTextureSize(64, 32); ChestOutTop.mirror = true; setRotation(ChestOutTop, 0F, 0F, 0F); - + LegLeftMid = new ModelRenderer(this, 9, 12); LegLeftMid.addBox(-1.5F, 1F, -7.5F, 3, 8, 3); LegLeftMid.setRotationPoint(7.8F, 9F, 2F); LegLeftMid.setTextureSize(64, 32); LegLeftMid.mirror = true; setRotation(LegLeftMid, 0.6981317F, 0F, 0F); - + TailMid = new ModelRenderer(this, 41, 2); TailMid.addBox(-2F, -2F, 6F, 4, 4, 6); TailMid.setRotationPoint(0F, 9.5F, 5F); TailMid.setTextureSize(64, 32); TailMid.mirror = true; setRotation(TailMid, 0F, 0F, 0F); - + FootLeftClaws = new ModelRenderer(this, 15, 23); FootLeftClaws.addBox(-1F, 13.8F, -7.8F, 2, 1, 2); FootLeftClaws.setRotationPoint(7.8F, 9F, 2F); FootLeftClaws.setTextureSize(64, 32); FootLeftClaws.mirror = true; setRotation(FootLeftClaws, 0F, 0F, 0F); - + LegLeftTop = new ModelRenderer(this, 9, 11); LegLeftTop.addBox(-2F, 0F, -2F, 4, 8, 4); LegLeftTop.setRotationPoint(7.8F, 9F, 2F); LegLeftTop.setTextureSize(64, 32); LegLeftTop.mirror = true; setRotation(LegLeftTop, -0.8726646F, 0F, 0F); - + LegLeftLow = new ModelRenderer(this, 27, 13); LegLeftLow.addBox(-1F, 7F, 5F, 2, 6, 2); LegLeftLow.setRotationPoint(7.8F, 9F, 2F); LegLeftLow.setTextureSize(64, 32); LegLeftLow.mirror = true; setRotation(LegLeftLow, -0.6108652F, 0F, 0F); - + FootLeft = new ModelRenderer(this, 43, 5); FootLeft.addBox(-1.5F, 13F, -6.5F, 3, 2, 5); FootLeft.setRotationPoint(7.8F, 9F, 2F); FootLeft.setTextureSize(64, 32); FootLeft.mirror = true; setRotation(FootLeft, 0F, 0F, 0F); - + ArmRightLow = new ModelRenderer(this, 13, 13); ArmRightLow.addBox(-1.5F, 4.4F, -14F, 2, 2, 8); ArmRightLow.setRotationPoint(-5.8F, -6F, 0F); ArmRightLow.setTextureSize(64, 32); ArmRightLow.mirror = true; setRotation(ArmRightLow, 0F, 0F, 0F); - + LegRightMid = new ModelRenderer(this, 20, 12); LegRightMid.addBox(-1.5F, 1F, -7.5F, 3, 8, 3); LegRightMid.setRotationPoint(-7.8F, 9F, 2F); LegRightMid.setTextureSize(64, 32); LegRightMid.mirror = true; setRotation(LegRightMid, 0.6981317F, 0F, 0F); - + FootRightClaws = new ModelRenderer(this, 15, 23); FootRightClaws.addBox(-1F, 13.8F, -7.8F, 2, 1, 2); FootRightClaws.setRotationPoint(-7.8F, 9F, 2F); FootRightClaws.setTextureSize(64, 32); FootRightClaws.mirror = true; setRotation(FootRightClaws, 0F, 0F, 0F); - + FootRight = new ModelRenderer(this, 43, 5); FootRight.addBox(-1.5F, 13F, -6.5F, 3, 2, 5); FootRight.setRotationPoint(-7.8F, 9F, 2F); FootRight.setTextureSize(64, 32); FootRight.mirror = true; setRotation(FootRight, 0F, 0F, 0F); - + LegRightLow = new ModelRenderer(this, 22, 13); LegRightLow.addBox(-1F, 7F, 5F, 2, 6, 2); LegRightLow.setRotationPoint(-7.8F, 9F, 2F); LegRightLow.setTextureSize(64, 32); LegRightLow.mirror = true; setRotation(LegRightLow, -0.6108652F, 0F, 0F); - + HipLeft = new ModelRenderer(this, 0, 0); HipLeft.addBox(0F, 0F, 0F, 5, 5, 6); HipLeft.setRotationPoint(5F, 6F, 0F); HipLeft.setTextureSize(64, 32); HipLeft.mirror = true; setRotation(HipLeft, 0F, 0F, 0F); - + ArmLeftGuard = new ModelRenderer(this, 0, 26); ArmLeftGuard.addBox(0F, 0F, 0F, 10, 3, 3); ArmLeftGuard.setRotationPoint(0.5F, -3.9F, -10.8F); ArmLeftGuard.setTextureSize(64, 32); ArmLeftGuard.mirror = true; setRotation(ArmLeftGuard, -0.0174533F, -0.2617994F, -0.122173F); - + TailEnd = new ModelRenderer(this, 40, 0); TailEnd.addBox(-1.5F, -1.5F, 12F, 3, 3, 8); TailEnd.setRotationPoint(0F, 9.5F, 5F); TailEnd.setTextureSize(64, 32); TailEnd.mirror = true; setRotation(TailEnd, 0F, 0F, 0F); - + TailHelper = new ModelRenderer(this, 39, 0); TailHelper.addBox(-2F, -4.5F, -6F, 4, 3, 8); TailHelper.setRotationPoint(0F, 9.5F, 5F); TailHelper.setTextureSize(64, 32); TailHelper.mirror = true; setRotation(TailHelper, -0.7330383F, 0F, 0F); - + Pelvis = new ModelRenderer(this, 0, 0); Pelvis.addBox(0F, 0.5F, 0.5F, 14, 6, 5); Pelvis.setRotationPoint(-7F, 6F, 0F); Pelvis.setTextureSize(64, 32); Pelvis.mirror = true; setRotation(Pelvis, 0F, 0F, 0F); - + StomachLow = new ModelRenderer(this, 32, 21); StomachLow.addBox(0F, 0.5F, 0.5F, 10, 5, 5); StomachLow.setRotationPoint(-5F, 8F, -2F); StomachLow.setTextureSize(64, 32); StomachLow.mirror = true; setRotation(StomachLow, 0F, 0F, 0F); - + SpineLow = new ModelRenderer(this, 0, 1); SpineLow.addBox(-4F, -11F, 0F, 8, 11, 3); SpineLow.setRotationPoint(0F, 7F, 2F); SpineLow.setTextureSize(64, 32); SpineLow.mirror = true; setRotation(SpineLow, 0.1745329F, 0F, 0F); - + SpineMid = new ModelRenderer(this, 0, 6); SpineMid.addBox(-4F, -5F, 0F, 8, 5, 3); SpineMid.setRotationPoint(0F, -4F, 0F); SpineMid.setTextureSize(64, 32); SpineMid.mirror = true; setRotation(SpineMid, 0.0698132F, 0F, 0F); - + StomachTop = new ModelRenderer(this, 30, 20); StomachTop.addBox(0F, 0.5F, 0.5F, 11, 6, 6); StomachTop.setRotationPoint(-5.5F, 2F, -3F); StomachTop.setTextureSize(64, 32); StomachTop.mirror = true; setRotation(StomachTop, 0F, 0F, 0F); - + TailBase = new ModelRenderer(this, 40, 2); TailBase.addBox(-2.5F, -2.5F, 0F, 5, 5, 6); TailBase.setRotationPoint(0F, 9.5F, 5F); TailBase.setTextureSize(64, 32); TailBase.mirror = true; setRotation(TailBase, 0F, 0F, 0F); - + HipRight = new ModelRenderer(this, 0, 0); HipRight.addBox(0F, 0F, 0F, 5, 5, 6); HipRight.setRotationPoint(-10F, 6F, 0F); HipRight.setTextureSize(64, 32); HipRight.mirror = true; setRotation(HipRight, 0F, 0F, 0F); - + ShoulderRight = new ModelRenderer(this, 0, 0); ShoulderRight.addBox(0F, 0F, 0F, 4, 4, 5); ShoulderRight.setRotationPoint(-8F, -9F, -1.6F); ShoulderRight.setTextureSize(64, 32); ShoulderRight.mirror = true; setRotation(ShoulderRight, 0F, 0F, 0F); - + LegRightTop = new ModelRenderer(this, 17, 11); LegRightTop.addBox(-2F, 0F, -2F, 4, 8, 4); LegRightTop.setRotationPoint(-7.8F, 9F, 2F); LegRightTop.setTextureSize(64, 32); LegRightTop.mirror = true; setRotation(LegRightTop, -0.8726646F, 0F, 0F); - + ArmLeftTop = new ModelRenderer(this, 10, 11); ArmLeftTop.addBox(-2F, 0F, -2F, 3, 9, 3); ArmLeftTop.setRotationPoint(6.8F, -6F, 0F); ArmLeftTop.setTextureSize(64, 32); ArmLeftTop.mirror = true; setRotation(ArmLeftTop, -1.308997F, -0.8726646F, 0.2617994F); - + ArmRightTop = new ModelRenderer(this, 20, 11); ArmRightTop.addBox(-2F, 0F, -2F, 3, 9, 3); ArmRightTop.setRotationPoint(-5.8F, -6F, 0F); ArmRightTop.setTextureSize(64, 32); ArmRightTop.mirror = true; setRotation(ArmRightTop, -0.8726646F, 0F, 0F); - + ShoulderLeft = new ModelRenderer(this, 0, 0); ShoulderLeft.addBox(0F, 0F, 0F, 4, 4, 5); ShoulderLeft.setRotationPoint(4F, -9F, -1.6F); ShoulderLeft.setTextureSize(64, 32); ShoulderLeft.mirror = true; setRotation(ShoulderLeft, 0F, 0F, 0F); - + ArmLeft = new ModelRenderer(this, 16, 13); ArmLeft.addBox(0F, 0F, 1F, 5, 2, 2); ArmLeft.setRotationPoint(9F, -4.3F, -9.5F); ArmLeft.setTextureSize(64, 32); ArmLeft.mirror = true; setRotation(ArmLeft, -0.0174533F, -0.6981317F, -0.122173F); - + Neck = new ModelRenderer(this, 24, 15); Neck.addBox(-1F, -4F, -2F, 2, 5, 2); Neck.setRotationPoint(0F, -8F, 0F); Neck.setTextureSize(64, 32); Neck.mirror = true; setRotation(Neck, 0.6457718F, 0F, 0F); - + Head5 = new ModelRenderer(this, 33, 24); Head5.addBox(-2F, -0.7F, -6.8F, 4, 2, 5); Head5.setRotationPoint(0F, -9.6F, -2F); Head5.setTextureSize(64, 32); Head5.mirror = true; setRotation(Head5, 0.1919862F, 0F, 0F); - + Head1 = new ModelRenderer(this, 45, 7); Head1.addBox(-2F, -2F, -2F, 4, 3, 2); Head1.setRotationPoint(0F, -9.6F, -2F); Head1.setTextureSize(64, 32); Head1.mirror = true; setRotation(Head1, 0F, 0F, 0F); - + HeadEyeLeft = new ModelRenderer(this, 4, 20); HeadEyeLeft.addBox(2.1F, -8F, -4F, 1, 3, 3); HeadEyeLeft.setRotationPoint(0F, -9.6F, -2F); HeadEyeLeft.setTextureSize(64, 32); HeadEyeLeft.mirror = true; setRotation(HeadEyeLeft, 0.7853982F, 0.1919862F, 0F); - + Head4 = new ModelRenderer(this, 47, 13); Head4.addBox(-1.5F, -4.8F, -8F, 3, 2, 5); Head4.setRotationPoint(0F, -9.6F, -2F); Head4.setTextureSize(64, 32); Head4.mirror = true; setRotation(Head4, 0.1919862F, 0F, 0F); - + HeadEyeRight = new ModelRenderer(this, 0, 20); HeadEyeRight.addBox(-3.1F, 1F, -8F, 1, 3, 3); HeadEyeRight.setRotationPoint(0F, -9.6F, -2F); HeadEyeRight.setTextureSize(64, 32); HeadEyeRight.mirror = true; setRotation(HeadEyeRight, -0.7853982F, -0.1919862F, 0F); - + Head2 = new ModelRenderer(this, 38, 1); Head2.addBox(-3F, -3F, -9F, 6, 4, 7); Head2.setRotationPoint(0F, -9.6F, -2F); Head2.setTextureSize(64, 32); Head2.mirror = true; setRotation(Head2, 0F, 0F, 0F); - + Head7 = new ModelRenderer(this, 46, 13); Head7.addBox(-2F, -5F, -12F, 4, 1, 5); Head7.setRotationPoint(0F, -9.6F, -2F); Head7.setTextureSize(64, 32); Head7.mirror = true; setRotation(Head7, 0.3490659F, 0F, 0F); - + Head6 = new ModelRenderer(this, 36, 24); Head6.addBox(-1.5F, 1F, -13.5F, 3, 1, 7); Head6.setRotationPoint(0F, -9.6F, -2F); Head6.setTextureSize(64, 32); Head6.mirror = true; setRotation(Head6, 0F, 0F, 0F); - + ChestTop = new ModelRenderer(this, 0, 0); ChestTop.addBox(0F, 0.5F, 0.5F, 9, 5, 4); ChestTop.setRotationPoint(-4.5F, -8F, -2F); ChestTop.setTextureSize(64, 32); ChestTop.mirror = true; setRotation(ChestTop, 0F, 0F, 0F); - + ChestLow = new ModelRenderer(this, 0, 1); ChestLow.addBox(0F, 0.5F, 0.5F, 9, 5, 4); ChestLow.setRotationPoint(-4.5F, -3F, -2F); ChestLow.setTextureSize(64, 32); ChestLow.mirror = true; setRotation(ChestLow, 0F, 0F, 0F); - + ChestOutLow = new ModelRenderer(this, 36, 23); ChestOutLow.addBox(0F, 0.5F, 0.5F, 8, 5, 4); ChestOutLow.setRotationPoint(-4F, -3F, -2.4F); ChestOutLow.setTextureSize(64, 32); ChestOutLow.mirror = true; setRotation(ChestOutLow, 0F, 0F, 0F); - + Head3 = new ModelRenderer(this, 46, 13); Head3.addBox(-2F, -1F, -14F, 4, 2, 5); Head3.setRotationPoint(0F, -9.6F, -2F); Head3.setTextureSize(64, 32); Head3.mirror = true; setRotation(Head3, 0F, 0F, 0F); - + SwordBladePoint = new ModelRenderer(this, 39, 17); SwordBladePoint.addBox(-1F, 12.5F, -10F, 1, 2, 1); SwordBladePoint.setRotationPoint(-5.8F, -6F, 0F); SwordBladePoint.setTextureSize(64, 32); SwordBladePoint.mirror = true; setRotation(SwordBladePoint, -1.570796F, 0F, 0F); - + SwordHilt = new ModelRenderer(this, 34, 0); SwordHilt.addBox(-1F, 4F, -13.5F, 1, 4, 1); SwordHilt.setRotationPoint(-5.8F, -6F, 0F); SwordHilt.setTextureSize(64, 32); SwordHilt.mirror = true; setRotation(SwordHilt, 0F, 0F, 0F); - + SwordCrossbar = new ModelRenderer(this, 34, 0); SwordCrossbar.addBox(-1F, 11F, 3F, 1, 4, 1); SwordCrossbar.setRotationPoint(-5.8F, -6F, 0F); SwordCrossbar.setTextureSize(64, 32); SwordCrossbar.mirror = true; setRotation(SwordCrossbar, -1.570796F, 0F, 0F); - + SwordBladeBase = new ModelRenderer(this, 36, 13); SwordBladeBase.addBox(-1F, 11.5F, -1F, 1, 3, 4); SwordBladeBase.setRotationPoint(-5.8F, -6F, 0F); SwordBladeBase.setTextureSize(64, 32); SwordBladeBase.mirror = true; setRotation(SwordBladeBase, -1.570796F, 0F, 0F); - + SwordBladeMid = new ModelRenderer(this, 36, 13); SwordBladeMid.addBox(-1F, 11.5F, -5F, 1, 3, 4); SwordBladeMid.setRotationPoint(-5.8F, -6F, 0F); SwordBladeMid.setTextureSize(64, 32); SwordBladeMid.mirror = true; setRotation(SwordBladeMid, -1.570796F, 0F, 0F); - + SwordBladeTop = new ModelRenderer(this, 36, 13); SwordBladeTop.addBox(-1F, 11.5F, -9F, 1, 3, 4); SwordBladeTop.setRotationPoint(-5.8F, -6F, 0F); @@ -399,11 +399,10 @@ public ModelLizalfos() { SwordBladeTop.mirror = true; setRotation(SwordBladeTop, -1.570796F, 0F, 0F); } - - + + @Override - public void render(Entity entity, float f, float f1, - float f2, float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); ChestOutTop.render(f5); @@ -448,7 +447,7 @@ public void render(Entity entity, float f, float f1, ChestLow.render(f5); ChestOutLow.render(f5); Head3.render(f5); - + SwordBladePoint.render(f5); SwordHilt.render(f5); SwordCrossbar.render(f5); @@ -456,44 +455,35 @@ public void render(Entity entity, float f, float f1, SwordBladeMid.render(f5); SwordBladeTop.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override - public void setRotationAngles(float f, float f1, - float f2, float f3, float f4, float f5, Entity ent) { + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { // let's do this! // LEEEEEEEEEEROOOOOOOOOOOOOOOOOOOY JENKINS! - + float var8 = 0.1F * (float) (ent.getEntityId() % 10); - + TailBase.rotateAngleY = MathHelper.cos((float) ent.ticksExisted * var8) * 16.0F * (float) Math.PI / 180.0F; TailMid.rotateAngleY = MathHelper.cos((float) ent.ticksExisted * var8) * 24.0F * (float) Math.PI / 180.0F; TailEnd.rotateAngleY = MathHelper.cos((float) ent.ticksExisted * var8) * 32.0F * (float) Math.PI / 180.0F; TailHelper.rotateAngleY = MathHelper.cos((float) ent.ticksExisted * var8) * 16.0F * (float) Math.PI / 180.0F; - + // H'okay, let's do legs! - + LegLeftLow.rotateAngleX = -0.6108652F + MathHelper.cos(f * 0.5662F) * 1.4F * f1; LegLeftMid.rotateAngleX = 0.6981317F + MathHelper.cos(f * 0.5662F) * 1.4F * f1; LegLeftTop.rotateAngleX = -0.8726646F + MathHelper.cos(f * 0.5662F) * 1.4F * f1; FootLeft.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; FootLeftClaws.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; - + LegRightLow.rotateAngleX = -0.6108652F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; LegRightMid.rotateAngleX = 0.6981317F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; LegRightTop.rotateAngleX = -0.8726646F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; FootRight.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; FootRightClaws.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; - + // And head! - + Head1.rotateAngleX = f4 / 57.29578F; Head1.rotateAngleY = f3 / 57.29578F; Head2.rotateAngleX = f4 / 57.29578F; @@ -508,14 +498,14 @@ public void setRotationAngles(float f, float f1, Head6.rotateAngleY = f3 / 57.29578F; Head7.rotateAngleX = 0.3490659F + f4 / 57.29578F; Head7.rotateAngleY = f3 / 57.29578F; - + HeadEyeLeft.rotateAngleX = 0.7853982F + f4 / 57.29578F; HeadEyeLeft.rotateAngleY = 0.1919862F + f3 / 57.29578F; HeadEyeRight.rotateAngleX = -0.7853982F + f4 / 57.29578F; HeadEyeRight.rotateAngleY = -0.1919862F + f3 / 57.29578F; - + EntityLizalfos foo = (EntityLizalfos) ent; - + if (foo.getAttackTarget() != null) { SwordBladePoint.rotateAngleX = -1.570796F + f4 / 57.29578F; SwordHilt.rotateAngleX = f4 / 57.29578F; @@ -527,6 +517,12 @@ public void setRotationAngles(float f, float f1, ArmRightLow.rotateAngleX = f4 / 57.29578F; } } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } diff --git a/src/main/java/com/gw/dm/model/ModelManticore.java b/src/main/java/com/gw/dm/model/ModelManticore.java index 6925a83..03d3ac7 100644 --- a/src/main/java/com/gw/dm/model/ModelManticore.java +++ b/src/main/java/com/gw/dm/model/ModelManticore.java @@ -6,7 +6,7 @@ import net.minecraft.util.math.MathHelper; public class ModelManticore extends ModelBase { - + //fields ModelRenderer bodySpines; ModelRenderer bodyBase; @@ -40,228 +40,228 @@ public class ModelManticore extends ModelBase { ModelRenderer LBLegLow; ModelRenderer LBPaw; ModelRenderer tail4; - + public ModelManticore() { textureWidth = 64; textureHeight = 32; - + bodySpines = new ModelRenderer(this, 40, 0); bodySpines.addBox(-0.5F, -3F, 0F, 1, 2, 11); bodySpines.setRotationPoint(0F, 11F, -3F); bodySpines.setTextureSize(64, 32); bodySpines.mirror = true; setRotation(bodySpines, 0F, 0F, 0F); - + bodyBase = new ModelRenderer(this, 0, 0); bodyBase.addBox(-4F, -1F, 0F, 8, 2, 18); bodyBase.setRotationPoint(0F, 15F, -6F); bodyBase.setTextureSize(64, 32); bodyBase.mirror = true; setRotation(bodyBase, 0F, 0F, 0F); - + bodyLow1 = new ModelRenderer(this, 6, 4); bodyLow1.addBox(-3F, -1F, 0F, 6, 2, 14); bodyLow1.setRotationPoint(0F, 17F, -5F); bodyLow1.setTextureSize(64, 32); bodyLow1.mirror = true; setRotation(bodyLow1, 0F, 0F, 0F); - + bodyTop1 = new ModelRenderer(this, 5, 3); bodyTop1.addBox(-3F, -1F, 0F, 6, 2, 15); bodyTop1.setRotationPoint(0F, 13F, -5F); bodyTop1.setTextureSize(64, 32); bodyTop1.mirror = true; setRotation(bodyTop1, 0F, 0F, 0F); - + tailSpines = new ModelRenderer(this, 28, 23); tailSpines.addBox(-2F, 13.8F, 8F, 4, 0, 5); tailSpines.setRotationPoint(0F, 14F, 11F); tailSpines.setTextureSize(64, 32); tailSpines.mirror = true; setRotation(tailSpines, 2.844887F, 0F, 0F); - + mouth = new ModelRenderer(this, 20, 28); mouth.addBox(-2F, -1F, -10F, 4, 3, 1); mouth.setRotationPoint(0F, 13.7F, -4F); mouth.setTextureSize(64, 32); mouth.mirror = true; setRotation(mouth, 0F, 0F, 0F); - + neck = new ModelRenderer(this, 18, 13); neck.addBox(-1.5F, -1.5F, -5F, 3, 3, 5); neck.setRotationPoint(0F, 13.7F, -4F); neck.setTextureSize(64, 32); neck.mirror = true; setRotation(neck, 0F, 0F, 0F); - + earLeft = new ModelRenderer(this, 20, 22); earLeft.addBox(2F, -3.5F, -6F, 1, 3, 3); earLeft.setRotationPoint(0F, 13.7F, -4F); earLeft.setTextureSize(64, 32); earLeft.mirror = true; setRotation(earLeft, 0F, 0F, 0F); - + head = new ModelRenderer(this, 0, 22); head.addBox(-2.5F, -3F, -9F, 5, 5, 5); head.setRotationPoint(0F, 13.7F, -4F); head.setTextureSize(64, 32); head.mirror = true; setRotation(head, 0F, 0F, 0F); - + earRight = new ModelRenderer(this, 20, 22); earRight.addBox(-3F, -3.5F, -6F, 1, 3, 3); earRight.setRotationPoint(0F, 13.7F, -4F); earRight.setTextureSize(64, 32); earRight.mirror = true; setRotation(earRight, 0F, 0F, 0F); - + bodyTop2 = new ModelRenderer(this, 10, 6); bodyTop2.addBox(-2F, -1F, 0F, 4, 2, 12); bodyTop2.setRotationPoint(0F, 11F, -4F); bodyTop2.setTextureSize(64, 32); bodyTop2.mirror = true; setRotation(bodyTop2, 0F, 0F, 0F); - + tailHelper = new ModelRenderer(this, 16, 12); tailHelper.addBox(-2F, 0F, 0F, 4, 2, 6); tailHelper.setRotationPoint(0F, 10F, 8F); tailHelper.setTextureSize(64, 32); tailHelper.mirror = true; setRotation(tailHelper, -0.7853982F, 0F, 0F); - + tail1 = new ModelRenderer(this, 46, 23); tail1.addBox(-1.5F, -1.5F, 0F, 3, 3, 6); tail1.setRotationPoint(0F, 14F, 11F); tail1.setTextureSize(64, 32); tail1.mirror = true; setRotation(tail1, 0.3141593F, 0F, 0F); - + tail2 = new ModelRenderer(this, 40, 20); tail2.addBox(-1F, 4F, 1F, 2, 2, 10); tail2.setRotationPoint(0F, 14F, 11F); tail2.setTextureSize(64, 32); tail2.mirror = true; setRotation(tail2, 1.518436F, 0F, 0F); - + RFShoulder = new ModelRenderer(this, 0, 0); RFShoulder.addBox(-3F, -1F, -1F, 3, 2, 3); RFShoulder.setRotationPoint(-3F, 16F, -3F); RFShoulder.setTextureSize(64, 32); RFShoulder.mirror = true; setRotation(RFShoulder, 0F, 0F, 0F); - + RFLegTop = new ModelRenderer(this, 0, 0); RFLegTop.addBox(-2.5F, -1F, 0F, 2, 2, 5); RFLegTop.setRotationPoint(-3F, 16F, -3F); RFLegTop.setTextureSize(64, 32); RFLegTop.mirror = true; setRotation(RFLegTop, -0.6283185F, 0F, 0F); - + RFPaw = new ModelRenderer(this, 0, 0); RFPaw.addBox(-3F, -8F, -1F, 3, 2, 4); RFPaw.setRotationPoint(-3F, 16F, -3F); RFPaw.setTextureSize(64, 32); RFPaw.mirror = true; setRotation(RFPaw, -3.141593F, 0F, 0F); - + RFLegLow = new ModelRenderer(this, 0, 0); RFLegLow.addBox(-2.5F, -5F, 0.9F, 2, 2, 5); RFLegLow.setRotationPoint(-3F, 16F, -3F); RFLegLow.setTextureSize(64, 32); RFLegLow.mirror = true; setRotation(RFLegLow, -2.199115F, 0F, 0F); - + tail3 = new ModelRenderer(this, 46, 20); tail3.addBox(-0.5F, 10F, 1F, 1, 1, 10); tail3.setRotationPoint(0F, 14F, 11F); tail3.setTextureSize(64, 32); tail3.mirror = true; setRotation(tail3, 2.530727F, 0F, 0F); - + RBShoulder = new ModelRenderer(this, 0, 0); RBShoulder.addBox(-1F, -1F, -1F, 3, 4, 4); RBShoulder.setRotationPoint(-5F, 14F, 5F); RBShoulder.setTextureSize(64, 32); RBShoulder.mirror = true; setRotation(RBShoulder, 0F, 0F, 0F); - + RBLegTop = new ModelRenderer(this, 0, 0); RBLegTop.addBox(-0.5F, -1F, 2F, 2, 2, 6); RBLegTop.setRotationPoint(-5F, 14F, 5F); RBLegTop.setTextureSize(64, 32); RBLegTop.mirror = true; setRotation(RBLegTop, -0.5235988F, 0F, 0F); - + RBLegLow = new ModelRenderer(this, 0, 0); RBLegLow.addBox(-0.5F, -8F, 0.8F, 2, 2, 5); RBLegLow.setRotationPoint(-5F, 14F, 5F); RBLegLow.setTextureSize(64, 32); RBLegLow.mirror = true; setRotation(RBLegLow, -2.129302F, 0F, 0F); - + RBPaw = new ModelRenderer(this, 0, 0); RBPaw.addBox(-1F, -10F, -4F, 3, 2, 4); RBPaw.setRotationPoint(-5F, 14F, 5F); RBPaw.setTextureSize(64, 32); RBPaw.mirror = true; setRotation(RBPaw, -3.141593F, 0F, 0F); - + LFShoulder = new ModelRenderer(this, 0, 0); LFShoulder.addBox(0F, -1F, -1F, 3, 2, 3); LFShoulder.setRotationPoint(3F, 16F, -3F); LFShoulder.setTextureSize(64, 32); LFShoulder.mirror = true; setRotation(LFShoulder, 0F, 0F, 0F); - + LFLegTop = new ModelRenderer(this, 0, 0); LFLegTop.addBox(0.5F, -1F, 0F, 2, 2, 5); LFLegTop.setRotationPoint(3F, 16F, -3F); LFLegTop.setTextureSize(64, 32); LFLegTop.mirror = true; setRotation(LFLegTop, -0.6283185F, 0F, 0F); - + LFLegLow = new ModelRenderer(this, 0, 0); LFLegLow.addBox(0.5F, -5F, 0.9F, 2, 2, 5); LFLegLow.setRotationPoint(3F, 16F, -3F); LFLegLow.setTextureSize(64, 32); LFLegLow.mirror = true; setRotation(LFLegLow, -2.199115F, 0F, 0F); - + LFPaw = new ModelRenderer(this, 0, 0); LFPaw.addBox(0F, -8F, -1F, 3, 2, 4); LFPaw.setRotationPoint(3F, 16F, -3F); LFPaw.setTextureSize(64, 32); LFPaw.mirror = true; setRotation(LFPaw, -3.141593F, 0F, 0F); - + LBShoulder = new ModelRenderer(this, 0, 0); LBShoulder.addBox(0F, -1F, -1F, 3, 4, 4); LBShoulder.setRotationPoint(3F, 14F, 5F); LBShoulder.setTextureSize(64, 32); LBShoulder.mirror = true; setRotation(LBShoulder, 0F, 0F, 0F); - + LBLegTop = new ModelRenderer(this, 0, 0); LBLegTop.addBox(0.5F, -1F, 2F, 2, 2, 6); LBLegTop.setRotationPoint(3F, 14F, 5F); LBLegTop.setTextureSize(64, 32); LBLegTop.mirror = true; setRotation(LBLegTop, -0.5235988F, 0F, 0F); - + LBLegLow = new ModelRenderer(this, 0, 0); LBLegLow.addBox(0.5F, -8F, 0.8F, 2, 2, 5); LBLegLow.setRotationPoint(3F, 14F, 5F); LBLegLow.setTextureSize(64, 32); LBLegLow.mirror = true; setRotation(LBLegLow, -2.129302F, 0F, 0F); - + LBPaw = new ModelRenderer(this, 0, 0); LBPaw.addBox(0F, -10F, -4F, 3, 2, 4); LBPaw.setRotationPoint(3F, 14F, 5F); LBPaw.setTextureSize(64, 32); LBPaw.mirror = true; setRotation(LBPaw, -3.141593F, 0F, 0F); - + tail4 = new ModelRenderer(this, 46, 20); tail4.addBox(-1F, 9.5F, 11F, 2, 2, 2); tail4.setRotationPoint(0F, 14F, 11F); @@ -269,10 +269,9 @@ public ModelManticore() { tail4.mirror = true; setRotation(tail4, 2.530727F, 0F, 0F); } - - - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); bodySpines.render(f5); @@ -308,19 +307,10 @@ public void render(Entity entity, float f, float f1, float f2, LBPaw.render(f5); tail4.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5, Entity ent) { + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); - + this.head.rotateAngleX = f4 / 57.29578F; this.head.rotateAngleY = f3 / 57.29578F; this.mouth.rotateAngleX = f4 / 57.29578F; @@ -331,14 +321,14 @@ public void setRotationAngles(float f, float f1, float f2, float f3, this.earRight.rotateAngleY = f3 / 57.29578F; this.neck.rotateAngleX = f4 / 57.29578F; this.neck.rotateAngleY = f3 / 57.29578F; - + this.LBLegTop.rotateAngleX = -0.5235988F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; this.LBLegLow.rotateAngleX = -2.129302F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; this.LBPaw.rotateAngleX = -3.141593F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; this.RFLegTop.rotateAngleX = -0.6283185F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; this.RFLegLow.rotateAngleX = -2.199115F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; this.RFPaw.rotateAngleX = -3.141593F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; - + this.RBLegTop.rotateAngleX = -0.5235988F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; this.RBLegLow.rotateAngleX = -2.129302F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; this.RBPaw.rotateAngleX = -3.141593F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; @@ -346,5 +336,11 @@ public void setRotationAngles(float f, float f1, float f2, float f3, this.LFLegLow.rotateAngleX = -2.199115F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; this.LFPaw.rotateAngleX = -3.141593F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } diff --git a/src/main/java/com/gw/dm/model/ModelNetherHound.java b/src/main/java/com/gw/dm/model/ModelNetherHound.java index 7410ed5..b5490eb 100644 --- a/src/main/java/com/gw/dm/model/ModelNetherHound.java +++ b/src/main/java/com/gw/dm/model/ModelNetherHound.java @@ -6,7 +6,7 @@ import net.minecraft.util.math.MathHelper; public class ModelNetherHound extends ModelBase { - + ModelRenderer MuzzleLow; ModelRenderer MuzzleTop; ModelRenderer EarRight; @@ -31,173 +31,173 @@ public class ModelNetherHound extends ModelBase { ModelRenderer RBLegMid; ModelRenderer RBLegLow; ModelRenderer RBPaw; - - + + public ModelNetherHound() { textureWidth = 64; textureHeight = 32; - + MuzzleLow = new ModelRenderer(this, 46, 8); MuzzleLow.addBox(-2F, -1.5F, -13F, 4, 1, 6); MuzzleLow.setRotationPoint(0F, 14F, 0F); MuzzleLow.setTextureSize(64, 32); MuzzleLow.mirror = true; setRotation(MuzzleLow, 0.4363323F, 0F, 0F); - + MuzzleTop = new ModelRenderer(this, 46, 0); MuzzleTop.addBox(-2F, -0.5F, -13F, 4, 3, 5); MuzzleTop.setRotationPoint(0F, 14F, 0F); MuzzleTop.setTextureSize(64, 32); MuzzleTop.mirror = true; setRotation(MuzzleTop, 0F, 0F, 0F); - + EarRight = new ModelRenderer(this, 0, 12); EarRight.addBox(-4F, -4.7F, -5F, 1, 5, 3); EarRight.setRotationPoint(0F, 14F, -1F); EarRight.setTextureSize(64, 32); EarRight.mirror = true; setRotation(EarRight, -0.3490659F, 0F, 0F); - + EarLeft = new ModelRenderer(this, 0, 12); EarLeft.addBox(3F, -4.7F, -5F, 1, 5, 3); EarLeft.setRotationPoint(0F, 14F, -1F); EarLeft.setTextureSize(64, 32); EarLeft.mirror = true; setRotation(EarLeft, -0.3490659F, 0F, 0F); - + HeadBase = new ModelRenderer(this, 0, 0); HeadBase.addBox(-3F, -2.5F, -7F, 6, 5, 7); HeadBase.setRotationPoint(0F, 14F, -1F); HeadBase.setTextureSize(64, 32); HeadBase.mirror = true; setRotation(HeadBase, 0F, 0F, 0F); - + BodyUp2 = new ModelRenderer(this, 23, 6); BodyUp2.addBox(-3F, -3.5F, -7F, 6, 1, 9); BodyUp2.setRotationPoint(0F, 12F, 7F); BodyUp2.setTextureSize(64, 32); BodyUp2.mirror = true; setRotation(BodyUp2, 0F, 0F, 0F); - + BodyBase = new ModelRenderer(this, 15, 0); BodyBase.addBox(-4F, -3.5F, -7F, 8, 6, 15); BodyBase.setRotationPoint(0F, 14F, 6F); BodyBase.setTextureSize(64, 32); BodyBase.mirror = true; setRotation(BodyBase, 0F, 0F, 0F); - + BodyUp1 = new ModelRenderer(this, 19, 3); BodyUp1.addBox(-3.5F, -3.5F, -7F, 7, 1, 12); BodyUp1.setRotationPoint(0F, 13F, 6.5F); BodyUp1.setTextureSize(64, 32); BodyUp1.mirror = true; setRotation(BodyUp1, 0F, 0F, 0F); - + LBLegMid = new ModelRenderer(this, 45, 23); LBLegMid.addBox(0.6F, 2.5F, -6.3F, 2, 6, 2); LBLegMid.setRotationPoint(4F, 12.3F, 11F); LBLegMid.setTextureSize(64, 32); LBLegMid.mirror = true; setRotation(LBLegMid, 0.9424778F, 0F, 0F); - + LFPaw = new ModelRenderer(this, 0, 20); LFPaw.addBox(0F, 10F, -2.5F, 3, 1, 4); LFPaw.setRotationPoint(4F, 13F, 1F); LFPaw.setTextureSize(64, 32); LFPaw.mirror = true; setRotation(LFPaw, 0F, 0F, 0F); - + LFShoulder = new ModelRenderer(this, 0, 26); LFShoulder.addBox(0F, -1.5F, -1.5F, 4, 3, 3); LFShoulder.setRotationPoint(3F, 13F, 1F); LFShoulder.setTextureSize(64, 32); LFShoulder.mirror = true; setRotation(LFShoulder, 0F, 0F, 0F); - + LFLeg = new ModelRenderer(this, 16, 21); LFLeg.addBox(0.5F, 1.5F, -1F, 2, 9, 2); LFLeg.setRotationPoint(4F, 13F, 1F); LFLeg.setTextureSize(64, 32); LFLeg.mirror = true; setRotation(LFLeg, 0F, 0F, 0F); - + RFShoulder = new ModelRenderer(this, 0, 26); RFShoulder.addBox(-3F, -1.5F, -1.5F, 4, 3, 3); RFShoulder.setRotationPoint(-4F, 13F, 1F); RFShoulder.setTextureSize(64, 32); RFShoulder.mirror = true; setRotation(RFShoulder, 0F, 0F, 0F); - + RFLeg = new ModelRenderer(this, 16, 21); RFLeg.addBox(-2.5F, 1.5F, -1F, 2, 9, 2); RFLeg.setRotationPoint(-4F, 13F, 1F); RFLeg.setTextureSize(64, 32); RFLeg.mirror = true; setRotation(RFLeg, 0F, 0F, 0F); - + LBPaw = new ModelRenderer(this, 0, 20); LBPaw.addBox(0.1F, 10F, -1.5F, 3, 1, 4); LBPaw.setRotationPoint(4F, 13F, 11F); LBPaw.setTextureSize(64, 32); LBPaw.mirror = true; setRotation(LBPaw, 0F, 0F, 0F); - + LBThigh = new ModelRenderer(this, 25, 24); LBThigh.addBox(-1F, -1.5F, -1.5F, 4, 4, 4); LBThigh.setRotationPoint(4F, 12.3F, 11F); LBThigh.setTextureSize(64, 32); LBThigh.mirror = true; setRotation(LBThigh, 0F, 0F, 0F); - + LBLegLow = new ModelRenderer(this, 56, 23); LBLegLow.addBox(0.6F, 3.7F, 8.5F, 2, 3, 1); LBLegLow.setRotationPoint(4F, 12.3F, 11F); LBLegLow.setTextureSize(64, 32); LBLegLow.mirror = true; setRotation(LBLegLow, -0.7504916F, 0F, 0F); - + LBLegTop = new ModelRenderer(this, 45, 22); LBLegTop.addBox(0.5F, -0.5F, -0.5F, 2, 7, 3); LBLegTop.setRotationPoint(4F, 12.3F, 11F); LBLegTop.setTextureSize(64, 32); LBLegTop.mirror = true; setRotation(LBLegTop, -0.5235988F, 0F, 0F); - + RFPaw = new ModelRenderer(this, 0, 20); RFPaw.addBox(-3F, 10F, -2.5F, 3, 1, 4); RFPaw.setRotationPoint(-4F, 13F, 1F); RFPaw.setTextureSize(64, 32); RFPaw.mirror = true; setRotation(RFPaw, 0F, 0F, 0F); - + RBThigh = new ModelRenderer(this, 25, 24); RBThigh.addBox(-3F, -1.5F, -1.5F, 4, 4, 4); RBThigh.setRotationPoint(-4F, 12.3F, 11F); RBThigh.setTextureSize(64, 32); RBThigh.mirror = true; setRotation(RBThigh, 0F, 0F, 0F); - + RBLegTop = new ModelRenderer(this, 45, 22); RBLegTop.addBox(-2.5F, -0.5F, -0.5F, 2, 7, 3); RBLegTop.setRotationPoint(-4F, 12.3F, 11F); RBLegTop.setTextureSize(64, 32); RBLegTop.mirror = true; setRotation(RBLegTop, -0.5235988F, 0F, 0F); - + RBLegMid = new ModelRenderer(this, 45, 23); RBLegMid.addBox(-2.6F, 2.5F, -6.3F, 2, 6, 2); RBLegMid.setRotationPoint(-4F, 12.3F, 11F); RBLegMid.setTextureSize(64, 32); RBLegMid.mirror = true; setRotation(RBLegMid, 0.9424778F, 0F, 0F); - + RBLegLow = new ModelRenderer(this, 56, 23); RBLegLow.addBox(-2.6F, 3.7F, 8.5F, 2, 3, 1); RBLegLow.setRotationPoint(-4F, 12.3F, 11F); RBLegLow.setTextureSize(64, 32); RBLegLow.mirror = true; setRotation(RBLegLow, -0.7504916F, 0F, 0F); - + RBPaw = new ModelRenderer(this, 0, 20); RBPaw.addBox(-3.1F, 10F, -1.5F, 3, 1, 4); RBPaw.setRotationPoint(-4F, 13F, 11F); @@ -205,11 +205,10 @@ public ModelNetherHound() { RBPaw.mirror = true; setRotation(RBPaw, 0F, 0F, 0F); } - - + + @Override - public void render(Entity entity, float f, float f1, - float f2, float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); MuzzleLow.render(f5); @@ -237,37 +236,24 @@ public void render(Entity entity, float f, float f1, RBLegLow.render(f5); RBPaw.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override - public void setRotationAngles(float f, float f1, - float f2, float f3, float f4, float f5, Entity ent) { + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { float var8 = 0.01F * (float) (ent.getEntityId() % 10); - - MuzzleLow.rotateAngleX = 0.4363323F + (f4 / 57.29578F) - + (MathHelper.sin((float) ent.ticksExisted * var8) - * 4.5F * (float) Math.PI / 180.0F); + + MuzzleLow.rotateAngleX = 0.4363323F + (f4 / 57.29578F) + (MathHelper.sin((float) ent.ticksExisted * var8) * 4.5F * (float) Math.PI / 180.0F); MuzzleLow.rotateAngleY = f3 / 57.29578F; MuzzleTop.rotateAngleX = f4 / 57.29578F; MuzzleTop.rotateAngleY = f3 / 57.29578F; EarRight.rotateAngleX = f4 / 57.29578F; EarRight.rotateAngleY = f3 / 57.29578F; - EarRight.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * 2.5F * (float) Math.PI / 180.0F; + EarRight.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * 2.5F * (float) Math.PI / 180.0F; EarLeft.rotateAngleX = f4 / 57.29578F; EarLeft.rotateAngleY = f3 / 57.29578F; - EarLeft.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) - * 2.5F * (float) Math.PI / 180.0F; + EarLeft.rotateAngleZ = MathHelper.cos((float) ent.ticksExisted * var8) * 2.5F * (float) Math.PI / 180.0F; HeadBase.rotateAngleX = f4 / 57.29578F; HeadBase.rotateAngleY = f3 / 57.29578F; - + LBLegMid.rotateAngleX = 0.9424778F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; LFPaw.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; LFLeg.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; @@ -275,17 +261,20 @@ public void setRotationAngles(float f, float f1, LBThigh.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; LBLegLow.rotateAngleX = -0.7504916F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; LBLegTop.rotateAngleX = -0.5235988F + MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; - + RFLeg.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; RFPaw.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1 * 0.5F; RBThigh.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; - RBLegTop.rotateAngleX = -0.5235988F - + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; - RBLegMid.rotateAngleX = 0.9424778F - + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; - RBLegLow.rotateAngleX = -0.7504916F - + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; + RBLegTop.rotateAngleX = -0.5235988F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; + RBLegMid.rotateAngleX = 0.9424778F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; + RBLegLow.rotateAngleX = -0.7504916F + MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; RBPaw.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1 * 0.5F; } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } diff --git a/src/main/java/com/gw/dm/model/ModelPetrified.java b/src/main/java/com/gw/dm/model/ModelPetrified.java index fb78cbf..447ede5 100644 --- a/src/main/java/com/gw/dm/model/ModelPetrified.java +++ b/src/main/java/com/gw/dm/model/ModelPetrified.java @@ -5,18 +5,18 @@ import net.minecraft.entity.Entity; public class ModelPetrified extends ModelBase { - + ModelRenderer head; ModelRenderer body; ModelRenderer rightarm; ModelRenderer leftarm; ModelRenderer rightleg; ModelRenderer leftleg; - + public ModelPetrified() { textureWidth = 64; textureHeight = 32; - + head = new ModelRenderer(this, 0, 0); head.addBox(-4F, -8F, -4F, 8, 8, 8); head.setRotationPoint(0F, 0F, 0F); @@ -54,11 +54,10 @@ public ModelPetrified() { leftleg.mirror = true; setRotation(leftleg, -0.0698132F, 0F, 0F); } - - + + @Override - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); head.render(f5); @@ -68,19 +67,16 @@ public void render(Entity entity, float f, float f1, float f2, rightleg.render(f5); leftleg.render(f5); } - - + + @Override + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); + } + private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } - - - @Override - public void setRotationAngles(float f, float f1, float f2, - float f3, float f4, float f5, Entity ent) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); - } - + } diff --git a/src/main/java/com/gw/dm/model/ModelRakshasa.java b/src/main/java/com/gw/dm/model/ModelRakshasa.java index 69c5c12..f397bd3 100644 --- a/src/main/java/com/gw/dm/model/ModelRakshasa.java +++ b/src/main/java/com/gw/dm/model/ModelRakshasa.java @@ -6,54 +6,54 @@ import net.minecraft.util.math.MathHelper; public class ModelRakshasa extends ModelBase { - + ModelRenderer head; ModelRenderer body; ModelRenderer rightarm; ModelRenderer leftarm; ModelRenderer rightleg; ModelRenderer leftleg; - - + + public ModelRakshasa() { textureWidth = 64; textureHeight = 32; - + head = new ModelRenderer(this, 0, 0); head.addBox(-4F, -8F, -4F, 8, 8, 8); head.setRotationPoint(0F, 0F, 0F); head.setTextureSize(64, 32); head.mirror = true; setRotation(head, 0F, 0F, 0F); - + body = new ModelRenderer(this, 16, 16); body.addBox(-4F, 0F, -2F, 8, 12, 4); body.setRotationPoint(0F, 0F, 0F); body.setTextureSize(64, 32); body.mirror = true; setRotation(body, 0F, 0F, 0F); - + rightarm = new ModelRenderer(this, 40, 16); rightarm.addBox(-3F, -2F, -2F, 4, 12, 4); rightarm.setRotationPoint(-5F, 2F, 0F); rightarm.setTextureSize(64, 32); rightarm.mirror = true; setRotation(rightarm, 0F, 0F, 0F); - + leftarm = new ModelRenderer(this, 40, 16); leftarm.addBox(-1F, -2F, -2F, 4, 12, 4); leftarm.setRotationPoint(7F, 2F, 0F); leftarm.setTextureSize(64, 32); leftarm.mirror = true; setRotation(leftarm, 0F, (float) Math.PI, 0F); - + rightleg = new ModelRenderer(this, 0, 16); rightleg.addBox(-2F, 0F, -2F, 4, 12, 4); rightleg.setRotationPoint(-2F, 12F, 0F); rightleg.setTextureSize(64, 32); rightleg.mirror = true; setRotation(rightleg, 0F, 0F, 0F); - + leftleg = new ModelRenderer(this, 0, 16); leftleg.addBox(-2F, 0F, -2F, 4, 12, 4); leftleg.setRotationPoint(2F, 12F, 0F); @@ -61,11 +61,10 @@ public ModelRakshasa() { leftleg.mirror = true; setRotation(leftleg, 0F, (float) Math.PI, 0F); } - - + + @Override - public void render(Entity entity, float f, float f1, - float f2, float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); head.render(f5); @@ -75,29 +74,26 @@ public void render(Entity entity, float f, float f1, rightleg.render(f5); leftleg.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override - public void setRotationAngles(float f, float f1, - float f2, float f3, float f4, float f5, Entity ent) { + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { head.rotateAngleX = f4 / 57.29578F; head.rotateAngleY = f3 / 57.29578F; - + rightleg.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; rightleg.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; leftleg.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; leftleg.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; - + leftarm.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; leftarm.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; rightarm.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; rightarm.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } } diff --git a/src/main/java/com/gw/dm/model/ModelRustMonster.java b/src/main/java/com/gw/dm/model/ModelRustMonster.java index bb419d3..83fcf6c 100644 --- a/src/main/java/com/gw/dm/model/ModelRustMonster.java +++ b/src/main/java/com/gw/dm/model/ModelRustMonster.java @@ -6,7 +6,7 @@ import net.minecraft.util.math.MathHelper; public class ModelRustMonster extends ModelBase { - + ModelRenderer BodyBase1; ModelRenderer BodyBase2; ModelRenderer BodyBase3; @@ -97,12 +97,12 @@ public class ModelRustMonster extends ModelBase { float RAntFeel2Angle; ModelRenderer RAntFeel3; float RAntFeel3Angle; - - + + public ModelRustMonster() { textureWidth = 64; textureHeight = 32; - + BodyBase1 = new ModelRenderer(this, 11, 5); BodyBase1.addBox(-4.0F, 0.0F, 0.0F, 8, 4, 13); BodyBase1.setRotationPoint(0.0F, 15.0F, -2.0F); @@ -277,7 +277,7 @@ public ModelRustMonster() { RBLegFootBase.setTextureSize(64, 32); RBLegFootBase.mirror = true; setRotation(RBLegFootBase, 0.0F, 0.0F, 0.0F); - + RBLegBase1 = new ModelRenderer(this, 19, 9); RBLegBase1.addBox(0.5F, -3.0F, -1.5F, 2, 3, 3); RBLegBase1.setRotationPoint(-5.5F, 19.0F, 9.0F); @@ -308,7 +308,7 @@ public ModelRustMonster() { RBLegBase5.setTextureSize(64, 32); RBLegBase5.mirror = true; setRotation(RBLegBase5, 0.0F, 0.0F, -0.9773844F); - + RFLegFootBase = new ModelRenderer(this, 25, 0); RFLegFootBase.addBox(-0.5F, 2.0F, 0.0F, 1, 3, 1); RFLegFootBase.setRotationPoint(-10.3F, 19.0F, 0.3F); @@ -357,7 +357,7 @@ public ModelRustMonster() { LFLegFootBase.setTextureSize(64, 32); LFLegFootBase.mirror = true; setRotation(LFLegFootBase, 0.0F, 0.0F, 0.0F); - + RFLegBase1 = new ModelRenderer(this, 15, 15); RFLegBase1.addBox(0.5F, -3.0F, -1.5F, 2, 3, 3); RFLegBase1.setRotationPoint(-5.5F, 19.0F, 1.0F); @@ -406,7 +406,7 @@ public ModelRustMonster() { Head.setTextureSize(64, 32); Head.mirror = true; setRotation(Head, 0.0F, 0.0F, 0.0F); - + RAntBase1 = new ModelRenderer(this, 22, 20); RAntBase1.addBox(-0.5F, -0.5F, -4.0F, 1, 1, 4); RAntBase1.setRotationPoint(-2.0F, 21.0F, -3.0F); @@ -414,7 +414,7 @@ public ModelRustMonster() { RAntBase1.mirror = true; setRotation(RAntBase1, 0.20944F, 0.0872665F, 0.0F); RAntBase1Angle = 0.20944F; - + LAntBase1 = new ModelRenderer(this, 46, 19); LAntBase1.addBox(-0.5F, -0.5F, -4.0F, 1, 1, 4); LAntBase1.setRotationPoint(2.0F, 21.0F, -3.0F); @@ -422,7 +422,7 @@ public ModelRustMonster() { LAntBase1.mirror = true; setRotation(LAntBase1, 0.20944F, -0.0872665F, 0.0F); LAntBase1Angle = 0.20944F; - + RAntBase2 = new ModelRenderer(this, 60, 17); RAntBase2.addBox(-0.5F, -8.0F, -0.5F, 1, 8, 1); RAntBase2.setRotationPoint(-2.3F, 22.0F, -6.4F); @@ -430,7 +430,7 @@ public ModelRustMonster() { RAntBase2.mirror = true; setRotation(RAntBase2, 0.1396263F, 0.10472F, 0.0F); RAntBase2Angle = 0.1396263F; - + RAntBase3 = new ModelRenderer(this, 59, 13); RAntBase3.addBox(-0.5F, -14.0F, -3.0F, 1, 7, 1); RAntBase3.setRotationPoint(-2.3F, 22.0F, -6.4F); @@ -438,7 +438,7 @@ public ModelRustMonster() { RAntBase3.mirror = true; setRotation(RAntBase3, -0.20944F, 0.10472F, 0.0F); RAntBase3Angle = -0.20944F; - + LAntBase2 = new ModelRenderer(this, 60, 23); LAntBase2.addBox(-0.5F, -8.0F, -0.5F, 1, 8, 1); LAntBase2.setRotationPoint(2.2F, 21.799999F, -6.5F); @@ -446,7 +446,7 @@ public ModelRustMonster() { LAntBase2.mirror = true; setRotation(LAntBase2, 0.1396263F, -0.10472F, 0.0F); LAntBase2Angle = 0.1396263F; - + RAntBase4 = new ModelRenderer(this, 59, 13); RAntBase4.addBox(-0.5F, -19.0F, 6.5F, 1, 7, 1); RAntBase4.setRotationPoint(-2.3F, 22.0F, -6.4F); @@ -454,7 +454,7 @@ public ModelRustMonster() { RAntBase4.mirror = true; setRotation(RAntBase4, 0.5061455F, 0.10472F, 0.0F); RAntBase4Angle = 0.5061455F; - + LAntBase3 = new ModelRenderer(this, 58, 12); LAntBase3.addBox(-0.5F, -14.0F, -3.0F, 1, 7, 1); LAntBase3.setRotationPoint(2.2F, 21.799999F, -6.5F); @@ -462,7 +462,7 @@ public ModelRustMonster() { LAntBase3.mirror = true; setRotation(LAntBase3, -0.20944F, -0.10472F, 0.0F); LAntBase3Angle = -0.20944F; - + LAntBase4 = new ModelRenderer(this, 59, 11); LAntBase4.addBox(-0.5F, -19.0F, 6.5F, 1, 7, 1); LAntBase4.setRotationPoint(2.2F, 21.799999F, -6.5F); @@ -470,7 +470,7 @@ public ModelRustMonster() { LAntBase4.mirror = true; setRotation(LAntBase4, 0.5061455F, -0.10472F, 0.0F); LAntBase4Angle = 0.5061455F; - + RAntFeel1 = new ModelRenderer(this, 43, 9); RAntFeel1.addBox(0.0F, -7.5F, -1.1F, 0, 7, 1); RAntFeel1.setRotationPoint(-2.4F, 22.0F, -6.4F); @@ -478,7 +478,7 @@ public ModelRustMonster() { RAntFeel1.mirror = true; setRotation(RAntFeel1, 0.1745329F, 0.10472F, 0.0F); RAntFeel1Angle = 0.1745329F; - + LAntFeel3 = new ModelRenderer(this, 47, 10); LAntFeel3.addBox(0.0F, -18.5F, 5.7F, 0, 6, 1); LAntFeel3.setRotationPoint(2.2F, 21.799999F, -6.5F); @@ -486,7 +486,7 @@ public ModelRustMonster() { LAntFeel3.mirror = true; setRotation(LAntFeel3, 0.5061455F, -0.10472F, 0.0F); LAntFeel3Angle = 0.5061455F; - + LAntFeel1 = new ModelRenderer(this, 54, 10); LAntFeel1.addBox(0.0F, -7.5F, -1.1F, 0, 7, 1); LAntFeel1.setRotationPoint(2.2F, 21.799999F, -6.5F); @@ -494,7 +494,7 @@ public ModelRustMonster() { LAntFeel1.mirror = true; setRotation(LAntFeel1, 0.1745329F, -0.10472F, 0.0F); LAntFeel1Angle = 0.1745329F; - + LAntFeel2 = new ModelRenderer(this, 42, 9); LAntFeel2.addBox(0.0F, -13.5F, -3.7F, 0, 6, 1); LAntFeel2.setRotationPoint(2.2F, 21.799999F, -6.5F); @@ -502,7 +502,7 @@ public ModelRustMonster() { LAntFeel2.mirror = true; setRotation(LAntFeel2, -0.20944F, -0.10472F, 0.0F); LAntFeel2Angle = -0.20944F; - + RAntFeel2 = new ModelRenderer(this, 50, 9); RAntFeel2.addBox(0.0F, -13.5F, -3.7F, 0, 6, 1); RAntFeel2.setRotationPoint(-2.3F, 22.0F, -6.4F); @@ -510,7 +510,7 @@ public ModelRustMonster() { RAntFeel2.mirror = true; setRotation(RAntFeel2, -0.20944F, 0.10472F, 0.0F); RAntFeel2Angle = -0.20944F; - + RAntFeel3 = new ModelRenderer(this, 55, 9); RAntFeel3.addBox(0.0F, -18.5F, 5.7F, 0, 6, 1); RAntFeel3.setRotationPoint(-2.3F, 22.0F, -6.4F); @@ -519,7 +519,7 @@ public ModelRustMonster() { setRotation(RAntFeel3, 0.5061455F, 0.10472F, 0.0F); RAntFeel3Angle = 0.5061455F; } - + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { setRotationAngles(f, f1, f2, f3, f4, f5, entity); BodyBase1.render(f5); @@ -551,13 +551,13 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f RFLegBase4.render(f5); RBLegBase4.render(f5); RBLegFootBase.render(f5); - + RBLegBase1.render(f5); RFLegBase2.render(f5); RFLegBase3.render(f5); RBLegBase3.render(f5); RBLegBase5.render(f5); - + RFLegFootBase.render(f5); RFLegBase5.render(f5); LFLegBase1.render(f5); @@ -566,7 +566,7 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f LFLegBase4.render(f5); LFLegBase5.render(f5); LFLegFootBase.render(f5); - + RFLegBase1.render(f5); LBLegFootBase.render(f5); LBLegBase6.render(f5); @@ -590,49 +590,38 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f RAntFeel2.render(f5); RAntFeel3.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override - public void setRotationAngles(float f, float f1, float f2, - float f3, float f4, float f5, Entity ent) { + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { RBLegFootBase.rotateAngleX = (MathHelper.cos(f * 0.5662F) * 1.4F * f1); LBLegFootBase.rotateAngleX = (MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1); RFLegFootBase.rotateAngleX = (MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1); LFLegFootBase.rotateAngleX = (MathHelper.cos(f * 0.5662F) * 1.4F * f1); - + LBLegBase6.rotateAngleX = (MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1); RBLegBase6.rotateAngleX = (MathHelper.cos(f * 0.5662F) * 1.4F * f1); RFLegBase5.rotateAngleX = (MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1); LFLegBase5.rotateAngleX = (MathHelper.cos(f * 0.5662F) * 1.4F * f1); - - LAntBase1.rotateAngleX = (LAntBase1Angle - MathHelper.cos(f * 0.5662F + 3.141593F) - * 1.4F * f1 / 2.0F); - RAntBase1.rotateAngleX = (RAntBase1Angle - MathHelper.cos(f * 0.5662F) - * 1.4F * f1 / 2.0F); - LAntBase2.rotateAngleX = (LAntBase2Angle - MathHelper.cos(f * 0.5662F + 3.141593F) - * 1.4F * f1 / 2.0F); + + LAntBase1.rotateAngleX = (LAntBase1Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1 / 2.0F); + RAntBase1.rotateAngleX = (RAntBase1Angle - MathHelper.cos(f * 0.5662F) * 1.4F * f1 / 2.0F); + LAntBase2.rotateAngleX = (LAntBase2Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1 / 2.0F); RAntBase2.rotateAngleX = (RAntBase2Angle - MathHelper.cos(f * 0.5662F) * 1.4F * f1 / 2.0F); - LAntBase3.rotateAngleX = (LAntBase3Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F - * f1 / 2.0F); + LAntBase3.rotateAngleX = (LAntBase3Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1 / 2.0F); RAntBase3.rotateAngleX = (RAntBase3Angle - MathHelper.cos(f * 0.5662F) * 1.4F * f1 / 2.0F); - LAntBase4.rotateAngleX = (LAntBase4Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F - * f1 / 2.0F); + LAntBase4.rotateAngleX = (LAntBase4Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1 / 2.0F); RAntBase4.rotateAngleX = (RAntBase4Angle - MathHelper.cos(f * 0.5662F) * 1.4F * f1 / 2.0F); - LAntFeel1.rotateAngleX = (LAntFeel1Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F - * f1 / 2.0F); + LAntFeel1.rotateAngleX = (LAntFeel1Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1 / 2.0F); RAntFeel1.rotateAngleX = (RAntFeel1Angle - MathHelper.cos(f * 0.5662F) * 1.4F * f1 / 2.0F); - LAntFeel2.rotateAngleX = (LAntFeel2Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F - * f1 / 2.0F); + LAntFeel2.rotateAngleX = (LAntFeel2Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1 / 2.0F); RAntFeel2.rotateAngleX = (RAntFeel2Angle - MathHelper.cos(f * 0.5662F) * 1.4F * f1 / 2.0F); - LAntFeel3.rotateAngleX = (LAntFeel3Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F - * f1 / 2.0F); + LAntFeel3.rotateAngleX = (LAntFeel3Angle - MathHelper.cos(f * 0.5662F + 3.141593F) * 1.4F * f1 / 2.0F); RAntFeel3.rotateAngleX = (RAntFeel3Angle - MathHelper.cos(f * 0.5662F) * 1.4F * f1 / 2.0F); } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } } \ No newline at end of file diff --git a/src/main/java/com/gw/dm/model/ModelShrieker.java b/src/main/java/com/gw/dm/model/ModelShrieker.java index 5f3ee5e..c0562bc 100644 --- a/src/main/java/com/gw/dm/model/ModelShrieker.java +++ b/src/main/java/com/gw/dm/model/ModelShrieker.java @@ -5,7 +5,7 @@ import net.minecraft.entity.Entity; public class ModelShrieker extends ModelBase { - + ModelRenderer Stem; ModelRenderer CapTop; ModelRenderer CapOverRear; @@ -14,13 +14,13 @@ public class ModelShrieker extends ModelBase { ModelRenderer CapOverLeft; ModelRenderer CapOverFront; ModelRenderer CapOverRight; - - + + public ModelShrieker() { - + textureWidth = 64; textureHeight = 32; - + Stem = new ModelRenderer(this, 0, 0); Stem.addBox(-3F, 0F, -3F, 6, 8, 6); Stem.setRotationPoint(0F, 16F, 0F); @@ -70,11 +70,10 @@ public ModelShrieker() { CapOverRight.mirror = true; setRotation(CapOverRight, 0F, 1.570796F, 0F); } - - + + @Override - public void render(Entity entity, float f, float f1, - float f2, float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Stem.render(f5); @@ -86,18 +85,15 @@ public void render(Entity entity, float f, float f1, CapOverFront.render(f5); CapOverRight.render(f5); } - - + + @Override + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { + } + private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } - - - @Override - public void setRotationAngles(float f, float f1, float f2, - float f3, float f4, float f5, Entity ent) { - } - + } diff --git a/src/main/java/com/gw/dm/model/ModelThoqqua.java b/src/main/java/com/gw/dm/model/ModelThoqqua.java index e571718..27299d9 100644 --- a/src/main/java/com/gw/dm/model/ModelThoqqua.java +++ b/src/main/java/com/gw/dm/model/ModelThoqqua.java @@ -5,7 +5,7 @@ import net.minecraft.entity.Entity; public class ModelThoqqua extends ModelBase { - + ModelRenderer BodyMid; ModelRenderer HeadConeEnd; ModelRenderer HeadConeLow; @@ -32,12 +32,12 @@ public class ModelThoqqua extends ModelBase { ModelRenderer SpineLB; ModelRenderer SpineLE; ModelRenderer SpineLF; - - + + public ModelThoqqua() { textureWidth = 64; textureHeight = 32; - + BodyMid = new ModelRenderer(this, 34, 17); BodyMid.addBox(0F, 0F, 0F, 5, 5, 10); BodyMid.setRotationPoint(-2.5F, 19F, -6F); @@ -195,11 +195,10 @@ public ModelThoqqua() { SpineLF.mirror = true; setRotation(SpineLF, 0F, 0.1745329F, 0F); } - - + + @Override - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); BodyMid.render(f5); @@ -229,28 +228,25 @@ public void render(Entity entity, float f, float f1, float f2, SpineLE.render(f5); SpineLF.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - + @Override - public void setRotationAngles(float f, float f1, float f2, - float f3, float f4, float f5, Entity ent) { + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); - + HeadConeEnd.rotateAngleY = (f3 / 57.29578F) * .2F; HeadConeEnd.rotateAngleX = (f4 / 57.29578F) * .2F; - + HeadConeLow.rotateAngleY = (f3 / 57.29578F) * .2F; HeadConeLow.rotateAngleX = (f4 / 57.29578F) * .2F; - + HeadConeMid.rotateAngleY = (f3 / 57.29578F) * .2F; HeadConeMid.rotateAngleX = (f4 / 57.29578F) * .2F; } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } \ No newline at end of file diff --git a/src/main/java/com/gw/dm/model/ModelTroll.java b/src/main/java/com/gw/dm/model/ModelTroll.java index 2b15b54..7904328 100644 --- a/src/main/java/com/gw/dm/model/ModelTroll.java +++ b/src/main/java/com/gw/dm/model/ModelTroll.java @@ -18,11 +18,11 @@ public class ModelTroll extends ModelBase { ModelRenderer ArmLeftJoint; ModelRenderer Nose; ModelRenderer ArmRight; - + public ModelTroll() { textureWidth = 64; textureHeight = 32; - + LegLeft = new ModelRenderer(this, 38, 0); LegLeft.addBox(-2.5F, 0F, -2F, 5, 16, 5); LegLeft.setRotationPoint(5F, 8F, 0F); @@ -90,7 +90,7 @@ public ModelTroll() { ArmRight.mirror = true; setRotation(ArmRight, 0F, 0F, 0F); } - + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); @@ -106,27 +106,27 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f Nose.render(f5); ArmRight.render(f5); } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { //super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); - + this.Shape1.rotateAngleY = f3 / 57.29578F; this.Shape1.rotateAngleX = f4 / 57.29578F; this.Nose.rotateAngleY = f3 / 57.29578F; this.Nose.rotateAngleX = f4 / 57.29578F; - + this.LegLeft.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.LegRight.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; - + this.ArmRight.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; this.ArmLeft.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } \ No newline at end of file diff --git a/src/main/java/com/gw/dm/model/ModelUmberHulk.java b/src/main/java/com/gw/dm/model/ModelUmberHulk.java index 0e3ebcd..0cb5194 100644 --- a/src/main/java/com/gw/dm/model/ModelUmberHulk.java +++ b/src/main/java/com/gw/dm/model/ModelUmberHulk.java @@ -6,7 +6,7 @@ import net.minecraft.util.math.MathHelper; public class ModelUmberHulk extends ModelBase { - + ModelRenderer RightFoot; ModelRenderer LeftFoot; ModelRenderer LeftLegLow; @@ -38,11 +38,11 @@ public class ModelUmberHulk extends ModelBase { ModelRenderer LittleEyeRight; ModelRenderer BigEyeRight; ModelRenderer LeftLegHigh; - + public ModelUmberHulk() { textureWidth = 64; textureHeight = 32; - + RightFoot = new ModelRenderer(this, 0, 0); RightFoot.addBox(-3F, 15F, -11F, 6, 6, 6); RightFoot.setRotationPoint(-8F, 3F, 15F); @@ -133,8 +133,8 @@ public ModelUmberHulk() { LeftPincer1.setTextureSize(64, 32); LeftPincer1.mirror = false; setRotation(LeftPincer1, 0F, -0.5759587F, 0F); - - + + LeftPincer2 = new ModelRenderer(this, 25, 13); LeftPincer2.addBox(12F, 4F, -21.3F, 2, 2, 10); LeftPincer2.setRotationPoint(0F, -10F, 2F); @@ -142,24 +142,24 @@ public ModelUmberHulk() { LeftPincer2.mirror = true; setRotation(LeftPincer2, 0F, 0.2617994F, 0F); LeftPincer2.mirror = false; - - + + RightPincer1 = new ModelRenderer(this, 25, 13); RightPincer1.addBox(-1F, 4F, -18F, 2, 2, 10); RightPincer1.setRotationPoint(0F, -10F, 2F); RightPincer1.setTextureSize(64, 32); RightPincer1.mirror = true; setRotation(RightPincer1, 0F, 0.5759587F, 0F); - - + + RightPincer2 = new ModelRenderer(this, 25, 13); RightPincer2.addBox(-14F, 4F, -21.3F, 2, 2, 10); RightPincer2.setRotationPoint(0F, -10F, 2F); RightPincer2.setTextureSize(64, 32); RightPincer2.mirror = true; setRotation(RightPincer2, 0F, -0.2617994F, 0F); - - + + LeftArmBase = new ModelRenderer(this, 0, 0); LeftArmBase.addBox(-1.5F, 0F, -1.5F, 3, 14, 3); LeftArmBase.setRotationPoint(10F, -8F, 2F); @@ -240,11 +240,10 @@ public ModelUmberHulk() { LeftLegHigh.mirror = true; setRotation(LeftLegHigh, 0.3490659F, 0F, 0F); } - - + + @Override - public void render(Entity entity, float f, float f1, float f2, - float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); RightFoot.render(f5); @@ -279,18 +278,9 @@ public void render(Entity entity, float f, float f1, float f2, BigEyeRight.render(f5); LeftLegHigh.render(f5); } - - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, - float f3, float f4, float f5, Entity ent) { - + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { + Head.rotateAngleY = f3 / 57.29578F; Head.rotateAngleX = f4 / 57.29578F; LittleEyeRight.rotateAngleY = f3 / 57.29578F; @@ -301,12 +291,12 @@ public void setRotationAngles(float f, float f1, float f2, LittleEyeLeft.rotateAngleX = f4 / 57.29578F; BigEyeLeft.rotateAngleY = f3 / 57.29578F; BigEyeLeft.rotateAngleX = f4 / 57.29578F; - + LeftPincer1.rotateAngleY = -0.5759587F + (f3 / 57.29578F); LeftPincer1.rotateAngleX = f4 / 57.29578F; RightPincer1.rotateAngleY = 0.5759587F + (f3 / 57.29578F); RightPincer1.rotateAngleX = f4 / 57.29578F; - + RightFoot.rotateAngleX = MathHelper.cos(f * 0.5662F) * 1.4F * f1; LeftFoot.rotateAngleX = MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; RightLegLow.rotateAngleX = -0.4363323F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; @@ -315,7 +305,7 @@ public void setRotationAngles(float f, float f1, float f2, LeftLegMid.rotateAngleX = -0.1745329F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; RightLegHigh.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; LeftLegHigh.rotateAngleX = 0.3490659F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; - + LeftArmBase.rotateAngleX = -0.3490659F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; LeftArmLow.rotateAngleX = -1.570796F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; LeftArmCara.rotateAngleX = -1.570796F - MathHelper.cos(f * 0.5662F) * 1.4F * f1; @@ -324,12 +314,18 @@ public void setRotationAngles(float f, float f1, float f2, RightArmLow.rotateAngleX = -1.570796F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; RightArmCara.rotateAngleX = -1.570796F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; RightHand.rotateAngleX = -1.570796F - MathHelper.cos(f * 0.5662F + (float) Math.PI) * 1.4F * f1; - + RightPincer2.rotateAngleY = -0.2617994F + ((f3 / 57.29578F) * 1.333F); RightPincer2.rotateAngleX = ((f4 / 57.29578F) * 1.333F); LeftPincer2.rotateAngleY = 0.2617994F + ((f3 / 57.29578F) * 1.333F); LeftPincer2.rotateAngleX = ((f4 / 57.29578F) * 1.333F); - + } - + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + } diff --git a/src/main/java/com/gw/dm/model/ModelVescavor.java b/src/main/java/com/gw/dm/model/ModelVescavor.java index 9526a04..4094ded 100644 --- a/src/main/java/com/gw/dm/model/ModelVescavor.java +++ b/src/main/java/com/gw/dm/model/ModelVescavor.java @@ -6,7 +6,7 @@ import net.minecraft.util.math.MathHelper; public class ModelVescavor extends ModelBase { - + ModelRenderer head; ModelRenderer eye; ModelRenderer TailA; @@ -24,124 +24,124 @@ public class ModelVescavor extends ModelBase { ModelRenderer WingLA; ModelRenderer WingRB; ModelRenderer WingLB; - - + + public ModelVescavor() { textureWidth = 64; textureHeight = 32; - + head = new ModelRenderer(this, 0, 0); head.addBox(-3F, -3F, -3F, 6, 6, 6); head.setRotationPoint(0F, 18F, -4F); head.setTextureSize(64, 32); head.mirror = true; setRotation(head, 0F, 0F, 0F); - + eye = new ModelRenderer(this, 0, 13); eye.addBox(-1F, -1.5F, -1F, 2, 3, 2); eye.setRotationPoint(0F, 17.5F, -6.5F); eye.setTextureSize(64, 32); eye.mirror = true; setRotation(eye, 0F, 0F, 0F); - + TailA = new ModelRenderer(this, 0, 24); TailA.addBox(-2F, -2F, 0F, 4, 4, 4); TailA.setRotationPoint(0F, 18F, -1F); TailA.setTextureSize(64, 32); TailA.mirror = true; setRotation(TailA, 0F, 0F, 0.7853982F); - + TailB = new ModelRenderer(this, 16, 25); TailB.addBox(-1.5F, -1.5F, 4F, 3, 3, 4); TailB.setRotationPoint(0F, 18F, -1F); TailB.setTextureSize(64, 32); TailB.mirror = true; setRotation(TailB, 0F, 0F, 0.7853982F); - + TailC = new ModelRenderer(this, 30, 27); TailC.addBox(-1F, -1F, 8F, 2, 2, 3); TailC.setRotationPoint(0F, 18F, -1F); TailC.setTextureSize(64, 32); TailC.mirror = true; setRotation(TailC, 0F, 0F, 0.7853982F); - + RLegMid = new ModelRenderer(this, 0, 20); RLegMid.addBox(-9F, -0.5F, -0.5F, 9, 1, 1); RLegMid.setRotationPoint(-2F, 18F, -4F); RLegMid.setTextureSize(64, 32); RLegMid.mirror = true; setRotation(RLegMid, 0F, 0F, -0.3490659F); - + RLegFront = new ModelRenderer(this, 0, 20); RLegFront.addBox(-9F, -0.5F, -0.5F, 9, 1, 1); RLegFront.setRotationPoint(-2F, 18F, -5.5F); RLegFront.setTextureSize(64, 32); RLegFront.mirror = true; setRotation(RLegFront, 0F, -0.2617994F, -0.3490659F); - + RLegRear = new ModelRenderer(this, 0, 20); RLegRear.addBox(-9F, -0.5F, -0.5F, 9, 1, 1); RLegRear.setRotationPoint(-2F, 18F, -2.5F); RLegRear.setTextureSize(64, 32); RLegRear.mirror = true; setRotation(RLegRear, 0F, 0.2617994F, -0.3490659F); - + LLegMid = new ModelRenderer(this, 0, 20); LLegMid.addBox(0F, -0.5F, -0.5F, 9, 1, 1); LLegMid.setRotationPoint(2F, 18F, -4F); LLegMid.setTextureSize(64, 32); LLegMid.mirror = true; setRotation(LLegMid, 0F, 0F, 0.3490659F); - + LLegFront = new ModelRenderer(this, 0, 20); LLegFront.addBox(0F, -0.5F, -0.5F, 9, 1, 1); LLegFront.setRotationPoint(2F, 18F, -5.5F); LLegFront.setTextureSize(64, 32); LLegFront.mirror = true; setRotation(LLegFront, 0F, 0.2617994F, 0.3490659F); - + LLegRear = new ModelRenderer(this, 0, 20); LLegRear.addBox(0F, -0.5F, -0.5F, 9, 1, 1); LLegRear.setRotationPoint(2F, 18F, -2.5F); LLegRear.setTextureSize(64, 32); LLegRear.mirror = true; setRotation(LLegRear, 0F, -0.2617994F, 0.3490659F); - + WingBaseL = new ModelRenderer(this, 0, 0); WingBaseL.addBox(-0.5F, -0.5F, -1F, 1, 1, 2); WingBaseL.setRotationPoint(1.5F, 15F, -3F); WingBaseL.setTextureSize(64, 32); WingBaseL.mirror = true; setRotation(WingBaseL, 0F, 0F, 0.7853982F); - + WingBaseR = new ModelRenderer(this, 0, 0); WingBaseR.addBox(-0.5F, -0.5F, -1F, 1, 1, 2); WingBaseR.setRotationPoint(-1.5F, 15F, -3F); WingBaseR.setTextureSize(64, 32); WingBaseR.mirror = true; setRotation(WingBaseR, 0F, 0F, 0.7853982F); - + WingRA = new ModelRenderer(this, 26, 0); WingRA.addBox(0F, -0.5F, 0F, 0, 1, 8); WingRA.setRotationPoint(-1.5F, 15F, -3.2F); WingRA.setTextureSize(64, 32); WingRA.mirror = true; setRotation(WingRA, 0.9250245F, 0F, -0.2617994F); - + WingLA = new ModelRenderer(this, 26, 0); WingLA.addBox(0F, -0.5F, 0F, 0, 1, 8); WingLA.setRotationPoint(1.5F, 15F, -3.2F); WingLA.setTextureSize(64, 32); WingLA.mirror = true; setRotation(WingLA, 0.9250245F, 0F, 0.2617994F); - + WingRB = new ModelRenderer(this, 26, 0); WingRB.addBox(0F, -0.5F, 0F, 0, 1, 8); WingRB.setRotationPoint(-1.5F, 15F, -3.2F); WingRB.setTextureSize(64, 32); WingRB.mirror = true; setRotation(WingRB, 0.6806784F, 0F, -0.6806784F); - + WingLB = new ModelRenderer(this, 26, 0); WingLB.addBox(0F, -0.5F, 0F, 0, 1, 8); WingLB.setRotationPoint(1.5F, 15F, -3.2F); @@ -149,11 +149,10 @@ public ModelVescavor() { WingLB.mirror = true; setRotation(WingLB, 0.6806784F, 0F, 0.6806784F); } - - + + @Override - public void render(Entity entity, float f, float f1, float - f2, float f3, float f4, float f5) { + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5); head.render(f5); @@ -174,26 +173,25 @@ public void render(Entity entity, float f, float f1, float WingRB.render(f5); WingLB.render(f5); } - - + + private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } - - - public void setRotationAngles(float f, float f1, - float f2, float f3, float f4, float f5) { + + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { //super.setRotationAngles(f, f1, f2, f3, f4, f5); - + LLegFront.rotateAngleZ = 0.3490659F - MathHelper.cos(f * 0.7662F) * 1.4F * f1; LLegMid.rotateAngleZ = 0.3490659F + MathHelper.cos(f * 0.7662F) * 1.4F * f1; LLegRear.rotateAngleZ = 0.3490659F - MathHelper.cos(f * 0.7662F) * 1.4F * f1; - + RLegFront.rotateAngleZ = -0.3490659F + MathHelper.cos(f * 0.7662F) * 1.4F * f1; RLegMid.rotateAngleZ = -0.3490659F - MathHelper.cos(f * 0.7662F) * 1.4F * f1; RLegRear.rotateAngleZ = -0.3490659F + MathHelper.cos(f * 0.7662F) * 1.4F * f1; } - + } diff --git a/src/main/java/com/gw/dm/network/ConfusionPacketHandler.java b/src/main/java/com/gw/dm/network/ConfusionPacketHandler.java index 0812e84..f4ccba9 100644 --- a/src/main/java/com/gw/dm/network/ConfusionPacketHandler.java +++ b/src/main/java/com/gw/dm/network/ConfusionPacketHandler.java @@ -11,7 +11,8 @@ public class ConfusionPacketHandler implements IMessageHandler duration) { + setDead(); + } + } + @Override public void writeEntityToNBT(NBTTagCompound compound) { super.writeEntityToNBT(compound); compound.setInteger("Duration", duration); compound.setInteger("FireAge", age); } - - + @Override public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); duration = compound.getInteger("Duration"); age = compound.getInteger("FireAge"); } - - - @Override - public void onUpdate() { - super.onUpdate(); - if (++age > duration) { - setDead(); - } - } } diff --git a/src/main/java/com/gw/dm/projectile/EntityCloudGenerator.java b/src/main/java/com/gw/dm/projectile/EntityCloudGenerator.java index bc83d05..320bff3 100644 --- a/src/main/java/com/gw/dm/projectile/EntityCloudGenerator.java +++ b/src/main/java/com/gw/dm/projectile/EntityCloudGenerator.java @@ -17,8 +17,8 @@ public class EntityCloudGenerator extends EntityThrowable { private int duration; // Time to live private int age; private double sx, sy, sz; - - + + public EntityCloudGenerator(World worldIn, EntityLivingBase thrower, PotionEffect effect) { super(worldIn, thrower); type = effect; @@ -29,15 +29,29 @@ public EntityCloudGenerator(World worldIn, EntityLivingBase thrower, PotionEffec sy = posY; sz = posZ; } - - + + @Override + public void onUpdate() { + if (!world.isRemote) { + spawnGas(); + } + if ((traveled() > RANGE) || (++age > duration)) { + setDead(); + } + super.onUpdate(); + } + + @Override + public float getGravityVelocity() { + return 0.0f; + } + @Override protected void onImpact(RayTraceResult result) { spawnAreaEffectCloud(); setDead(); } - - + @Override public void writeEntityToNBT(NBTTagCompound compound) { super.writeEntityToNBT(compound); @@ -49,8 +63,7 @@ public void writeEntityToNBT(NBTTagCompound compound) { compound.setDouble("startY", sy); compound.setDouble("startZ", sz); } - - + @Override public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); @@ -61,23 +74,9 @@ public void readEntityFromNBT(NBTTagCompound compound) { sy = compound.getDouble("startY"); sz = compound.getDouble("startZ"); } - - - @Override - public void onUpdate() { - if (!world.isRemote) { - spawnGas(); - } - if ((traveled() > RANGE) || (++age > duration)) { - setDead(); - } - super.onUpdate(); - } - - + private void spawnAreaEffectCloud() { - EntityAreaEffectCloud droppedCloud - = new EntityAreaEffectCloud(world, posX, posY, posZ); + EntityAreaEffectCloud droppedCloud = new EntityAreaEffectCloud(world, posX, posY, posZ); float powerLeft = (float) (1.0f - (traveled() / RANGE)); droppedCloud.setOwner(getThrower()); droppedCloud.setDuration(duration - age); @@ -88,11 +87,9 @@ private void spawnAreaEffectCloud() { droppedCloud.addEffect(new PotionEffect(type.getPotion(), type.getDuration(), type.getAmplifier())); world.spawnEntity(droppedCloud); } - - + private void spawnGas() { - EntityAreaEffectCloud tempCloud - = new EntityAreaEffectCloud(world, posX, posY, posZ); + EntityAreaEffectCloud tempCloud = new EntityAreaEffectCloud(world, posX, posY, posZ); tempCloud.setOwner(getThrower()); tempCloud.setDuration(10); tempCloud.setRadius(2.5f); @@ -102,34 +99,27 @@ private void spawnGas() { tempCloud.addEffect(new PotionEffect(type.getPotion(), type.getDuration(), type.getAmplifier())); world.spawnEntity(tempCloud); } - - - @Override - public float getGravityVelocity() { - return 0.0f; - } - - + private double traveled() { return ((posX - sx) * (posX - sx)) + ((posY - sy) * (posY - sx)) + ((posZ - sz) * (posZ - sz)); } - - + + @Override public boolean hasNoGravity() { return true; } - - + + @Override public boolean isInWater() { return false; } - - + + @Override public boolean canBePushed() { return false; } - + } diff --git a/src/main/java/com/gw/dm/projectile/EntityEldermobBall.java b/src/main/java/com/gw/dm/projectile/EntityEldermobBall.java index d67f14b..780c153 100644 --- a/src/main/java/com/gw/dm/projectile/EntityEldermobBall.java +++ b/src/main/java/com/gw/dm/projectile/EntityEldermobBall.java @@ -1,7 +1,6 @@ package com.gw.dm.projectile; import com.gw.dm.util.ConfigHandler; - import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.nbt.NBTTagCompound; @@ -13,96 +12,86 @@ public class EntityEldermobBall extends EntityThrowable { private int age; - - + + public EntityEldermobBall(World worldIn) { super(worldIn); age = 0; } - - + + public EntityEldermobBall(World worldIn, double x, double y, double z) { super(worldIn, x, y, z); age = 0; } - - + + public EntityEldermobBall(World world, EntityLivingBase thrower) { super(world, thrower); age = 0; } - - + + @Override + public void onUpdate() { + age++; + if ((age >= 72) && world.isRemote) { + world.newExplosion(this, posX, posY, posZ, 1, false, false); + this.setDead(); + } + super.onUpdate(); + } + + @Override + public float getGravityVelocity() { + return 0.0f; + } + @Override protected void onImpact(RayTraceResult result) { if (!world.isRemote) { if (result.entityHit instanceof EntityLivingBase) { // No longer checking for null thrower -- that should never happen! EntityLivingBase entity = (EntityLivingBase) result.entityHit; - entity.attackEntityFrom(DamageSource.causeMobDamage(getThrower()) - .setDifficultyScaled() - .setProjectile(), 6.0f + - (6.0f * ConfigHandler.damagex) + ConfigHandler.damageplus); + entity.attackEntityFrom(DamageSource.causeMobDamage(getThrower()).setDifficultyScaled().setProjectile(), 6.0f + (6.0f * ConfigHandler.damagex) + ConfigHandler.damageplus); world.newExplosion(this, posX, posY, posZ, 1, false, true); } setDead(); } - - } - - - @Override - public float getGravityVelocity() { - return 0.0f; + } - - - @Override - public void onUpdate() { - age++; - if ((age >= 72) && world.isRemote) { - world.newExplosion(this, posX, posY, posZ, 1, false, false); - this.setDead(); - } - super.onUpdate(); - } - - + @Override public void writeEntityToNBT(NBTTagCompound compound) { super.writeEntityToNBT(compound); compound.setInteger("Age", age); } - - + + @Override public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); age = compound.getInteger("Age"); } - - + + public float getBrightness(float partialTicks) { return 1.0f; } - - - @SideOnly(Side.CLIENT) - @Override - public int getBrightnessForRender() { - return 0xf000f0; - } - - + @Override public boolean hasNoGravity() { return true; } - - + @Override public boolean isInWater() { return false; } - + + @SideOnly(Side.CLIENT) + @Override + public int getBrightnessForRender() { + return 0xf000f0; + } + } diff --git a/src/main/java/com/gw/dm/projectile/EntityEyeRay.java b/src/main/java/com/gw/dm/projectile/EntityEyeRay.java index 37a5ef0..c4bbd1c 100644 --- a/src/main/java/com/gw/dm/projectile/EntityEyeRay.java +++ b/src/main/java/com/gw/dm/projectile/EntityEyeRay.java @@ -13,8 +13,8 @@ public class EntityEyeRay extends EntityThrowable { PotionEffect[] myEffect; private int age; private double sx, sy, sz; - - + + public EntityEyeRay(World worldIn) { super(worldIn); sx = posX; @@ -22,8 +22,8 @@ public EntityEyeRay(World worldIn) { sz = posZ; age = 0; } - - + + public EntityEyeRay(World worldIn, EntityLivingBase throwerIn) { super(worldIn, throwerIn); sx = posX; @@ -31,8 +31,8 @@ public EntityEyeRay(World worldIn, EntityLivingBase throwerIn) { sz = posZ; age = 0; } - - + + public EntityEyeRay(World worldIn, double x, double y, double z) { super(worldIn, x, y, z); sx = posX; @@ -40,18 +40,35 @@ public EntityEyeRay(World worldIn, double x, double y, double z) { sz = posZ; age = 0; } - - + + public void setEffects(PotionEffect[] effs) { myEffect = effs; } - - + + public void setEffects(PotionEffect eff) { myEffect = new PotionEffect[]{eff}; } - - + + @Override + public boolean isInWater() { + return false; + } + + @Override + public void onUpdate() { + if ((traveled() > RANGE) || (++age > 100)) { + setDead(); + } + super.onUpdate(); + } + + @Override + protected float getGravityVelocity() { + return 0.0f; + } + @Override protected void onImpact(RayTraceResult result) { if (myEffect != null) { @@ -65,31 +82,9 @@ protected void onImpact(RayTraceResult result) { } } } - - - @Override - public boolean isInWater() { - return false; - } - - - @Override - protected float getGravityVelocity() { - return 0.0f; - } - - - @Override - public void onUpdate() { - if ((traveled() > RANGE) || (++age > 100)) { - setDead(); - } - super.onUpdate(); - } - - + private double traveled() { return ((posX - sx) * (posX - sx)) + ((posY - sy) * (posY - sx)) + ((posZ - sz) * (posZ - sz)); } - + } diff --git a/src/main/java/com/gw/dm/projectile/EntityFireCloudGenerator.java b/src/main/java/com/gw/dm/projectile/EntityFireCloudGenerator.java index 1f86651..fd12e79 100644 --- a/src/main/java/com/gw/dm/projectile/EntityFireCloudGenerator.java +++ b/src/main/java/com/gw/dm/projectile/EntityFireCloudGenerator.java @@ -15,8 +15,8 @@ public class EntityFireCloudGenerator extends EntityThrowable { private int duration; // Time to live private int age; private double sx, sy, sz; - - + + public EntityFireCloudGenerator(World worldIn, EntityLivingBase throwerIn) { super(worldIn, throwerIn); duration = 120; @@ -25,8 +25,29 @@ public EntityFireCloudGenerator(World worldIn, EntityLivingBase throwerIn) { sy = posY; sz = posZ; } - - + + @Override + public void onUpdate() { + if (!world.isRemote) { + spawnCloud(); + } + if ((traveled() > RANGE) || isInWater() || (++age > duration)) { + setDead(); + } + super.onUpdate(); + } + + @Override + public float getGravityVelocity() { + return 0.0f; + } + + @Override + protected void onImpact(RayTraceResult result) { + spawnCloud(); + setDead(); + } + @Override public void writeEntityToNBT(NBTTagCompound compound) { super.writeEntityToNBT(compound); @@ -36,8 +57,7 @@ public void writeEntityToNBT(NBTTagCompound compound) { compound.setDouble("startY", sy); compound.setDouble("startZ", sz); } - - + @Override public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); @@ -47,27 +67,7 @@ public void readEntityFromNBT(NBTTagCompound compound) { sy = compound.getDouble("startY"); sz = compound.getDouble("startZ"); } - - - @Override - protected void onImpact(RayTraceResult result) { - spawnCloud(); - setDead(); - } - - - @Override - public void onUpdate() { - if (!world.isRemote) { - spawnCloud(); - } - if ((traveled() > RANGE) || isInWater() || (++age > duration)) { - setDead(); - } - super.onUpdate(); - } - - + private void spawnCloud() { for (int i = 0; i < NUM; i++) { float hangle = rand.nextFloat() * TWOPI; @@ -77,37 +77,26 @@ private void spawnCloud() { double x = (posX + (dist * vcos * MathHelper.sin(hangle))); double y = (posY + (dist * MathHelper.sin(vangle))); double z = (posZ + (dist * vcos * MathHelper.cos(hangle))); - EntityBurningFireParticloid particle - = new EntityBurningFireParticloid(world, x, y, z, - (rand.nextDouble() - 0.5d) * 0.02d, - (rand.nextDouble() * 0.03d) + 0.01d, - (rand.nextDouble() - 0.5d) * 0.02d); + EntityBurningFireParticloid particle = new EntityBurningFireParticloid(world, x, y, z, (rand.nextDouble() - 0.5d) * 0.02d, (rand.nextDouble() * 0.03d) + 0.01d, (rand.nextDouble() - 0.5d) * 0.02d); //System.out.println("Spawning fire at " + x + ", " + y + ", " + z); world.spawnEntity(particle); } } - - - @Override - public float getGravityVelocity() { - return 0.0f; - } - - + private double traveled() { return ((posX - sx) * (posX - sx)) + ((posY - sy) * (posY - sx)) + ((posZ - sz) * (posZ - sz)); } - - + + @Override public boolean hasNoGravity() { return true; } - - + + @Override public boolean canBePushed() { return false; } - + } diff --git a/src/main/java/com/gw/dm/projectile/EntityLightball.java b/src/main/java/com/gw/dm/projectile/EntityLightball.java index 061929d..adceb5e 100644 --- a/src/main/java/com/gw/dm/projectile/EntityLightball.java +++ b/src/main/java/com/gw/dm/projectile/EntityLightball.java @@ -1,5 +1,7 @@ package com.gw.dm.projectile; +import com.gw.dm.DungeonMobsDamageSource; +import com.gw.dm.util.ConfigHandler; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; @@ -7,46 +9,64 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.SoundCategory; -import net.minecraft.util.SoundEvent; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import com.gw.dm.DungeonMobsDamageSource; -import com.gw.dm.util.ConfigHandler; - public class EntityLightball extends EntityThrowable { public static final DamageSource LIGHT_BALL = DungeonMobsDamageSource.LIGHT_BALL; private int age; - + public EntityLightball(World worldIn) { super(worldIn); age = 0; } - - + + public EntityLightball(World worldIn, double x, double y, double z) { super(worldIn, x, y, z); age = 0; } - - + + public EntityLightball(World world, EntityLivingBase thrower) { super(world, thrower); age = 0; } - - + + private boolean damageable(EntityLivingBase entity) { + boolean out = entity.getIsInvulnerable() || entity.world.isRemote || (entity.getHealth() <= 0.0); + if (entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entity; + out = out || player.isCreative(); + } + return !out; + } + + @Override + public void onUpdate() { + age++; + if ((age >= 72) && world.isRemote) { + world.newExplosion(this, posX, posY, posZ, 1, false, false); + this.setDead(); + } + super.onUpdate(); + } + + @Override + public float getGravityVelocity() { + return 0.0f; + } + @Override protected void onImpact(RayTraceResult result) { if (!world.isRemote) { if (result.entityHit instanceof EntityLivingBase) { EntityLivingBase entity = (EntityLivingBase) result.entityHit; - float dmg = ConfigHandler.damagex - + (ConfigHandler.damageplus / 5.0f); - if(entity instanceof EntityPlayer) { - switch(world.getDifficulty()) { + float dmg = ConfigHandler.damagex + (ConfigHandler.damageplus / 5.0f); + if (entity instanceof EntityPlayer) { + switch (world.getDifficulty()) { case EASY: dmg *= 0.5; break; @@ -58,90 +78,54 @@ protected void onImpact(RayTraceResult result) { break; case HARD: default: - break; + break; } } // First, do some armor piercing damage - if(damageable(entity)) { + if (damageable(entity)) { entity.setHealth(entity.getHealth() - dmg); - if(entity.getHealth() <= 0.0F) { - entity.onDeath(DungeonMobsDamageSource.LIGHT_BALL - .causeMobDamage(getThrower())); - } - } + if (entity.getHealth() <= 0.0F) { + entity.onDeath(DungeonMobsDamageSource.LIGHT_BALL.causeMobDamage(getThrower())); + } + } // Then do some normal damage // This is what the explosion was used as a stand-in for - entity.attackEntityFrom(DungeonMobsDamageSource.LIGHT_BALL - .causeMobDamage(getThrower()), dmg); + entity.attackEntityFrom(DungeonMobsDamageSource.LIGHT_BALL.causeMobDamage(getThrower()), dmg); } - world.playSound((EntityPlayer)null, this.posX, this.posY, this.posZ, - SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, - 4.0F, (1.0F + (this.world.rand.nextFloat() - - world.rand.nextFloat()) * 0.2F) * 0.7F); + world.playSound((EntityPlayer) null, this.posX, this.posY, this.posZ, SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, 4.0F, (1.0F + (this.world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); setDead(); } - + } - - private boolean damageable(EntityLivingBase entity) { - boolean out = entity.getIsInvulnerable() || entity.world.isRemote || (entity.getHealth() <= 0.0); - if(entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)entity; - out = out || player.isCreative(); - } - return !out; - } - - - @Override - public float getGravityVelocity() { - return 0.0f; - } - - - @Override - public void onUpdate() { - age++; - if ((age >= 72) && world.isRemote) { - world.newExplosion(this, posX, posY, posZ, 1, false, false); - this.setDead(); - } - super.onUpdate(); - } - - @Override public void writeEntityToNBT(NBTTagCompound compound) { super.writeEntityToNBT(compound); compound.setInteger("Age", age); } - - + + @Override public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); age = compound.getInteger("Age"); } - - - @SideOnly(Side.CLIENT) - @Override - public int getBrightnessForRender() { - return 0xf000f0; - } - - + @Override public boolean hasNoGravity() { return true; } - - + @Override public boolean isInWater() { return false; } - - + + @SideOnly(Side.CLIENT) + @Override + public int getBrightnessForRender() { + return 0xf000f0; + } + + } diff --git a/src/main/java/com/gw/dm/projectile/EntityMagicMissile.java b/src/main/java/com/gw/dm/projectile/EntityMagicMissile.java index ee42473..10f4672 100644 --- a/src/main/java/com/gw/dm/projectile/EntityMagicMissile.java +++ b/src/main/java/com/gw/dm/projectile/EntityMagicMissile.java @@ -15,23 +15,23 @@ public class EntityMagicMissile extends EntityArrow { private int potionLevel = 2; private int age = 0; - - + + public EntityMagicMissile(World worldIn) { super(worldIn); } - - + + public EntityMagicMissile(World worldIn, double x, double y, double z) { super(worldIn, x, y, z); } - - + + public EntityMagicMissile(World worldIn, EntityLivingBase entity, int level) { super(worldIn, entity); potionLevel = level; } - + @Override public void onUpdate() { if (age++ > 100) { @@ -39,73 +39,64 @@ public void onUpdate() { } super.onUpdate(); } - - + + @Override protected void onHit(RayTraceResult var1) { if (!world.isRemote) { if (var1.entityHit != null && (var1.entityHit instanceof EntityLivingBase)) { EntityLivingBase foo = (EntityLivingBase) var1.entityHit; - if(foo.isEntityUndead()) { - foo.addPotionEffect(new PotionEffect(Potion - .getPotionFromResourceLocation("instant_health"), 1, potionLevel)); - } else { - foo.addPotionEffect(new PotionEffect(Potion - .getPotionFromResourceLocation("instant_damage"), 1, potionLevel)); + if (foo.isEntityUndead()) { + foo.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("instant_health"), 1, potionLevel)); + } + else { + foo.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("instant_damage"), 1, potionLevel)); } } } setDead(); } - - + @Override - protected ItemStack getArrowStack() { - return null; + public void writeEntityToNBT(NBTTagCompound compound) { + compound.setInteger("livecounter", age); + super.writeEntityToNBT(compound); } - - + @Override - public boolean isInWater() { - return false; + public void readEntityFromNBT(NBTTagCompound compound) { + age = compound.getInteger("livecounter"); + super.readEntityFromNBT(compound); } - - + @Override - public boolean isGlowing() { - return true; + protected ItemStack getArrowStack() { + return null; } - - + @Override public boolean isSilent() { return true; } - - + + @Override + public boolean isInWater() { + return false; + } + @Override public boolean isInLava() { return false; } - - + @SideOnly(Side.CLIENT) @Override public int getBrightnessForRender() { return 0xf000f0; } - - + @Override - public void writeEntityToNBT(NBTTagCompound compound) { - compound.setInteger("livecounter", age); - super.writeEntityToNBT(compound); - } - - - @Override - public void readEntityFromNBT(NBTTagCompound compound) { - age = compound.getInteger("livecounter"); - super.readEntityFromNBT(compound); + public boolean isGlowing() { + return true; } } \ No newline at end of file diff --git a/src/main/java/com/gw/dm/projectile/EntitySonicBoom.java b/src/main/java/com/gw/dm/projectile/EntitySonicBoom.java index 0ace0b7..9760349 100644 --- a/src/main/java/com/gw/dm/projectile/EntitySonicBoom.java +++ b/src/main/java/com/gw/dm/projectile/EntitySonicBoom.java @@ -38,14 +38,11 @@ public EntitySonicBoom(World par1World) { } - public EntitySonicBoom(World par1World, - EntityLiving par2EntityLiving, double ax, double ay, double az) { + public EntitySonicBoom(World par1World, EntityLiving par2EntityLiving, double ax, double ay, double az) { super(par1World); shootingEntity = par2EntityLiving; setSize(1.0F, 1.0F); - setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + 1, - par2EntityLiving.posZ, par2EntityLiving.rotationYaw, - par2EntityLiving.rotationPitch); + setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + 1, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); setPosition(posX, posY, posZ); motionX = motionY = motionZ = 0.0D; ax += rand.nextGaussian() * 0.4D; @@ -78,25 +75,43 @@ protected float getMotionFactor() { return 0.8F; } + @SideOnly(Side.CLIENT) + public float getShadowSize() { + return 0.0F; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float par1) { + return 1.0F; + } @SideOnly(Side.CLIENT) - public boolean isInRangeToRenderDist(double par1) { - return false; + public int getBrightnessForRender(float par1) { + return 15728880; } + @Override + protected void entityInit() { + } + + @Override + public void setDead() { + super.setDead(); + } @Override public void onUpdate() { world.spawnParticle(EnumParticleTypes.SPELL, posX, posY, posZ, 1.0d, 1.0d, 1.0d); ++ticksAlive; - if (ticksAlive % 50 == 0) - onImpact(false); + if (ticksAlive % 50 == 0) onImpact(false); - if (!world.isRemote && (shootingEntity != null && shootingEntity.isDead - || !world.isAirBlock(new BlockPos(posX, posY, posZ)))) { + if (!world.isRemote && (shootingEntity != null && shootingEntity.isDead || !world.isAirBlock(new BlockPos(posX, posY, posZ)))) { setDead(); - } else if (!isDead) { + } + else if (!isDead) { super.onUpdate(); if (inGround) { @@ -114,7 +129,8 @@ public void onUpdate() { motionZ *= (double) (rand.nextFloat() * 0.2F); ticksAlive = 0; ticksInAir = 0; - } else { + } + else { ++ticksInAir; } @@ -129,23 +145,15 @@ public void onUpdate() { } Entity var4 = null; - List var5 = world.getEntitiesWithinAABBExcludingEntity(this, - getEntityBoundingBox().offset(motionX, motionY, motionZ) - .expand(1.0D, 1.0D, 1.0D)); + List var5 = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().offset(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); double var6 = 0.0D; for (int var8 = 0; var8 < var5.size(); ++var8) { Entity var9 = (Entity) var5.get(var8); - if (var9.canBeCollidedWith() - && !var9.isEntityEqual(shootingEntity) - && !(var9 instanceof EntityDestrachan) - && !(var9 instanceof EntityArrow) - && !(var9 instanceof EntityThrowable) - && !(var9 instanceof EntityEyeRay)) { + if (var9.canBeCollidedWith() && !var9.isEntityEqual(shootingEntity) && !(var9 instanceof EntityDestrachan) && !(var9 instanceof EntityArrow) && !(var9 instanceof EntityThrowable) && !(var9 instanceof EntityEyeRay)) { float var10 = 0.3F; - AxisAlignedBB var11 = var9.getEntityBoundingBox() - .expand(var10, var10, var10); + AxisAlignedBB var11 = var9.getEntityBoundingBox().expand(var10, var10, var10); RayTraceResult var12 = var11.calculateIntercept(var15, var2); if (var12 != null) { @@ -171,13 +179,9 @@ public void onUpdate() { posY += motionY; posZ += motionZ; float var16 = MathHelper.sqrt(motionX * motionX + motionZ * motionZ); - rotationYaw = (float) (Math.atan2(motionZ, motionX) - * 180.0D / Math.PI) + 90.0F; + rotationYaw = (float) (Math.atan2(motionZ, motionX) * 180.0D / Math.PI) + 90.0F; - for (rotationPitch = (float) (Math.atan2((double) var16, motionY) - * 180.0D / Math.PI) - 90.0F; - rotationPitch - prevRotationPitch < -180.0F; - prevRotationPitch -= 360.0F) { + for (rotationPitch = (float) (Math.atan2((double) var16, motionY) * 180.0D / Math.PI) - 90.0F; rotationPitch - prevRotationPitch < -180.0F; prevRotationPitch -= 360.0F) { } while (rotationPitch - prevRotationPitch >= 180.0F) { @@ -199,11 +203,7 @@ public void onUpdate() { if (isInWater()) { for (int var19 = 0; var19 < 4; ++var19) { float var18 = 0.25F; - world.spawnParticle(EnumParticleTypes.WATER_BUBBLE, posX - - motionX * (double) var18, posY - - motionY * (double) var18, posZ - - motionZ * (double) var18, - motionX, motionY, motionZ); + world.spawnParticle(EnumParticleTypes.WATER_BUBBLE, posX - motionX * (double) var18, posY - motionY * (double) var18, posZ - motionZ * (double) var18, motionX, motionY, motionZ); } var17 = 0.8F; } @@ -218,18 +218,15 @@ public void onUpdate() { } } - - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setShort("xTile", (short) xTile); - par1NBTTagCompound.setShort("yTile", (short) yTile); - par1NBTTagCompound.setShort("zTile", (short) zTile); - par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", newDoubleNBTList(new double[]{motionX, motionY, motionZ})); - par1NBTTagCompound.setInteger("explosionCount", explodeCount); - par1NBTTagCompound.setInteger("lastExplode", lastExplosionTick); - par1NBTTagCompound.setInteger("ticksAlive", ticksAlive); + @Override + public boolean canBeCollidedWith() { + return false; } + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double par1) { + return false; + } @Override public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { @@ -243,7 +240,8 @@ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { motionX = var2.getDoubleAt(0); motionY = var2.getDoubleAt(1); motionZ = var2.getDoubleAt(2); - } else { + } + else { setDead(); } @@ -252,45 +250,18 @@ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ticksAlive = par1NBTTagCompound.getInteger("ticksAlive"); } - - @Override - public boolean canBeCollidedWith() { - return false; + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + par1NBTTagCompound.setShort("xTile", (short) xTile); + par1NBTTagCompound.setShort("yTile", (short) yTile); + par1NBTTagCompound.setShort("zTile", (short) zTile); + par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0)); + par1NBTTagCompound.setTag("direction", newDoubleNBTList(new double[]{motionX, motionY, motionZ})); + par1NBTTagCompound.setInteger("explosionCount", explodeCount); + par1NBTTagCompound.setInteger("lastExplode", lastExplosionTick); + par1NBTTagCompound.setInteger("ticksAlive", ticksAlive); } - public float getCollisionBorderSize() { return 1.0F; } - - - @SideOnly(Side.CLIENT) - public float getShadowSize() { - return 0.0F; - } - - - /** - * Gets how bright this entity is. - */ - public float getBrightness(float par1) { - return 1.0F; - } - - - @SideOnly(Side.CLIENT) - public int getBrightnessForRender(float par1) { - return 15728880; - } - - - @Override - protected void entityInit() { - } - - - @Override - public void setDead() { - super.setDead(); - } } diff --git a/src/main/java/com/gw/dm/proxy/ClientProxy.java b/src/main/java/com/gw/dm/proxy/ClientProxy.java index 54c778f..3dd140d 100644 --- a/src/main/java/com/gw/dm/proxy/ClientProxy.java +++ b/src/main/java/com/gw/dm/proxy/ClientProxy.java @@ -1,7 +1,16 @@ package com.gw.dm.proxy; -import java.util.Collection; - +import com.gw.dm.DungeonMobs; +import com.gw.dm.entity.*; +import com.gw.dm.model.*; +import com.gw.dm.projectile.EntityEldermobBall; +import com.gw.dm.projectile.EntityEyeRay; +import com.gw.dm.projectile.EntityLightball; +import com.gw.dm.projectile.EntityMagicMissile; +import com.gw.dm.render.*; +import com.gw.dm.util.DungeonMobsHelper; +import com.gw.dm.util.InputConfusedMovement; +import com.gw.dm.util.MiscRegistrar; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.model.ModelBiped; @@ -22,122 +31,43 @@ import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import net.minecraftforge.fml.relauncher.Side; -import com.gw.dm.DungeonMobs; -import com.gw.dm.entity.EntityAhriman; -import com.gw.dm.entity.EntityBladeTrap; -import com.gw.dm.entity.EntityCaveFisher; -import com.gw.dm.entity.EntityCockatrice; -import com.gw.dm.entity.EntityDestrachan; -import com.gw.dm.entity.EntityEldermob; -import com.gw.dm.entity.EntityFallenAngel; -import com.gw.dm.entity.EntityGhost; -import com.gw.dm.entity.EntityGhoul; -import com.gw.dm.entity.EntityHookHorror; -import com.gw.dm.entity.EntityIllithid; -import com.gw.dm.entity.EntityLizalfos; -import com.gw.dm.entity.EntityManticore; -import com.gw.dm.entity.EntityNetherHound; -import com.gw.dm.entity.EntityPetrified; -import com.gw.dm.entity.EntityRakshasa; -import com.gw.dm.entity.EntityRakshasaImage; -import com.gw.dm.entity.EntityRevenant; -import com.gw.dm.entity.EntityRustMonster; -import com.gw.dm.entity.EntityShrieker; -import com.gw.dm.entity.EntityThoqqua; -import com.gw.dm.entity.EntityTroll; -import com.gw.dm.entity.EntityUmberHulk; -import com.gw.dm.entity.EntityVampire; -import com.gw.dm.entity.EntityVescavor; -import com.gw.dm.model.ModelAhriman; -import com.gw.dm.model.ModelBladeTrap; -import com.gw.dm.model.ModelCaveFisher; -import com.gw.dm.model.ModelCockatrice; -import com.gw.dm.model.ModelDestrachan; -import com.gw.dm.model.ModelEldermob; -import com.gw.dm.model.ModelFallenAngel; -import com.gw.dm.model.ModelGhoul; -import com.gw.dm.model.ModelHookHorror; -import com.gw.dm.model.ModelIllithid; -import com.gw.dm.model.ModelLizalfos; -import com.gw.dm.model.ModelManticore; -import com.gw.dm.model.ModelNetherHound; -import com.gw.dm.model.ModelPetrified; -import com.gw.dm.model.ModelRakshasa; -import com.gw.dm.model.ModelRustMonster; -import com.gw.dm.model.ModelShrieker; -import com.gw.dm.model.ModelThoqqua; -import com.gw.dm.model.ModelTroll; -import com.gw.dm.model.ModelUmberHulk; -import com.gw.dm.model.ModelVescavor; -import com.gw.dm.projectile.EntityEldermobBall; -import com.gw.dm.projectile.EntityEyeRay; -import com.gw.dm.projectile.EntityLightball; -import com.gw.dm.projectile.EntityMagicMissile; -import com.gw.dm.render.RenderAhriman; -import com.gw.dm.render.RenderBladeTrapEntity; -import com.gw.dm.render.RenderCaveFisher; -import com.gw.dm.render.RenderCockatrice; -import com.gw.dm.render.RenderDestrachan; -import com.gw.dm.render.RenderEldermob; -import com.gw.dm.render.RenderFallenAngel; -import com.gw.dm.render.RenderGhost; -import com.gw.dm.render.RenderGhoul; -import com.gw.dm.render.RenderHookHorror; -import com.gw.dm.render.RenderIllithid; -import com.gw.dm.render.RenderLizalfos; -import com.gw.dm.render.RenderMagicMissile; -import com.gw.dm.render.RenderManticore; -import com.gw.dm.render.RenderNetherHound; -import com.gw.dm.render.RenderPetrified; -import com.gw.dm.render.RenderProjectile; -import com.gw.dm.render.RenderRakshasa; -import com.gw.dm.render.RenderRustMonster; -import com.gw.dm.render.RenderShrieker; -import com.gw.dm.render.RenderThoqqua; -import com.gw.dm.render.RenderTroll; -import com.gw.dm.render.RenderUmberHulk; -import com.gw.dm.render.RenderVampire; -import com.gw.dm.render.RenderVescavor; -import com.gw.dm.util.DungeonMobsHelper; -import com.gw.dm.util.InputConfusedMovement; -import com.gw.dm.util.MiscRegistrar; +import java.util.Collection; //import com.gw.dm.render.RenderBladeTrapBlock; @Mod.EventBusSubscriber(Side.CLIENT) public class ClientProxy extends CommonProxy { - + static InputConfusedMovement confusedMovementInput; - + @SubscribeEvent public static void doStuff(ClientTickEvent event) { - + EntityPlayerSP player = Minecraft.getMinecraft().player; - + if (player != null) { if (isAddled(player)) { if (!(player.movementInput instanceof InputConfusedMovement)) { - confusedMovementInput - = new InputConfusedMovement(player.movementInput); - + confusedMovementInput = new InputConfusedMovement(player.movementInput); + int foo = DungeonMobsHelper.getDifficulty(player.world); confusedMovementInput.setConfValue(foo); - + confusedMovementInput.randomize(); player.movementInput = confusedMovementInput; confusedMovementInput.setConfusion(true); - } else { + } + else { confusedMovementInput.setConfusion(true); - if (player.ticksExisted % 40 == 0) - confusedMovementInput.randomize(); + if (player.ticksExisted % 40 == 0) confusedMovementInput.randomize(); } - - } else if (player.movementInput instanceof InputConfusedMovement) - confusedMovementInput.setConfusion(false); + + } + else if (player.movementInput instanceof InputConfusedMovement) confusedMovementInput.setConfusion(false); } } - - + + private static boolean isAddled(EntityPlayer player) { Collection effects = player.getActivePotionEffects(); for (PotionEffect eff : effects) { @@ -147,255 +77,190 @@ private static boolean isAddled(EntityPlayer player) { } return false; } - - + + @Override public void registerRenders() { - RenderingRegistry.registerEntityRenderingHandler(EntityGhoul.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderGhoul(manager, new ModelGhoul(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityAhriman.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderAhriman(manager, new ModelAhriman(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityEyeRay.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderProjectile(manager, 0.5f, - new ResourceLocation(DungeonMobs.MODID, - "textures/entity/eyeray.png")); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityTroll.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderTroll(manager, new ModelTroll(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityManticore.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderManticore(manager, new ModelManticore(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityVampire.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderVampire(manager, new ModelBiped(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityRevenant.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderZombie(manager); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityHookHorror.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderHookHorror(manager, new ModelHookHorror(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityDestrachan.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderDestrachan(manager, new ModelDestrachan(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityCaveFisher.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderCaveFisher(manager, new ModelCaveFisher(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityNetherHound.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderNetherHound(manager, new ModelNetherHound(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityRustMonster.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderRustMonster(manager, new ModelRustMonster(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityUmberHulk.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderUmberHulk(manager, new ModelUmberHulk(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityPetrified.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderPetrified(manager, new ModelPetrified(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityCockatrice.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderCockatrice(manager, new ModelCockatrice(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityShrieker.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderShrieker(manager, new ModelShrieker(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityThoqqua.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderThoqqua(manager, new ModelThoqqua(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityVescavor.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderVescavor(manager, new ModelVescavor(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityIllithid.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderIllithid(manager, new ModelIllithid(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityRakshasa.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderRakshasa(manager, new ModelRakshasa(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityMagicMissile.class, - new IRenderFactory() { - @Override - public RenderMagicMissile createRenderFor( - RenderManager manager) { - return new RenderMagicMissile(manager); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityRakshasaImage.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderRakshasa(manager, new ModelRakshasa(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityLightball.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderProjectile(manager, 0.5f, - new ResourceLocation(DungeonMobs.MODID, - "textures/entity/lightball.png")); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityFallenAngel.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderFallenAngel(manager, new ModelFallenAngel(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityLizalfos.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderLizalfos(manager, new ModelLizalfos(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityEldermob.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderEldermob(manager, new ModelEldermob(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityEldermobBall.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderProjectile(manager, 0.5f, - new ResourceLocation(DungeonMobs.MODID, - "textures/entity/eldermobball.png")); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityBladeTrap.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderBladeTrapEntity(manager, new ModelBladeTrap(), 0.5f); - } - }); - RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, - new IRenderFactory() { - @Override - public Render createRenderFor( - RenderManager manager) { - return new RenderGhost(manager, new ModelBiped(), 0.5f); - } - }); + RenderingRegistry.registerEntityRenderingHandler(EntityGhoul.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderGhoul(manager, new ModelGhoul(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityAhriman.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderAhriman(manager, new ModelAhriman(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityEyeRay.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderProjectile(manager, 0.5f, new ResourceLocation(DungeonMobs.MODID, "textures/entity/eyeray.png")); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityTroll.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderTroll(manager, new ModelTroll(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityManticore.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderManticore(manager, new ModelManticore(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityVampire.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderVampire(manager, new ModelBiped(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityRevenant.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderZombie(manager); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityHookHorror.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderHookHorror(manager, new ModelHookHorror(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityDestrachan.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderDestrachan(manager, new ModelDestrachan(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityCaveFisher.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderCaveFisher(manager, new ModelCaveFisher(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityNetherHound.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderNetherHound(manager, new ModelNetherHound(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityRustMonster.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderRustMonster(manager, new ModelRustMonster(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityUmberHulk.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderUmberHulk(manager, new ModelUmberHulk(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityPetrified.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderPetrified(manager, new ModelPetrified(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityCockatrice.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderCockatrice(manager, new ModelCockatrice(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityShrieker.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderShrieker(manager, new ModelShrieker(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityThoqqua.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderThoqqua(manager, new ModelThoqqua(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityVescavor.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderVescavor(manager, new ModelVescavor(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityIllithid.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderIllithid(manager, new ModelIllithid(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityRakshasa.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderRakshasa(manager, new ModelRakshasa(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityMagicMissile.class, new IRenderFactory() { + @Override + public RenderMagicMissile createRenderFor(RenderManager manager) { + return new RenderMagicMissile(manager); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityRakshasaImage.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderRakshasa(manager, new ModelRakshasa(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityLightball.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderProjectile(manager, 0.5f, new ResourceLocation(DungeonMobs.MODID, "textures/entity/lightball.png")); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityFallenAngel.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderFallenAngel(manager, new ModelFallenAngel(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityLizalfos.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderLizalfos(manager, new ModelLizalfos(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityEldermob.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderEldermob(manager, new ModelEldermob(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityEldermobBall.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderProjectile(manager, 0.5f, new ResourceLocation(DungeonMobs.MODID, "textures/entity/eldermobball.png")); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityBladeTrap.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderBladeTrapEntity(manager, new ModelBladeTrap(), 0.5f); + } + }); + RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new IRenderFactory() { + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderGhost(manager, new ModelBiped(), 0.5f); + } + }); } - - + + @Override public void registerItemRender(Item item, int meta, String id) { - ModelLoader.setCustomModelResourceLocation(item, meta, - new ModelResourceLocation(item.getRegistryName(), id)); + ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id)); } - + } diff --git a/src/main/java/com/gw/dm/proxy/CommonProxy.java b/src/main/java/com/gw/dm/proxy/CommonProxy.java index 78a2107..ca75f46 100644 --- a/src/main/java/com/gw/dm/proxy/CommonProxy.java +++ b/src/main/java/com/gw/dm/proxy/CommonProxy.java @@ -7,9 +7,9 @@ public class CommonProxy { public void registerRenders() { } - + public void registerItemRenders(ModelRegistryEvent event) { } - + public void registerItemRender(Item itemFromBlock, int i, String string) {/*Do Nothing*/} } diff --git a/src/main/java/com/gw/dm/render/RenderAhriman.java b/src/main/java/com/gw/dm/render/RenderAhriman.java index 6b9cef1..7a7a693 100644 --- a/src/main/java/com/gw/dm/render/RenderAhriman.java +++ b/src/main/java/com/gw/dm/render/RenderAhriman.java @@ -8,8 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderAhriman extends RenderLiving { - private static final ResourceLocation ahrimanTextures - = new ResourceLocation(DungeonMobs.MODID + ":textures/entity/ahriman.png"); + private static final ResourceLocation ahrimanTextures = new ResourceLocation(DungeonMobs.MODID + ":textures/entity/ahriman.png"); protected ModelAhriman model; public RenderAhriman(RenderManager renderManager, ModelAhriman modelA, float f) { diff --git a/src/main/java/com/gw/dm/render/RenderBladeTrapBlock.java b/src/main/java/com/gw/dm/render/RenderBladeTrapBlock.java index ba7c016..2e92683 100644 --- a/src/main/java/com/gw/dm/render/RenderBladeTrapBlock.java +++ b/src/main/java/com/gw/dm/render/RenderBladeTrapBlock.java @@ -8,34 +8,32 @@ import net.minecraft.util.ResourceLocation; public class RenderBladeTrapBlock extends TileEntitySpecialRenderer { - private static final ResourceLocation bladeTrapTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/BladeTrap.png"); + private static final ResourceLocation bladeTrapTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/BladeTrap.png"); private static final ModelBladeTrap model = new ModelBladeTrap(); - - + + @Override - public void render(TileEntityBladeTrap te, double x, double y, double z, - float partialTicks, int destroyStage, float alpha) { - + public void render(TileEntityBladeTrap te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { + //System.out.println("Rendering Bladetrap Block!!!!"); - + bindTexture(bladeTrapTextures); - + GlStateManager.pushMatrix(); GlStateManager.enableRescaleNormal(); - + // Don't know if I need this yet... //GlStateManager.translate(0.5F, 0.5F, 0.5F); //GlStateManager.rotate(0.0f, 0.0F, 1.0F, 0.0F); //GlStateManager.translate(-0.5F, -0.5F, -0.5F); - + GlStateManager.translate(0.5F, -0.5F, 0.5F); // DO I need this? model.renderAllTE(1.0f); // FIXME / TODO: What is the correct scale value? - + GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - + } - + } diff --git a/src/main/java/com/gw/dm/render/RenderBladeTrapEntity.java b/src/main/java/com/gw/dm/render/RenderBladeTrapEntity.java index e52b6b8..db178f7 100644 --- a/src/main/java/com/gw/dm/render/RenderBladeTrapEntity.java +++ b/src/main/java/com/gw/dm/render/RenderBladeTrapEntity.java @@ -8,17 +8,16 @@ import net.minecraft.util.ResourceLocation; public class RenderBladeTrapEntity extends RenderLiving { - private static final ResourceLocation bladeTrapTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/BladeTrap.png"); + private static final ResourceLocation bladeTrapTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/BladeTrap.png"); protected ModelBladeTrap model; - - + + public RenderBladeTrapEntity(RenderManager manager, ModelBladeTrap modelBT, float f) { super(manager, modelBT, f); model = (ModelBladeTrap) mainModel; } - - + + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return bladeTrapTextures; diff --git a/src/main/java/com/gw/dm/render/RenderCaveFisher.java b/src/main/java/com/gw/dm/render/RenderCaveFisher.java index f96c19a..3627e47 100644 --- a/src/main/java/com/gw/dm/render/RenderCaveFisher.java +++ b/src/main/java/com/gw/dm/render/RenderCaveFisher.java @@ -8,17 +8,16 @@ import net.minecraft.util.ResourceLocation; public class RenderCaveFisher extends RenderLiving { - private static final ResourceLocation caveFisherTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/CaveFisher.png"); + private static final ResourceLocation caveFisherTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/CaveFisher.png"); protected ModelCaveFisher model; - - + + public RenderCaveFisher(RenderManager manager, ModelCaveFisher modelCF, float f) { super(manager, modelCF, f); model = (ModelCaveFisher) mainModel; } - - + + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return caveFisherTextures; diff --git a/src/main/java/com/gw/dm/render/RenderCockatrice.java b/src/main/java/com/gw/dm/render/RenderCockatrice.java index c97cb20..984ef4e 100644 --- a/src/main/java/com/gw/dm/render/RenderCockatrice.java +++ b/src/main/java/com/gw/dm/render/RenderCockatrice.java @@ -10,13 +10,13 @@ public class RenderCockatrice extends RenderLiving { private static final ResourceLocation cockatriceTextures = new ResourceLocation(DungeonMobs.MODID + ":textures/entity/Cockatrice.png"); protected ModelCockatrice model; - + public RenderCockatrice(RenderManager manager, ModelCockatrice modelC, float f) { super(manager, modelC, f); model = (ModelCockatrice) mainModel; } - - + + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return cockatriceTextures; diff --git a/src/main/java/com/gw/dm/render/RenderDestrachan.java b/src/main/java/com/gw/dm/render/RenderDestrachan.java index 022c9b1..18bc1ce 100644 --- a/src/main/java/com/gw/dm/render/RenderDestrachan.java +++ b/src/main/java/com/gw/dm/render/RenderDestrachan.java @@ -8,17 +8,16 @@ import net.minecraft.util.ResourceLocation; public class RenderDestrachan extends RenderLiving { - private static final ResourceLocation destrachanTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Destrachan.png"); + private static final ResourceLocation destrachanTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Destrachan.png"); protected ModelDestrachan model; - - + + public RenderDestrachan(RenderManager manager, ModelDestrachan modelD, float f) { super(manager, modelD, f); model = (ModelDestrachan) mainModel; } - - + + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return destrachanTextures; diff --git a/src/main/java/com/gw/dm/render/RenderEldermob.java b/src/main/java/com/gw/dm/render/RenderEldermob.java index 14ec30f..04b7ff1 100644 --- a/src/main/java/com/gw/dm/render/RenderEldermob.java +++ b/src/main/java/com/gw/dm/render/RenderEldermob.java @@ -12,8 +12,7 @@ public class RenderEldermob extends RenderLiving { public ModelBase mainModel; - public RenderEldermob(RenderManager rendermanagerIn, ModelEldermob modelIn, - float shadowsizeIn) { + public RenderEldermob(RenderManager rendermanagerIn, ModelEldermob modelIn, float shadowsizeIn) { super(rendermanagerIn, modelIn, shadowsizeIn); mainModel = modelIn; addLayer(new LayerCustomHead(modelIn.body)); diff --git a/src/main/java/com/gw/dm/render/RenderEldermobBall.java b/src/main/java/com/gw/dm/render/RenderEldermobBall.java index 5869817..1bef195 100644 --- a/src/main/java/com/gw/dm/render/RenderEldermobBall.java +++ b/src/main/java/com/gw/dm/render/RenderEldermobBall.java @@ -6,10 +6,8 @@ import net.minecraft.util.ResourceLocation; public class RenderEldermobBall extends RenderProjectile { - + public RenderEldermobBall(RenderManager renderManager) { - super(renderManager, 1.0f, - new ResourceLocation(DungeonMobs.MODID, - "textures/entity/eldermobball.png")); + super(renderManager, 1.0f, new ResourceLocation(DungeonMobs.MODID, "textures/entity/eldermobball.png")); } } diff --git a/src/main/java/com/gw/dm/render/RenderFallenAngel.java b/src/main/java/com/gw/dm/render/RenderFallenAngel.java index fd3e1ce..235328d 100644 --- a/src/main/java/com/gw/dm/render/RenderFallenAngel.java +++ b/src/main/java/com/gw/dm/render/RenderFallenAngel.java @@ -11,19 +11,18 @@ public class RenderFallenAngel extends RenderLiving { public ModelBase mainModel; - - public RenderFallenAngel(RenderManager rendermanagerIn, - ModelFallenAngel modelIn, float shadowsizeIn) { + + public RenderFallenAngel(RenderManager rendermanagerIn, ModelFallenAngel modelIn, float shadowsizeIn) { super(rendermanagerIn, modelIn, shadowsizeIn); mainModel = modelIn; addLayer(new LayerCustomHead(modelIn.head)); - + } - - + + @Override protected ResourceLocation getEntityTexture(T entity) { return new ResourceLocation(DungeonMobs.MODID, "textures/entity/FallenAngel.png"); } - + } diff --git a/src/main/java/com/gw/dm/render/RenderGhost.java b/src/main/java/com/gw/dm/render/RenderGhost.java index 2914029..d1ce031 100644 --- a/src/main/java/com/gw/dm/render/RenderGhost.java +++ b/src/main/java/com/gw/dm/render/RenderGhost.java @@ -1,21 +1,18 @@ package com.gw.dm.render; +import com.gw.dm.DungeonMobs; +import com.gw.dm.entity.EntityGhost; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderBiped; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.ResourceLocation; -import com.gw.dm.DungeonMobs; -import com.gw.dm.entity.EntityGhost; - -public class RenderGhost extends RenderBiped { - public static final ResourceLocation VAMPIRE_TEXTURES = - new ResourceLocation(DungeonMobs.MODID, "textures/entity/ghost.png"); +public class RenderGhost extends RenderBiped { + public static final ResourceLocation VAMPIRE_TEXTURES = new ResourceLocation(DungeonMobs.MODID, "textures/entity/ghost.png"); - public RenderGhost(RenderManager renderManagerIn, ModelBiped modelBipedIn, - float shadowSize) { + public RenderGhost(RenderManager renderManagerIn, ModelBiped modelBipedIn, float shadowSize) { super(renderManagerIn, modelBipedIn, shadowSize); } @@ -27,21 +24,19 @@ protected ResourceLocation getEntityTexture(EntityGhost entity) { @Override - public void doRender(EntityGhost entity, double x, double y, double z, - float entityYaw, float partialTicks) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 0.25F); - //GlStateManager.depthMask(false); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, - GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); - GlStateManager.alphaFunc(516, 0.003921569F); - + public void doRender(EntityGhost entity, double x, double y, double z, float entityYaw, float partialTicks) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.25F); + //GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.alphaFunc(516, 0.003921569F); + super.doRender(entity, x, y, z, entityYaw, partialTicks); - GlStateManager.enableLighting(); - GlStateManager.disableBlend(); - GlStateManager.alphaFunc(516, 0.1F); - //GlStateManager.depthMask(true); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.alphaFunc(516, 0.1F); + //GlStateManager.depthMask(true); } } diff --git a/src/main/java/com/gw/dm/render/RenderGhoul.java b/src/main/java/com/gw/dm/render/RenderGhoul.java index 05a878d..bf23cb1 100644 --- a/src/main/java/com/gw/dm/render/RenderGhoul.java +++ b/src/main/java/com/gw/dm/render/RenderGhoul.java @@ -8,8 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderGhoul extends RenderLiving { - private static final ResourceLocation ghoulTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/ghoul.png"); + private static final ResourceLocation ghoulTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/ghoul.png"); protected ModelGhoul model; public RenderGhoul(RenderManager renderManager, ModelGhoul modelG, float f) { diff --git a/src/main/java/com/gw/dm/render/RenderHookHorror.java b/src/main/java/com/gw/dm/render/RenderHookHorror.java index d53c4ca..7e93f57 100644 --- a/src/main/java/com/gw/dm/render/RenderHookHorror.java +++ b/src/main/java/com/gw/dm/render/RenderHookHorror.java @@ -8,17 +8,16 @@ import net.minecraft.util.ResourceLocation; public class RenderHookHorror extends RenderLiving { - private static final ResourceLocation hookHorrorTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/HookHorror.png"); - + private static final ResourceLocation hookHorrorTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/HookHorror.png"); + protected ModelHookHorror model; - + public RenderHookHorror(RenderManager manager, ModelHookHorror modelHH, float f) { super(manager, modelHH, f); model = (ModelHookHorror) mainModel; } - - + + protected ResourceLocation getEntityTexture(Entity par1Entity) { return hookHorrorTextures; } diff --git a/src/main/java/com/gw/dm/render/RenderIllithid.java b/src/main/java/com/gw/dm/render/RenderIllithid.java index e4b8554..1c53db1 100644 --- a/src/main/java/com/gw/dm/render/RenderIllithid.java +++ b/src/main/java/com/gw/dm/render/RenderIllithid.java @@ -9,8 +9,7 @@ public class RenderIllithid extends RenderLiving { - private static final ResourceLocation illithidTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Illithid.png"); + private static final ResourceLocation illithidTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Illithid.png"); protected ModelIllithid model; diff --git a/src/main/java/com/gw/dm/render/RenderLizalfos.java b/src/main/java/com/gw/dm/render/RenderLizalfos.java index 204ed2b..cf1bd32 100644 --- a/src/main/java/com/gw/dm/render/RenderLizalfos.java +++ b/src/main/java/com/gw/dm/render/RenderLizalfos.java @@ -8,8 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderLizalfos extends RenderLiving { - private static final ResourceLocation lizalfosTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Lizalfos.png"); + private static final ResourceLocation lizalfosTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Lizalfos.png"); protected ModelLizalfos model; public RenderLizalfos(RenderManager manager, ModelLizalfos modelL, float f) { diff --git a/src/main/java/com/gw/dm/render/RenderMagicMissile.java b/src/main/java/com/gw/dm/render/RenderMagicMissile.java index ce4a80d..7486cc7 100644 --- a/src/main/java/com/gw/dm/render/RenderMagicMissile.java +++ b/src/main/java/com/gw/dm/render/RenderMagicMissile.java @@ -7,16 +7,15 @@ import net.minecraft.util.ResourceLocation; public class RenderMagicMissile extends RenderArrow { - public static final ResourceLocation MAGIC_ARROW - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/magicmissile.png"); - + public static final ResourceLocation MAGIC_ARROW = new ResourceLocation(DungeonMobs.MODID, "textures/entity/magicmissile.png"); + public RenderMagicMissile(RenderManager renderManagerIn) { super(renderManagerIn); } - + @Override protected ResourceLocation getEntityTexture(EntityMagicMissile entity) { return MAGIC_ARROW; } - + } diff --git a/src/main/java/com/gw/dm/render/RenderManticore.java b/src/main/java/com/gw/dm/render/RenderManticore.java index 2ec39e2..36d13d0 100644 --- a/src/main/java/com/gw/dm/render/RenderManticore.java +++ b/src/main/java/com/gw/dm/render/RenderManticore.java @@ -8,16 +8,15 @@ import net.minecraft.util.ResourceLocation; public class RenderManticore extends RenderLiving { - private static final ResourceLocation manticoreTextures - = new ResourceLocation(DungeonMobs.MODID + ":textures/entity/Manticore.png"); + private static final ResourceLocation manticoreTextures = new ResourceLocation(DungeonMobs.MODID + ":textures/entity/Manticore.png"); protected ModelManticore model; - + public RenderManticore(RenderManager manager, ModelManticore modelM, float f) { super(manager, modelM, f); model = (ModelManticore) mainModel; } - - + + protected ResourceLocation getEntityTexture(Entity par1Entity) { return manticoreTextures; } diff --git a/src/main/java/com/gw/dm/render/RenderNetherHound.java b/src/main/java/com/gw/dm/render/RenderNetherHound.java index 981fe4f..8280832 100644 --- a/src/main/java/com/gw/dm/render/RenderNetherHound.java +++ b/src/main/java/com/gw/dm/render/RenderNetherHound.java @@ -9,17 +9,16 @@ public class RenderNetherHound extends RenderLiving { - private static final ResourceLocation hellHoundTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/HellHound.png"); + private static final ResourceLocation hellHoundTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/HellHound.png"); protected ModelNetherHound model; - - + + public RenderNetherHound(RenderManager manager, ModelNetherHound modelNH, float f) { super(manager, modelNH, f); model = (ModelNetherHound) mainModel; } - - + + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return hellHoundTextures; diff --git a/src/main/java/com/gw/dm/render/RenderPetrified.java b/src/main/java/com/gw/dm/render/RenderPetrified.java index e78a3e9..55b84b2 100644 --- a/src/main/java/com/gw/dm/render/RenderPetrified.java +++ b/src/main/java/com/gw/dm/render/RenderPetrified.java @@ -8,16 +8,15 @@ import net.minecraft.util.ResourceLocation; public class RenderPetrified extends RenderLiving { - private static final ResourceLocation petrifiedTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Petrified.png"); + private static final ResourceLocation petrifiedTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Petrified.png"); protected ModelPetrified model; - + public RenderPetrified(RenderManager manager, ModelPetrified modelP, float f) { super(manager, modelP, f); model = (ModelPetrified) mainModel; } - - + + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return petrifiedTextures; diff --git a/src/main/java/com/gw/dm/render/RenderProjectile.java b/src/main/java/com/gw/dm/render/RenderProjectile.java index 5f1cf2c..96cf3bb 100644 --- a/src/main/java/com/gw/dm/render/RenderProjectile.java +++ b/src/main/java/com/gw/dm/render/RenderProjectile.java @@ -12,32 +12,30 @@ public class RenderProjectile extends Render { private final float scale; private ResourceLocation texture; - + public RenderProjectile(RenderManager manager, float scale) { super(manager); this.scale = scale; } - - - public RenderProjectile(RenderManager manager, float scale, - ResourceLocation textureLoc) { + + + public RenderProjectile(RenderManager manager, float scale, ResourceLocation textureLoc) { super(manager); this.scale = scale; setTexture(textureLoc); } - - + + public RenderProjectile setTexture(ResourceLocation textureLoc) { texture = textureLoc; return this; } - - + + /** * Renders the desired {@code T} type Entity. */ - public void doRender(Entity entity, double x, double y, double z, - float entityYaw, float partialTicks) { + public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) { GlStateManager.pushMatrix(); bindEntityTexture(entity); GlStateManager.translate(x, y, z); @@ -45,45 +43,32 @@ public void doRender(Entity entity, double x, double y, double z, GlStateManager.scale(scale, scale, scale); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); - GlStateManager.rotate(180.0F - renderManager.playerViewY, - 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - + if (renderOutlines) { GlStateManager.enableColorMaterial(); GlStateManager.enableOutlineMode(this.getTeamColor(entity)); } - + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL); - bufferbuilder.pos(-0.5D, -0.25D, 0.0D) - .tex(0.0, 1.0) - .normal(0.0F, 1.0F, 0.0F) - .endVertex(); - bufferbuilder.pos(0.5D, -0.25D, 0.0D) - .tex(1.0, 1.0) - .normal(0.0F, 1.0F, 0.0F) - .endVertex(); - bufferbuilder.pos(0.5D, 0.75D, 0.0D) - .tex(1.0, 0.0) - .normal(0.0F, 1.0F, 0.0F) - .endVertex(); - bufferbuilder.pos(-0.5D, 0.75D, 0.0D) - .tex(0.0, 0.0) - .normal(0.0F, 1.0F, 0.0F) - .endVertex(); + bufferbuilder.pos(-0.5D, -0.25D, 0.0D).tex(0.0, 1.0).normal(0.0F, 1.0F, 0.0F).endVertex(); + bufferbuilder.pos(0.5D, -0.25D, 0.0D).tex(1.0, 1.0).normal(0.0F, 1.0F, 0.0F).endVertex(); + bufferbuilder.pos(0.5D, 0.75D, 0.0D).tex(1.0, 0.0).normal(0.0F, 1.0F, 0.0F).endVertex(); + bufferbuilder.pos(-0.5D, 0.75D, 0.0D).tex(0.0, 0.0).normal(0.0F, 1.0F, 0.0F).endVertex(); tessellator.draw(); - - if(renderOutlines) { + + if (renderOutlines) { GlStateManager.disableOutlineMode(); GlStateManager.disableColorMaterial(); } - + GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); super.doRender(entity, x, y, z, entityYaw, partialTicks); } - - + + @Override protected ResourceLocation getEntityTexture(Entity entity) { return texture; diff --git a/src/main/java/com/gw/dm/render/RenderRakshasa.java b/src/main/java/com/gw/dm/render/RenderRakshasa.java index 3759d45..2627909 100644 --- a/src/main/java/com/gw/dm/render/RenderRakshasa.java +++ b/src/main/java/com/gw/dm/render/RenderRakshasa.java @@ -9,8 +9,7 @@ import net.minecraft.util.ResourceLocation; public class RenderRakshasa extends RenderLiving { - private static final ResourceLocation rakshasaTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Rakshasa.png"); + private static final ResourceLocation rakshasaTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Rakshasa.png"); protected ModelRakshasa model; public RenderRakshasa(RenderManager manager, ModelRakshasa modelR, float f) { diff --git a/src/main/java/com/gw/dm/render/RenderRustMonster.java b/src/main/java/com/gw/dm/render/RenderRustMonster.java index 2822ca6..cc90a34 100644 --- a/src/main/java/com/gw/dm/render/RenderRustMonster.java +++ b/src/main/java/com/gw/dm/render/RenderRustMonster.java @@ -8,15 +8,14 @@ import net.minecraft.util.ResourceLocation; public class RenderRustMonster extends RenderLiving { - protected static final ResourceLocation rustMonsterTexture - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/RustMonster.png"); + protected static final ResourceLocation rustMonsterTexture = new ResourceLocation(DungeonMobs.MODID, "textures/entity/RustMonster.png"); protected ModelRustMonster model; - + public RenderRustMonster(RenderManager manager, ModelRustMonster modelRM, float f) { super(manager, modelRM, f); model = modelRM; } - + // FIXME: Do I need to keep this? I don't know what was planned for it! /* // Why is this here? @@ -27,7 +26,7 @@ protected void preRenderCallbackAirBoat(EntityAirBoat par1, float par2) { GL11.glScalef(2.0F, 2.0F, 2.0F); } */ - + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return rustMonsterTexture; diff --git a/src/main/java/com/gw/dm/render/RenderShrieker.java b/src/main/java/com/gw/dm/render/RenderShrieker.java index ca70446..b849d6b 100644 --- a/src/main/java/com/gw/dm/render/RenderShrieker.java +++ b/src/main/java/com/gw/dm/render/RenderShrieker.java @@ -8,8 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderShrieker extends RenderLiving { - private static final ResourceLocation shriekerTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Shrieker.png"); + private static final ResourceLocation shriekerTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Shrieker.png"); protected ModelShrieker model; diff --git a/src/main/java/com/gw/dm/render/RenderThoqqua.java b/src/main/java/com/gw/dm/render/RenderThoqqua.java index 577ba41..5c50e4a 100644 --- a/src/main/java/com/gw/dm/render/RenderThoqqua.java +++ b/src/main/java/com/gw/dm/render/RenderThoqqua.java @@ -8,8 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderThoqqua extends RenderLiving { - private static final ResourceLocation thoqquaTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Thoqqua.png"); + private static final ResourceLocation thoqquaTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Thoqqua.png"); protected ModelThoqqua model; public RenderThoqqua(RenderManager manager, ModelThoqqua modelT, float f) { diff --git a/src/main/java/com/gw/dm/render/RenderTroll.java b/src/main/java/com/gw/dm/render/RenderTroll.java index 091f9c6..e5aa40d 100644 --- a/src/main/java/com/gw/dm/render/RenderTroll.java +++ b/src/main/java/com/gw/dm/render/RenderTroll.java @@ -9,8 +9,7 @@ public class RenderTroll extends RenderLiving { - private static final ResourceLocation trollTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Troll.png"); + private static final ResourceLocation trollTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Troll.png"); protected ModelTroll model; public RenderTroll(RenderManager renderManager, ModelTroll modelT, float f) { diff --git a/src/main/java/com/gw/dm/render/RenderUmberHulk.java b/src/main/java/com/gw/dm/render/RenderUmberHulk.java index 209676f..ff2410a 100644 --- a/src/main/java/com/gw/dm/render/RenderUmberHulk.java +++ b/src/main/java/com/gw/dm/render/RenderUmberHulk.java @@ -8,19 +8,18 @@ import net.minecraft.util.ResourceLocation; public class RenderUmberHulk extends RenderLiving { - private static final ResourceLocation umberHulkTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/umberhulk.png"); + private static final ResourceLocation umberHulkTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/umberhulk.png"); protected ModelUmberHulk model; - + public RenderUmberHulk(RenderManager manager, ModelUmberHulk modelUH, float f) { super(manager, modelUH, f); model = (ModelUmberHulk) mainModel; } - - + + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return umberHulkTextures; } - + } diff --git a/src/main/java/com/gw/dm/render/RenderVampire.java b/src/main/java/com/gw/dm/render/RenderVampire.java index 1176770..98c36a5 100644 --- a/src/main/java/com/gw/dm/render/RenderVampire.java +++ b/src/main/java/com/gw/dm/render/RenderVampire.java @@ -1,20 +1,17 @@ package com.gw.dm.render; +import com.gw.dm.DungeonMobs; +import com.gw.dm.entity.EntityVampire; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderBiped; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.ResourceLocation; -import com.gw.dm.DungeonMobs; -import com.gw.dm.entity.EntityVampire; - public class RenderVampire extends RenderBiped { - public static final ResourceLocation VAMPIRE_TEXTURES = - new ResourceLocation(DungeonMobs.MODID, "textures/entity/vampire1.png"); + public static final ResourceLocation VAMPIRE_TEXTURES = new ResourceLocation(DungeonMobs.MODID, "textures/entity/vampire1.png"); - public RenderVampire(RenderManager rendermanagerIn, ModelBase modelbaseIn, - float shadowsizeIn) { + public RenderVampire(RenderManager rendermanagerIn, ModelBase modelbaseIn, float shadowsizeIn) { super(rendermanagerIn, (ModelBiped) modelbaseIn, shadowsizeIn); } diff --git a/src/main/java/com/gw/dm/render/RenderVescavor.java b/src/main/java/com/gw/dm/render/RenderVescavor.java index e05fb4d..4fa8925 100644 --- a/src/main/java/com/gw/dm/render/RenderVescavor.java +++ b/src/main/java/com/gw/dm/render/RenderVescavor.java @@ -8,17 +8,16 @@ import net.minecraft.util.ResourceLocation; public class RenderVescavor extends RenderLiving { - private static final ResourceLocation vescavorTextures - = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Vescavor.png"); + private static final ResourceLocation vescavorTextures = new ResourceLocation(DungeonMobs.MODID, "textures/entity/Vescavor.png"); protected ModelVescavor model; - - + + public RenderVescavor(RenderManager manager, ModelVescavor modelV, float f) { super(manager, modelV, f); model = (ModelVescavor) mainModel; } - - + + @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return vescavorTextures; diff --git a/src/main/java/com/gw/dm/util/AudioHandler.java b/src/main/java/com/gw/dm/util/AudioHandler.java index cbb7bb9..a515da3 100644 --- a/src/main/java/com/gw/dm/util/AudioHandler.java +++ b/src/main/java/com/gw/dm/util/AudioHandler.java @@ -6,55 +6,55 @@ import net.minecraftforge.fml.common.registry.ForgeRegistries; public class AudioHandler { - + public static SoundEvent entityGhoulAmbient; public static SoundEvent entityGhoulHurt; public static SoundEvent entityGhoulDeath; - + public static SoundEvent entityAhrimanAmbient; - + public static SoundEvent entityTrollAmbient; public static SoundEvent entityTrollHurt; public static SoundEvent entityTrollDeath; public static SoundEvent dmbts; - + public static SoundEvent entityManticoreA1; public static SoundEvent entityManticoreA2; public static SoundEvent entityManticoreHurt; public static SoundEvent entityManticoreDeath; public static SoundEvent entityManticoreAttack; - + public static SoundEvent entityHookHorrorA1; public static SoundEvent entityHookHorrorA2; public static SoundEvent entityHookHorrorHurt; - + public static SoundEvent entityDestrachanAmbient; public static SoundEvent entityDestrachanHurt; public static SoundEvent entityDestrachanDeath; public static SoundEvent entityDestrachanStep; - + public static SoundEvent entityCaveFisherAmbient; public static SoundEvent entityCaveFisherHurt; public static SoundEvent entityCaveFisherDeath; - + public static SoundEvent entityNetherHoundAmbient; public static SoundEvent entityNetherHoundHurt; public static SoundEvent entityNetherHoundFire; - + public static SoundEvent entityRustMonsterAmbient; public static SoundEvent entityRustMonsterHurt; public static SoundEvent entityRustMonsterDeath; - + public static SoundEvent entityUmberHulkAmbient; public static SoundEvent entityUmberHulkHurt; - + public static SoundEvent entityCockatriceAmbient; public static SoundEvent entityCockatriceHurt; public static SoundEvent entityCockatriceDeath; public static SoundEvent entityCockatriceStone; - + public static SoundEvent entityShrieker; - + public static SoundEvent entityVescavorAmbient1q; public static SoundEvent entityVescavorAmbient2q; public static SoundEvent entityVescavorHurtq; @@ -67,31 +67,31 @@ public class AudioHandler { public static SoundEvent entityVescavorAmbient2; public static SoundEvent entityVescavorHurt; public static SoundEvent entityVescavorDeath; - + public static SoundEvent entityIllithidAmbient; public static SoundEvent entityIllithidPower; public static SoundEvent entityIllithidDeath; - + public static SoundEvent entityRakshasaAmbient; public static SoundEvent entityRakshasaHurt; public static SoundEvent entityRakshasael; - + public static SoundEvent entityFallenSing1; public static SoundEvent entityFallenSing2; public static SoundEvent entityFallenSing3; public static SoundEvent entityFallenSing4; - + public static SoundEvent entityLizalfosAmbient1; public static SoundEvent entityLizalfosAmbient2; public static SoundEvent entityLizalfosHurt; public static SoundEvent entityLizalfosDeath; public static SoundEvent entityLizalfosBlock; - + public static SoundEvent entityBladeTrapAmbient; public static SoundEvent entityBladeTrapHurt; public static SoundEvent entityBladeTrapDeath; public static SoundEvent entityBladeTrapBlade; - + public static SoundEvent entityEldermobA1; public static SoundEvent entityEldermobA2; public static SoundEvent entityEldermobA3; @@ -100,101 +100,102 @@ public class AudioHandler { public static SoundEvent entityGhostAmbient2; public static SoundEvent entityGhostHurt; public static SoundEvent entityGhostDeath; - - + + public static void registerSounds() { dmbts = registerSound("bt_s"); - + entityGhoulAmbient = registerSound("g_l"); entityGhoulHurt = registerSound("g_h"); entityGhoulDeath = registerSound("g_d"); - + entityAhrimanAmbient = registerSound("1_l"); - + entityTrollAmbient = registerSound("t_l"); entityTrollHurt = registerSound("t_h"); entityTrollDeath = registerSound("t_d"); - + entityManticoreA1 = registerSound("ma_l"); entityManticoreA2 = registerSound("ma_l2"); entityManticoreHurt = registerSound("ma_h"); entityManticoreDeath = registerSound("ma_d"); entityManticoreAttack = registerSound("ma_s"); - + entityHookHorrorA1 = registerSound("hh_l"); entityHookHorrorA2 = registerSound("hh_l2"); entityHookHorrorHurt = registerSound("hh_h"); - + entityDestrachanAmbient = registerSound("d_l"); entityDestrachanHurt = registerSound("d_h"); entityDestrachanDeath = registerSound("d_d"); - + entityCaveFisherAmbient = registerSound("cf_l"); entityCaveFisherHurt = registerSound("cf_h"); entityCaveFisherDeath = registerSound("cf_d"); - + entityNetherHoundAmbient = registerSound("nh_l"); entityNetherHoundHurt = registerSound("nh_h"); entityNetherHoundFire = registerSound("nh_i"); - + entityRustMonsterAmbient = registerSound("rm_l"); entityRustMonsterHurt = registerSound("rm_h"); entityRustMonsterDeath = registerSound("rm_d"); - + entityUmberHulkAmbient = registerSound("uh_l"); entityUmberHulkHurt = registerSound("uh_h"); - + entityCockatriceAmbient = registerSound("co_l"); entityCockatriceHurt = registerSound("co_h"); entityCockatriceDeath = registerSound("co_d"); entityCockatriceStone = registerSound("co_s"); - + entityShrieker = registerSound("s_s"); entityVescavorAmbient1l = registerSound("v_lo"); - entityVescavorAmbient2l = registerSound("v_lo2"); + entityVescavorAmbient2l = registerSound("v_lo2"); entityVescavorHurtl = registerSound("v_ho"); - entityVescavorDeathl = registerSound("v_do"); + entityVescavorDeathl = registerSound("v_do"); entityVescavorAmbient1q = registerSound("v_l"); entityVescavorAmbient1q = registerSound("v_l2"); entityVescavorHurtq = registerSound("v_h"); - entityVescavorDeathq = registerSound("v_d"); - if(ConfigHandler.loudVescavor) { - entityVescavorAmbient1 = entityVescavorAmbient2l; - entityVescavorAmbient2 = entityVescavorAmbient2l; + entityVescavorDeathq = registerSound("v_d"); + if (ConfigHandler.loudVescavor) { + entityVescavorAmbient1 = entityVescavorAmbient2l; + entityVescavorAmbient2 = entityVescavorAmbient2l; entityVescavorHurt = entityVescavorHurtl; - entityVescavorDeath = entityVescavorDeathl; - } else { - entityVescavorAmbient1 = entityVescavorAmbient1q; - entityVescavorAmbient2 = entityVescavorAmbient2q; + entityVescavorDeath = entityVescavorDeathl; + } + else { + entityVescavorAmbient1 = entityVescavorAmbient1q; + entityVescavorAmbient2 = entityVescavorAmbient2q; entityVescavorHurt = entityVescavorHurtq; entityVescavorDeath = entityVescavorDeathq; } - + entityIllithidAmbient = registerSound("i_l"); entityIllithidPower = registerSound("i_p"); entityIllithidDeath = registerSound("i_d"); - + entityRakshasaAmbient = registerSound("ra_l"); entityRakshasaHurt = registerSound("ra_h"); entityRakshasael = registerSound("ra_el"); - + entityFallenSing1 = registerSound("fa_l1"); entityFallenSing2 = registerSound("fa_l2"); entityFallenSing3 = registerSound("fa_l3"); entityFallenSing4 = registerSound("fa_l4"); - + entityLizalfosAmbient1 = registerSound("li_l"); entityLizalfosAmbient2 = registerSound("li_l2"); entityLizalfosHurt = registerSound("li_h"); entityLizalfosDeath = registerSound("li_d"); entityLizalfosBlock = registerSound("li_a"); - + entityBladeTrapAmbient = registerSound("bl_l"); entityBladeTrapHurt = registerSound("bl_sw"); entityBladeTrapDeath = registerSound("bl_d"); entityBladeTrapBlade = registerSound("bl_b"); - + entityEldermobA1 = registerSound("em_l1"); entityEldermobA2 = registerSound("em_l2"); entityEldermobA3 = registerSound("em_l3"); @@ -204,13 +205,13 @@ public static void registerSounds() { entityGhostHurt = registerSound("g2_h"); entityGhostDeath = registerSound("g2_d"); } - - + + private static SoundEvent registerSound(String name) { SoundEvent evt = new SoundEvent(new ResourceLocation(DungeonMobs.MODID, name)); evt.setRegistryName(name); ForgeRegistries.SOUND_EVENTS.register(evt); return evt; } - + } diff --git a/src/main/java/com/gw/dm/util/ConfigHandler.java b/src/main/java/com/gw/dm/util/ConfigHandler.java index 0eb7222..2f774b5 100644 --- a/src/main/java/com/gw/dm/util/ConfigHandler.java +++ b/src/main/java/com/gw/dm/util/ConfigHandler.java @@ -15,16 +15,16 @@ import java.util.logging.Logger; public class ConfigHandler { - + public static File mainConfig; public static File configDir; - + public static boolean devMode; - + public static boolean spawnNaturally; public static boolean addToVanillaDungeons; public static boolean addToDoomlikeDungeons; - + public static boolean spawnRustMonster; public static boolean spawnGhoul; public static boolean spawnShrieker; @@ -49,7 +49,7 @@ public class ConfigHandler { public static boolean spawnBeamos; public static boolean spawnBladeTrap; public static boolean spawnGhost; - + public static boolean lightBallExplode; public static boolean loudVescavor; public static boolean hardcoreVampire; @@ -73,7 +73,7 @@ public class ConfigHandler { public static boolean rustMonsterIg; public static int rustMonsterP; public static int rustMonsterMn; - public static int rustMonsterMx; + public static int rustMonsterMx; public static boolean ghoulIg; public static int ghoulP; @@ -193,7 +193,7 @@ public class ConfigHandler { public static int outerThingEP; public static int outerThingEMn; public static int outerThingEMx; - + public static float healthx; public static float damagex; @@ -202,41 +202,31 @@ public class ConfigHandler { /*----------------------------------------------------------* * WORKING CODE * *----------------------------------------------------------*/ - - + + public static void init() { - File file = new File(ConfigHandler.configDir.toString() - + File.separator + DungeonMobs.MODID + ".cfg"); + File file = new File(ConfigHandler.configDir.toString() + File.separator + DungeonMobs.MODID + ".cfg"); Configuration config = new Configuration(file); config.load(); - + boolean client = FMLCommonHandler.instance().getSide() == Side.CLIENT; - + // Dev and Debugging config.addCustomCategoryComment("DevNDebug", "Setting for debugging a development"); - devMode = config.get("DevNDebug", "DevMode", false, "Allow WIP mobs / features to appear; " - + "these mobs may not have AI or even textures and done. \r\n " - + "Keep this false (unless you're actually trying to code new mobs).").getBoolean(); - + devMode = config.get("DevNDebug", "DevMode", false, "Allow WIP mobs / features to appear; " + "these mobs may not have AI or even textures and done. \r\n " + "Keep this false (unless you're actually trying to code new mobs).").getBoolean(); + // General Configuration config.addCustomCategoryComment("General", "General setting effecting all mobs"); - spawnNaturally = config.get("General", "SpawnNaturally", true, - "Determines if dungeon mobs can spawn naturally in the world (\"dark spawn\")").getBoolean(); - addToVanillaDungeons = config.get("General", "AddToVanillaDungeons", true, - "Determines dungeons mobs will be added to spawners in vanilla dungeons").getBoolean(); - addToDoomlikeDungeons = config.get("General", "AddToDoomlikeDungeons", true, - "Determines dungeons mobs will be added to spawners in doomlike dungeons").getBoolean() - && (net.minecraftforge.fml.common.Loader.isModLoaded("DLDungeonsJBG") - // Yes, I botch some of this and Doomlike Dungeons and have to - // accomodate for it here... :( - || net.minecraftforge.fml.common.Loader.isModLoaded("dldungeonsjbg") - || net.minecraftforge.fml.common.Loader.isModLoaded("dldungeonjbg") - || net.minecraftforge.fml.common.Loader.isModLoaded("DLDungeonJBG")); + spawnNaturally = config.get("General", "SpawnNaturally", true, "Determines if dungeon mobs can spawn naturally in the world (\"dark spawn\")").getBoolean(); + addToVanillaDungeons = config.get("General", "AddToVanillaDungeons", true, "Determines dungeons mobs will be added to spawners in vanilla dungeons").getBoolean(); + addToDoomlikeDungeons = config.get("General", "AddToDoomlikeDungeons", true, "Determines dungeons mobs will be added to spawners in doomlike dungeons").getBoolean() && (net.minecraftforge.fml.common.Loader.isModLoaded("DLDungeonsJBG") + // Yes, I botch some of this and Doomlike Dungeons and have to + // accomodate for it here... :( + || net.minecraftforge.fml.common.Loader.isModLoaded("dldungeonsjbg") || net.minecraftforge.fml.common.Loader.isModLoaded("dldungeonjbg") || net.minecraftforge.fml.common.Loader.isModLoaded("DLDungeonJBG")); //addToDoomlikeDungeons = false; - + // Mob Existence - config.addCustomCategoryComment("Mobs", "Which mobs exist in the word \r\n " - + "(if false it does not exist and can never spawn)"); + config.addCustomCategoryComment("Mobs", "Which mobs exist in the word \r\n " + "(if false it does not exist and can never spawn)"); spawnRustMonster = config.get("Mobs", "RustMonster", true).getBoolean(); spawnGhoul = config.get("Mobs", "Ghoul", true).getBoolean(); spawnGhost = config.get("Mobs", "Ghost", true).getBoolean(); @@ -244,9 +234,9 @@ public static void init() { spawnHookHorror = config.get("Mobs", "HookHorror", true).getBoolean(); spawnUmberHulk = config.get("Mobs", "UmberHulk", true).getBoolean(); spawnBeholder = config.get("Mobs", "Beholder", true).getBoolean(); - + spawnCaveFisher = (config.get("Mobs", "CaveFisher", true).getBoolean() && client); - + spawnCockatrice = config.get("Mobs", "Cockatrice", true).getBoolean(); spawnDestrachan = config.get("Mobs", "Destrachan", true).getBoolean(); spawnIllithid = config.get("Mobs", "Illithid", true).getBoolean(); @@ -262,75 +252,47 @@ public static void init() { spawnFallenAngel = config.get("Mobs", "FallenAngel", true).getBoolean(); spawnOuterThing = config.get("Mobs", "OuterThing", true).getBoolean(); spawnBladeTrap = config.get("Mobs", "BladeTrap", true).getBoolean(); - + // Rust Monster Foods - config.addCustomCategoryComment("Rust Monster Foods", "Items eaten / wanted by " - + "rust monsters)"); - replaceRMFoods = config.get("Rust Monster Foods", "Replace", false, - "If true the food list for rust monster will be replaced, " - + "\r\notherwise it will be kept and added to.").getBoolean(); + config.addCustomCategoryComment("Rust Monster Foods", "Items eaten / wanted by " + "rust monsters)"); + replaceRMFoods = config.get("Rust Monster Foods", "Replace", false, "If true the food list for rust monster will be replaced, " + "\r\notherwise it will be kept and added to.").getBoolean(); rustMonFoodsList = new ArrayList(); - String[] array = config.get("Rust Monster Foods", - "FoodList", - new String[]{}, - "Items the rust monsters want to eat (put metal here); \r\n" - + "format \"modid:reistry_name\"") - .getStringList(); + String[] array = config.get("Rust Monster Foods", "FoodList", new String[]{}, "Items the rust monsters want to eat (put metal here); \r\n" + "format \"modid:reistry_name\"").getStringList(); rustMonFoodsList.addAll(Arrays.asList(array)); - + // Shrieker Summons config.addCustomCategoryComment("Shrieker Summons", "Mobs that can be summoned by shriekers"); shriekerMobs = new ArrayList<>(); - array = config.get("Shrieker Summons", "ShriekerSummons", new String[]{}, - "Mobs the that may be spawned when shriekers shriek (will be added to list); \r\n" - + "format \"modid:resource_location\"") - .getStringList(); + array = config.get("Shrieker Summons", "ShriekerSummons", new String[]{}, "Mobs the that may be spawned when shriekers shriek (will be added to list); \r\n" + "format \"modid:resource_location\"").getStringList(); shriekerMobs.addAll(Arrays.asList(array)); if (!shriekerMobs.isEmpty()) { EntityShrieker.appendToSummonList(shriekerMobs); } // Special mob configurations - config.addCustomCategoryComment("Special Mob Traits", - "Some other special characteristics of some mobs"); - loudVescavor = config.get("Special Mob Traits", "LoudVescavor", false, - "True: Use old, LOUD vescavor sound\nFalse: Use new, quieter vescavor sound") - .getBoolean(); - hardcoreVampire = config.get("Special Mob Traits", "HardcoreVampire", false, - "If true vampires will drain levels from the player.") - .getBoolean(); - hardcoreThoqqua = config.get("Special Mob Traits", "HardcoreThoqqua", true, - "If true thoqquas will turn stone into actual lava (temporarily).") - .getBoolean(); - fireClouds = config.get("Special Mob Traits", "Outerthing Fireclouds", true, - "If false outerthings will not use the fire cloud attack.") - .getBoolean(); + config.addCustomCategoryComment("Special Mob Traits", "Some other special characteristics of some mobs"); + loudVescavor = config.get("Special Mob Traits", "LoudVescavor", false, "True: Use old, LOUD vescavor sound\nFalse: Use new, quieter vescavor sound").getBoolean(); + hardcoreVampire = config.get("Special Mob Traits", "HardcoreVampire", false, "If true vampires will drain levels from the player.").getBoolean(); + hardcoreThoqqua = config.get("Special Mob Traits", "HardcoreThoqqua", true, "If true thoqquas will turn stone into actual lava (temporarily).").getBoolean(); + fireClouds = config.get("Special Mob Traits", "Outerthing Fireclouds", true, "If false outerthings will not use the fire cloud attack.").getBoolean(); // Power-Up - config.addCustomCategoryComment("Power Boost", - "Incase you don't think these mobs are tough enough for your " - + "OP modpack / gear"); - healthx = config.getFloat("Health Multiplier", "Power Boost", 1.0f, 0.1f, 1000f, - "Multiply every mob's base health by this"); - damagex = config.getFloat("Damage Multiplier", "Power Boost", 1.0f, 0.1f, 1000f, - "Multiply every mob's base damage by this");; - damageplus = config.getFloat("Damage Additive", "Power Boost", 0.0f, 0.0f, 1000f, - "Add this to every mob's base damage " - + "(usually less extreme than multiplying"); - rakshasaPtLvl = config.getInt("Rakshasa Damage", "Power Boost", 2, 0, 127, - "The damage potion level for rakshasa magic missles."); - beholderPtLvl = config.getInt("Beholder Damage", "Power Boost", 1, 0, 127, - "The potion level for eye rays that act as damage potions."); + config.addCustomCategoryComment("Power Boost", "Incase you don't think these mobs are tough enough for your " + "OP modpack / gear"); + healthx = config.getFloat("Health Multiplier", "Power Boost", 1.0f, 0.1f, 1000f, "Multiply every mob's base health by this"); + damagex = config.getFloat("Damage Multiplier", "Power Boost", 1.0f, 0.1f, 1000f, "Multiply every mob's base damage by this"); + ; + damageplus = config.getFloat("Damage Additive", "Power Boost", 0.0f, 0.0f, 1000f, "Add this to every mob's base damage " + "(usually less extreme than multiplying"); + rakshasaPtLvl = config.getInt("Rakshasa Damage", "Power Boost", 2, 0, 127, "The damage potion level for rakshasa magic missles."); + beholderPtLvl = config.getInt("Beholder Damage", "Power Boost", 1, 0, 127, "The potion level for eye rays that act as damage potions."); - // Save It!!! config.save(); mobDat(); } - - + + /** * This looks for the mods config directory, and attempts to * create it if it does not exist. It will them set this as @@ -343,23 +305,26 @@ public static File findConfigDir(File fd) { File out = new File(fd.toString() + File.separator + DungeonMobs.MODID); if (!out.exists()) out.mkdir(); Logger logger = Logger.getGlobal(); - + if (!out.exists()) { logger.log(Level.SEVERE, "[DUNGEON MOBS] ERROR: Could not create config directory"); - } else if (!out.isDirectory()) { + } + else if (!out.isDirectory()) { logger.log(Level.SEVERE, "[DUNGEON MOBS] ERROR: Config directory is not a directory!"); - } else { + } + else { configDir = out; } return out; } - - + + public static void mobSpecialSetup() { if (!rustMonFoodsList.isEmpty()) { if (replaceRMFoods) { EntityRustMonster.setFoods(rustMonFoodsList); - } else { + } + else { EntityRustMonster.appendToFoods(rustMonFoodsList); } } @@ -367,164 +332,183 @@ public static void mobSpecialSetup() { public static void mobDat() { - File file = new File(ConfigHandler.configDir.toString() - + File.separator + "spawn_rules.cfg"); + File file = new File(ConfigHandler.configDir.toString() + File.separator + "spawn_rules.cfg"); Configuration config = new Configuration(file); - config.load(); - - config.addCustomCategoryComment("Rust Monster", "Spawn configurations for rust monster"); - rustMonsterIg = config.get("Rust Monster", "RMSpawnAnywhere", false).getBoolean();; - rustMonsterP = config.get("Rust Monster", "RMSpawnChance", 25).getInt(); + config.load(); + + config.addCustomCategoryComment("Rust Monster", "Spawn configurations for rust monster"); + rustMonsterIg = config.get("Rust Monster", "RMSpawnAnywhere", false).getBoolean(); + ; + rustMonsterP = config.get("Rust Monster", "RMSpawnChance", 25).getInt(); rustMonsterMn = config.get("Rust Monster", "RMSpawnMin", 1).getInt(); - rustMonsterMx = config.get("Rust Monster", "RMSpawnMax", 4).getInt(); + rustMonsterMx = config.get("Rust Monster", "RMSpawnMax", 4).getInt(); - config.addCustomCategoryComment("Ghoul", "Spawn configurations for ghoul"); - ghoulIg = config.get("Ghoul", "GhoulSpawnAnywhere", false).getBoolean();; - ghoulP = config.get("Ghoul", "GhoulSpawnChance", 15).getInt(); + config.addCustomCategoryComment("Ghoul", "Spawn configurations for ghoul"); + ghoulIg = config.get("Ghoul", "GhoulSpawnAnywhere", false).getBoolean(); + ; + ghoulP = config.get("Ghoul", "GhoulSpawnChance", 15).getInt(); ghoulMn = config.get("Ghoul", "GhoulSpawnMin", 2).getInt(); - ghoulMx = config.get("Ghoul", "GhoulSpawnMax", 4).getInt(); + ghoulMx = config.get("Ghoul", "GhoulSpawnMax", 4).getInt(); - config.addCustomCategoryComment("Ghost", "Spawn configurations for ghostl"); - ghostIg = config.get("Ghost", "GhostSpawnAnywhere", false).getBoolean();; - ghostP = config.get("Ghost", "GhostSpawnChance", 6).getInt(); + config.addCustomCategoryComment("Ghost", "Spawn configurations for ghostl"); + ghostIg = config.get("Ghost", "GhostSpawnAnywhere", false).getBoolean(); + ; + ghostP = config.get("Ghost", "GhostSpawnChance", 6).getInt(); ghostMn = config.get("Ghost", "GhostSpawnMin", 1).getInt(); - ghostMx = config.get("Ghost", "GhostSpawnMax", 3).getInt(); + ghostMx = config.get("Ghost", "GhostSpawnMax", 3).getInt(); - config.addCustomCategoryComment("Shrieker", "Spawn configurations for shrieker"); - shriekerIg = config.get("Shrieker", "ShriekerSpawnAnywhere", false).getBoolean();; - shriekerP = config.get("Shrieker", "ShriekerSpawnChance", 15).getInt(); + config.addCustomCategoryComment("Shrieker", "Spawn configurations for shrieker"); + shriekerIg = config.get("Shrieker", "ShriekerSpawnAnywhere", false).getBoolean(); + ; + shriekerP = config.get("Shrieker", "ShriekerSpawnChance", 15).getInt(); shriekerMn = config.get("Shrieker", "ShriekerSpawnMin", 2).getInt(); - shriekerMx = config.get("Shrieker", "ShriekerSpawnMax", 4).getInt(); + shriekerMx = config.get("Shrieker", "ShriekerSpawnMax", 4).getInt(); - config.addCustomCategoryComment("Hook Horror", "Spawn configurations for hook horror"); - hookHorrorIg = config.get("Hook Horror", "HHSpawnAnywhere", false).getBoolean();; - hookHorrorP = config.get("Hook Horror", "HHSpawnChance", 12).getInt(); + config.addCustomCategoryComment("Hook Horror", "Spawn configurations for hook horror"); + hookHorrorIg = config.get("Hook Horror", "HHSpawnAnywhere", false).getBoolean(); + ; + hookHorrorP = config.get("Hook Horror", "HHSpawnChance", 12).getInt(); hookHorrorMn = config.get("Hook Horror", "HHSpawnMin", 1).getInt(); - hookHorrorMx = config.get("Hook Horror", "HHSpawnMax", 4).getInt(); + hookHorrorMx = config.get("Hook Horror", "HHSpawnMax", 4).getInt(); - config.addCustomCategoryComment("Umber Hulk", "Spawn configurations for umber hulk"); - umberHulkIg = config.get("Umber Hulk", "UHSpawnAnywhere", false).getBoolean();; - umberHulkP = config.get("Umber Hulk", "UHSpawnChance", 6).getInt(); + config.addCustomCategoryComment("Umber Hulk", "Spawn configurations for umber hulk"); + umberHulkIg = config.get("Umber Hulk", "UHSpawnAnywhere", false).getBoolean(); + ; + umberHulkP = config.get("Umber Hulk", "UHSpawnChance", 6).getInt(); umberHulkMn = config.get("Umber Hulk", "UHSpawnMin", 1).getInt(); - umberHulkMx = config.get("Umber Hulk", "UHSpawnMax", 1).getInt(); + umberHulkMx = config.get("Umber Hulk", "UHSpawnMax", 1).getInt(); - config.addCustomCategoryComment("Beholder", "Spawn configurations for beholder"); - beholderIg = config.get("Beholder", "BeholderSpawnAnywhere", false).getBoolean();; - beholderP = config.get("Beholder", "BeholderSpawnChance", 6).getInt(); + config.addCustomCategoryComment("Beholder", "Spawn configurations for beholder"); + beholderIg = config.get("Beholder", "BeholderSpawnAnywhere", false).getBoolean(); + ; + beholderP = config.get("Beholder", "BeholderSpawnChance", 6).getInt(); beholderMn = config.get("Beholder", "BeholderSpawnMin", 1).getInt(); - beholderMx = config.get("Beholder", "BeholderSpawnMax", 2).getInt(); + beholderMx = config.get("Beholder", "BeholderSpawnMax", 2).getInt(); - config.addCustomCategoryComment("Cave Fisher", "Spawn configurations for cave fisher"); - caveFisherIg = config.get("Cave Fisher", "CFSpawnAnywhere", false).getBoolean();; - caveFisherP = config.get("Cave Fisher", "CFSpawnChance", 12).getInt(); + config.addCustomCategoryComment("Cave Fisher", "Spawn configurations for cave fisher"); + caveFisherIg = config.get("Cave Fisher", "CFSpawnAnywhere", false).getBoolean(); + ; + caveFisherP = config.get("Cave Fisher", "CFSpawnChance", 12).getInt(); caveFisherMn = config.get("Cave Fisher", "CFSpawnMin", 1).getInt(); - caveFisherMx = config.get("Cave Fisher", "CFSpawnMax", 2).getInt(); + caveFisherMx = config.get("Cave Fisher", "CFSpawnMax", 2).getInt(); - config.addCustomCategoryComment("Cockatrice", "Spawn configurations for cockatrice"); - cockatriceIg = config.get("Cockatrice", "CockatriceSpawnAnywhere", false).getBoolean();; - cockatriceP = config.get("Cockatrice", "CockatriceSpawnChance", 15).getInt(); + config.addCustomCategoryComment("Cockatrice", "Spawn configurations for cockatrice"); + cockatriceIg = config.get("Cockatrice", "CockatriceSpawnAnywhere", false).getBoolean(); + ; + cockatriceP = config.get("Cockatrice", "CockatriceSpawnChance", 15).getInt(); cockatriceMn = config.get("Cockatrice", "CockatriceSpawnMin", 1).getInt(); - cockatriceMx = config.get("Cockatrice", "CockatriceSpawnMax", 3).getInt(); + cockatriceMx = config.get("Cockatrice", "CockatriceSpawnMax", 3).getInt(); - config.addCustomCategoryComment("Destrachan", "Spawn configurations for destrachanr"); - destrachanIg = config.get("Destrachan", "DestrachanSpawnAnywhere", false).getBoolean();; - destrachanP = config.get("Destrachan", "DestrachanSpawnChance", 15).getInt(); + config.addCustomCategoryComment("Destrachan", "Spawn configurations for destrachanr"); + destrachanIg = config.get("Destrachan", "DestrachanSpawnAnywhere", false).getBoolean(); + ; + destrachanP = config.get("Destrachan", "DestrachanSpawnChance", 15).getInt(); destrachanMn = config.get("Destrachan", "DestrachanSpawnMin", 1).getInt(); - destrachanMx = config.get("Destrachan", "DestrachanSpawnMax", 3).getInt(); + destrachanMx = config.get("Destrachan", "DestrachanSpawnMax", 3).getInt(); - config.addCustomCategoryComment("Illithid", "Spawn configurations for illithid"); - illithidIg = config.get("Illithid", "IllithidSpawnAnywhere", false).getBoolean();; - illithidP = config.get("Illithid", "IllithidSpawnChance", 10).getInt(); + config.addCustomCategoryComment("Illithid", "Spawn configurations for illithid"); + illithidIg = config.get("Illithid", "IllithidSpawnAnywhere", false).getBoolean(); + ; + illithidP = config.get("Illithid", "IllithidSpawnChance", 10).getInt(); illithidMn = config.get("Illithid", "IllithidSpawnMin", 1).getInt(); - illithidMx = config.get("Illithid", "IllithidSpawnMax", 1).getInt(); + illithidMx = config.get("Illithid", "IllithidSpawnMax", 1).getInt(); - config.addCustomCategoryComment("Manticore", "Spawn configurations for manticore"); - manticoreIg = config.get("Manticore", "ManticoreSpawnAnywhere", false).getBoolean();; - manticoreP = config.get("Manticore", "ManticoreSpawnChance", 15).getInt(); + config.addCustomCategoryComment("Manticore", "Spawn configurations for manticore"); + manticoreIg = config.get("Manticore", "ManticoreSpawnAnywhere", false).getBoolean(); + ; + manticoreP = config.get("Manticore", "ManticoreSpawnChance", 15).getInt(); manticoreMn = config.get("Manticore", "ManticoreSpawnMin", 2).getInt(); - manticoreMx = config.get("Manticore", "ManticoreSpawnMax", 4).getInt(); + manticoreMx = config.get("Manticore", "ManticoreSpawnMax", 4).getInt(); - config.addCustomCategoryComment("Hell Hound", "Spawn configurations for hell hound"); - hellHoundIg = config.get("Hell Hound", "HHSpawnAnywhere", false).getBoolean();; - hellHoundP = config.get("Hell Hound", "HHSpawnChance", 10).getInt(); + config.addCustomCategoryComment("Hell Hound", "Spawn configurations for hell hound"); + hellHoundIg = config.get("Hell Hound", "HHSpawnAnywhere", false).getBoolean(); + ; + hellHoundP = config.get("Hell Hound", "HHSpawnChance", 10).getInt(); hellHoundMn = config.get("Hell Hound", "HHSpawnMin", 1).getInt(); hellHoundMx = config.get("Hell Hound", "HHSpawnMax", 2).getInt(); - hellHoundNP = config.get("Hell Hound", "HHNetherChance", 20).getInt(); + hellHoundNP = config.get("Hell Hound", "HHNetherChance", 20).getInt(); hellHoundNMn = config.get("Hell Hound", "HHNetherMin", 4).getInt(); - hellHoundNMx = config.get("Hell Hound", "HHNetherMax", 4).getInt(); + hellHoundNMx = config.get("Hell Hound", "HHNetherMax", 4).getInt(); - config.addCustomCategoryComment("Rakshasa", "Spawn configurations for rakshasa"); - rakshasaIg = config.get("Rakshasa", "RakshasaSpawnAnywhere", false).getBoolean();; - rakshasaP = config.get("Rakshasa", "RakshasaSpawnChance", 3).getInt(); + config.addCustomCategoryComment("Rakshasa", "Spawn configurations for rakshasa"); + rakshasaIg = config.get("Rakshasa", "RakshasaSpawnAnywhere", false).getBoolean(); + ; + rakshasaP = config.get("Rakshasa", "RakshasaSpawnChance", 3).getInt(); rakshasaMn = config.get("Rakshasa", "RakshasaSpawnMin", 1).getInt(); - rakshasaMx = config.get("Rakshasa", "RakshasaSpawnMax", 1).getInt(); + rakshasaMx = config.get("Rakshasa", "RakshasaSpawnMax", 1).getInt(); - config.addCustomCategoryComment("Manticore", "Spawn configurations for manticore"); - manticoreIg = config.get("Manticore", "ManticoreSpawnAnywhere", false).getBoolean();; - manticoreP = config.get("Manticore", "ManticoreSpawnChance", 12).getInt(); + config.addCustomCategoryComment("Manticore", "Spawn configurations for manticore"); + manticoreIg = config.get("Manticore", "ManticoreSpawnAnywhere", false).getBoolean(); + ; + manticoreP = config.get("Manticore", "ManticoreSpawnChance", 12).getInt(); manticoreMn = config.get("Manticore", "ManticoreSpawnMin", 1).getInt(); - manticoreMx = config.get("Manticore", "ManticoreSpawnMax", 2).getInt(); + manticoreMx = config.get("Manticore", "ManticoreSpawnMax", 2).getInt(); - config.addCustomCategoryComment("Thoqqua", "Spawn configurations for thoqqua"); + config.addCustomCategoryComment("Thoqqua", "Spawn configurations for thoqqua"); thoqquaIg = config.get("Thoqqua", "ThoqquaSpawnAnywhere", false).getBoolean(); - thoqquaP = config.get("Thoqqua", "ThoqquaSpawnChance", 10).getInt(); + thoqquaP = config.get("Thoqqua", "ThoqquaSpawnChance", 10).getInt(); thoqquaMn = config.get("Thoqqua", "ThoqquaSpawnMin", 1).getInt(); thoqquaMx = config.get("Thoqqua", "ThoqquaSpawnMax", 1).getInt(); - thoqquaNP = config.get("Thoqqua", "ThoqquaNetherChance", 15).getInt(); + thoqquaNP = config.get("Thoqqua", "ThoqquaNetherChance", 15).getInt(); thoqquaNMn = config.get("Thoqqua", "ThoqquaNetherMin", 1).getInt(); - thoqquaNMx = config.get("Thoqqua", "ThoqquaNetherMax", 2).getInt(); + thoqquaNMx = config.get("Thoqqua", "ThoqquaNetherMax", 2).getInt(); - config.addCustomCategoryComment("Troll", "Spawn configurations for troll"); - trollIg = config.get("Troll", "TrollSpawnAnywhere", false).getBoolean();; - trollP = config.get("Troll", "TrollSpawnChance", 20).getInt(); + config.addCustomCategoryComment("Troll", "Spawn configurations for troll"); + trollIg = config.get("Troll", "TrollSpawnAnywhere", false).getBoolean(); + ; + trollP = config.get("Troll", "TrollSpawnChance", 20).getInt(); trollMn = config.get("Troll", "TrollSpawnMin", 1).getInt(); trollMx = config.get("Troll", "TrollSpawnMax", 4).getInt(); - config.addCustomCategoryComment("Vescavor", "Spawn configurations for vescavor"); - vescavorIg = config.get("Vescavor", "VescavorSpawnAnywhere", false).getBoolean();; - vescavorP = config.get("Vescavor", "VescavorSpawnChance", 18).getInt(); + config.addCustomCategoryComment("Vescavor", "Spawn configurations for vescavor"); + vescavorIg = config.get("Vescavor", "VescavorSpawnAnywhere", false).getBoolean(); + ; + vescavorP = config.get("Vescavor", "VescavorSpawnChance", 18).getInt(); vescavorMn = config.get("Vescavor", "VescavorSpawnMin", 2).getInt(); - vescavorMx = config.get("Vescavor", "VescavorSpawnMax", 8).getInt(); + vescavorMx = config.get("Vescavor", "VescavorSpawnMax", 8).getInt(); - config.addCustomCategoryComment("Revenant", "Spawn configurations for revenant"); - revenantIg = config.get("Revenant", "RevenantSpawnAnywhere", false).getBoolean();; - revenantP = config.get("Revenant", "RevenantSpawnChance", 9).getInt(); + config.addCustomCategoryComment("Revenant", "Spawn configurations for revenant"); + revenantIg = config.get("Revenant", "RevenantSpawnAnywhere", false).getBoolean(); + ; + revenantP = config.get("Revenant", "RevenantSpawnChance", 9).getInt(); revenantMn = config.get("Revenant", "RevenantSpawnMin", 1).getInt(); - revenantMx = config.get("Revenant", "RevenantSpawnMax", 2).getInt(); + revenantMx = config.get("Revenant", "RevenantSpawnMax", 2).getInt(); - config.addCustomCategoryComment("Vampire", "Spawn configurations for vampire"); - vampireIg = config.get("Vampire", "VampireSpawnAnywhere", false).getBoolean();; - vampireP = config.get("Vampire", "VampireSpawnChance", 5).getInt(); + config.addCustomCategoryComment("Vampire", "Spawn configurations for vampire"); + vampireIg = config.get("Vampire", "VampireSpawnAnywhere", false).getBoolean(); + ; + vampireP = config.get("Vampire", "VampireSpawnChance", 5).getInt(); vampireMn = config.get("Vampire", "VampireSpawnMin", 1).getInt(); - vampireMx = config.get("Vampire", "VampireSpawnMax", 2).getInt(); + vampireMx = config.get("Vampire", "VampireSpawnMax", 2).getInt(); - config.addCustomCategoryComment("Fallen Angel", "Spawn configurations for fallen angel"); + config.addCustomCategoryComment("Fallen Angel", "Spawn configurations for fallen angel"); fallenAngelIg = config.get("Fallen Angel", "FASpawnAnywhere", false).getBoolean(); - fallenAngelP = config.get("Fallen Angel", "FASpawnChance", 2).getInt(); + fallenAngelP = config.get("Fallen Angel", "FASpawnChance", 2).getInt(); fallenAngelMn = config.get("Fallen Angel", "FASpawnMin", 1).getInt(); - fallenAngelMx = config.get("Fallen Angel", "FASpawnMax", 1).getInt(); - fallenAngelNP = config.get("Fallen Angel", "FANetherChance", 1).getInt(); + fallenAngelMx = config.get("Fallen Angel", "FASpawnMax", 1).getInt(); + fallenAngelNP = config.get("Fallen Angel", "FANetherChance", 1).getInt(); fallenAngelNMn = config.get("Fallen Angel", "FANetherMin", 1).getInt(); - fallenAngelNMx = config.get("Fallen Angel", "FANetherMax", 1).getInt(); + fallenAngelNMx = config.get("Fallen Angel", "FANetherMax", 1).getInt(); - config.addCustomCategoryComment("Outer Thing", "Spawn configurations for other thing"); - outerThingIg = config.get("Outer Thing", "OTSpawnAnywhere", false).getBoolean(); + config.addCustomCategoryComment("Outer Thing", "Spawn configurations for other thing"); + outerThingIg = config.get("Outer Thing", "OTSpawnAnywhere", false).getBoolean(); outerThingEI = config.get("Outer Thing", "OTMainEndIsland", false).getBoolean(); - outerThingP = config.get("Outer Thing", "OTSpawnChance", 2).getInt(); + outerThingP = config.get("Outer Thing", "OTSpawnChance", 2).getInt(); outerThingMn = config.get("Outer Thing", "OTSpawnMin", 1).getInt(); outerThingMx = config.get("Outer Thing", "OTSpawnMax", 1).getInt(); - outerThingEP = config.get("Outer Thing", "OTEndChance", 2).getInt(); + outerThingEP = config.get("Outer Thing", "OTEndChance", 2).getInt(); outerThingEMn = config.get("Outer Thing", "OTEndMin", 1).getInt(); - outerThingEMx = config.get("Outer Thing", "OTEndMax", 1).getInt(); + outerThingEMx = config.get("Outer Thing", "OTEndMax", 1).getInt(); - config.addCustomCategoryComment("Lizalfos", "Spawn configurations for lizalfos"); - lizalfosIg = config.get("Lizalfos", "LizalfosSpawnAnywhere", false).getBoolean();; - lizalfosP = config.get("Lizalfos", "LizalfosSpawnChance", 6).getInt(); + config.addCustomCategoryComment("Lizalfos", "Spawn configurations for lizalfos"); + lizalfosIg = config.get("Lizalfos", "LizalfosSpawnAnywhere", false).getBoolean(); + ; + lizalfosP = config.get("Lizalfos", "LizalfosSpawnChance", 6).getInt(); lizalfosMn = config.get("Lizalfos", "LizalfosSpawnMin", 2).getInt(); - lizalfosMx = config.get("Lizalfos", "LizalfosSpawnMax", 2).getInt(); - + lizalfosMx = config.get("Lizalfos", "LizalfosSpawnMax", 2).getInt(); + // Save It!!! config.save(); } - + } diff --git a/src/main/java/com/gw/dm/util/DMGenerationHandler.java b/src/main/java/com/gw/dm/util/DMGenerationHandler.java index d9266f9..2bcb732 100644 --- a/src/main/java/com/gw/dm/util/DMGenerationHandler.java +++ b/src/main/java/com/gw/dm/util/DMGenerationHandler.java @@ -17,59 +17,56 @@ public class DMGenerationHandler implements IWorldGenerator { private static final Set targets = new HashSet(); - + public DMGenerationHandler() { GameRegistry.registerWorldGenerator(this, 100); } - + public static void initTargetBlocks() { targets.add(Blocks.STONEBRICK); targets.add(Blocks.STONE_BRICK_STAIRS); targets.add(Blocks.COBBLESTONE); } - + @Override - public void generate(Random random, int chunkX, int chunkZ, World world, - IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { if (world.isRemote) { return; } generateTraps(chunkGenerator, world, world.rand, chunkX, chunkZ); } - - private void generateTraps(IChunkGenerator iChunkGenerator, - World world, Random rand, int chunkX, int chunkZ) { + + private void generateTraps(IChunkGenerator iChunkGenerator, World world, Random rand, int chunkX, int chunkZ) { int posX = chunkX << 4; int posZ = chunkZ << 4; - - BlockPos foo = iChunkGenerator.getNearestStructurePos(world, "Stronghold", - new BlockPos(posX, 64, posZ), false); - + + BlockPos foo = iChunkGenerator.getNearestStructurePos(world, "Stronghold", new BlockPos(posX, 64, posZ), false); + boolean sh; if (foo == null) { sh = false; - } else { + } + else { sh = (((foo.getX() >> 4) == chunkX) && ((foo.getZ() >> 4) == chunkZ)); } - + int max = 0; - + EnumDifficulty diff = world.getDifficulty(); - + if (diff != EnumDifficulty.PEACEFUL) { max = rand.nextInt(8) + rand.nextInt(3) + 2; - - if (diff == EnumDifficulty.NORMAL) - max += rand.nextInt(3) + 3; + + if (diff == EnumDifficulty.NORMAL) max += rand.nextInt(3) + 3; if (diff == EnumDifficulty.HARD) { max += rand.nextInt(3) + 3; max += rand.nextInt(3) + 3; } } - + int x, z, lower, upper; int match = world.rand.nextInt(10 - DungeonMobsHelper.getDifficulty(world)); - + for (int i = 0; i < max; i++) { x = posX + world.rand.nextInt(16); z = posZ + world.rand.nextInt(16); @@ -77,35 +74,33 @@ private void generateTraps(IChunkGenerator iChunkGenerator, upper = 64; if (((i % 3) == match) || (sh && ((i % 2) == 0))) { do { - if (targets.contains(world.getBlockState(new BlockPos(x, lower, z)).getBlock()) - && world.isAirBlock(new BlockPos(x, lower + 1, z))) { - world.setBlockState(new BlockPos(x, lower + 1, z), - MiscRegistrar.blockBladeTrap.getDefaultState(), 3); + if (targets.contains(world.getBlockState(new BlockPos(x, lower, z)).getBlock()) && world.isAirBlock(new BlockPos(x, lower + 1, z))) { + world.setBlockState(new BlockPos(x, lower + 1, z), MiscRegistrar.blockBladeTrap.getDefaultState(), 3); break; } lower++; - } while (lower < upper); - } else { + } + while (lower < upper); + } + else { if (sh) { do { - if (targets.contains(world.getBlockState(new BlockPos(x, upper, z)).getBlock()) - && world.isAirBlock(new BlockPos(x, upper + 1, z))) { - world.setBlockState(new BlockPos(x, upper + 1, z), - MiscRegistrar.blockBladeTrap.getDefaultState(), 3); + if (targets.contains(world.getBlockState(new BlockPos(x, upper, z)).getBlock()) && world.isAirBlock(new BlockPos(x, upper + 1, z))) { + world.setBlockState(new BlockPos(x, upper + 1, z), MiscRegistrar.blockBladeTrap.getDefaultState(), 3); break; } upper--; - } while (lower < upper); - } else { + } + while (lower < upper); + } + else { lower = rand.nextInt(54) + 10; - if (targets.contains(world.getBlockState(new BlockPos(x, lower, z)).getBlock()) - && world.isAirBlock(new BlockPos(x, lower + 1, z))) { - world.setBlockState(new BlockPos(x, lower + 1, z), - MiscRegistrar.blockBladeTrap.getDefaultState(), 3); + if (targets.contains(world.getBlockState(new BlockPos(x, lower, z)).getBlock()) && world.isAirBlock(new BlockPos(x, lower + 1, z))) { + world.setBlockState(new BlockPos(x, lower + 1, z), MiscRegistrar.blockBladeTrap.getDefaultState(), 3); } } } } } - + } diff --git a/src/main/java/com/gw/dm/util/DungeonMobsHelper.java b/src/main/java/com/gw/dm/util/DungeonMobsHelper.java index ad5ffd5..2dd84b0 100644 --- a/src/main/java/com/gw/dm/util/DungeonMobsHelper.java +++ b/src/main/java/com/gw/dm/util/DungeonMobsHelper.java @@ -23,34 +23,33 @@ import java.util.Random; public class DungeonMobsHelper { - + public static boolean displayedVersion = false; private static NetworkHelper helper = NetworkHelper.getNetworkHelper(); private static LinkedList confusedClientPlayers = new LinkedList(); private static LinkedList confusedPlayers = new LinkedList(); - + public static void printLists() { System.out.println("[DM] Printing " + confusedClientPlayers.size() + " client players."); - + for (int i = 0; i < confusedClientPlayers.size(); i++) { System.out.println("[DM] " + confusedClientPlayers.get(i).toString()); } - + System.out.println("[DM] Printing " + confusedPlayers.size() + " players."); - + for (int i = 0; i < confusedPlayers.size(); i++) { System.out.println("[DM] " + confusedPlayers.get(i).toString()); } } - - + + public static void sendConfusionPacket(EntityPlayerMP target, boolean b) { Entity test = (Entity) target; - - if (!(test instanceof FakePlayer)) - helper.sendPacketToPlayer(new ConfusionPacket(b), target); + + if (!(test instanceof FakePlayer)) helper.sendPacketToPlayer(new ConfusionPacket(b), target); } - + // FIXME: I don't know if these are needed with the current networking // System. /* @@ -70,37 +69,35 @@ public static void makePlayerNormal(EntityClientPlayerMP player) { confusedClientPlayers.remove(player); } */ - - + + /* * These three are local, don't deal with packet bullshit. */ public static void makePlayerConfused(EntityPlayerMP player) { - if (!confusedPlayers.contains(player)) - confusedPlayers.add(player); + if (!confusedPlayers.contains(player)) confusedPlayers.add(player); } - - + + public static boolean isPlayerConfused(EntityPlayerMP player) { return confusedPlayers.contains(player); } - - + + public static void makePlayerNormal(EntityPlayerMP player) { - if (confusedPlayers.contains(player)) - confusedPlayers.remove(player); + if (confusedPlayers.contains(player)) confusedPlayers.remove(player); } - - + + public static void sendKnockBackPacket(EntityPlayerMP target, double xVel, double zVel) { Entity test = (Entity) target; - + if (!(test instanceof FakePlayer)) { helper.sendPacketToPlayer(new KnockBackPacket((float) xVel, (float) zVel), target); } } - - + + public static void knockBack(EntityLivingBase target, double x, double z) { target.isAirBorne = true; float normalizedPower = MathHelper.sqrt(x * x + z * z); @@ -111,27 +108,23 @@ public static void knockBack(EntityLivingBase target, double x, double z) { target.motionX -= x / (double) normalizedPower * (double) knockPower; target.motionY += (double) knockPower; target.motionZ -= z / (double) normalizedPower * (double) knockPower; - + if (target.motionY > 0.4000000059604645D) { target.motionY = 0.4000000059604645D; } } - - + + public static int getDifficulty(World world) { - if (world.getDifficulty() == EnumDifficulty.PEACEFUL) - return 0; - if (world.getDifficulty() == EnumDifficulty.EASY) - return 1; - if (world.getDifficulty() == EnumDifficulty.NORMAL) - return 2; - if (world.getDifficulty() == EnumDifficulty.HARD) - return 3; - + if (world.getDifficulty() == EnumDifficulty.PEACEFUL) return 0; + if (world.getDifficulty() == EnumDifficulty.EASY) return 1; + if (world.getDifficulty() == EnumDifficulty.NORMAL) return 2; + if (world.getDifficulty() == EnumDifficulty.HARD) return 3; + return 0; } - - + + /** * This method will tell whether a mob is near a spawner for that * type of mob. This if for spawning logic, to allow mobs to spawn @@ -151,7 +144,7 @@ public static boolean isNearSpawner(World world, EntityLiving entity, String nam int minz = (int) (entity.posZ - 4), maxz = (int) (entity.posZ + 5); boolean out = false; BlockPos test; - + for (int i = minx; i < maxx; i++) for (int j = miny; j < maxy; j++) for (int k = minz; k < maxz; k++) { @@ -168,19 +161,19 @@ public static boolean isNearSpawner(World world, EntityLiving entity, String nam if (spawnData.hasKey("id")) { String mobSpawnEntityId = spawnData.getString("id"); String id = (name); - if (mobSpawnEntityId.equalsIgnoreCase(id)) - return true; + if (mobSpawnEntityId.equalsIgnoreCase(id)) return true; } } - } catch (Exception e) { + } + catch (Exception e) { } } } } return out; } - - + + /** * A replacement for the vanilla addRandomEnchantment methodm which is * broken in Forge 1.12.2. @@ -195,5 +188,5 @@ public static void addEnchantment(ItemStack stack, Random rand) { stack.addEnchantment(ench, l); } } - + } diff --git a/src/main/java/com/gw/dm/util/InputConfusedMovement.java b/src/main/java/com/gw/dm/util/InputConfusedMovement.java index 2f2f85f..064952e 100644 --- a/src/main/java/com/gw/dm/util/InputConfusedMovement.java +++ b/src/main/java/com/gw/dm/util/InputConfusedMovement.java @@ -116,7 +116,8 @@ public void randomize() { if (foo == 1) { this.jump = underlyingMovementInput.jump; this.sneak = underlyingMovementInput.sneak; - } else { + } + else { this.jump = underlyingMovementInput.sneak; this.sneak = underlyingMovementInput.jump; } diff --git a/src/main/java/com/gw/dm/util/MiscRegistrar.java b/src/main/java/com/gw/dm/util/MiscRegistrar.java index 92739c2..6040667 100644 --- a/src/main/java/com/gw/dm/util/MiscRegistrar.java +++ b/src/main/java/com/gw/dm/util/MiscRegistrar.java @@ -85,8 +85,7 @@ public static void registerModels(ModelRegistryEvent event) { public static void registerTileEntities() { - GameRegistry.registerTileEntity(TileEntityBladeTrap.class, - DungeonMobs.MODID + ".bladetrap"); + GameRegistry.registerTileEntity(TileEntityBladeTrap.class, DungeonMobs.MODID + ".bladetrap"); } diff --git a/src/main/java/com/gw/dm/util/MobRegistrar.java b/src/main/java/com/gw/dm/util/MobRegistrar.java index b47d465..9324b9f 100644 --- a/src/main/java/com/gw/dm/util/MobRegistrar.java +++ b/src/main/java/com/gw/dm/util/MobRegistrar.java @@ -1,108 +1,10 @@ package com.gw.dm.util; -import static com.gw.dm.DungeonMobs.MODID; -import static com.gw.dm.DungeonMobs.instance; -import static com.gw.dm.util.ConfigHandler.beholderMn; -import static com.gw.dm.util.ConfigHandler.beholderMx; -import static com.gw.dm.util.ConfigHandler.beholderP; -import static com.gw.dm.util.ConfigHandler.caveFisherMn; -import static com.gw.dm.util.ConfigHandler.caveFisherMx; -import static com.gw.dm.util.ConfigHandler.caveFisherP; -import static com.gw.dm.util.ConfigHandler.cockatriceMn; -import static com.gw.dm.util.ConfigHandler.cockatriceMx; -import static com.gw.dm.util.ConfigHandler.cockatriceP; -import static com.gw.dm.util.ConfigHandler.destrachanMn; -import static com.gw.dm.util.ConfigHandler.destrachanMx; -import static com.gw.dm.util.ConfigHandler.destrachanP; -import static com.gw.dm.util.ConfigHandler.fallenAngelMn; -import static com.gw.dm.util.ConfigHandler.fallenAngelMx; -import static com.gw.dm.util.ConfigHandler.fallenAngelP; -import static com.gw.dm.util.ConfigHandler.ghostMn; -import static com.gw.dm.util.ConfigHandler.ghostMx; -import static com.gw.dm.util.ConfigHandler.ghostP; -import static com.gw.dm.util.ConfigHandler.ghoulMn; -import static com.gw.dm.util.ConfigHandler.ghoulMx; -import static com.gw.dm.util.ConfigHandler.ghoulP; -import static com.gw.dm.util.ConfigHandler.hellHoundMn; -import static com.gw.dm.util.ConfigHandler.hellHoundMx; -import static com.gw.dm.util.ConfigHandler.hellHoundNMn; -import static com.gw.dm.util.ConfigHandler.hellHoundNP; -import static com.gw.dm.util.ConfigHandler.hellHoundP; -import static com.gw.dm.util.ConfigHandler.hookHorrorMn; -import static com.gw.dm.util.ConfigHandler.hookHorrorMx; -import static com.gw.dm.util.ConfigHandler.hookHorrorP; -import static com.gw.dm.util.ConfigHandler.illithidMn; -import static com.gw.dm.util.ConfigHandler.illithidMx; -import static com.gw.dm.util.ConfigHandler.illithidP; -import static com.gw.dm.util.ConfigHandler.lizalfosMn; -import static com.gw.dm.util.ConfigHandler.lizalfosMx; -import static com.gw.dm.util.ConfigHandler.lizalfosP; -import static com.gw.dm.util.ConfigHandler.manticoreMn; -import static com.gw.dm.util.ConfigHandler.manticoreMx; -import static com.gw.dm.util.ConfigHandler.manticoreP; -import static com.gw.dm.util.ConfigHandler.outerThingEMn; -import static com.gw.dm.util.ConfigHandler.outerThingEMx; -import static com.gw.dm.util.ConfigHandler.outerThingEP; -import static com.gw.dm.util.ConfigHandler.outerThingMn; -import static com.gw.dm.util.ConfigHandler.outerThingMx; -import static com.gw.dm.util.ConfigHandler.outerThingP; -import static com.gw.dm.util.ConfigHandler.rakshasaMn; -import static com.gw.dm.util.ConfigHandler.rakshasaMx; -import static com.gw.dm.util.ConfigHandler.rakshasaP; -import static com.gw.dm.util.ConfigHandler.revenantMn; -import static com.gw.dm.util.ConfigHandler.revenantMx; -import static com.gw.dm.util.ConfigHandler.revenantP; -import static com.gw.dm.util.ConfigHandler.rustMonsterMn; -import static com.gw.dm.util.ConfigHandler.rustMonsterMx; -import static com.gw.dm.util.ConfigHandler.rustMonsterP; -import static com.gw.dm.util.ConfigHandler.shriekerMn; -import static com.gw.dm.util.ConfigHandler.shriekerMx; -import static com.gw.dm.util.ConfigHandler.shriekerP; -import static com.gw.dm.util.ConfigHandler.spawnBeholder; -import static com.gw.dm.util.ConfigHandler.spawnBladeTrap; -import static com.gw.dm.util.ConfigHandler.spawnCaveFisher; -import static com.gw.dm.util.ConfigHandler.spawnCockatrice; -import static com.gw.dm.util.ConfigHandler.spawnDestrachan; -import static com.gw.dm.util.ConfigHandler.spawnFallenAngel; -import static com.gw.dm.util.ConfigHandler.spawnGhost; -import static com.gw.dm.util.ConfigHandler.spawnGhoul; -import static com.gw.dm.util.ConfigHandler.spawnHellHound; -import static com.gw.dm.util.ConfigHandler.spawnHookHorror; -import static com.gw.dm.util.ConfigHandler.spawnIllithid; -import static com.gw.dm.util.ConfigHandler.spawnLizalfos; -import static com.gw.dm.util.ConfigHandler.spawnManticore; -import static com.gw.dm.util.ConfigHandler.spawnOuterThing; -import static com.gw.dm.util.ConfigHandler.spawnRakshasa; -import static com.gw.dm.util.ConfigHandler.spawnRevenant; -import static com.gw.dm.util.ConfigHandler.spawnRustMonster; -import static com.gw.dm.util.ConfigHandler.spawnShrieker; -import static com.gw.dm.util.ConfigHandler.spawnThoqqua; -import static com.gw.dm.util.ConfigHandler.spawnTroll; -import static com.gw.dm.util.ConfigHandler.spawnUmberHulk; -import static com.gw.dm.util.ConfigHandler.spawnVampire; -import static com.gw.dm.util.ConfigHandler.spawnVescavor; -import static com.gw.dm.util.ConfigHandler.thoqquaMn; -import static com.gw.dm.util.ConfigHandler.thoqquaMx; -import static com.gw.dm.util.ConfigHandler.thoqquaNMn; -import static com.gw.dm.util.ConfigHandler.thoqquaNMx; -import static com.gw.dm.util.ConfigHandler.thoqquaNP; -import static com.gw.dm.util.ConfigHandler.thoqquaP; -import static com.gw.dm.util.ConfigHandler.trollMn; -import static com.gw.dm.util.ConfigHandler.trollMx; -import static com.gw.dm.util.ConfigHandler.trollP; -import static com.gw.dm.util.ConfigHandler.umberHulkMn; -import static com.gw.dm.util.ConfigHandler.umberHulkMx; -import static com.gw.dm.util.ConfigHandler.umberHulkP; -import static com.gw.dm.util.ConfigHandler.vampireMn; -import static com.gw.dm.util.ConfigHandler.vampireMx; -import static com.gw.dm.util.ConfigHandler.vampireP; -import static com.gw.dm.util.ConfigHandler.vescavorMn; -import static com.gw.dm.util.ConfigHandler.vescavorMx; -import static com.gw.dm.util.ConfigHandler.vescavorP; - -import java.util.ArrayList; -import java.util.List; - +import com.gw.dm.entity.*; +import com.gw.dm.projectile.EntityEldermobBall; +import com.gw.dm.projectile.EntityEyeRay; +import com.gw.dm.projectile.EntityLightball; +import com.gw.dm.projectile.EntityMagicMissile; import net.minecraft.entity.EnumCreatureType; import net.minecraft.util.ResourceLocation; import net.minecraft.world.biome.Biome; @@ -111,35 +13,12 @@ import net.minecraftforge.common.DungeonHooks; import net.minecraftforge.fml.common.registry.EntityRegistry; -import com.gw.dm.entity.EntityAhriman; -import com.gw.dm.entity.EntityBladeTrap; -import com.gw.dm.entity.EntityCaveFisher; -import com.gw.dm.entity.EntityCockatrice; -import com.gw.dm.entity.EntityDestrachan; -import com.gw.dm.entity.EntityEldermob; -import com.gw.dm.entity.EntityFallenAngel; -import com.gw.dm.entity.EntityGhost; -import com.gw.dm.entity.EntityGhoul; -import com.gw.dm.entity.EntityHookHorror; -import com.gw.dm.entity.EntityIllithid; -import com.gw.dm.entity.EntityLizalfos; -import com.gw.dm.entity.EntityManticore; -import com.gw.dm.entity.EntityNetherHound; -import com.gw.dm.entity.EntityPetrified; -import com.gw.dm.entity.EntityRakshasa; -import com.gw.dm.entity.EntityRakshasaImage; -import com.gw.dm.entity.EntityRevenant; -import com.gw.dm.entity.EntityRustMonster; -import com.gw.dm.entity.EntityShrieker; -import com.gw.dm.entity.EntityThoqqua; -import com.gw.dm.entity.EntityTroll; -import com.gw.dm.entity.EntityUmberHulk; -import com.gw.dm.entity.EntityVampire; -import com.gw.dm.entity.EntityVescavor; -import com.gw.dm.projectile.EntityEldermobBall; -import com.gw.dm.projectile.EntityEyeRay; -import com.gw.dm.projectile.EntityLightball; -import com.gw.dm.projectile.EntityMagicMissile; +import java.util.ArrayList; +import java.util.List; + +import static com.gw.dm.DungeonMobs.MODID; +import static com.gw.dm.DungeonMobs.instance; +import static com.gw.dm.util.ConfigHandler.*; public class MobRegistrar { public static final int revenantID = 0; @@ -177,9 +56,9 @@ public class MobRegistrar { public static final int eldermobID = 34; public static final int fireparticloidID = 35; public static final int ghostID = 36; - + // FIXME: All identifiers should now be all lower case! - + /** * Register all mobs. This should be called during pre-init, * just before registering the mob renderers. @@ -187,163 +66,106 @@ public class MobRegistrar { public static void registerMobs() { // GHOUL if (spawnGhoul) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmghoul"), - EntityGhoul.class, MODID + ".dmghoul", ghoulID, instance, 80, 3, - true, 0x5F3E67, 0x362C1A); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmghoul"), EntityGhoul.class, MODID + ".dmghoul", ghoulID, instance, 80, 3, true, 0x5F3E67, 0x362C1A); } // BEHOLDER if (spawnBeholder) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmbeholder"), - EntityAhriman.class, MODID + ".dmbeholder", ahrimanID, - instance, 80, 3, true, 0x720000, 0xFFF99A); - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmeyeray"), - EntityEyeRay.class, MODID + ".dmeyeray", eyerayID, instance, 80, 1, true); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmbeholder"), EntityAhriman.class, MODID + ".dmbeholder", ahrimanID, instance, 80, 3, true, 0x720000, 0xFFF99A); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmeyeray"), EntityEyeRay.class, MODID + ".dmeyeray", eyerayID, instance, 80, 1, true); } // TROLL if (spawnTroll) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmtroll"), - EntityTroll.class, MODID + ".dmtroll", trollID, instance, 80, 3, true, - 0x164300, 0x292929); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmtroll"), EntityTroll.class, MODID + ".dmtroll", trollID, instance, 80, 3, true, 0x164300, 0x292929); } // MANTICORE if (spawnManticore) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmmanticore"), - EntityManticore.class, MODID + ".dmmanticore", manticoreID, instance, 80, 3, true, - 0xd28247, 0x201f1d); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmmanticore"), EntityManticore.class, MODID + ".dmmanticore", manticoreID, instance, 80, 3, true, 0xd28247, 0x201f1d); } // REVENANT if (spawnRevenant) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmrevenant"), - EntityRevenant.class, MODID + ".dmrevenant", revenantID, instance, 80, 2, true, - 0x004400, 0x777777); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmrevenant"), EntityRevenant.class, MODID + ".dmrevenant", revenantID, instance, 80, 2, true, 0x004400, 0x777777); } // VAMPIRE if (spawnVampire) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmvampire"), - EntityVampire.class, MODID + ".dmvampire", vampireID, instance, 80, 2, true, - 0x000000, 0x550000); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmvampire"), EntityVampire.class, MODID + ".dmvampire", vampireID, instance, 80, 2, true, 0x000000, 0x550000); } // HOOK HORROR if (spawnHookHorror) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmhookhorror"), - EntityHookHorror.class, MODID + ".dmhookhorror", hookHorrorID, instance, 80, 3, true, - 0x4372AA, 0xD9D9F3); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmhookhorror"), EntityHookHorror.class, MODID + ".dmhookhorror", hookHorrorID, instance, 80, 3, true, 0x4372AA, 0xD9D9F3); } // DESTRACHAN if (spawnDestrachan) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmdestrachan"), - EntityDestrachan.class, MODID + ".dmdestrachan", destrachanID, instance, 80, 3, true, - 0xc99918, 0x161616); - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmsonicboom"), - EntityEyeRay.class, MODID + "dmsonicboom", sonicBoomID, instance, 80, 1, true); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmdestrachan"), EntityDestrachan.class, MODID + ".dmdestrachan", destrachanID, instance, 80, 3, true, 0xc99918, 0x161616); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmsonicboom"), EntityEyeRay.class, MODID + "dmsonicboom", sonicBoomID, instance, 80, 1, true); } // CAVE FISHER if (spawnCaveFisher) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmcavefisher"), - EntityCaveFisher.class, MODID + ".dmcavefisher", caveFisherID, instance, 80, 3, true, - 0xf6e7cc, 0x29a0b2); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmcavefisher"), EntityCaveFisher.class, MODID + ".dmcavefisher", caveFisherID, instance, 80, 3, true, 0xf6e7cc, 0x29a0b2); } // HELL HOUND if (spawnHellHound) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmnetherhound"), - EntityNetherHound.class, MODID + ".dmnetherhound", netherHoundID, instance, 80, 3, true, - 0xf9390d, 0x775532); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmnetherhound"), EntityNetherHound.class, MODID + ".dmnetherhound", netherHoundID, instance, 80, 3, true, 0xf9390d, 0x775532); } // RUST MONSTER if (spawnRustMonster) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmrustmonster"), - EntityRustMonster.class, MODID + ".dmrustmonster", rustMonsterID, instance, 80, 3, true, - 0x643200, 0x7C0F0F); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmrustmonster"), EntityRustMonster.class, MODID + ".dmrustmonster", rustMonsterID, instance, 80, 3, true, 0x643200, 0x7C0F0F); } // UMBER HULK if (spawnUmberHulk) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmumberhulk"), - EntityUmberHulk.class, MODID + ".dmumberhulk", umberHulkID, instance, 80, 3, true, - 0x734A12, 0x8B795E); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmumberhulk"), EntityUmberHulk.class, MODID + ".dmumberhulk", umberHulkID, instance, 80, 3, true, 0x734A12, 0x8B795E); } // COCKATRICE if (spawnCockatrice) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmpetrified"), - EntityPetrified.class, MODID + ".dmpetrified", petrifiedID, instance, 80, 3, true); - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmcockatrice"), - EntityCockatrice.class, MODID + ".dmcockatrice", cockatriceID, instance, 80, 3, true, - 0x8acf92, 0x93ab96); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmpetrified"), EntityPetrified.class, MODID + ".dmpetrified", petrifiedID, instance, 80, 3, true); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmcockatrice"), EntityCockatrice.class, MODID + ".dmcockatrice", cockatriceID, instance, 80, 3, true, 0x8acf92, 0x93ab96); } // SHRIEKER if (spawnShrieker) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmshrieker"), - EntityShrieker.class, MODID + ".dmshrieker", shriekerID, instance, 80, 3, true, - 0xBBA786, 0xE4DCB0); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmshrieker"), EntityShrieker.class, MODID + ".dmshrieker", shriekerID, instance, 80, 3, true, 0xBBA786, 0xE4DCB0); } // THOQQUA if (spawnThoqqua) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmthoqqua"), - EntityThoqqua.class, MODID + ".dmthoqqua", thoqquaID, instance, 80, 3, true, - 0xf1c33a, 0xb08968); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmthoqqua"), EntityThoqqua.class, MODID + ".dmthoqqua", thoqquaID, instance, 80, 3, true, 0xf1c33a, 0xb08968); } // VESCAVOR if (spawnVescavor) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmvescavor"), - EntityVescavor.class, MODID + ".dmvescavor", vescavorID, instance, 80, 3, true, - 0x170007, 0xa05155); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmvescavor"), EntityVescavor.class, MODID + ".dmvescavor", vescavorID, instance, 80, 3, true, 0x170007, 0xa05155); } // MIND FLAYER if (spawnIllithid) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmillithid"), - EntityIllithid.class, MODID + ".dmillithid", illithidID, instance, 80, 3, true, - 0x9932CD, 0xf6f4ba); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmillithid"), EntityIllithid.class, MODID + ".dmillithid", illithidID, instance, 80, 3, true, 0x9932CD, 0xf6f4ba); } // RAKSHASA if (spawnRakshasa) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmrakshasa"), - EntityRakshasa.class, MODID + ".dmrakshasa", rakshasaID, instance, 80, 3, true, - 0xa06c3e, 0xdec580); - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmrakshasaImage"), - EntityRakshasaImage.class, MODID + ".dmrakshasaImage", rakshasaImageID, - instance, 80, 3, true); - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmmagicmissile"), - EntityMagicMissile.class, MODID + ".dmmagicmissle", magicMissileID, - instance, 80, 1, true); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmrakshasa"), EntityRakshasa.class, MODID + ".dmrakshasa", rakshasaID, instance, 80, 3, true, 0xa06c3e, 0xdec580); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmrakshasaImage"), EntityRakshasaImage.class, MODID + ".dmrakshasaImage", rakshasaImageID, instance, 80, 3, true); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmmagicmissile"), EntityMagicMissile.class, MODID + ".dmmagicmissle", magicMissileID, instance, 80, 1, true); } // FALLEN ANGEL if (spawnFallenAngel) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmfallenangel"), - EntityFallenAngel.class, MODID + ".dmfallenangel", fallenAngelID, - instance, 80, 3, true, 0x000000, 0x998800); - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmlightball"), - EntityLightball.class, MODID + ".dmlightball", lightballID, instance, - 80, 1, true); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmfallenangel"), EntityFallenAngel.class, MODID + ".dmfallenangel", fallenAngelID, instance, 80, 3, true, 0x000000, 0x998800); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmlightball"), EntityLightball.class, MODID + ".dmlightball", lightballID, instance, 80, 1, true); } // LIZALFOS if (spawnLizalfos) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmlizalfos"), - EntityLizalfos.class, MODID + ".dmlizalfos", lizalfosID, instance, 80, 3, true, - 0x257a36, 0xe5d067); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmlizalfos"), EntityLizalfos.class, MODID + ".dmlizalfos", lizalfosID, instance, 80, 3, true, 0x257a36, 0xe5d067); } // OUTER THING if (spawnOuterThing) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmeldermob"), - EntityEldermob.class, MODID + ".dmeldermob", eldermobID, instance, 80, 3, true, - 0x003300, 0x004422); - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmdarkball"), - EntityEldermobBall.class, MODID + ".dmdarkball", darkballID, - instance, 80, 1, true); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmeldermob"), EntityEldermob.class, MODID + ".dmeldermob", eldermobID, instance, 80, 3, true, 0x003300, 0x004422); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmdarkball"), EntityEldermobBall.class, MODID + ".dmdarkball", darkballID, instance, 80, 1, true); } // BLADE TRAP if (spawnBladeTrap) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmbladetrap"), - EntityBladeTrap.class, MODID + ".dmbladetrap", bladeTrapID, instance, 80, 3, true, - 0x464646, 0xb70202); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmbladetrap"), EntityBladeTrap.class, MODID + ".dmbladetrap", bladeTrapID, instance, 80, 3, true, 0x464646, 0xb70202); } // GHOST if (spawnGhost) { - EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmghost"), - EntityGhost.class, MODID + ".dmghost", ghostID, instance, 80, 3, - true, 0xffffff, 0xe0e0e8); + EntityRegistry.registerModEntity(new ResourceLocation(MODID, "dmghost"), EntityGhost.class, MODID + ".dmghost", ghostID, instance, 80, 3, true, 0xffffff, 0xe0e0e8); } } - - + + /** * Registers all natural spawns. *

@@ -352,116 +174,64 @@ public static void registerMobs() { */ public static void registerSpawns() { Biome[] biomes = getBiomeArray(); - List tmp1 = new ArrayList<>(), - tmp2 = new ArrayList<>(), - tmp3 = new ArrayList<>(); + List tmp1 = new ArrayList<>(), tmp2 = new ArrayList<>(), tmp3 = new ArrayList<>(); for (Biome biome : biomes) { if (BiomeDictionary.hasType(biome, Type.NETHER)) { tmp1.add(biome); - } else if (BiomeDictionary.hasType(biome, Type.END)) { + } + else if (BiomeDictionary.hasType(biome, Type.END)) { tmp2.add(biome); - } else { + } + else { tmp3.add(biome); } } - + Biome[] overworld = new Biome[tmp3.size()]; tmp3.toArray(overworld); Biome[] nether = new Biome[tmp1.size()]; tmp1.toArray(nether); Biome[] end = new Biome[tmp2.size()]; tmp2.toArray(end); - + // FIXME: This should be re-organized to simplified application of a config file. - if (spawnGhoul && (ghoulP > 0)) EntityRegistry.addSpawn(EntityGhoul.class, - ghoulP, ghoulMn, ghoulMx, - EnumCreatureType.MONSTER, overworld); - if (spawnBeholder && (beholderP > 0)) EntityRegistry.addSpawn(EntityAhriman.class, - beholderP, beholderMn, beholderMx, - EnumCreatureType.MONSTER, overworld); - if (spawnRustMonster && (rustMonsterP > 0)) EntityRegistry.addSpawn(EntityRustMonster.class, - rustMonsterP, rustMonsterMn, rustMonsterMx, - EnumCreatureType.MONSTER, overworld); - if (spawnShrieker && (shriekerP > 0)) EntityRegistry.addSpawn(EntityShrieker.class, - shriekerP, shriekerMn, shriekerMx, - EnumCreatureType.MONSTER, overworld); - if (spawnUmberHulk && (umberHulkP > 0)) EntityRegistry.addSpawn(EntityUmberHulk.class, - umberHulkP, umberHulkMn, umberHulkMx, - EnumCreatureType.MONSTER, overworld); - if (spawnHookHorror && (hookHorrorP > 0)) EntityRegistry.addSpawn(EntityHookHorror.class, - hookHorrorP, hookHorrorMn, hookHorrorMx, - EnumCreatureType.MONSTER, overworld); - if (spawnTroll && (trollP > 0)) EntityRegistry.addSpawn(EntityTroll.class, - trollP, trollMn, trollMx, - EnumCreatureType.MONSTER, overworld); - if (spawnCaveFisher && (caveFisherP > 0)) EntityRegistry.addSpawn(EntityCaveFisher.class, - caveFisherP, caveFisherMn, caveFisherMx, - EnumCreatureType.MONSTER, overworld); - if (spawnDestrachan && (destrachanP > 0)) EntityRegistry.addSpawn(EntityDestrachan.class, - destrachanP, destrachanMn, destrachanMx, - EnumCreatureType.MONSTER, overworld); - if (spawnIllithid && (illithidP > 0)) EntityRegistry.addSpawn(EntityIllithid.class, - illithidP, illithidMn, illithidMx, - EnumCreatureType.MONSTER, overworld); + if (spawnGhoul && (ghoulP > 0)) EntityRegistry.addSpawn(EntityGhoul.class, ghoulP, ghoulMn, ghoulMx, EnumCreatureType.MONSTER, overworld); + if (spawnBeholder && (beholderP > 0)) EntityRegistry.addSpawn(EntityAhriman.class, beholderP, beholderMn, beholderMx, EnumCreatureType.MONSTER, overworld); + if (spawnRustMonster && (rustMonsterP > 0)) EntityRegistry.addSpawn(EntityRustMonster.class, rustMonsterP, rustMonsterMn, rustMonsterMx, EnumCreatureType.MONSTER, overworld); + if (spawnShrieker && (shriekerP > 0)) EntityRegistry.addSpawn(EntityShrieker.class, shriekerP, shriekerMn, shriekerMx, EnumCreatureType.MONSTER, overworld); + if (spawnUmberHulk && (umberHulkP > 0)) EntityRegistry.addSpawn(EntityUmberHulk.class, umberHulkP, umberHulkMn, umberHulkMx, EnumCreatureType.MONSTER, overworld); + if (spawnHookHorror && (hookHorrorP > 0)) EntityRegistry.addSpawn(EntityHookHorror.class, hookHorrorP, hookHorrorMn, hookHorrorMx, EnumCreatureType.MONSTER, overworld); + if (spawnTroll && (trollP > 0)) EntityRegistry.addSpawn(EntityTroll.class, trollP, trollMn, trollMx, EnumCreatureType.MONSTER, overworld); + if (spawnCaveFisher && (caveFisherP > 0)) EntityRegistry.addSpawn(EntityCaveFisher.class, caveFisherP, caveFisherMn, caveFisherMx, EnumCreatureType.MONSTER, overworld); + if (spawnDestrachan && (destrachanP > 0)) EntityRegistry.addSpawn(EntityDestrachan.class, destrachanP, destrachanMn, destrachanMx, EnumCreatureType.MONSTER, overworld); + if (spawnIllithid && (illithidP > 0)) EntityRegistry.addSpawn(EntityIllithid.class, illithidP, illithidMn, illithidMx, EnumCreatureType.MONSTER, overworld); if (spawnHellHound) { - if(hellHoundP > 0) EntityRegistry.addSpawn(EntityNetherHound.class, - hellHoundP, hellHoundMn, hellHoundMx, - EnumCreatureType.MONSTER, overworld); - if(hellHoundNP > 0) EntityRegistry.addSpawn(EntityNetherHound.class, - hellHoundNP, hellHoundNMn, hellHoundMx, - EnumCreatureType.MONSTER, nether); + if (hellHoundP > 0) EntityRegistry.addSpawn(EntityNetherHound.class, hellHoundP, hellHoundMn, hellHoundMx, EnumCreatureType.MONSTER, overworld); + if (hellHoundNP > 0) EntityRegistry.addSpawn(EntityNetherHound.class, hellHoundNP, hellHoundNMn, hellHoundMx, EnumCreatureType.MONSTER, nether); } - if (spawnRakshasa && (rakshasaP > 0)) EntityRegistry.addSpawn(EntityRakshasa.class, - rakshasaP, rakshasaMn, rakshasaMx, - EnumCreatureType.MONSTER, overworld); - if (spawnLizalfos && (lizalfosP > 0)) EntityRegistry.addSpawn(EntityLizalfos.class, - lizalfosP, lizalfosMn, lizalfosMx, - EnumCreatureType.MONSTER, overworld); - if (spawnCockatrice && (cockatriceP > 0)) EntityRegistry.addSpawn(EntityCockatrice.class, - cockatriceP, cockatriceMn, cockatriceMx, - EnumCreatureType.MONSTER, overworld); - if (spawnManticore && (manticoreP > 0)) EntityRegistry.addSpawn(EntityManticore.class, - manticoreP, manticoreMn, manticoreMx, - EnumCreatureType.MONSTER, overworld); + if (spawnRakshasa && (rakshasaP > 0)) EntityRegistry.addSpawn(EntityRakshasa.class, rakshasaP, rakshasaMn, rakshasaMx, EnumCreatureType.MONSTER, overworld); + if (spawnLizalfos && (lizalfosP > 0)) EntityRegistry.addSpawn(EntityLizalfos.class, lizalfosP, lizalfosMn, lizalfosMx, EnumCreatureType.MONSTER, overworld); + if (spawnCockatrice && (cockatriceP > 0)) EntityRegistry.addSpawn(EntityCockatrice.class, cockatriceP, cockatriceMn, cockatriceMx, EnumCreatureType.MONSTER, overworld); + if (spawnManticore && (manticoreP > 0)) EntityRegistry.addSpawn(EntityManticore.class, manticoreP, manticoreMn, manticoreMx, EnumCreatureType.MONSTER, overworld); if (spawnThoqqua) { - if(thoqquaP > 0) EntityRegistry.addSpawn(EntityThoqqua.class, - thoqquaP, thoqquaMn, thoqquaMx, - EnumCreatureType.MONSTER, overworld); - if(thoqquaNP > 0) EntityRegistry.addSpawn(EntityThoqqua.class, - thoqquaNP, thoqquaNMn, thoqquaNMx, - EnumCreatureType.MONSTER, nether); + if (thoqquaP > 0) EntityRegistry.addSpawn(EntityThoqqua.class, thoqquaP, thoqquaMn, thoqquaMx, EnumCreatureType.MONSTER, overworld); + if (thoqquaNP > 0) EntityRegistry.addSpawn(EntityThoqqua.class, thoqquaNP, thoqquaNMn, thoqquaNMx, EnumCreatureType.MONSTER, nether); } - if (spawnVescavor && (vescavorP > 0)) EntityRegistry.addSpawn(EntityVescavor.class, - vescavorP, vescavorMn, vescavorMx, - EnumCreatureType.MONSTER, overworld); - if (spawnRevenant && (revenantP > 0)) EntityRegistry.addSpawn(EntityRevenant.class, - revenantP, revenantMn, revenantMx, - EnumCreatureType.MONSTER, overworld); - if (spawnVampire && (vampireP > 0)) EntityRegistry.addSpawn(EntityVampire.class, - vampireP, vampireMn, vampireMx, - EnumCreatureType.MONSTER, overworld); + if (spawnVescavor && (vescavorP > 0)) EntityRegistry.addSpawn(EntityVescavor.class, vescavorP, vescavorMn, vescavorMx, EnumCreatureType.MONSTER, overworld); + if (spawnRevenant && (revenantP > 0)) EntityRegistry.addSpawn(EntityRevenant.class, revenantP, revenantMn, revenantMx, EnumCreatureType.MONSTER, overworld); + if (spawnVampire && (vampireP > 0)) EntityRegistry.addSpawn(EntityVampire.class, vampireP, vampireMn, vampireMx, EnumCreatureType.MONSTER, overworld); if (spawnFallenAngel && (fallenAngelP > 0)) { - EntityRegistry.addSpawn(EntityFallenAngel.class, - fallenAngelP, fallenAngelMn, fallenAngelMx, - EnumCreatureType.MONSTER, overworld); - EntityRegistry.addSpawn(EntityFallenAngel.class, - fallenAngelP, fallenAngelMn, fallenAngelMx, - EnumCreatureType.MONSTER, nether); + EntityRegistry.addSpawn(EntityFallenAngel.class, fallenAngelP, fallenAngelMn, fallenAngelMx, EnumCreatureType.MONSTER, overworld); + EntityRegistry.addSpawn(EntityFallenAngel.class, fallenAngelP, fallenAngelMn, fallenAngelMx, EnumCreatureType.MONSTER, nether); } if (spawnOuterThing) { - if(outerThingP > 0) EntityRegistry.addSpawn(EntityEldermob.class, - outerThingP, outerThingMn, outerThingMx, - EnumCreatureType.MONSTER, overworld); - if(outerThingEP > 0) EntityRegistry.addSpawn(EntityEldermob.class, - outerThingEP, outerThingEMn, outerThingEMx, - EnumCreatureType.MONSTER, end); - } - if (spawnGhost && (ghostP > 0)) EntityRegistry.addSpawn(EntityGhost.class, - ghostP, ghostMn, ghostMx, - EnumCreatureType.MONSTER, overworld); + if (outerThingP > 0) EntityRegistry.addSpawn(EntityEldermob.class, outerThingP, outerThingMn, outerThingMx, EnumCreatureType.MONSTER, overworld); + if (outerThingEP > 0) EntityRegistry.addSpawn(EntityEldermob.class, outerThingEP, outerThingEMn, outerThingEMx, EnumCreatureType.MONSTER, end); + } + if (spawnGhost && (ghostP > 0)) EntityRegistry.addSpawn(EntityGhost.class, ghostP, ghostMn, ghostMx, EnumCreatureType.MONSTER, overworld); } - - + + /** * This is a convenience / code-organizing method to get * all the biomes currently registered. @@ -480,8 +250,8 @@ private static Biome[] getBiomeArray() { } return biomes; } - - + + public static void addToVanillaDungeons() { if (spawnGhoul) DungeonHooks.addDungeonMob(new ResourceLocation(MODID, "dmghoul"), 1); if (spawnBeholder) DungeonHooks.addDungeonMob(new ResourceLocation(MODID, "dmbeholder"), 1); diff --git a/src/main/java/com/gw/dm/util/RMFoodItem.java b/src/main/java/com/gw/dm/util/RMFoodItem.java index 25faac5..2126707 100644 --- a/src/main/java/com/gw/dm/util/RMFoodItem.java +++ b/src/main/java/com/gw/dm/util/RMFoodItem.java @@ -5,34 +5,30 @@ public class RMFoodItem { private final Item item; private final int meta; - + public RMFoodItem(Item item, int meta) { this.item = item; this.meta = meta; } - - + + public RMFoodItem(Item item) { this.item = item; meta = -1; } - - + + @Override + public int hashCode() { + return item.hashCode(); + } + @Override public boolean equals(Object obj) { if ((obj instanceof RMFoodItem)) { RMFoodItem other = (RMFoodItem) obj; - return ((other.item == item) - && ((meta < 0) || (other.meta < 0) - || (other.meta == meta))); + return ((other.item == item) && ((meta < 0) || (other.meta < 0) || (other.meta == meta))); } return false; } - - - @Override - public int hashCode() { - return item.hashCode(); - } - + } diff --git a/src/main/resources/assets/dungeonmobs/blockstates/bladetrap.json b/src/main/resources/assets/dungeonmobs/blockstates/bladetrap.json index 1c957f7..df24f87 100644 --- a/src/main/resources/assets/dungeonmobs/blockstates/bladetrap.json +++ b/src/main/resources/assets/dungeonmobs/blockstates/bladetrap.json @@ -1,7 +1,7 @@ { "variants": { - "normal": { - "model": "dungeonmobs:bladetrap" - } + "normal": { + "model": "dungeonmobs:bladetrap" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/dungeonmobs/blockstates/lavarock.json b/src/main/resources/assets/dungeonmobs/blockstates/lavarock.json index a0337c5..3d77b76 100644 --- a/src/main/resources/assets/dungeonmobs/blockstates/lavarock.json +++ b/src/main/resources/assets/dungeonmobs/blockstates/lavarock.json @@ -1,52 +1,52 @@ { "variants": { - "age=0": { - "model": "dungeonmobs:lavarock" - }, - "age=1": { - "model": "dungeonmobs:lavarock" - }, - "age=2": { - "model": "dungeonmobs:lavarock" - }, - "age=3": { - "model": "dungeonmobs:lavarock" - }, - "age=4": { - "model": "dungeonmobs:lavarock" - }, - "age=5": { - "model": "dungeonmobs:lavarock" - }, - "age=6": { - "model": "dungeonmobs:lavarock" - }, - "age=7": { - "model": "dungeonmobs:lavarock" - }, - "age=8": { - "model": "dungeonmobs:lavarock" - }, - "age=9": { - "model": "dungeonmobs:lavarock" - }, - "age=10": { - "model": "dungeonmobs:lavarock" - }, - "age=11": { - "model": "dungeonmobs:lavarock" - }, - "age=12": { - "model": "dungeonmobs:lavarock" - }, - "age=13": { - "model": "dungeonmobs:lavarock" - }, - "age=14": { - "model": "dungeonmobs:lavarock" - }, - "age=15": { - "model": "dungeonmobs:lavarock" - } + "age=0": { + "model": "dungeonmobs:lavarock" + }, + "age=1": { + "model": "dungeonmobs:lavarock" + }, + "age=2": { + "model": "dungeonmobs:lavarock" + }, + "age=3": { + "model": "dungeonmobs:lavarock" + }, + "age=4": { + "model": "dungeonmobs:lavarock" + }, + "age=5": { + "model": "dungeonmobs:lavarock" + }, + "age=6": { + "model": "dungeonmobs:lavarock" + }, + "age=7": { + "model": "dungeonmobs:lavarock" + }, + "age=8": { + "model": "dungeonmobs:lavarock" + }, + "age=9": { + "model": "dungeonmobs:lavarock" + }, + "age=10": { + "model": "dungeonmobs:lavarock" + }, + "age=11": { + "model": "dungeonmobs:lavarock" + }, + "age=12": { + "model": "dungeonmobs:lavarock" + }, + "age=13": { + "model": "dungeonmobs:lavarock" + }, + "age=14": { + "model": "dungeonmobs:lavarock" + }, + "age=15": { + "model": "dungeonmobs:lavarock" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/dungeonmobs/models/block/bladetrap.json b/src/main/resources/assets/dungeonmobs/models/block/bladetrap.json index 70e7364..da78758 100644 --- a/src/main/resources/assets/dungeonmobs/models/block/bladetrap.json +++ b/src/main/resources/assets/dungeonmobs/models/block/bladetrap.json @@ -1,6 +1,6 @@ { "parent": "block/cross", "textures": { - "cross": "dungeonmobs:blocks/bladetrap" + "cross": "dungeonmobs:blocks/bladetrap" } } \ No newline at end of file diff --git a/src/main/resources/assets/dungeonmobs/models/block/lavarock.json b/src/main/resources/assets/dungeonmobs/models/block/lavarock.json index e48e890..7c07551 100644 --- a/src/main/resources/assets/dungeonmobs/models/block/lavarock.json +++ b/src/main/resources/assets/dungeonmobs/models/block/lavarock.json @@ -1,6 +1,6 @@ { "parent": "block/cube_all", "textures": { - "all": "dungeonmobs:blocks/lavarock" + "all": "dungeonmobs:blocks/lavarock" } } diff --git a/src/main/resources/assets/dungeonmobs/models/item/bladetrap.json b/src/main/resources/assets/dungeonmobs/models/item/bladetrap.json index 49f7f79..4fe9aa9 100644 --- a/src/main/resources/assets/dungeonmobs/models/item/bladetrap.json +++ b/src/main/resources/assets/dungeonmobs/models/item/bladetrap.json @@ -1,6 +1,6 @@ { "parent": "item/generated", "textures": { - "layer0": "dungeonmobs:blocks/bladetrap" + "layer0": "dungeonmobs:blocks/bladetrap" } } \ No newline at end of file diff --git a/src/main/resources/assets/dungeonmobs/sounds.json b/src/main/resources/assets/dungeonmobs/sounds.json index 0815591..caad097 100644 --- a/src/main/resources/assets/dungeonmobs/sounds.json +++ b/src/main/resources/assets/dungeonmobs/sounds.json @@ -1,668 +1,668 @@ { "bl_b": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:bl_b", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:bl_b", + "stream": true + } + ] }, "bl_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:bl_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:bl_d", + "stream": true + } + ] }, "bl_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:bl_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:bl_l", + "stream": true + } + ] }, "rm_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:rm_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:rm_d", + "stream": true + } + ] }, "rm_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:rm_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:rm_h", + "stream": true + } + ] }, "rm_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:rm_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:rm_l", + "stream": true + } + ] }, "g_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:g_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:g_l", + "stream": true + } + ] }, "g_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:g_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:g_d", + "stream": true + } + ] }, "g_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:g_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:g_h", + "stream": true + } + ] }, "s_s": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:s_s", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:s_s", + "stream": true + } + ] }, "uh_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:uh_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:uh_l", + "stream": true + } + ] }, "uh_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:uh_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:uh_h", + "stream": true + } + ] }, "hh_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:hh_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:hh_h", + "stream": true + } + ] }, "hh_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:hh_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:hh_l", + "stream": true + } + ] }, "hh_l2": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:hh_l2", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:hh_l2", + "stream": true + } + ] }, "a_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:a_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:a_l", + "stream": true + } + ] }, "er_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:er_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:er_d", + "stream": true + } + ] }, "t_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:t_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:t_l", + "stream": true + } + ] }, "t_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:t_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:t_h", + "stream": true + } + ] }, "t_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:t_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:t_d", + "stream": true + } + ] }, "cf_c": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:cf_c", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:cf_c", + "stream": true + } + ] }, "cf_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:cf_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:cf_d", + "stream": true + } + ] }, "cf_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:cf_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:cf_h", + "stream": true + } + ] }, "cf_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:cf_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:cf_l", + "stream": true + } + ] }, "cf_r": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:cf_r", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:cf_r", + "stream": true + } + ] }, "d_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:d_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:d_d", + "stream": true + } + ] }, "d_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:d_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:d_h", + "stream": true + } + ] }, "d_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:d_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:d_l", + "stream": true + } + ] }, "d_s": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:d_s", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:d_s", + "stream": true + } + ] }, "i_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:i_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:i_d", + "stream": true + } + ] }, "i_e": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:i_e", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:i_e", + "stream": true + } + ] }, "i_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:i_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:i_l", + "stream": true + } + ] }, "i_p": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:i_p", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:i_p", + "stream": true + } + ] }, "nh_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:nh_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:nh_h", + "stream": true + } + ] }, "nh_i": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:nh_i", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:nh_i", + "stream": true + } + ] }, "nh_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:nh_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:nh_l", + "stream": true + } + ] }, "ra_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:ra_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:ra_l", + "stream": true + } + ] }, "ra_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:ra_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:ra_h", + "stream": true + } + ] }, "ra_el": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:ra_el", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:ra_el", + "stream": true + } + ] }, "li_a": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:li_a", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:li_a", + "stream": true + } + ] }, "li_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:li_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:li_d", + "stream": true + } + ] }, "li_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:li_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:li_h", + "stream": true + } + ] }, "li_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:li_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:li_l", + "stream": true + } + ] }, "li_l2": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:li_l2", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:li_l2", + "stream": true + } + ] }, "co_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:co_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:co_h", + "stream": true + } + ] }, "co_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:co_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:co_l", + "stream": true + } + ] }, "t_s": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:t_s", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:t_s", + "stream": true + } + ] }, "ma_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:ma_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:ma_d", + "stream": true + } + ] }, "ma_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:ma_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:ma_h", + "stream": true + } + ] }, "ma_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:ma_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:ma_l", + "stream": true + } + ] }, "ma_l2": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:ma_l2", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:ma_l2", + "stream": true + } + ] }, "ma_s": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:ma_s", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:ma_s", + "stream": true + } + ] }, "v_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:v_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:v_l", + "stream": true + } + ] }, "v_l2": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:v_l2", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:v_l2", + "stream": true + } + ] }, "v_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:v_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:v_h", + "stream": true + } + ] }, "v_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:v_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:v_d", + "stream": true + } + ] }, "v_lo": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:v_lo", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:v_lo", + "stream": true + } + ] }, "v_lo2": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:v_lo2", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:v_lo2", + "stream": true + } + ] }, "v_ho": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:v_ho", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:v_ho", + "stream": true + } + ] }, "v_do": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:v_do", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:v_do", + "stream": true + } + ] }, "be_be": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:be_be", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:be_be", + "stream": true + } + ] }, "be_pl": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:be_pl", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:be_pl", + "stream": true + } + ] }, "be_sw": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:be_sw", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:be_sw", + "stream": true + } + ] }, "fa_l1": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:fa_l1", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:fa_l1", + "stream": true + } + ] }, "fa_l2": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:fa_l2", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:fa_l2", + "stream": true + } + ] }, "fa_l3": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:fa_l3", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:fa_l3", + "stream": true + } + ] }, "fa_l4": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:fa_l4", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:fa_l4", + "stream": true + } + ] }, "em_l1": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:em_l1", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:em_l1", + "stream": true + } + ] }, "em_l2": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:em_l2", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:em_l2", + "stream": true + } + ] }, "em_l3": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:em_l3", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:em_l3", + "stream": true + } + ] }, "g2_l": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:g2_l", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:g2_l", + "stream": true + } + ] }, "g2_l2": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:g2_l2", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:g2_l2", + "stream": true + } + ] }, "g2_h": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:g2_h", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:g2_h", + "stream": true + } + ] }, "g2_d": { - "category": "entity", - "sounds": [ - { - "name": "dungeonmobs:g2_d", - "stream": true - } - ] + "category": "entity", + "sounds": [ + { + "name": "dungeonmobs:g2_d", + "stream": true + } + ] } } \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 68ce729..d77f688 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,16 +1,18 @@ [ -{ - "modid": "dungeonmobs", - "name": "Dungeon Mobs", - "description": "Evil Monsters for Minecraft", - "version": "${version}", - "mcversion": "${mcversion}", - "url": "", - "updateUrl": "", - "authorList": ["ExampleDude"], - "credits": "The Forge and FML guys, for making this example", - "logoFile": "", - "screenshots": [], - "dependencies": [] -} + { + "modid": "dungeonmobs", + "name": "Dungeon Mobs", + "description": "Evil Monsters for Minecraft", + "version": "${version}", + "mcversion": "${mcversion}", + "url": "", + "updateUrl": "", + "authorList": [ + "ExampleDude" + ], + "credits": "The Forge and FML guys, for making this example", + "logoFile": "", + "screenshots": [], + "dependencies": [] + } ] \ No newline at end of file