From e85e6a4e308d15894f1970bfe46ff0288a9df271 Mon Sep 17 00:00:00 2001 From: ACGaming <4818419+ACGaming@users.noreply.github.com> Date: Mon, 13 Sep 2021 19:03:13 +0200 Subject: [PATCH] Backport Gisela, reformatting, misc --- .../mod/acgaming/spackenmobs/Spackenmobs.java | 51 +- .../acgaming/spackenmobs/SpackenmobsTab.java | 23 +- .../spackenmobs/entities/EntityApoRed.java | 41 +- .../entities/EntityBakaMitaiCreeper.java | 460 ++--- .../entities/EntityDrachenlord.java | 418 ++--- .../EntityFriedrichLiechtenstein.java | 269 +-- .../spackenmobs/entities/EntityGisela.java | 77 + .../entities/EntityHolzstammhuhn.java | 104 +- .../spackenmobs/entities/EntityITbyHF.java | 64 - .../spackenmobs/entities/EntityIslamist.java | 460 ++--- .../spackenmobs/entities/EntityJens.java | 575 +++--- .../entities/EntityJensWither.java | 1352 +++++++------- .../entities/EntityLatinTeacher.java | 247 --- .../spackenmobs/entities/EntityMZTEWolf.java | 153 +- .../entities/EntityMarcellDAvis.java | 43 +- .../spackenmobs/entities/EntityMrBean.java | 43 +- .../spackenmobs/entities/EntitySchalker.java | 1644 +++++++++-------- .../entities/EntitySmavaCreeper.java | 470 ++--- .../entities/EntityTileraGhast.java | 584 +++--- .../ai/EntityAIBakaMitaiCreeperSwell.java | 80 +- .../entities/ai/EntityAIDance.java | 135 +- .../entities/ai/EntityAIEatDroppedFish.java | 117 +- .../entities/ai/EntityAIIslamistSwell.java | 80 +- .../ai/EntityAISmavaCreeperSwell.java | 80 +- .../events/SurstroemmingSmellsBadEvent.java | 27 +- .../spackenmobs/items/ModItemBase.java | 27 +- .../spackenmobs/items/ModItemFoodBase.java | 29 +- .../spackenmobs/items/ModItemFoodDrink.java | 42 +- .../spackenmobs/items/ModItemFoodEffect.java | 30 +- .../spackenmobs/misc/BiomeHelper.java | 66 +- .../acgaming/spackenmobs/misc/ModConfigs.java | 264 ++- .../spackenmobs/misc/ModEntities.java | 38 +- .../acgaming/spackenmobs/misc/ModItems.java | 27 +- .../spackenmobs/misc/ModLootTableList.java | 77 +- .../spackenmobs/misc/ModSoundEvents.java | 77 +- .../acgaming/spackenmobs/misc/RegHandler.java | 242 --- .../spackenmobs/misc/RegHandlerModels.java | 30 - .../spackenmobs/misc/RegistryHandler.java | 244 +++ .../misc/RegistryHandlerClient.java | 30 + .../render/LayerHeldItemLatinTeacher.java | 97 - .../render/LayerJensWitherAura.java | 85 +- .../spackenmobs/render/ModelSchalker.java | 100 +- .../spackenmobs/render/RenderApoRed.java | 73 +- .../render/RenderBakaMitaiCreeper.java | 94 +- .../spackenmobs/render/RenderDrachenlord.java | 61 +- .../render/RenderFriedrichLiechtenstein.java | 41 +- .../spackenmobs/render/RenderGisela.java | 39 + .../render/RenderHolzstammhuhn.java | 43 +- .../spackenmobs/render/RenderITbyHF.java | 38 - .../spackenmobs/render/RenderIslamist.java | 94 +- .../spackenmobs/render/RenderJens.java | 41 +- .../spackenmobs/render/RenderJensWither.java | 62 +- .../render/RenderLatinTeacher.java | 61 - .../spackenmobs/render/RenderMZTEWolf.java | 96 +- .../render/RenderMarcellDAvis.java | 63 +- .../spackenmobs/render/RenderMrBean.java | 63 +- .../spackenmobs/render/RenderSchalker.java | 355 ++-- .../render/RenderSmavaCreeper.java | 94 +- .../spackenmobs/render/RenderTileraGhast.java | 57 +- .../assets/spackenmobs/lang/de_de.lang | 3 +- .../assets/spackenmobs/lang/en_us.lang | 5 +- .../spackenmobs/textures/entities/gisela.png | Bin 0 -> 39378 bytes .../spackenmobs/textures/entities/itbyhf.png | Bin 15705 -> 0 bytes .../textures/entities/latin_teacher.png | Bin 23710 -> 0 bytes 64 files changed, 5100 insertions(+), 5385 deletions(-) create mode 100644 src/main/java/mod/acgaming/spackenmobs/entities/EntityGisela.java delete mode 100644 src/main/java/mod/acgaming/spackenmobs/entities/EntityITbyHF.java delete mode 100644 src/main/java/mod/acgaming/spackenmobs/entities/EntityLatinTeacher.java delete mode 100644 src/main/java/mod/acgaming/spackenmobs/misc/RegHandler.java delete mode 100644 src/main/java/mod/acgaming/spackenmobs/misc/RegHandlerModels.java create mode 100644 src/main/java/mod/acgaming/spackenmobs/misc/RegistryHandler.java create mode 100644 src/main/java/mod/acgaming/spackenmobs/misc/RegistryHandlerClient.java delete mode 100644 src/main/java/mod/acgaming/spackenmobs/render/LayerHeldItemLatinTeacher.java create mode 100644 src/main/java/mod/acgaming/spackenmobs/render/RenderGisela.java delete mode 100644 src/main/java/mod/acgaming/spackenmobs/render/RenderITbyHF.java delete mode 100644 src/main/java/mod/acgaming/spackenmobs/render/RenderLatinTeacher.java create mode 100644 src/main/resources/assets/spackenmobs/textures/entities/gisela.png delete mode 100644 src/main/resources/assets/spackenmobs/textures/entities/itbyhf.png delete mode 100644 src/main/resources/assets/spackenmobs/textures/entities/latin_teacher.png diff --git a/src/main/java/mod/acgaming/spackenmobs/Spackenmobs.java b/src/main/java/mod/acgaming/spackenmobs/Spackenmobs.java index 6a2d924..13e1495 100644 --- a/src/main/java/mod/acgaming/spackenmobs/Spackenmobs.java +++ b/src/main/java/mod/acgaming/spackenmobs/Spackenmobs.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs; -import mod.acgaming.spackenmobs.misc.ModEntities; import net.minecraft.creativetab.CreativeTabs; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -11,39 +10,41 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -@Mod(modid = "spackenmobs", version = "RC7", acceptedMinecraftVersions = "[1.12.2]") +import mod.acgaming.spackenmobs.misc.ModEntities; + +@Mod(modid = Spackenmobs.MODID, version = Spackenmobs.VERSION, acceptedMinecraftVersions = "[1.12.2]") public class Spackenmobs { - public static final String MODID = "spackenmobs"; - public static final String VERSION = "RC7"; + public static final String MODID = "spackenmobs"; + public static final String VERSION = "RC8"; - public static final CreativeTabs SPACKENMOBS_TAB = new SpackenmobsTab(); + public static final CreativeTabs SPACKENMOBS_TAB = new SpackenmobsTab(); - @Instance - public static Spackenmobs instance; + @Instance + public static Spackenmobs instance; - @SideOnly(Side.CLIENT) - @EventHandler - public void preInitClient(FMLPreInitializationEvent event) - { - ModEntities.initModels(); - } + @SideOnly(Side.CLIENT) + @EventHandler + public void preInitClient(FMLPreInitializationEvent event) + { + ModEntities.initModels(); + } - @EventHandler - public void preInit(FMLPreInitializationEvent event) - { + @EventHandler + public void preInit(FMLPreInitializationEvent event) + { - } + } - @EventHandler - public void init(FMLInitializationEvent event) - { + @EventHandler + public void init(FMLInitializationEvent event) + { - } + } - @EventHandler - public void postInit(FMLPostInitializationEvent event) - { + @EventHandler + public void postInit(FMLPostInitializationEvent event) + { - } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/SpackenmobsTab.java b/src/main/java/mod/acgaming/spackenmobs/SpackenmobsTab.java index 4094c66..983cff0 100644 --- a/src/main/java/mod/acgaming/spackenmobs/SpackenmobsTab.java +++ b/src/main/java/mod/acgaming/spackenmobs/SpackenmobsTab.java @@ -1,22 +1,23 @@ package mod.acgaming.spackenmobs; -import mod.acgaming.spackenmobs.misc.ModItems; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.misc.ModItems; + public class SpackenmobsTab extends CreativeTabs { - public SpackenmobsTab() - { - super(Spackenmobs.MODID); - } + public SpackenmobsTab() + { + super(Spackenmobs.MODID); + } - @SideOnly(Side.CLIENT) - @Override - public ItemStack getTabIconItem() - { - return new ItemStack(ModItems.RAM); - } + @SideOnly(Side.CLIENT) + @Override + public ItemStack getTabIconItem() + { + return new ItemStack(ModItems.RAM); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityApoRed.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityApoRed.java index 6d65a93..d694d27 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityApoRed.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityApoRed.java @@ -1,33 +1,34 @@ package mod.acgaming.spackenmobs.entities; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.util.DamageSource; import net.minecraft.util.SoundEvent; import net.minecraft.world.World; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; + public class EntityApoRed extends EntitySkeleton { - public EntityApoRed(World worldIn) - { - super(worldIn); - } + public EntityApoRed(World worldIn) + { + super(worldIn); + } - @Override - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_APORED_AMBIENT; - } + @Override + protected SoundEvent getAmbientSound() + { + return ModSoundEvents.ENTITY_APORED_AMBIENT; + } - @Override - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return ModSoundEvents.ENTITY_APORED_HURT; - } + @Override + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return ModSoundEvents.ENTITY_APORED_HURT; + } - @Override - protected SoundEvent getDeathSound() - { - return ModSoundEvents.ENTITY_APORED_DEATH; - } + @Override + protected SoundEvent getDeathSound() + { + return ModSoundEvents.ENTITY_APORED_DEATH; + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityBakaMitaiCreeper.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityBakaMitaiCreeper.java index 341e0c4..78fa0ef 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityBakaMitaiCreeper.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityBakaMitaiCreeper.java @@ -1,7 +1,8 @@ package mod.acgaming.spackenmobs.entities; -import mod.acgaming.spackenmobs.entities.ai.EntityAIBakaMitaiCreeperSwell; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; +import java.util.Collection; +import javax.annotation.Nullable; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAreaEffectCloud; import net.minecraft.entity.SharedMonsterAttributes; @@ -29,279 +30,280 @@ import net.minecraft.world.storage.loot.LootTableList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import javax.annotation.Nullable; -import java.util.Collection; +import mod.acgaming.spackenmobs.entities.ai.EntityAIBakaMitaiCreeperSwell; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; public class EntityBakaMitaiCreeper extends EntityMob { - private static final DataParameter STATE = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.VARINT); - private static final DataParameter POWERED = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN); - private static final DataParameter IGNITED = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN); - private int lastActiveTime; - private int timeSinceIgnited; - private int fuseTime = 100; - private int explosionRadius = 12; - private int droppedSkulls; + private static final DataParameter STATE = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.VARINT); + private static final DataParameter POWERED = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN); + private static final DataParameter IGNITED = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN); + private int lastActiveTime; + private int timeSinceIgnited; + private int fuseTime = 100; + private int explosionRadius = 12; + private int droppedSkulls; - public EntityBakaMitaiCreeper(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 1.7F); - } + public EntityBakaMitaiCreeper(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 1.7F); + } - protected void initEntityAI() - { - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIBakaMitaiCreeperSwell(this)); - this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); - this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false)); - this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D)); - this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(6, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); - this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); - } + public void onUpdate() + { + if (this.isEntityAlive()) + { + this.lastActiveTime = this.timeSinceIgnited; - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); - } + if (this.hasIgnited()) + { + this.setCreeperState(1); + } - public int getMaxFallHeight() - { - return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); - } + int i = this.getCreeperState(); - public void fall(float distance, float damageMultiplier) - { - super.fall(distance, damageMultiplier); - this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F); + if (i > 0 && this.timeSinceIgnited == 0) + { + this.playSound(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE, 1.0F, 1.0F); + } - if (this.timeSinceIgnited > this.fuseTime - 5) - { - this.timeSinceIgnited = this.fuseTime - 5; - } - } + this.timeSinceIgnited += i; - protected void entityInit() - { - super.entityInit(); - this.dataManager.register(STATE, -1); - this.dataManager.register(POWERED, Boolean.FALSE); - this.dataManager.register(IGNITED, Boolean.FALSE); - } + if (this.timeSinceIgnited < 0) + { + this.timeSinceIgnited = 0; + } - public void writeEntityToNBT(NBTTagCompound compound) - { - super.writeEntityToNBT(compound); + if (this.timeSinceIgnited >= this.fuseTime) + { + this.timeSinceIgnited = this.fuseTime; + this.explode(); + } + } + super.onUpdate(); + } - if (this.dataManager.get(POWERED)) - { - compound.setBoolean("powered", true); - } + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return SoundEvents.ENTITY_CREEPER_HURT; + } - compound.setShort("Fuse", (short) this.fuseTime); - compound.setByte("ExplosionRadius", (byte) this.explosionRadius); - compound.setBoolean("ignited", this.hasIgnited()); - } + protected SoundEvent getDeathSound() + { + return SoundEvents.ENTITY_CREEPER_DEATH; + } - public void readEntityFromNBT(NBTTagCompound compound) - { - super.readEntityFromNBT(compound); - this.dataManager.set(POWERED, compound.getBoolean("powered")); + public boolean attackEntityAsMob(Entity entityIn) + { + return true; + } - if (compound.hasKey("Fuse", 99)) - { - this.fuseTime = compound.getShort("Fuse"); - } + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); + } - if (compound.hasKey("ExplosionRadius", 99)) - { - this.explosionRadius = compound.getByte("ExplosionRadius"); - } + public void onDeath(DamageSource cause) + { + super.onDeath(cause); - if (compound.getBoolean("ignited")) - { - this.ignite(); - } - } + if (this.world.getGameRules().getBoolean("doMobLoot")) + { + if (cause.getTrueSource() instanceof EntitySkeleton) + { + int i = Item.getIdFromItem(Items.RECORD_13); + int j = Item.getIdFromItem(Items.RECORD_WAIT); + int k = i + this.rand.nextInt(j - i + 1); + this.dropItem(Item.getItemById(k), 1); + } + else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).ableToCauseSkullDrop()) + { + ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).incrementDroppedSkulls(); + this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F); + } + } + } - public void onUpdate() - { - if (this.isEntityAlive()) - { - this.lastActiveTime = this.timeSinceIgnited; + public void fall(float distance, float damageMultiplier) + { + super.fall(distance, damageMultiplier); + this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F); - if (this.hasIgnited()) - { - this.setCreeperState(1); - } + if (this.timeSinceIgnited > this.fuseTime - 5) + { + this.timeSinceIgnited = this.fuseTime - 5; + } + } - int i = this.getCreeperState(); + public boolean getPowered() + { + return this.dataManager.get(POWERED); + } - if (i > 0 && this.timeSinceIgnited == 0) - { - this.playSound(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE, 1.0F, 1.0F); - } + @SideOnly(Side.CLIENT) + public float getCreeperFlashIntensity(float p_70831_1_) + { + return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2); + } - this.timeSinceIgnited += i; + public int getCreeperState() + { + return this.dataManager.get(STATE); + } - if (this.timeSinceIgnited < 0) - { - this.timeSinceIgnited = 0; - } + public void setCreeperState(int state) + { + this.dataManager.set(STATE, state); + } - if (this.timeSinceIgnited >= this.fuseTime) - { - this.timeSinceIgnited = this.fuseTime; - this.explode(); - } - } - super.onUpdate(); - } + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + super.onStruckByLightning(lightningBolt); + this.dataManager.set(POWERED, Boolean.TRUE); + } - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return SoundEvents.ENTITY_CREEPER_HURT; - } + public boolean hasIgnited() + { + return this.dataManager.get(IGNITED); + } - protected SoundEvent getDeathSound() - { - return SoundEvents.ENTITY_CREEPER_DEATH; - } + public void ignite() + { + this.dataManager.set(IGNITED, Boolean.TRUE); + } - public void onDeath(DamageSource cause) - { - super.onDeath(cause); + public boolean ableToCauseSkullDrop() + { + return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot"); + } - if (this.world.getGameRules().getBoolean("doMobLoot")) - { - if (cause.getTrueSource() instanceof EntitySkeleton) - { - int i = Item.getIdFromItem(Items.RECORD_13); - int j = Item.getIdFromItem(Items.RECORD_WAIT); - int k = i + this.rand.nextInt(j - i + 1); - this.dropItem(Item.getItemById(k), 1); - } else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).ableToCauseSkullDrop()) - { - ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).incrementDroppedSkulls(); - this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F); - } - } - } + public void incrementDroppedSkulls() + { + ++this.droppedSkulls; + } - public boolean attackEntityAsMob(Entity entityIn) - { - return true; - } + protected void initEntityAI() + { + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIBakaMitaiCreeperSwell(this)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false)); + this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + } - public boolean getPowered() - { - return this.dataManager.get(POWERED); - } + protected void entityInit() + { + super.entityInit(); + this.dataManager.register(STATE, -1); + this.dataManager.register(POWERED, Boolean.FALSE); + this.dataManager.register(IGNITED, Boolean.FALSE); + } - @SideOnly(Side.CLIENT) - public float getCreeperFlashIntensity(float p_70831_1_) - { - return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2); - } + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); - @Nullable - protected ResourceLocation getLootTable() - { - return LootTableList.ENTITIES_CREEPER; - } + if (this.dataManager.get(POWERED)) + { + compound.setBoolean("powered", true); + } - public int getCreeperState() - { - return this.dataManager.get(STATE); - } + compound.setShort("Fuse", (short) this.fuseTime); + compound.setByte("ExplosionRadius", (byte) this.explosionRadius); + compound.setBoolean("ignited", this.hasIgnited()); + } - public void setCreeperState(int state) - { - this.dataManager.set(STATE, state); - } + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); + this.dataManager.set(POWERED, compound.getBoolean("powered")); - public void onStruckByLightning(EntityLightningBolt lightningBolt) - { - super.onStruckByLightning(lightningBolt); - this.dataManager.set(POWERED, Boolean.TRUE); - } + if (compound.hasKey("Fuse", 99)) + { + this.fuseTime = compound.getShort("Fuse"); + } - protected boolean processInteract(EntityPlayer player, EnumHand hand) - { - ItemStack itemstack = player.getHeldItem(hand); + if (compound.hasKey("ExplosionRadius", 99)) + { + this.explosionRadius = compound.getByte("ExplosionRadius"); + } - if (itemstack.getItem() == Items.FLINT_AND_STEEL) - { - this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); - player.swingArm(hand); + if (compound.getBoolean("ignited")) + { + this.ignite(); + } + } - if (!this.world.isRemote) - { - this.ignite(); - itemstack.damageItem(1, player); - return true; - } - } + @Nullable + protected ResourceLocation getLootTable() + { + return LootTableList.ENTITIES_CREEPER; + } - return super.processInteract(player, hand); - } + public int getMaxFallHeight() + { + return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); + } - private void explode() - { - if (!this.world.isRemote) - { - boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this); - float f = this.getPowered() ? 2.0F : 1.0F; - this.dead = true; - this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW, getSoundCategory(), 2.0F, 1.0F); - this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag); - this.setDead(); - this.spawnLingeringCloud(); - } - } + protected boolean processInteract(EntityPlayer player, EnumHand hand) + { + ItemStack itemstack = player.getHeldItem(hand); - private void spawnLingeringCloud() - { - Collection collection = this.getActivePotionEffects(); + if (itemstack.getItem() == Items.FLINT_AND_STEEL) + { + this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); + player.swingArm(hand); - if (!collection.isEmpty()) - { - EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ); - entityareaeffectcloud.setRadius(2.5F); - entityareaeffectcloud.setRadiusOnUse(-0.5F); - entityareaeffectcloud.setWaitTime(10); - entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2); - entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration()); + if (!this.world.isRemote) + { + this.ignite(); + itemstack.damageItem(1, player); + return true; + } + } - for (PotionEffect potioneffect : collection) - { - entityareaeffectcloud.addEffect(new PotionEffect(potioneffect)); - } + return super.processInteract(player, hand); + } - this.world.spawnEntity(entityareaeffectcloud); - } - } + private void explode() + { + if (!this.world.isRemote) + { + boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this); + float f = this.getPowered() ? 2.0F : 1.0F; + this.dead = true; + this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW, getSoundCategory(), 2.0F, 1.0F); + this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag); + this.setDead(); + this.spawnLingeringCloud(); + } + } - public boolean hasIgnited() - { - return this.dataManager.get(IGNITED); - } + private void spawnLingeringCloud() + { + Collection collection = this.getActivePotionEffects(); - public void ignite() - { - this.dataManager.set(IGNITED, Boolean.TRUE); - } + if (!collection.isEmpty()) + { + EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ); + entityareaeffectcloud.setRadius(2.5F); + entityareaeffectcloud.setRadiusOnUse(-0.5F); + entityareaeffectcloud.setWaitTime(10); + entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2); + entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration()); - public boolean ableToCauseSkullDrop() - { - return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot"); - } + for (PotionEffect potioneffect : collection) + { + entityareaeffectcloud.addEffect(new PotionEffect(potioneffect)); + } - public void incrementDroppedSkulls() - { - ++this.droppedSkulls; - } + this.world.spawnEntity(entityareaeffectcloud); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityDrachenlord.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityDrachenlord.java index 39f3a5d..f835acd 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityDrachenlord.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityDrachenlord.java @@ -1,6 +1,8 @@ package mod.acgaming.spackenmobs.entities; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; +import java.util.UUID; +import javax.annotation.Nullable; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; @@ -24,250 +26,252 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; import net.minecraft.world.storage.loot.LootTableList; -import javax.annotation.Nullable; -import java.util.UUID; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; public class EntityDrachenlord extends EntityZombie { - private static final UUID ATTACK_SPEED_BOOST_MODIFIER_UUID = UUID - .fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); - private static final AttributeModifier ATTACK_SPEED_BOOST_MODIFIER = (new AttributeModifier( - ATTACK_SPEED_BOOST_MODIFIER_UUID, "Attacking speed boost", 0.05D, 0)).setSaved(false); - private int angerLevel; - private int randomSoundDelay; - private UUID angerTargetUUID; + private static final UUID ATTACK_SPEED_BOOST_MODIFIER_UUID = UUID + .fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); + private static final AttributeModifier ATTACK_SPEED_BOOST_MODIFIER = (new AttributeModifier( + ATTACK_SPEED_BOOST_MODIFIER_UUID, "Attacking speed boost", 0.05D, 0)).setSaved(false); + private int angerLevel; + private int randomSoundDelay; + private UUID angerTargetUUID; - public EntityDrachenlord(World worldIn) - { - super(worldIn); - this.isImmuneToFire = true; - } + public EntityDrachenlord(World worldIn) + { + super(worldIn); + this.isImmuneToFire = true; + } - @Override - public void setRevengeTarget(@Nullable EntityLivingBase livingBase) - { - super.setRevengeTarget(livingBase); + @Override + public void setRevengeTarget(@Nullable EntityLivingBase livingBase) + { + super.setRevengeTarget(livingBase); - if (livingBase != null) - { - this.angerTargetUUID = livingBase.getUniqueID(); - } - } + if (livingBase != null) + { + this.angerTargetUUID = livingBase.getUniqueID(); + } + } - @Override - protected void applyEntityAI() - { - this.targetTasks.addTask(1, new EntityDrachenlord.AIHurtByAggressor(this)); - this.targetTasks.addTask(2, new EntityDrachenlord.AITargetAggressor(this)); - } + @Override + public boolean getCanSpawnHere() + { + return this.world.getDifficulty() != EnumDifficulty.PEACEFUL; + } - @Override - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(0.0D); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D); - this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D); - } + @Override + public boolean isPreventingPlayerRest(EntityPlayer playerIn) + { + return this.isAngry(); + } - @Override - protected void updateAITasks() - { - IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED); + public void becomeAngryAt(Entity p_70835_1_) + { + this.angerLevel = 400 + this.rand.nextInt(400); + this.randomSoundDelay = this.rand.nextInt(40); - if (this.isAngry()) - { - if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER)) - { - iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER); - } + if (p_70835_1_ instanceof EntityLivingBase) + { + this.setRevengeTarget((EntityLivingBase) p_70835_1_); + } + } - --this.angerLevel; - } else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER)) - { - iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER); - } + public boolean isAngry() + { + return this.angerLevel > 0; + } - if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) - { - this.playSound(ModSoundEvents.ENTITY_DRACHENLORD_ANGRY, this.getSoundVolume() * 2.0F, 1.0F); - } + @Override + protected void applyEntityAI() + { + this.targetTasks.addTask(1, new EntityDrachenlord.AIHurtByAggressor(this)); + this.targetTasks.addTask(2, new EntityDrachenlord.AITargetAggressor(this)); + } - if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getRevengeTarget() == null) - { - EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID); - this.setRevengeTarget(entityplayer); - this.attackingPlayer = entityplayer; - this.recentlyHit = this.getRevengeTimer(); - } + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(0.0D); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D); + } - super.updateAITasks(); - } + @Override + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + Entity entity = source.getTrueSource(); - @Override - public boolean getCanSpawnHere() - { - return this.world.getDifficulty() != EnumDifficulty.PEACEFUL; - } + if (entity instanceof EntityPlayer) + { + this.becomeAngryAt(entity); + } - @Override - public boolean isNotColliding() - { - return this.world.checkNoEntityCollision(this.getEntityBoundingBox(), this) - && this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() - && !this.world.containsAnyLiquid(this.getEntityBoundingBox()); - } + return super.attackEntityFrom(source, amount); + } + } - @Override - public void writeEntityToNBT(NBTTagCompound compound) - { - super.writeEntityToNBT(compound); - compound.setShort("Anger", (short) this.angerLevel); + @Override + protected SoundEvent getAmbientSound() + { + return ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT; + } - if (this.angerTargetUUID != null) - { - compound.setString("HurtBy", this.angerTargetUUID.toString()); - } else - { - compound.setString("HurtBy", ""); - } - } + @Override + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return ModSoundEvents.ENTITY_DRACHENLORD_HURT; + } - @Override - public void readEntityFromNBT(NBTTagCompound compound) - { - super.readEntityFromNBT(compound); - this.angerLevel = compound.getShort("Anger"); - String s = compound.getString("HurtBy"); + @Override + protected SoundEvent getDeathSound() + { + return ModSoundEvents.ENTITY_DRACHENLORD_DEATH; + } - if (!s.isEmpty()) - { - this.angerTargetUUID = UUID.fromString(s); - EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID); - this.setRevengeTarget(entityplayer); + @Override + @Nullable + protected ResourceLocation getLootTable() + { + return LootTableList.ENTITIES_ZOMBIE_PIGMAN; + } - if (entityplayer != null) - { - this.attackingPlayer = entityplayer; - this.recentlyHit = this.getRevengeTimer(); - } - } - } + @Override + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) + { + this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_AXE)); + } - @Override - public boolean attackEntityFrom(DamageSource source, float amount) - { - if (this.isEntityInvulnerable(source)) - { - return false; - } else - { - Entity entity = source.getTrueSource(); + @Override + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); + compound.setShort("Anger", (short) this.angerLevel); - if (entity instanceof EntityPlayer) - { - this.becomeAngryAt(entity); - } + if (this.angerTargetUUID != null) + { + compound.setString("HurtBy", this.angerTargetUUID.toString()); + } + else + { + compound.setString("HurtBy", ""); + } + } - return super.attackEntityFrom(source, amount); - } - } + @Override + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); + this.angerLevel = compound.getShort("Anger"); + String s = compound.getString("HurtBy"); - public void becomeAngryAt(Entity p_70835_1_) - { - this.angerLevel = 400 + this.rand.nextInt(400); - this.randomSoundDelay = this.rand.nextInt(40); + if (!s.isEmpty()) + { + this.angerTargetUUID = UUID.fromString(s); + EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID); + this.setRevengeTarget(entityplayer); - if (p_70835_1_ instanceof EntityLivingBase) - { - this.setRevengeTarget((EntityLivingBase) p_70835_1_); - } - } + if (entityplayer != null) + { + this.attackingPlayer = entityplayer; + this.recentlyHit = this.getRevengeTimer(); + } + } + } - public boolean isAngry() - { - return this.angerLevel > 0; - } + @Override + protected ItemStack getSkullDrop() + { + return ItemStack.EMPTY; + } - @Override - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT; - } + @Override + protected void updateAITasks() + { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED); - @Override - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return ModSoundEvents.ENTITY_DRACHENLORD_HURT; - } + if (this.isAngry()) + { + if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER)) + { + iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER); + } - @Override - protected SoundEvent getDeathSound() - { - return ModSoundEvents.ENTITY_DRACHENLORD_DEATH; - } + --this.angerLevel; + } + else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER)) + { + iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER); + } - @Override - @Nullable - protected ResourceLocation getLootTable() - { - return LootTableList.ENTITIES_ZOMBIE_PIGMAN; - } + if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) + { + this.playSound(ModSoundEvents.ENTITY_DRACHENLORD_ANGRY, this.getSoundVolume() * 2.0F, 1.0F); + } - @Override - public boolean processInteract(EntityPlayer player, EnumHand hand) - { - return false; - } + if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getRevengeTarget() == null) + { + EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID); + this.setRevengeTarget(entityplayer); + this.attackingPlayer = entityplayer; + this.recentlyHit = this.getRevengeTimer(); + } - @Override - protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) - { - this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_AXE)); - } + super.updateAITasks(); + } - @Override - protected ItemStack getSkullDrop() - { - return ItemStack.EMPTY; - } + @Override + public boolean isNotColliding() + { + return this.world.checkNoEntityCollision(this.getEntityBoundingBox(), this) + && this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() + && !this.world.containsAnyLiquid(this.getEntityBoundingBox()); + } - @Override - public boolean isPreventingPlayerRest(EntityPlayer playerIn) - { - return this.isAngry(); - } + @Override + public boolean processInteract(EntityPlayer player, EnumHand hand) + { + return false; + } - static class AIHurtByAggressor extends EntityAIHurtByTarget - { - public AIHurtByAggressor(EntityDrachenlord p_i45828_1_) - { - super(p_i45828_1_, true); - } + static class AIHurtByAggressor extends EntityAIHurtByTarget + { + public AIHurtByAggressor(EntityDrachenlord p_i45828_1_) + { + super(p_i45828_1_, true); + } - @Override - protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) - { - super.setEntityAttackTarget(creatureIn, entityLivingBaseIn); + @Override + protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) + { + super.setEntityAttackTarget(creatureIn, entityLivingBaseIn); - if (creatureIn instanceof EntityDrachenlord) - { - ((EntityDrachenlord) creatureIn).becomeAngryAt(entityLivingBaseIn); - } - } - } + if (creatureIn instanceof EntityDrachenlord) + { + ((EntityDrachenlord) creatureIn).becomeAngryAt(entityLivingBaseIn); + } + } + } - static class AITargetAggressor extends EntityAINearestAttackableTarget - { - public AITargetAggressor(EntityDrachenlord p_i45829_1_) - { - super(p_i45829_1_, EntityPlayer.class, true); - } + static class AITargetAggressor extends EntityAINearestAttackableTarget + { + public AITargetAggressor(EntityDrachenlord p_i45829_1_) + { + super(p_i45829_1_, EntityPlayer.class, true); + } - @Override - public boolean shouldExecute() - { - return ((EntityDrachenlord) this.taskOwner).isAngry() && super.shouldExecute(); - } - } + @Override + public boolean shouldExecute() + { + return ((EntityDrachenlord) this.taskOwner).isAngry() && super.shouldExecute(); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityFriedrichLiechtenstein.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityFriedrichLiechtenstein.java index 1fb8f42..2d1ae4c 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityFriedrichLiechtenstein.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityFriedrichLiechtenstein.java @@ -1,8 +1,5 @@ package mod.acgaming.spackenmobs.entities; -import mod.acgaming.spackenmobs.misc.ModItems; -import mod.acgaming.spackenmobs.misc.ModLootTableList; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.IMerchant; @@ -19,159 +16,167 @@ import net.minecraft.village.MerchantRecipe; import net.minecraft.village.MerchantRecipeList; import net.minecraft.world.World; +import mod.acgaming.spackenmobs.misc.ModItems; +import mod.acgaming.spackenmobs.misc.ModLootTableList; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; + public class EntityFriedrichLiechtenstein extends EntityCreature implements IMerchant { - public EntityFriedrichLiechtenstein(World worldIn) - { - super(worldIn); - setSize(0.6F, 1.8F); - setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.AHOJ_BRAUSE)); - setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK)); - } + public EntityFriedrichLiechtenstein(World worldIn) + { + super(worldIn); + setSize(0.6F, 1.8F); + setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.AHOJ_BRAUSE)); + setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK)); + } - @Override - protected void initEntityAI() - { - this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIMoveIndoors(this)); - this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); - this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); - this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); - this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); - this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D)); - this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); - } + @Override + protected void initEntityAI() + { + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIMoveIndoors(this)); + this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); + this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); + this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); + this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D)); + this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); + } - @Override - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); - } + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); + } - @Override - public boolean processInteract(EntityPlayer player, EnumHand hand) - { - ItemStack itemstack = player.getHeldItem(hand); + @Override + protected SoundEvent getAmbientSound() + { + return ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT; + } - if (itemstack.getItem() == Items.GLASS_BOTTLE) - { - player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_DEATH, 1.0F, 1.0F); - player.playSound(SoundEvents.ENTITY_COW_MILK, 1.0F, 1.0F); - for (int i = 0; i < 7; ++i) - { - double d0 = this.rand.nextGaussian() * 0.02D; - double d1 = this.rand.nextGaussian() * 0.02D; - double d2 = this.rand.nextGaussian() * 0.02D; - this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2); - } - itemstack.shrink(1); + @Override + protected ResourceLocation getLootTable() + { + return ModLootTableList.ENTITIES_FRIEDRICH; + } - if (itemstack.isEmpty()) - { - player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK)); - } else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE_DRINK))) - { - player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE_DRINK), false); - } + @Override + public boolean processInteract(EntityPlayer player, EnumHand hand) + { + ItemStack itemstack = player.getHeldItem(hand); - return true; - } else if (itemstack.getItem() == Items.PAPER) - { - player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT, 1.0F, 1.0F); - for (int i = 0; i < 7; ++i) - { - double d0 = this.rand.nextGaussian() * 0.02D; - double d1 = this.rand.nextGaussian() * 0.02D; - double d2 = this.rand.nextGaussian() * 0.02D; - this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2); - } - itemstack.shrink(1); + if (itemstack.getItem() == Items.GLASS_BOTTLE) + { + player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_DEATH, 1.0F, 1.0F); + player.playSound(SoundEvents.ENTITY_COW_MILK, 1.0F, 1.0F); + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2); + } + itemstack.shrink(1); - if (itemstack.isEmpty()) - { - player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE)); - } else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE))) - { - player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE), false); - } + if (itemstack.isEmpty()) + { + player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK)); + } + else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE_DRINK))) + { + player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE_DRINK), false); + } - return true; - } else - { - return super.processInteract(player, hand); - } - } + return true; + } + else if (itemstack.getItem() == Items.PAPER) + { + player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT, 1.0F, 1.0F); + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2); + } + itemstack.shrink(1); - @Override - protected ResourceLocation getLootTable() - { - return ModLootTableList.ENTITIES_FRIEDRICH; - } + if (itemstack.isEmpty()) + { + player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE)); + } + else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE))) + { + player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE), false); + } - @Override - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT; - } + return true; + } + else + { + return super.processInteract(player, hand); + } + } - @Override - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return ModSoundEvents.ENTITY_FRIEDRICH_HURT; - } + @Override + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return ModSoundEvents.ENTITY_FRIEDRICH_HURT; + } - @Override - protected SoundEvent getDeathSound() - { - return ModSoundEvents.ENTITY_FRIEDRICH_DEATH; - } + @Override + protected SoundEvent getDeathSound() + { + return ModSoundEvents.ENTITY_FRIEDRICH_DEATH; + } - @Override - public EntityPlayer getCustomer() - { - return null; - } + @Override + public EntityPlayer getCustomer() + { + return null; + } - @Override - public void setCustomer(EntityPlayer player) - { + @Override + public void setCustomer(EntityPlayer player) + { - } + } - @Override - public MerchantRecipeList getRecipes(EntityPlayer player) - { - return null; - } + @Override + public MerchantRecipeList getRecipes(EntityPlayer player) + { + return null; + } - @Override - public void setRecipes(MerchantRecipeList recipeList) - { + @Override + public void setRecipes(MerchantRecipeList recipeList) + { - } + } - @Override - public void useRecipe(MerchantRecipe recipe) - { + @Override + public void useRecipe(MerchantRecipe recipe) + { - } + } - @Override - public void verifySellingItem(ItemStack stack) - { + @Override + public void verifySellingItem(ItemStack stack) + { - } + } - @Override - public World getWorld() - { - return null; - } + @Override + public World getWorld() + { + return null; + } - @Override - public BlockPos getPos() - { - return null; - } + @Override + public BlockPos getPos() + { + return null; + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityGisela.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityGisela.java new file mode 100644 index 0000000..c9a3661 --- /dev/null +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityGisela.java @@ -0,0 +1,77 @@ +package mod.acgaming.spackenmobs.entities; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; +import net.minecraft.util.DamageSource; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class EntityGisela extends EntityAnimal +{ + public EntityGisela(World worldIn) + { + super(worldIn); + this.setSize(0.9F, 1.4F); + } + + public EntityGisela createChild(EntityAgeable ageable) + { + return new EntityGisela(this.world); + } + + protected void initEntityAI() + { + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.SUGAR, true)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); + this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(1.25D); + } + + protected SoundEvent getAmbientSound() + { + return SoundEvents.ENTITY_COW_AMBIENT; + } + + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return SoundEvents.ENTITY_COW_HURT; + } + + protected SoundEvent getDeathSound() + { + return SoundEvents.ENTITY_COW_DEATH; + } + + protected float getSoundVolume() + { + return 0.6F; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound(SoundEvents.ENTITY_COW_STEP, 0.15F, 1.0F); + } + + public float getEyeHeight() + { + return this.isChild() ? this.height : 1.3F; + } +} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityHolzstammhuhn.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityHolzstammhuhn.java index 3d94307..da1ef6b 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityHolzstammhuhn.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityHolzstammhuhn.java @@ -1,5 +1,7 @@ package mod.acgaming.spackenmobs.entities; +import java.util.Set; + import com.google.common.collect.Sets; import net.minecraft.block.Block; import net.minecraft.entity.EntityAgeable; @@ -16,66 +18,64 @@ import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.Set; - public class EntityHolzstammhuhn extends EntityChicken { - private static final Set TEMPTATION_ITEMS = Sets.newHashSet(Items.STICK); + private static final Set TEMPTATION_ITEMS = Sets.newHashSet(Items.STICK); - public EntityHolzstammhuhn(World worldIn) - { - super(worldIn); - this.setSize(0.4F, 0.7F); - this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; - this.setPathPriority(PathNodeType.WATER, 0.0F); - } + public EntityHolzstammhuhn(World worldIn) + { + super(worldIn); + this.setSize(0.4F, 0.7F); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + this.setPathPriority(PathNodeType.WATER, 0.0F); + } - @Override - protected void initEntityAI() - { - this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); - this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(3, new EntityAITempt(this, 1.0D, false, TEMPTATION_ITEMS)); - this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); - this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); - this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - this.tasks.addTask(7, new EntityAILookIdle(this)); - } + @Override + protected void initEntityAI() + { + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.0D, false, TEMPTATION_ITEMS)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } - @Override - public boolean isBreedingItem(ItemStack stack) - { - return TEMPTATION_ITEMS.contains(stack.getItem()); - } + @Override + protected SoundEvent getAmbientSound() + { + return SoundEvents.BLOCK_WOOD_PLACE; + } - @Override - protected SoundEvent getAmbientSound() - { - return SoundEvents.BLOCK_WOOD_PLACE; - } + @Override + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return SoundEvents.BLOCK_WOOD_HIT; + } - @Override - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return SoundEvents.BLOCK_WOOD_HIT; - } + @Override + protected SoundEvent getDeathSound() + { + return SoundEvents.BLOCK_WOOD_BREAK; + } - @Override - protected SoundEvent getDeathSound() - { - return SoundEvents.BLOCK_WOOD_BREAK; - } + @Override + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound(SoundEvents.BLOCK_WOOD_STEP, 0.15F, 1.0F); + } - @Override - protected void playStepSound(BlockPos pos, Block blockIn) - { - this.playSound(SoundEvents.BLOCK_WOOD_STEP, 0.15F, 1.0F); - } + @Override + public EntityHolzstammhuhn createChild(EntityAgeable ageable) + { + return new EntityHolzstammhuhn(this.world); + } - @Override - public EntityHolzstammhuhn createChild(EntityAgeable ageable) - { - return new EntityHolzstammhuhn(this.world); - } + @Override + public boolean isBreedingItem(ItemStack stack) + { + return TEMPTATION_ITEMS.contains(stack.getItem()); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityITbyHF.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityITbyHF.java deleted file mode 100644 index 76a9682..0000000 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityITbyHF.java +++ /dev/null @@ -1,64 +0,0 @@ -package mod.acgaming.spackenmobs.entities; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.*; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.SoundEvents; -import net.minecraft.util.DamageSource; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.SoundEvent; -import net.minecraft.world.World; -import net.minecraft.world.storage.loot.LootTableList; - -import javax.annotation.Nullable; - -public class EntityITbyHF extends EntityCreature -{ - public EntityITbyHF(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 2.0F); - } - - protected void initEntityAI() - { - this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityLatinTeacher.class, 12.0F, 0.8D, 0.8D)); - this.tasks.addTask(2, new EntityAIMoveIndoors(this)); - this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); - this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); - this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); - this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); - this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D)); - this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); - } - - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D); - } - - protected void entityInit() - { - super.entityInit(); - } - - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return SoundEvents.ENTITY_VILLAGER_HURT; - } - - protected SoundEvent getDeathSound() - { - return SoundEvents.ENTITY_VILLAGER_DEATH; - } - - @Nullable - protected ResourceLocation getLootTable() - { - return LootTableList.ENTITIES_VILLAGER; - } -} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityIslamist.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityIslamist.java index 5c6b42e..3bca50d 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityIslamist.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityIslamist.java @@ -1,7 +1,8 @@ package mod.acgaming.spackenmobs.entities; -import mod.acgaming.spackenmobs.entities.ai.EntityAIIslamistSwell; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; +import java.util.Collection; +import javax.annotation.Nullable; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAreaEffectCloud; import net.minecraft.entity.SharedMonsterAttributes; @@ -29,279 +30,280 @@ import net.minecraft.world.storage.loot.LootTableList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import javax.annotation.Nullable; -import java.util.Collection; +import mod.acgaming.spackenmobs.entities.ai.EntityAIIslamistSwell; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; public class EntityIslamist extends EntityMob { - private static final DataParameter STATE = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.VARINT); - private static final DataParameter POWERED = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.BOOLEAN); - private static final DataParameter IGNITED = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.BOOLEAN); - private int lastActiveTime; - private int timeSinceIgnited; - private int fuseTime = 30; - private int explosionRadius = 6; - private int droppedSkulls; + private static final DataParameter STATE = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.VARINT); + private static final DataParameter POWERED = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.BOOLEAN); + private static final DataParameter IGNITED = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.BOOLEAN); + private int lastActiveTime; + private int timeSinceIgnited; + private int fuseTime = 30; + private int explosionRadius = 6; + private int droppedSkulls; - public EntityIslamist(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 1.7F); - } + public EntityIslamist(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 1.7F); + } - protected void initEntityAI() - { - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIIslamistSwell(this)); - this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); - this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false)); - this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D)); - this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(6, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); - this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); - } + public void onUpdate() + { + if (this.isEntityAlive()) + { + this.lastActiveTime = this.timeSinceIgnited; - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); - } + if (this.hasIgnited()) + { + this.setCreeperState(1); + } - public int getMaxFallHeight() - { - return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); - } + int i = this.getCreeperState(); - public void fall(float distance, float damageMultiplier) - { - super.fall(distance, damageMultiplier); - this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F); + if (i > 0 && this.timeSinceIgnited == 0) + { + this.playSound(ModSoundEvents.ENTITY_ISLAMIST_FUSE, 1.0F, 0.5F); + } - if (this.timeSinceIgnited > this.fuseTime - 5) - { - this.timeSinceIgnited = this.fuseTime - 5; - } - } + this.timeSinceIgnited += i; - protected void entityInit() - { - super.entityInit(); - this.dataManager.register(STATE, -1); - this.dataManager.register(POWERED, Boolean.FALSE); - this.dataManager.register(IGNITED, Boolean.FALSE); - } + if (this.timeSinceIgnited < 0) + { + this.timeSinceIgnited = 0; + } - public void writeEntityToNBT(NBTTagCompound compound) - { - super.writeEntityToNBT(compound); + if (this.timeSinceIgnited >= this.fuseTime) + { + this.timeSinceIgnited = this.fuseTime; + this.explode(); + } + } + super.onUpdate(); + } - if (this.dataManager.get(POWERED)) - { - compound.setBoolean("powered", true); - } + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return ModSoundEvents.ENTITY_ISLAMIST_HURT; + } - compound.setShort("Fuse", (short) this.fuseTime); - compound.setByte("ExplosionRadius", (byte) this.explosionRadius); - compound.setBoolean("ignited", this.hasIgnited()); - } + protected SoundEvent getDeathSound() + { + return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT; + } - public void readEntityFromNBT(NBTTagCompound compound) - { - super.readEntityFromNBT(compound); - this.dataManager.set(POWERED, compound.getBoolean("powered")); + public boolean attackEntityAsMob(Entity entityIn) + { + return true; + } - if (compound.hasKey("Fuse", 99)) - { - this.fuseTime = compound.getShort("Fuse"); - } + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); + } - if (compound.hasKey("ExplosionRadius", 99)) - { - this.explosionRadius = compound.getByte("ExplosionRadius"); - } + public void onDeath(DamageSource cause) + { + super.onDeath(cause); - if (compound.getBoolean("ignited")) - { - this.ignite(); - } - } + if (this.world.getGameRules().getBoolean("doMobLoot")) + { + if (cause.getTrueSource() instanceof EntitySkeleton) + { + int i = Item.getIdFromItem(Items.RECORD_13); + int j = Item.getIdFromItem(Items.RECORD_WAIT); + int k = i + this.rand.nextInt(j - i + 1); + this.dropItem(Item.getItemById(k), 1); + } + else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntityIslamist && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).ableToCauseSkullDrop()) + { + ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).incrementDroppedSkulls(); + this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F); + } + } + } - public void onUpdate() - { - if (this.isEntityAlive()) - { - this.lastActiveTime = this.timeSinceIgnited; + public void fall(float distance, float damageMultiplier) + { + super.fall(distance, damageMultiplier); + this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F); - if (this.hasIgnited()) - { - this.setCreeperState(1); - } + if (this.timeSinceIgnited > this.fuseTime - 5) + { + this.timeSinceIgnited = this.fuseTime - 5; + } + } - int i = this.getCreeperState(); + public boolean getPowered() + { + return this.dataManager.get(POWERED); + } - if (i > 0 && this.timeSinceIgnited == 0) - { - this.playSound(ModSoundEvents.ENTITY_ISLAMIST_FUSE, 1.0F, 0.5F); - } + @SideOnly(Side.CLIENT) + public float getCreeperFlashIntensity(float p_70831_1_) + { + return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2); + } - this.timeSinceIgnited += i; + public int getCreeperState() + { + return this.dataManager.get(STATE); + } - if (this.timeSinceIgnited < 0) - { - this.timeSinceIgnited = 0; - } + public void setCreeperState(int state) + { + this.dataManager.set(STATE, state); + } - if (this.timeSinceIgnited >= this.fuseTime) - { - this.timeSinceIgnited = this.fuseTime; - this.explode(); - } - } - super.onUpdate(); - } + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + super.onStruckByLightning(lightningBolt); + this.dataManager.set(POWERED, Boolean.TRUE); + } - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return ModSoundEvents.ENTITY_ISLAMIST_HURT; - } + public boolean hasIgnited() + { + return this.dataManager.get(IGNITED); + } - protected SoundEvent getDeathSound() - { - return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT; - } + public void ignite() + { + this.dataManager.set(IGNITED, Boolean.TRUE); + } - public void onDeath(DamageSource cause) - { - super.onDeath(cause); + public boolean ableToCauseSkullDrop() + { + return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot"); + } - if (this.world.getGameRules().getBoolean("doMobLoot")) - { - if (cause.getTrueSource() instanceof EntitySkeleton) - { - int i = Item.getIdFromItem(Items.RECORD_13); - int j = Item.getIdFromItem(Items.RECORD_WAIT); - int k = i + this.rand.nextInt(j - i + 1); - this.dropItem(Item.getItemById(k), 1); - } else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntityIslamist && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).ableToCauseSkullDrop()) - { - ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).incrementDroppedSkulls(); - this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F); - } - } - } + public void incrementDroppedSkulls() + { + ++this.droppedSkulls; + } - public boolean attackEntityAsMob(Entity entityIn) - { - return true; - } + protected void initEntityAI() + { + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIIslamistSwell(this)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false)); + this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + } - public boolean getPowered() - { - return this.dataManager.get(POWERED); - } + protected void entityInit() + { + super.entityInit(); + this.dataManager.register(STATE, -1); + this.dataManager.register(POWERED, Boolean.FALSE); + this.dataManager.register(IGNITED, Boolean.FALSE); + } - @SideOnly(Side.CLIENT) - public float getCreeperFlashIntensity(float p_70831_1_) - { - return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2); - } + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); - @Nullable - protected ResourceLocation getLootTable() - { - return LootTableList.ENTITIES_CREEPER; - } + if (this.dataManager.get(POWERED)) + { + compound.setBoolean("powered", true); + } - public int getCreeperState() - { - return this.dataManager.get(STATE); - } + compound.setShort("Fuse", (short) this.fuseTime); + compound.setByte("ExplosionRadius", (byte) this.explosionRadius); + compound.setBoolean("ignited", this.hasIgnited()); + } - public void setCreeperState(int state) - { - this.dataManager.set(STATE, state); - } + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); + this.dataManager.set(POWERED, compound.getBoolean("powered")); - public void onStruckByLightning(EntityLightningBolt lightningBolt) - { - super.onStruckByLightning(lightningBolt); - this.dataManager.set(POWERED, Boolean.TRUE); - } + if (compound.hasKey("Fuse", 99)) + { + this.fuseTime = compound.getShort("Fuse"); + } - protected boolean processInteract(EntityPlayer player, EnumHand hand) - { - ItemStack itemstack = player.getHeldItem(hand); + if (compound.hasKey("ExplosionRadius", 99)) + { + this.explosionRadius = compound.getByte("ExplosionRadius"); + } - if (itemstack.getItem() == Items.FLINT_AND_STEEL) - { - this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); - player.swingArm(hand); + if (compound.getBoolean("ignited")) + { + this.ignite(); + } + } - if (!this.world.isRemote) - { - this.ignite(); - itemstack.damageItem(1, player); - return true; - } - } + @Nullable + protected ResourceLocation getLootTable() + { + return LootTableList.ENTITIES_CREEPER; + } - return super.processInteract(player, hand); - } + public int getMaxFallHeight() + { + return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); + } - private void explode() - { - if (!this.world.isRemote) - { - boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this); - float f = this.getPowered() ? 2.0F : 1.0F; - this.dead = true; - this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_ISLAMIST_BLOW, getSoundCategory(), 1.0F, 1.0F); - this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag); - this.setDead(); - this.spawnLingeringCloud(); - } - } + protected boolean processInteract(EntityPlayer player, EnumHand hand) + { + ItemStack itemstack = player.getHeldItem(hand); - private void spawnLingeringCloud() - { - Collection collection = this.getActivePotionEffects(); + if (itemstack.getItem() == Items.FLINT_AND_STEEL) + { + this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); + player.swingArm(hand); - if (!collection.isEmpty()) - { - EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ); - entityareaeffectcloud.setRadius(2.5F); - entityareaeffectcloud.setRadiusOnUse(-0.5F); - entityareaeffectcloud.setWaitTime(10); - entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2); - entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration()); + if (!this.world.isRemote) + { + this.ignite(); + itemstack.damageItem(1, player); + return true; + } + } - for (PotionEffect potioneffect : collection) - { - entityareaeffectcloud.addEffect(new PotionEffect(potioneffect)); - } + return super.processInteract(player, hand); + } - this.world.spawnEntity(entityareaeffectcloud); - } - } + private void explode() + { + if (!this.world.isRemote) + { + boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this); + float f = this.getPowered() ? 2.0F : 1.0F; + this.dead = true; + this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_ISLAMIST_BLOW, getSoundCategory(), 1.0F, 1.0F); + this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag); + this.setDead(); + this.spawnLingeringCloud(); + } + } - public boolean hasIgnited() - { - return this.dataManager.get(IGNITED); - } + private void spawnLingeringCloud() + { + Collection collection = this.getActivePotionEffects(); - public void ignite() - { - this.dataManager.set(IGNITED, Boolean.TRUE); - } + if (!collection.isEmpty()) + { + EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ); + entityareaeffectcloud.setRadius(2.5F); + entityareaeffectcloud.setRadiusOnUse(-0.5F); + entityareaeffectcloud.setWaitTime(10); + entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2); + entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration()); - public boolean ableToCauseSkullDrop() - { - return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot"); - } + for (PotionEffect potioneffect : collection) + { + entityareaeffectcloud.addEffect(new PotionEffect(potioneffect)); + } - public void incrementDroppedSkulls() - { - ++this.droppedSkulls; - } + this.world.spawnEntity(entityareaeffectcloud); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityJens.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityJens.java index d851e34..ded13b7 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityJens.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityJens.java @@ -1,12 +1,9 @@ package mod.acgaming.spackenmobs.entities; +import java.util.Set; +import javax.annotation.Nullable; + import com.google.common.collect.Sets; -import mod.acgaming.spackenmobs.entities.ai.EntityAIDance; -import mod.acgaming.spackenmobs.entities.ai.EntityAIEatDroppedFish; -import mod.acgaming.spackenmobs.misc.ModConfigs; -import mod.acgaming.spackenmobs.misc.ModItems; -import mod.acgaming.spackenmobs.misc.ModLootTableList; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; @@ -29,327 +26,339 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; -import javax.annotation.Nullable; -import java.util.Set; +import mod.acgaming.spackenmobs.entities.ai.EntityAIDance; +import mod.acgaming.spackenmobs.entities.ai.EntityAIEatDroppedFish; +import mod.acgaming.spackenmobs.misc.ModConfigs; +import mod.acgaming.spackenmobs.misc.ModItems; +import mod.acgaming.spackenmobs.misc.ModLootTableList; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; public class EntityJens extends EntityAnimal { - private static final DataParameter DIGESTING = EntityDataManager.createKey(EntityJens.class, DataSerializers.BOOLEAN); - private static final DataParameter BOOST_TIME = EntityDataManager.createKey(EntityJens.class, DataSerializers.VARINT); - private static final DataParameter DIGEST_TIME = EntityDataManager.createKey(EntityJens.class, DataSerializers.VARINT); - private static final Set TEMPTATION_ITEMS = Sets.newHashSet(ModItems.RAM, Items.FISH); - private static final Set FISH_ITEMS = Sets.newHashSet(Items.FISH); - public boolean digesting; - public int digestTime; - private boolean boosting; - private int boostTime; - private int totalBoostTime; + private static final DataParameter DIGESTING = EntityDataManager.createKey(EntityJens.class, DataSerializers.BOOLEAN); + private static final DataParameter BOOST_TIME = EntityDataManager.createKey(EntityJens.class, DataSerializers.VARINT); + private static final DataParameter DIGEST_TIME = EntityDataManager.createKey(EntityJens.class, DataSerializers.VARINT); + private static final Set TEMPTATION_ITEMS = Sets.newHashSet(ModItems.RAM, Items.FISH); + private static final Set FISH_ITEMS = Sets.newHashSet(Items.FISH); + public boolean digesting; + public int digestTime; + private boolean boosting; + private int boostTime; + private int totalBoostTime; - public EntityJens(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 1.8F); - } + public EntityJens(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 1.8F); + } - @Override - protected void initEntityAI() - { - this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); - this.tasks.addTask(2, new EntityAIDance(this, ModConfigs.Jens_search_distance)); - this.tasks.addTask(2, new EntityAIEatDroppedFish(this)); - this.tasks.addTask(3, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(4, new EntityAITempt(this, 1.2D, ModItems.RAM, false)); - this.tasks.addTask(4, new EntityAITempt(this, 1.2D, false, TEMPTATION_ITEMS)); - this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D)); - this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - this.tasks.addTask(8, new EntityAILookIdle(this)); - } + @Override + public void onDeath(DamageSource cause) + { + super.onDeath(cause); - @Override - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); - } + if (!this.world.isRemote) + { - @Nullable - public Entity getControllingPassenger() - { - return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); - } + } + } - @Override - public boolean canBeSteered() - { - Entity entity = this.getControllingPassenger(); + @Override + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return ModSoundEvents.ENTITY_JENS_HURT; + } - if (!(entity instanceof EntityPlayer)) - { - return false; - } else - { - EntityPlayer entityplayer = (EntityPlayer) entity; - return entityplayer.getHeldItemMainhand().getItem() == ModItems.RAM_ON_A_STICK || entityplayer.getHeldItemOffhand().getItem() == ModItems.RAM_ON_A_STICK; - } - } + @Override + protected SoundEvent getDeathSound() + { + return ModSoundEvents.ENTITY_JENS_DEATH; + } - @Override - public void notifyDataManagerChange(DataParameter key) - { - if (BOOST_TIME.equals(key) && this.world.isRemote) - { - this.boosting = true; - this.boostTime = 0; - this.totalBoostTime = this.dataManager.get(BOOST_TIME); - } + @Override + public void travel(float strafe, float vertical, float forward) + { + Entity entity = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); - super.notifyDataManagerChange(key); - } + if (this.isBeingRidden() && this.canBeSteered()) + { + this.rotationYaw = entity.rotationYaw; + this.prevRotationYaw = this.rotationYaw; + this.rotationPitch = entity.rotationPitch * 0.5F; + this.setRotation(this.rotationYaw, this.rotationPitch); + this.renderYawOffset = this.rotationYaw; + this.rotationYawHead = this.rotationYaw; + this.stepHeight = 1.0F; + this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; - @Override - protected void entityInit() - { - super.entityInit(); - this.dataManager.register(DIGESTING, Boolean.FALSE); - this.dataManager.register(BOOST_TIME, 0); - this.dataManager.register(DIGEST_TIME, 0); - } + if (this.boosting && this.boostTime++ > this.totalBoostTime) + { + this.boosting = false; + } - @Override - public void writeEntityToNBT(NBTTagCompound compound) - { - super.writeEntityToNBT(compound); - compound.setBoolean("Digesting", this.digesting); - compound.setInteger("DigestTime", this.digestTime); - } + if (this.canPassengerSteer()) + { + float f = (float) this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue() * 0.225F; - @Override - public void readEntityFromNBT(NBTTagCompound compound) - { - super.readEntityFromNBT(compound); - this.digesting = compound.getBoolean("Digesting"); - this.digestTime = compound.getInteger("DigestTime"); - } + if (this.boosting) + { + f += f * 1.15F * MathHelper.sin((float) this.boostTime / (float) this.totalBoostTime * (float) Math.PI); + } - @Override - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_JENS_AMBIENT; - } + this.setAIMoveSpeed(f); + super.travel(0.0F, 0.0F, 1.0F); + } + else + { + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + } - @Override - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return ModSoundEvents.ENTITY_JENS_HURT; - } + this.prevLimbSwingAmount = this.limbSwingAmount; + double d1 = this.posX - this.prevPosX; + double d0 = this.posZ - this.prevPosZ; + float f1 = MathHelper.sqrt(d1 * d1 + d0 * d0) * 4.0F; - @Override - protected SoundEvent getDeathSound() - { - return ModSoundEvents.ENTITY_JENS_DEATH; - } + if (f1 > 1.0F) + { + f1 = 1.0F; + } - @Override - protected void playStepSound(BlockPos pos, Block blockIn) - { - this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F); - } + this.limbSwingAmount += (f1 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + else + { + this.stepHeight = 0.5F; + this.jumpMovementFactor = 0.02F; + super.travel(strafe, vertical, forward); + } + } - @Override - public boolean processInteract(EntityPlayer player, EnumHand hand) - { - if (!super.processInteract(player, hand)) - { - ItemStack itemstack = player.getHeldItem(hand); - if (itemstack.getItem() == Items.FISH && !this.isChild() && !this.digesting) - { - itemstack.shrink(1); - digestFish(); - return true; - } else if (itemstack.getItem() == Items.NAME_TAG) - { - itemstack.interactWithEntity(player, this, hand); - return true; - } else if (!this.isBeingRidden()) - { - if (!this.world.isRemote) - { - player.startRiding(this); - } - return true; - } else - { - return false; - } - } else - { - return true; - } - } + public boolean boost() + { + if (this.boosting) + { + return false; + } + else + { + this.boosting = true; + this.boostTime = 0; + this.totalBoostTime = this.getRNG().nextInt(841) + 140; + this.getDataManager().set(BOOST_TIME, this.totalBoostTime); + return true; + } + } - @Override - public void onDeath(DamageSource cause) - { - super.onDeath(cause); + @Override + public mod.acgaming.spackenmobs.entities.EntityJens createChild(EntityAgeable ageable) + { + return new mod.acgaming.spackenmobs.entities.EntityJens(this.world); + } - if (!this.world.isRemote) - { + @Override + protected void entityInit() + { + super.entityInit(); + this.dataManager.register(DIGESTING, Boolean.FALSE); + this.dataManager.register(BOOST_TIME, 0); + this.dataManager.register(DIGEST_TIME, 0); + } - } - } + @Override + public void notifyDataManagerChange(DataParameter key) + { + if (BOOST_TIME.equals(key) && this.world.isRemote) + { + this.boosting = true; + this.boostTime = 0; + this.totalBoostTime = this.dataManager.get(BOOST_TIME); + } - @Override - @Nullable - protected ResourceLocation getLootTable() - { - return ModLootTableList.ENTITIES_JENS; - } + super.notifyDataManagerChange(key); + } - @Override - public void travel(float strafe, float vertical, float forward) - { - Entity entity = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); + public boolean isFishItem(ItemStack stack) + { + return FISH_ITEMS.contains(stack.getItem()); + } - if (this.isBeingRidden() && this.canBeSteered()) - { - this.rotationYaw = entity.rotationYaw; - this.prevRotationYaw = this.rotationYaw; - this.rotationPitch = entity.rotationPitch * 0.5F; - this.setRotation(this.rotationYaw, this.rotationPitch); - this.renderYawOffset = this.rotationYaw; - this.rotationYawHead = this.rotationYaw; - this.stepHeight = 1.0F; - this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; + @Override + public void onLivingUpdate() + { + super.onLivingUpdate(); - if (this.boosting && this.boostTime++ > this.totalBoostTime) - { - this.boosting = false; - } + if (!this.world.isRemote && this.digesting && this.digestTime > 0) + { + this.digestTime--; + this.dataManager.set(DIGEST_TIME, this.digestTime); + } - if (this.canPassengerSteer()) - { - float f = (float) this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue() * 0.225F; + if (!this.world.isRemote && this.digesting && this.digestTime <= 0) + { + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2); + } + this.playSound(ModSoundEvents.ENTITY_JENS_POOP, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.dropItem(ModItems.SURSTROEMMING, 1); + this.clearActivePotions(); - if (this.boosting) - { - f += f * 1.15F * MathHelper.sin((float) this.boostTime / (float) this.totalBoostTime * (float) Math.PI); - } + this.digesting = false; + this.dataManager.set(DIGESTING, false); - this.setAIMoveSpeed(f); - super.travel(0.0F, 0.0F, 1.0F); - } else - { - this.motionX = 0.0D; - this.motionY = 0.0D; - this.motionZ = 0.0D; - } + this.digestTime = 0; + this.dataManager.set(DIGEST_TIME, 0); + } + } - this.prevLimbSwingAmount = this.limbSwingAmount; - double d1 = this.posX - this.prevPosX; - double d0 = this.posZ - this.prevPosZ; - float f1 = MathHelper.sqrt(d1 * d1 + d0 * d0) * 4.0F; + @Override + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); + compound.setBoolean("Digesting", this.digesting); + compound.setInteger("DigestTime", this.digestTime); + } - if (f1 > 1.0F) - { - f1 = 1.0F; - } + @Override + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); + this.digesting = compound.getBoolean("Digesting"); + this.digestTime = compound.getInteger("DigestTime"); + } - this.limbSwingAmount += (f1 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } else - { - this.stepHeight = 0.5F; - this.jumpMovementFactor = 0.02F; - super.travel(strafe, vertical, forward); - } - } + @Override + public boolean isBreedingItem(ItemStack stack) + { + return TEMPTATION_ITEMS.contains(stack.getItem()); + } - public boolean boost() - { - if (this.boosting) - { - return false; - } else - { - this.boosting = true; - this.boostTime = 0; - this.totalBoostTime = this.getRNG().nextInt(841) + 140; - this.getDataManager().set(BOOST_TIME, this.totalBoostTime); - return true; - } - } + @Override + public boolean processInteract(EntityPlayer player, EnumHand hand) + { + if (!super.processInteract(player, hand)) + { + ItemStack itemstack = player.getHeldItem(hand); + if (itemstack.getItem() == Items.FISH && !this.isChild() && !this.digesting) + { + itemstack.shrink(1); + digestFish(); + return true; + } + else if (itemstack.getItem() == Items.NAME_TAG) + { + itemstack.interactWithEntity(player, this, hand); + return true; + } + else if (!this.isBeingRidden()) + { + if (!this.world.isRemote) + { + player.startRiding(this); + } + return true; + } + else + { + return false; + } + } + else + { + return true; + } + } - @Override - public mod.acgaming.spackenmobs.entities.EntityJens createChild(EntityAgeable ageable) - { - return new mod.acgaming.spackenmobs.entities.EntityJens(this.world); - } + public void digestFish() + { + this.playSound(SoundEvents.ENTITY_PLAYER_BURP, 1.0F, 1.0F); + this.playSound(ModSoundEvents.ENTITY_JENS_EAT, 1.0F, 1.0F); - @Override - public boolean isBreedingItem(ItemStack stack) - { - return TEMPTATION_ITEMS.contains(stack.getItem()); - } + this.digesting = true; + this.dataManager.set(DIGESTING, true); - public boolean isFishItem(ItemStack stack) - { - return FISH_ITEMS.contains(stack.getItem()); - } + this.digestTime = (ModConfigs.Jens_digest_time * 20); + this.dataManager.set(DIGEST_TIME, this.digestTime); - @Override - public void onLivingUpdate() - { - super.onLivingUpdate(); + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.world.spawnParticle(EnumParticleTypes.HEART, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2); + } - if (!this.world.isRemote && this.digesting && this.digestTime > 0) - { - this.digestTime--; - this.dataManager.set(DIGEST_TIME, this.digestTime); - } + this.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, ModConfigs.Jens_digest_time * 20)); + } - if (!this.world.isRemote && this.digesting && this.digestTime <= 0) - { - for (int i = 0; i < 7; ++i) - { - double d0 = this.rand.nextGaussian() * 0.02D; - double d1 = this.rand.nextGaussian() * 0.02D; - double d2 = this.rand.nextGaussian() * 0.02D; - this.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2); - } - this.playSound(ModSoundEvents.ENTITY_JENS_POOP, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - this.dropItem(ModItems.SURSTROEMMING, 1); - this.clearActivePotions(); + @Override + protected void initEntityAI() + { + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, new EntityAIDance(this, ModConfigs.Jens_search_distance)); + this.tasks.addTask(2, new EntityAIEatDroppedFish(this)); + this.tasks.addTask(3, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, ModItems.RAM, false)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, false, TEMPTATION_ITEMS)); + this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + } - this.digesting = false; - this.dataManager.set(DIGESTING, false); + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); + } - this.digestTime = 0; - this.dataManager.set(DIGEST_TIME, 0); - } - } + @Override + protected SoundEvent getAmbientSound() + { + return ModSoundEvents.ENTITY_JENS_AMBIENT; + } - public void digestFish() - { - this.playSound(SoundEvents.ENTITY_PLAYER_BURP, 1.0F, 1.0F); - this.playSound(ModSoundEvents.ENTITY_JENS_EAT, 1.0F, 1.0F); + @Override + @Nullable + protected ResourceLocation getLootTable() + { + return ModLootTableList.ENTITIES_JENS; + } - this.digesting = true; - this.dataManager.set(DIGESTING, true); + @Override + public boolean canBeSteered() + { + Entity entity = this.getControllingPassenger(); - this.digestTime = (ModConfigs.Jens_digest_time * 20); - this.dataManager.set(DIGEST_TIME, this.digestTime); + if (!(entity instanceof EntityPlayer)) + { + return false; + } + else + { + EntityPlayer entityplayer = (EntityPlayer) entity; + return entityplayer.getHeldItemMainhand().getItem() == ModItems.RAM_ON_A_STICK || entityplayer.getHeldItemOffhand().getItem() == ModItems.RAM_ON_A_STICK; + } + } - for (int i = 0; i < 7; ++i) - { - double d0 = this.rand.nextGaussian() * 0.02D; - double d1 = this.rand.nextGaussian() * 0.02D; - double d2 = this.rand.nextGaussian() * 0.02D; - this.world.spawnParticle(EnumParticleTypes.HEART, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2); - } + @Override + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F); + } - this.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, ModConfigs.Jens_digest_time * 20)); - } + @Nullable + public Entity getControllingPassenger() + { + return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityJensWither.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityJensWither.java index b1e3c31..d262bf8 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityJensWither.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityJensWither.java @@ -1,5 +1,7 @@ package mod.acgaming.spackenmobs.entities; +import java.util.List; + import com.google.common.base.Predicate; import com.google.common.base.Predicates; import net.minecraft.block.Block; @@ -34,675 +36,687 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class EntityJensWither extends EntityMob implements IRangedAttackMob { - private static final DataParameter FIRST_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT); - private static final DataParameter SECOND_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT); - private static final DataParameter THIRD_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT); - private static final DataParameter[] HEAD_TARGETS = new DataParameter[]{FIRST_HEAD_TARGET, SECOND_HEAD_TARGET, THIRD_HEAD_TARGET}; - private static final DataParameter INVULNERABILITY_TIME = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT); - /** - * Selector used to determine the entities a wither boss should attack. - */ - private static final Predicate NOT_UNDEAD = p_apply_1_ -> p_apply_1_ instanceof EntityLivingBase && ((EntityLivingBase) p_apply_1_).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD && ((EntityLivingBase) p_apply_1_).attackable(); - private final float[] xRotationHeads = new float[2]; - private final float[] yRotationHeads = new float[2]; - private final float[] xRotOHeads = new float[2]; - private final float[] yRotOHeads = new float[2]; - private final int[] nextHeadUpdate = new int[2]; - private final int[] idleHeadUpdates = new int[2]; - private final BossInfoServer bossInfo = (BossInfoServer) (new BossInfoServer(this.getDisplayName(), BossInfo.Color.PURPLE, BossInfo.Overlay.PROGRESS)).setDarkenSky(true); - /** - * Time before the Wither tries to break blocks - */ - private int blockBreakCounter; - - public EntityJensWither(World worldIn) - { - super(worldIn); - this.setHealth(this.getMaxHealth()); - this.setSize(0.9F, 3.5F); - this.isImmuneToFire = true; - ((PathNavigateGround) this.getNavigator()).setCanSwim(true); - this.experienceValue = 50; - } - - public static boolean canDestroyBlock(Block blockIn) - { - return blockIn != Blocks.BEDROCK && blockIn != Blocks.END_PORTAL && blockIn != Blocks.END_PORTAL_FRAME && blockIn != Blocks.COMMAND_BLOCK && blockIn != Blocks.REPEATING_COMMAND_BLOCK && blockIn != Blocks.CHAIN_COMMAND_BLOCK && blockIn != Blocks.BARRIER && blockIn != Blocks.STRUCTURE_BLOCK && blockIn != Blocks.STRUCTURE_VOID && blockIn != Blocks.PISTON_EXTENSION && blockIn != Blocks.END_GATEWAY; - } - - protected void initEntityAI() - { - this.tasks.addTask(0, new EntityJensWither.AIDoNothing()); - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 40, 20.0F)); - this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); - this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(7, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, NOT_UNDEAD)); - } - - protected void entityInit() - { - super.entityInit(); - this.dataManager.register(FIRST_HEAD_TARGET, 0); - this.dataManager.register(SECOND_HEAD_TARGET, 0); - this.dataManager.register(THIRD_HEAD_TARGET, 0); - this.dataManager.register(INVULNERABILITY_TIME, 0); - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT(NBTTagCompound compound) - { - super.writeEntityToNBT(compound); - compound.setInteger("Invul", this.getInvulTime()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound compound) - { - super.readEntityFromNBT(compound); - this.setInvulTime(compound.getInteger("Invul")); - - if (this.hasCustomName()) - { - this.bossInfo.setName(this.getDisplayName()); - } - } - - /** - * Sets the custom name tag for this entity - */ - public void setCustomNameTag(String name) - { - super.setCustomNameTag(name); - this.bossInfo.setName(this.getDisplayName()); - } - - protected SoundEvent getAmbientSound() - { - return SoundEvents.ENTITY_WITHER_AMBIENT; - } - - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return SoundEvents.ENTITY_WITHER_HURT; - } - - protected SoundEvent getDeathSound() - { - return SoundEvents.ENTITY_WITHER_DEATH; - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - public void onLivingUpdate() - { - this.motionY *= 0.6000000238418579D; - - if (!this.world.isRemote && this.getWatchedTargetId(0) > 0) - { - Entity entity = this.world.getEntityByID(this.getWatchedTargetId(0)); - - if (entity != null) - { - if (this.posY < entity.posY || !this.isArmored() && this.posY < entity.posY + 5.0D) - { - if (this.motionY < 0.0D) - { - this.motionY = 0.0D; - } - - this.motionY += (0.5D - this.motionY) * 0.6000000238418579D; - } - - double d0 = entity.posX - this.posX; - double d1 = entity.posZ - this.posZ; - double d3 = d0 * d0 + d1 * d1; - - if (d3 > 9.0D) - { - double d5 = MathHelper.sqrt(d3); - this.motionX += (d0 / d5 * 0.5D - this.motionX) * 0.6000000238418579D; - this.motionZ += (d1 / d5 * 0.5D - this.motionZ) * 0.6000000238418579D; - } - } - } - - if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) - { - this.rotationYaw = (float) MathHelper.atan2(this.motionZ, this.motionX) * (180F / (float) Math.PI) - 90.0F; - } - - super.onLivingUpdate(); - - for (int i = 0; i < 2; ++i) - { - this.yRotOHeads[i] = this.yRotationHeads[i]; - this.xRotOHeads[i] = this.xRotationHeads[i]; - } - - for (int j = 0; j < 2; ++j) - { - int k = this.getWatchedTargetId(j + 1); - Entity entity1 = null; - - if (k > 0) - { - entity1 = this.world.getEntityByID(k); - } - - if (entity1 != null) - { - double d11 = this.getHeadX(j + 1); - double d12 = this.getHeadY(j + 1); - double d13 = this.getHeadZ(j + 1); - double d6 = entity1.posX - d11; - double d7 = entity1.posY + (double) entity1.getEyeHeight() - d12; - double d8 = entity1.posZ - d13; - double d9 = MathHelper.sqrt(d6 * d6 + d8 * d8); - float f = (float) (MathHelper.atan2(d8, d6) * (180D / Math.PI)) - 90.0F; - float f1 = (float) (-(MathHelper.atan2(d7, d9) * (180D / Math.PI))); - this.xRotationHeads[j] = this.rotlerp(this.xRotationHeads[j], f1, 40.0F); - this.yRotationHeads[j] = this.rotlerp(this.yRotationHeads[j], f, 10.0F); - } else - { - this.yRotationHeads[j] = this.rotlerp(this.yRotationHeads[j], this.renderYawOffset, 10.0F); - } - } - - boolean flag = this.isArmored(); - - for (int l = 0; l < 3; ++l) - { - double d10 = this.getHeadX(l); - double d2 = this.getHeadY(l); - double d4 = this.getHeadZ(l); - this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); - - if (flag && this.world.rand.nextInt(4) == 0) - { - this.world.spawnParticle(EnumParticleTypes.SPELL_MOB, d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D); - } - } - - if (this.getInvulTime() > 0) - { - for (int i1 = 0; i1 < 3; ++i1) - { - this.world.spawnParticle(EnumParticleTypes.SPELL_MOB, this.posX + this.rand.nextGaussian(), this.posY + (double) (this.rand.nextFloat() * 3.3F), this.posZ + this.rand.nextGaussian(), 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); - } - } - } - - protected void updateAITasks() - { - if (this.getInvulTime() > 0) - { - int j1 = this.getInvulTime() - 1; - - if (j1 <= 0) - { - this.world.newExplosion(this, this.posX, this.posY + (double) this.getEyeHeight(), this.posZ, 7.0F, false, net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this)); - this.world.playBroadcastSound(1023, new BlockPos(this), 0); - } - - this.setInvulTime(j1); - - if (this.ticksExisted % 10 == 0) - { - this.heal(10.0F); - } - } else - { - super.updateAITasks(); - - for (int i = 1; i < 3; ++i) - { - if (this.ticksExisted >= this.nextHeadUpdate[i - 1]) - { - this.nextHeadUpdate[i - 1] = this.ticksExisted + 10 + this.rand.nextInt(10); - - if (this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD) - { - int j3 = i - 1; - int k3 = this.idleHeadUpdates[i - 1]; - this.idleHeadUpdates[j3] = this.idleHeadUpdates[i - 1] + 1; - - if (k3 > 15) - { - float f = 10.0F; - float f1 = 5.0F; - double d0 = MathHelper.nextDouble(this.rand, this.posX - 10.0D, this.posX + 10.0D); - double d1 = MathHelper.nextDouble(this.rand, this.posY - 5.0D, this.posY + 5.0D); - double d2 = MathHelper.nextDouble(this.rand, this.posZ - 10.0D, this.posZ + 10.0D); - this.launchWitherSkullToCoords(i + 1, d0, d1, d2, true); - this.idleHeadUpdates[i - 1] = 0; - } - } - - int k1 = this.getWatchedTargetId(i); - - if (k1 > 0) - { - Entity entity = this.world.getEntityByID(k1); - - if (entity != null && entity.isEntityAlive() && this.getDistanceSq(entity) <= 900.0D && this.canEntityBeSeen(entity)) - { - if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.disableDamage) - { - this.updateWatchedTargetId(i, 0); - } else - { - this.launchWitherSkullToEntity(i + 1, (EntityLivingBase) entity); - this.nextHeadUpdate[i - 1] = this.ticksExisted + 40 + this.rand.nextInt(20); - this.idleHeadUpdates[i - 1] = 0; - } - } else - { - this.updateWatchedTargetId(i, 0); - } - } else - { - List list = this.world.getEntitiesWithinAABB(EntityLivingBase.class, this.getEntityBoundingBox().grow(20.0D, 8.0D, 20.0D), Predicates.and(NOT_UNDEAD, EntitySelectors.NOT_SPECTATING)); - - for (int j2 = 0; j2 < 10 && !list.isEmpty(); ++j2) - { - EntityLivingBase entitylivingbase = list.get(this.rand.nextInt(list.size())); - - if (entitylivingbase != this && entitylivingbase.isEntityAlive() && this.canEntityBeSeen(entitylivingbase)) - { - if (entitylivingbase instanceof EntityPlayer) - { - if (!((EntityPlayer) entitylivingbase).capabilities.disableDamage) - { - this.updateWatchedTargetId(i, entitylivingbase.getEntityId()); - } - } else - { - this.updateWatchedTargetId(i, entitylivingbase.getEntityId()); - } - - break; - } - - list.remove(entitylivingbase); - } - } - } - } - - if (this.getAttackTarget() != null) - { - this.updateWatchedTargetId(0, this.getAttackTarget().getEntityId()); - } else - { - this.updateWatchedTargetId(0, 0); - } - - if (this.blockBreakCounter > 0) - { - --this.blockBreakCounter; - - if (this.blockBreakCounter == 0 && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this)) - { - int i1 = MathHelper.floor(this.posY); - int l1 = MathHelper.floor(this.posX); - int i2 = MathHelper.floor(this.posZ); - boolean flag = false; - - for (int k2 = -1; k2 <= 1; ++k2) - { - for (int l2 = -1; l2 <= 1; ++l2) - { - for (int j = 0; j <= 3; ++j) - { - int i3 = l1 + k2; - int k = i1 + j; - int l = i2 + l2; - BlockPos blockpos = new BlockPos(i3, k, l); - IBlockState iblockstate = this.world.getBlockState(blockpos); - Block block = iblockstate.getBlock(); - - if (!block.isAir(iblockstate, this.world, blockpos) && block.canEntityDestroy(iblockstate, world, blockpos, this) && net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this, blockpos, iblockstate)) - { - flag = this.world.destroyBlock(blockpos, true) || flag; - } - } - } - } - - if (flag) - { - this.world.playEvent(null, 1022, new BlockPos(this), 0); - } - } - } - - if (this.ticksExisted % 20 == 0) - { - this.heal(1.0F); - } - - this.bossInfo.setPercent(this.getHealth() / this.getMaxHealth()); - } - } - - /** - * Initializes this Wither's explosion sequence and makes it invulnerable. Called immediately after spawning. - */ - public void ignite() - { - this.setInvulTime(220); - this.setHealth(this.getMaxHealth() / 3.0F); - } - - /** - * Sets the Entity inside a web block. - */ - public void setInWeb() - { - } - - /** - * Add the given player to the list of players tracking this entity. For instance, a player may track a boss in - * order to view its associated boss bar. - */ - public void addTrackingPlayer(EntityPlayerMP player) - { - super.addTrackingPlayer(player); - this.bossInfo.addPlayer(player); - } - - /** - * Removes the given player from the list of players tracking this entity. See {@link Entity#addTrackingPlayer} for - * more information on tracking. - */ - public void removeTrackingPlayer(EntityPlayerMP player) - { - super.removeTrackingPlayer(player); - this.bossInfo.removePlayer(player); - } - - private double getHeadX(int p_82214_1_) - { - if (p_82214_1_ <= 0) - { - return this.posX; - } else - { - float f = (this.renderYawOffset + (float) (180 * (p_82214_1_ - 1))) * 0.017453292F; - float f1 = MathHelper.cos(f); - return this.posX + (double) f1 * 1.3D; - } - } - - private double getHeadY(int p_82208_1_) - { - return p_82208_1_ <= 0 ? this.posY + 3.0D : this.posY + 2.2D; - } - - private double getHeadZ(int p_82213_1_) - { - if (p_82213_1_ <= 0) - { - return this.posZ; - } else - { - float f = (this.renderYawOffset + (float) (180 * (p_82213_1_ - 1))) * 0.017453292F; - float f1 = MathHelper.sin(f); - return this.posZ + (double) f1 * 1.3D; - } - } - - private float rotlerp(float p_82204_1_, float p_82204_2_, float p_82204_3_) - { - float f = MathHelper.wrapDegrees(p_82204_2_ - p_82204_1_); - - if (f > p_82204_3_) - { - f = p_82204_3_; - } - - if (f < -p_82204_3_) - { - f = -p_82204_3_; - } - - return p_82204_1_ + f; - } - - private void launchWitherSkullToEntity(int p_82216_1_, EntityLivingBase p_82216_2_) - { - this.launchWitherSkullToCoords(p_82216_1_, p_82216_2_.posX, p_82216_2_.posY + (double) p_82216_2_.getEyeHeight() * 0.5D, p_82216_2_.posZ, p_82216_1_ == 0 && this.rand.nextFloat() < 0.001F); - } - - /** - * Launches a Wither skull toward (par2, par4, par6) - */ - private void launchWitherSkullToCoords(int p_82209_1_, double x, double y, double z, boolean invulnerable) - { - this.world.playEvent(null, 1024, new BlockPos(this), 0); - double d0 = this.getHeadX(p_82209_1_); - double d1 = this.getHeadY(p_82209_1_); - double d2 = this.getHeadZ(p_82209_1_); - double d3 = x - d0; - double d4 = y - d1; - double d5 = z - d2; - EntityWitherSkull EntityWitherskull = new EntityWitherSkull(this.world, this, d3, d4, d5); - - if (invulnerable) - { - EntityWitherskull.setInvulnerable(true); - } - - EntityWitherskull.posY = d1; - EntityWitherskull.posX = d0; - EntityWitherskull.posZ = d2; - this.world.spawnEntity(EntityWitherskull); - } - - /** - * Attack the specified entity using a ranged attack. - */ - public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) - { - this.launchWitherSkullToEntity(0, target); - } - - /** - * Called when the entity is attacked. - */ - public boolean attackEntityFrom(DamageSource source, float amount) - { - if (this.isEntityInvulnerable(source)) - { - return false; - } else if (source != DamageSource.DROWN && !(source.getTrueSource() instanceof EntityJensWither)) - { - if (this.getInvulTime() > 0 && source != DamageSource.OUT_OF_WORLD) - { - return false; - } else - { - if (this.isArmored()) - { - Entity entity = source.getImmediateSource(); - - if (entity instanceof EntityArrow) - { - return false; - } - } - - Entity entity1 = source.getTrueSource(); - - if (!(entity1 instanceof EntityPlayer) && entity1 instanceof EntityLivingBase && ((EntityLivingBase) entity1).getCreatureAttribute() == this.getCreatureAttribute()) - { - return false; - } else - { - if (this.blockBreakCounter <= 0) - { - this.blockBreakCounter = 20; - } - - for (int i = 0; i < this.idleHeadUpdates.length; ++i) - { - this.idleHeadUpdates[i] += 3; - } - - return super.attackEntityFrom(source, amount); - } - } - } else - { - return false; - } - } - - /** - * Drop 0-2 items of this living's type - */ - protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) - { - EntityItem entityitem = this.dropItem(Items.NETHER_STAR, 1); - - if (entityitem != null) - { - entityitem.setNoDespawn(); - } - } - - /** - * Makes the entity despawn if requirements are reached - */ - protected void despawnEntity() - { - this.idleTime = 0; - } - - @SideOnly(Side.CLIENT) - public int getBrightnessForRender() - { - return 15728880; - } - - public void fall(float distance, float damageMultiplier) - { - } - - /** - * adds a PotionEffect to the entity - */ - public void addPotionEffect(PotionEffect potioneffectIn) - { - } - - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(300.0D); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.6000000238418579D); - this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(40.0D); - this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(4.0D); - } - - @SideOnly(Side.CLIENT) - public float getHeadYRotation(int p_82207_1_) - { - return this.yRotationHeads[p_82207_1_]; - } - - @SideOnly(Side.CLIENT) - public float getHeadXRotation(int p_82210_1_) - { - return this.xRotationHeads[p_82210_1_]; - } - - public int getInvulTime() - { - return this.dataManager.get(INVULNERABILITY_TIME); - } - - public void setInvulTime(int time) - { - this.dataManager.set(INVULNERABILITY_TIME, time); - } - - /** - * Returns the target entity ID if present, or -1 if not @param par1 The target offset, should be from 0-2 - */ - public int getWatchedTargetId(int head) - { - return this.dataManager.get(HEAD_TARGETS[head]); - } - - /** - * Updates the target entity ID - */ - public void updateWatchedTargetId(int targetOffset, int newId) - { - this.dataManager.set(HEAD_TARGETS[targetOffset], newId); - } - - /** - * Returns whether the wither is armored with its boss armor or not by checking whether its health is below half of - * its maximum. - */ - public boolean isArmored() - { - return this.getHealth() <= this.getMaxHealth() / 2.0F; - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - public EnumCreatureAttribute getCreatureAttribute() - { - return EnumCreatureAttribute.UNDEAD; - } - - protected boolean canBeRidden(Entity entityIn) - { - return false; - } - - /** - * Returns false if this Entity is a boss, true otherwise. - */ - public boolean isNonBoss() - { - return false; - } - - public void setSwingingArms(boolean swingingArms) - { - } - - class AIDoNothing extends EntityAIBase - { - public AIDoNothing() - { - this.setMutexBits(7); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - return EntityJensWither.this.getInvulTime() > 0; - } - } + private static final DataParameter FIRST_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT); + private static final DataParameter SECOND_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT); + private static final DataParameter THIRD_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT); + private static final DataParameter[] HEAD_TARGETS = new DataParameter[] {FIRST_HEAD_TARGET, SECOND_HEAD_TARGET, THIRD_HEAD_TARGET}; + private static final DataParameter INVULNERABILITY_TIME = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT); + /** + * Selector used to determine the entities a wither boss should attack. + */ + private static final Predicate NOT_UNDEAD = p_apply_1_ -> p_apply_1_ instanceof EntityLivingBase && ((EntityLivingBase) p_apply_1_).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD && ((EntityLivingBase) p_apply_1_).attackable(); + + public static boolean canDestroyBlock(Block blockIn) + { + return blockIn != Blocks.BEDROCK && blockIn != Blocks.END_PORTAL && blockIn != Blocks.END_PORTAL_FRAME && blockIn != Blocks.COMMAND_BLOCK && blockIn != Blocks.REPEATING_COMMAND_BLOCK && blockIn != Blocks.CHAIN_COMMAND_BLOCK && blockIn != Blocks.BARRIER && blockIn != Blocks.STRUCTURE_BLOCK && blockIn != Blocks.STRUCTURE_VOID && blockIn != Blocks.PISTON_EXTENSION && blockIn != Blocks.END_GATEWAY; + } + + private final float[] xRotationHeads = new float[2]; + private final float[] yRotationHeads = new float[2]; + private final float[] xRotOHeads = new float[2]; + private final float[] yRotOHeads = new float[2]; + private final int[] nextHeadUpdate = new int[2]; + private final int[] idleHeadUpdates = new int[2]; + private final BossInfoServer bossInfo = (BossInfoServer) (new BossInfoServer(this.getDisplayName(), BossInfo.Color.PURPLE, BossInfo.Overlay.PROGRESS)).setDarkenSky(true); + /** + * Time before the Wither tries to break blocks + */ + private int blockBreakCounter; + + public EntityJensWither(World worldIn) + { + super(worldIn); + this.setHealth(this.getMaxHealth()); + this.setSize(0.9F, 3.5F); + this.isImmuneToFire = true; + ((PathNavigateGround) this.getNavigator()).setCanSwim(true); + this.experienceValue = 50; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + this.motionY *= 0.6000000238418579D; + + if (!this.world.isRemote && this.getWatchedTargetId(0) > 0) + { + Entity entity = this.world.getEntityByID(this.getWatchedTargetId(0)); + + if (entity != null) + { + if (this.posY < entity.posY || !this.isArmored() && this.posY < entity.posY + 5.0D) + { + if (this.motionY < 0.0D) + { + this.motionY = 0.0D; + } + + this.motionY += (0.5D - this.motionY) * 0.6000000238418579D; + } + + double d0 = entity.posX - this.posX; + double d1 = entity.posZ - this.posZ; + double d3 = d0 * d0 + d1 * d1; + + if (d3 > 9.0D) + { + double d5 = MathHelper.sqrt(d3); + this.motionX += (d0 / d5 * 0.5D - this.motionX) * 0.6000000238418579D; + this.motionZ += (d1 / d5 * 0.5D - this.motionZ) * 0.6000000238418579D; + } + } + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) + { + this.rotationYaw = (float) MathHelper.atan2(this.motionZ, this.motionX) * (180F / (float) Math.PI) - 90.0F; + } + + super.onLivingUpdate(); + + for (int i = 0; i < 2; ++i) + { + this.yRotOHeads[i] = this.yRotationHeads[i]; + this.xRotOHeads[i] = this.xRotationHeads[i]; + } + + for (int j = 0; j < 2; ++j) + { + int k = this.getWatchedTargetId(j + 1); + Entity entity1 = null; + + if (k > 0) + { + entity1 = this.world.getEntityByID(k); + } + + if (entity1 != null) + { + double d11 = this.getHeadX(j + 1); + double d12 = this.getHeadY(j + 1); + double d13 = this.getHeadZ(j + 1); + double d6 = entity1.posX - d11; + double d7 = entity1.posY + (double) entity1.getEyeHeight() - d12; + double d8 = entity1.posZ - d13; + double d9 = MathHelper.sqrt(d6 * d6 + d8 * d8); + float f = (float) (MathHelper.atan2(d8, d6) * (180D / Math.PI)) - 90.0F; + float f1 = (float) (-(MathHelper.atan2(d7, d9) * (180D / Math.PI))); + this.xRotationHeads[j] = this.rotlerp(this.xRotationHeads[j], f1, 40.0F); + this.yRotationHeads[j] = this.rotlerp(this.yRotationHeads[j], f, 10.0F); + } + else + { + this.yRotationHeads[j] = this.rotlerp(this.yRotationHeads[j], this.renderYawOffset, 10.0F); + } + } + + boolean flag = this.isArmored(); + + for (int l = 0; l < 3; ++l) + { + double d10 = this.getHeadX(l); + double d2 = this.getHeadY(l); + double d4 = this.getHeadZ(l); + this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); + + if (flag && this.world.rand.nextInt(4) == 0) + { + this.world.spawnParticle(EnumParticleTypes.SPELL_MOB, d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D); + } + } + + if (this.getInvulTime() > 0) + { + for (int i1 = 0; i1 < 3; ++i1) + { + this.world.spawnParticle(EnumParticleTypes.SPELL_MOB, this.posX + this.rand.nextGaussian(), this.posY + (double) (this.rand.nextFloat() * 3.3F), this.posZ + this.rand.nextGaussian(), 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); + } + } + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (source != DamageSource.DROWN && !(source.getTrueSource() instanceof EntityJensWither)) + { + if (this.getInvulTime() > 0 && source != DamageSource.OUT_OF_WORLD) + { + return false; + } + else + { + if (this.isArmored()) + { + Entity entity = source.getImmediateSource(); + + if (entity instanceof EntityArrow) + { + return false; + } + } + + Entity entity1 = source.getTrueSource(); + + if (!(entity1 instanceof EntityPlayer) && entity1 instanceof EntityLivingBase && ((EntityLivingBase) entity1).getCreatureAttribute() == this.getCreatureAttribute()) + { + return false; + } + else + { + if (this.blockBreakCounter <= 0) + { + this.blockBreakCounter = 20; + } + + for (int i = 0; i < this.idleHeadUpdates.length; ++i) + { + this.idleHeadUpdates[i] += 3; + } + + return super.attackEntityFrom(source, amount); + } + } + } + else + { + return false; + } + } + + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return SoundEvents.ENTITY_WITHER_HURT; + } + + protected SoundEvent getDeathSound() + { + return SoundEvents.ENTITY_WITHER_DEATH; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(300.0D); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(4.0D); + } + + /** + * Initializes this Wither's explosion sequence and makes it invulnerable. Called immediately after spawning. + */ + public void ignite() + { + this.setInvulTime(220); + this.setHealth(this.getMaxHealth() / 3.0F); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) + { + this.launchWitherSkullToEntity(0, target); + } + + public void setSwingingArms(boolean swingingArms) + { + } + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender() + { + return 15728880; + } + + protected boolean canBeRidden(Entity entityIn) + { + return false; + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() + { + } + + /** + * Returns false if this Entity is a boss, true otherwise. + */ + public boolean isNonBoss() + { + return false; + } + + /** + * Sets the custom name tag for this entity + */ + public void setCustomNameTag(String name) + { + super.setCustomNameTag(name); + this.bossInfo.setName(this.getDisplayName()); + } + + /** + * Add the given player to the list of players tracking this entity. For instance, a player may track a boss in + * order to view its associated boss bar. + */ + public void addTrackingPlayer(EntityPlayerMP player) + { + super.addTrackingPlayer(player); + this.bossInfo.addPlayer(player); + } + + /** + * Removes the given player from the list of players tracking this entity. See {@link Entity#addTrackingPlayer} for + * more information on tracking. + */ + public void removeTrackingPlayer(EntityPlayerMP player) + { + super.removeTrackingPlayer(player); + this.bossInfo.removePlayer(player); + } + + /** + * adds a PotionEffect to the entity + */ + public void addPotionEffect(PotionEffect potioneffectIn) + { + } + + public void fall(float distance, float damageMultiplier) + { + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEAD; + } + + @SideOnly(Side.CLIENT) + public float getHeadYRotation(int p_82207_1_) + { + return this.yRotationHeads[p_82207_1_]; + } + + @SideOnly(Side.CLIENT) + public float getHeadXRotation(int p_82210_1_) + { + return this.xRotationHeads[p_82210_1_]; + } + + public int getInvulTime() + { + return this.dataManager.get(INVULNERABILITY_TIME); + } + + public void setInvulTime(int time) + { + this.dataManager.set(INVULNERABILITY_TIME, time); + } + + /** + * Returns the target entity ID if present, or -1 if not @param par1 The target offset, should be from 0-2 + */ + public int getWatchedTargetId(int head) + { + return this.dataManager.get(HEAD_TARGETS[head]); + } + + /** + * Updates the target entity ID + */ + public void updateWatchedTargetId(int targetOffset, int newId) + { + this.dataManager.set(HEAD_TARGETS[targetOffset], newId); + } + + /** + * Returns whether the wither is armored with its boss armor or not by checking whether its health is below half of + * its maximum. + */ + public boolean isArmored() + { + return this.getHealth() <= this.getMaxHealth() / 2.0F; + } + + protected void initEntityAI() + { + this.tasks.addTask(0, new EntityJensWither.AIDoNothing()); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 40, 20.0F)); + this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, NOT_UNDEAD)); + } + + protected void entityInit() + { + super.entityInit(); + this.dataManager.register(FIRST_HEAD_TARGET, 0); + this.dataManager.register(SECOND_HEAD_TARGET, 0); + this.dataManager.register(THIRD_HEAD_TARGET, 0); + this.dataManager.register(INVULNERABILITY_TIME, 0); + } + + protected SoundEvent getAmbientSound() + { + return SoundEvents.ENTITY_WITHER_AMBIENT; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + EntityItem entityitem = this.dropItem(Items.NETHER_STAR, 1); + + if (entityitem != null) + { + entityitem.setNoDespawn(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); + compound.setInteger("Invul", this.getInvulTime()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); + this.setInvulTime(compound.getInteger("Invul")); + + if (this.hasCustomName()) + { + this.bossInfo.setName(this.getDisplayName()); + } + } + + /** + * Makes the entity despawn if requirements are reached + */ + protected void despawnEntity() + { + this.idleTime = 0; + } + + protected void updateAITasks() + { + if (this.getInvulTime() > 0) + { + int j1 = this.getInvulTime() - 1; + + if (j1 <= 0) + { + this.world.newExplosion(this, this.posX, this.posY + (double) this.getEyeHeight(), this.posZ, 7.0F, false, net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this)); + this.world.playBroadcastSound(1023, new BlockPos(this), 0); + } + + this.setInvulTime(j1); + + if (this.ticksExisted % 10 == 0) + { + this.heal(10.0F); + } + } + else + { + super.updateAITasks(); + + for (int i = 1; i < 3; ++i) + { + if (this.ticksExisted >= this.nextHeadUpdate[i - 1]) + { + this.nextHeadUpdate[i - 1] = this.ticksExisted + 10 + this.rand.nextInt(10); + + if (this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD) + { + int j3 = i - 1; + int k3 = this.idleHeadUpdates[i - 1]; + this.idleHeadUpdates[j3] = this.idleHeadUpdates[i - 1] + 1; + + if (k3 > 15) + { + float f = 10.0F; + float f1 = 5.0F; + double d0 = MathHelper.nextDouble(this.rand, this.posX - 10.0D, this.posX + 10.0D); + double d1 = MathHelper.nextDouble(this.rand, this.posY - 5.0D, this.posY + 5.0D); + double d2 = MathHelper.nextDouble(this.rand, this.posZ - 10.0D, this.posZ + 10.0D); + this.launchWitherSkullToCoords(i + 1, d0, d1, d2, true); + this.idleHeadUpdates[i - 1] = 0; + } + } + + int k1 = this.getWatchedTargetId(i); + + if (k1 > 0) + { + Entity entity = this.world.getEntityByID(k1); + + if (entity != null && entity.isEntityAlive() && this.getDistanceSq(entity) <= 900.0D && this.canEntityBeSeen(entity)) + { + if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.disableDamage) + { + this.updateWatchedTargetId(i, 0); + } + else + { + this.launchWitherSkullToEntity(i + 1, (EntityLivingBase) entity); + this.nextHeadUpdate[i - 1] = this.ticksExisted + 40 + this.rand.nextInt(20); + this.idleHeadUpdates[i - 1] = 0; + } + } + else + { + this.updateWatchedTargetId(i, 0); + } + } + else + { + List list = this.world.getEntitiesWithinAABB(EntityLivingBase.class, this.getEntityBoundingBox().grow(20.0D, 8.0D, 20.0D), Predicates.and(NOT_UNDEAD, EntitySelectors.NOT_SPECTATING)); + + for (int j2 = 0; j2 < 10 && !list.isEmpty(); ++j2) + { + EntityLivingBase entitylivingbase = list.get(this.rand.nextInt(list.size())); + + if (entitylivingbase != this && entitylivingbase.isEntityAlive() && this.canEntityBeSeen(entitylivingbase)) + { + if (entitylivingbase instanceof EntityPlayer) + { + if (!((EntityPlayer) entitylivingbase).capabilities.disableDamage) + { + this.updateWatchedTargetId(i, entitylivingbase.getEntityId()); + } + } + else + { + this.updateWatchedTargetId(i, entitylivingbase.getEntityId()); + } + + break; + } + + list.remove(entitylivingbase); + } + } + } + } + + if (this.getAttackTarget() != null) + { + this.updateWatchedTargetId(0, this.getAttackTarget().getEntityId()); + } + else + { + this.updateWatchedTargetId(0, 0); + } + + if (this.blockBreakCounter > 0) + { + --this.blockBreakCounter; + + if (this.blockBreakCounter == 0 && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this)) + { + int i1 = MathHelper.floor(this.posY); + int l1 = MathHelper.floor(this.posX); + int i2 = MathHelper.floor(this.posZ); + boolean flag = false; + + for (int k2 = -1; k2 <= 1; ++k2) + { + for (int l2 = -1; l2 <= 1; ++l2) + { + for (int j = 0; j <= 3; ++j) + { + int i3 = l1 + k2; + int k = i1 + j; + int l = i2 + l2; + BlockPos blockpos = new BlockPos(i3, k, l); + IBlockState iblockstate = this.world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (!block.isAir(iblockstate, this.world, blockpos) && block.canEntityDestroy(iblockstate, world, blockpos, this) && net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this, blockpos, iblockstate)) + { + flag = this.world.destroyBlock(blockpos, true) || flag; + } + } + } + } + + if (flag) + { + this.world.playEvent(null, 1022, new BlockPos(this), 0); + } + } + } + + if (this.ticksExisted % 20 == 0) + { + this.heal(1.0F); + } + + this.bossInfo.setPercent(this.getHealth() / this.getMaxHealth()); + } + } + + private double getHeadX(int p_82214_1_) + { + if (p_82214_1_ <= 0) + { + return this.posX; + } + else + { + float f = (this.renderYawOffset + (float) (180 * (p_82214_1_ - 1))) * 0.017453292F; + float f1 = MathHelper.cos(f); + return this.posX + (double) f1 * 1.3D; + } + } + + private double getHeadY(int p_82208_1_) + { + return p_82208_1_ <= 0 ? this.posY + 3.0D : this.posY + 2.2D; + } + + private double getHeadZ(int p_82213_1_) + { + if (p_82213_1_ <= 0) + { + return this.posZ; + } + else + { + float f = (this.renderYawOffset + (float) (180 * (p_82213_1_ - 1))) * 0.017453292F; + float f1 = MathHelper.sin(f); + return this.posZ + (double) f1 * 1.3D; + } + } + + private float rotlerp(float p_82204_1_, float p_82204_2_, float p_82204_3_) + { + float f = MathHelper.wrapDegrees(p_82204_2_ - p_82204_1_); + + if (f > p_82204_3_) + { + f = p_82204_3_; + } + + if (f < -p_82204_3_) + { + f = -p_82204_3_; + } + + return p_82204_1_ + f; + } + + private void launchWitherSkullToEntity(int p_82216_1_, EntityLivingBase p_82216_2_) + { + this.launchWitherSkullToCoords(p_82216_1_, p_82216_2_.posX, p_82216_2_.posY + (double) p_82216_2_.getEyeHeight() * 0.5D, p_82216_2_.posZ, p_82216_1_ == 0 && this.rand.nextFloat() < 0.001F); + } + + /** + * Launches a Wither skull toward (par2, par4, par6) + */ + private void launchWitherSkullToCoords(int p_82209_1_, double x, double y, double z, boolean invulnerable) + { + this.world.playEvent(null, 1024, new BlockPos(this), 0); + double d0 = this.getHeadX(p_82209_1_); + double d1 = this.getHeadY(p_82209_1_); + double d2 = this.getHeadZ(p_82209_1_); + double d3 = x - d0; + double d4 = y - d1; + double d5 = z - d2; + EntityWitherSkull EntityWitherskull = new EntityWitherSkull(this.world, this, d3, d4, d5); + + if (invulnerable) + { + EntityWitherskull.setInvulnerable(true); + } + + EntityWitherskull.posY = d1; + EntityWitherskull.posX = d0; + EntityWitherskull.posZ = d2; + this.world.spawnEntity(EntityWitherskull); + } + + class AIDoNothing extends EntityAIBase + { + public AIDoNothing() + { + this.setMutexBits(7); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + return EntityJensWither.this.getInvulTime() > 0; + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityLatinTeacher.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityLatinTeacher.java deleted file mode 100644 index 359f046..0000000 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityLatinTeacher.java +++ /dev/null @@ -1,247 +0,0 @@ -package mod.acgaming.spackenmobs.entities; - -import mod.acgaming.spackenmobs.misc.ModSoundEvents; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.*; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.ai.attributes.IAttributeInstance; -import net.minecraft.entity.monster.EntityMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.init.MobEffects; -import net.minecraft.init.PotionTypes; -import net.minecraft.init.SoundEvents; -import net.minecraft.inventory.EntityEquipmentSlot; -import net.minecraft.item.ItemStack; -import net.minecraft.network.datasync.DataParameter; -import net.minecraft.network.datasync.DataSerializers; -import net.minecraft.network.datasync.EntityDataManager; -import net.minecraft.potion.PotionEffect; -import net.minecraft.potion.PotionType; -import net.minecraft.potion.PotionUtils; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.SoundEvent; -import net.minecraft.util.math.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.storage.loot.LootTableList; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import javax.annotation.Nullable; -import java.util.List; -import java.util.UUID; - -public class EntityLatinTeacher extends EntityMob implements IRangedAttackMob -{ - private static final UUID MODIFIER_UUID = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); - private static final AttributeModifier MODIFIER = (new AttributeModifier(MODIFIER_UUID, "Drinking speed penalty", -0.25D, 0)).setSaved(false); - private static final DataParameter IS_DRINKING = EntityDataManager.createKey(EntityLatinTeacher.class, DataSerializers.BOOLEAN); - - private int potionUseTimer; - - public EntityLatinTeacher(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 1.95F); - } - - protected void initEntityAI() - { - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F)); - this.tasks.addTask(2, new EntityAIWanderAvoidWater(this, 1.0D)); - this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityITbyHF.class, 8.0F)); - this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(3, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityITbyHF.class, true)); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); - } - - protected void entityInit() - { - super.entityInit(); - this.getDataManager().register(IS_DRINKING, Boolean.FALSE); - } - - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_LATINTEACHER_AMBIENT; - } - - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return SoundEvents.ENTITY_WITCH_HURT; - } - - protected SoundEvent getDeathSound() - { - return SoundEvents.ENTITY_WITCH_DEATH; - } - - public boolean isDrinkingPotion() - { - return this.getDataManager().get(IS_DRINKING); - } - - public void setDrinkingPotion(boolean drinkingPotion) - { - this.getDataManager().set(IS_DRINKING, drinkingPotion); - } - - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(26.0D); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); - } - - public void onLivingUpdate() - { - if (!this.world.isRemote) - { - if (this.isDrinkingPotion()) - { - if (this.potionUseTimer-- <= 0) - { - this.setDrinkingPotion(false); - ItemStack itemstack = this.getHeldItemMainhand(); - this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, ItemStack.EMPTY); - - if (itemstack.getItem() == Items.POTIONITEM) - { - List list = PotionUtils.getEffectsFromStack(itemstack); - - if (list != null) - { - for (PotionEffect potioneffect : list) - { - this.addPotionEffect(new PotionEffect(potioneffect)); - } - } - } - - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).removeModifier(MODIFIER); - } - } else - { - PotionType potiontype = null; - - if (this.rand.nextFloat() < 0.15F && this.isInsideOfMaterial(Material.WATER) && !this.isPotionActive(MobEffects.WATER_BREATHING)) - { - potiontype = PotionTypes.WATER_BREATHING; - } else if (this.rand.nextFloat() < 0.15F && (this.isBurning() || this.getLastDamageSource() != null && this.getLastDamageSource().isFireDamage()) && !this.isPotionActive(MobEffects.FIRE_RESISTANCE)) - { - potiontype = PotionTypes.FIRE_RESISTANCE; - } else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) - { - potiontype = PotionTypes.HEALING; - } else if (this.rand.nextFloat() < 0.5F && this.getAttackTarget() != null && !this.isPotionActive(MobEffects.SPEED) && this.getAttackTarget().getDistanceSq(this) > 121.0D) - { - potiontype = PotionTypes.SWIFTNESS; - } - - if (potiontype != null) - { - this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), potiontype)); - this.potionUseTimer = this.getHeldItemMainhand().getMaxItemUseDuration(); - this.setDrinkingPotion(true); - this.world.playSound(null, this.posX, this.posY, this.posZ, SoundEvents.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.rand.nextFloat() * 0.4F); - IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED); - iattributeinstance.removeModifier(MODIFIER); - iattributeinstance.applyModifier(MODIFIER); - } - } - - if (this.rand.nextFloat() < 7.5E-4F) - { - this.world.setEntityState(this, (byte) 15); - } - } - - super.onLivingUpdate(); - } - - @SideOnly(Side.CLIENT) - public void handleStatusUpdate(byte id) - { - if (id == 15) - { - for (int i = 0; i < this.rand.nextInt(35) + 10; ++i) - { - this.world.spawnParticle(EnumParticleTypes.SPELL_WITCH, this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.getEntityBoundingBox().maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D); - } - } else - { - super.handleStatusUpdate(id); - } - } - - protected float applyPotionDamageCalculations(DamageSource source, float damage) - { - damage = super.applyPotionDamageCalculations(source, damage); - - if (source.getTrueSource() == this) - { - damage = 0.0F; - } - - if (source.isMagicDamage()) - { - damage = (float) ((double) damage * 0.15D); - } - - return damage; - } - - @Nullable - protected ResourceLocation getLootTable() - { - return LootTableList.ENTITIES_WITCH; - } - - public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) - { - if (!this.isDrinkingPotion()) - { - double d0 = target.posY + (double) target.getEyeHeight() - 1.100000023841858D; - double d1 = target.posX + target.motionX - this.posX; - double d2 = d0 - this.posY; - double d3 = target.posZ + target.motionZ - this.posZ; - float f = MathHelper.sqrt(d1 * d1 + d3 * d3); - PotionType potiontype = PotionTypes.HARMING; - - if (f >= 8.0F && !target.isPotionActive(MobEffects.SLOWNESS)) - { - potiontype = PotionTypes.SLOWNESS; - } else if (target.getHealth() >= 8.0F && !target.isPotionActive(MobEffects.POISON)) - { - potiontype = PotionTypes.POISON; - } else if (f <= 3.0F && !target.isPotionActive(MobEffects.WEAKNESS) && this.rand.nextFloat() < 0.25F) - { - potiontype = PotionTypes.WEAKNESS; - } - - EntityPotion entitypotion = new EntityPotion(this.world, this, PotionUtils.addPotionToItemStack(new ItemStack(Items.SPLASH_POTION), potiontype)); - entitypotion.rotationPitch -= -20.0F; - entitypotion.shoot(d1, d2 + (double) (f * 0.2F), d3, 0.75F, 8.0F); - this.world.playSound(null, this.posX, this.posY, this.posZ, SoundEvents.ENTITY_WITCH_THROW, this.getSoundCategory(), 1.0F, 0.8F + this.rand.nextFloat() * 0.4F); - this.world.spawnEntity(entitypotion); - } - } - - public float getEyeHeight() - { - return 1.62F; - } - - public void setSwingingArms(boolean swingingArms) - { - } -} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityMZTEWolf.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityMZTEWolf.java index e7a04ac..afda598 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityMZTEWolf.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityMZTEWolf.java @@ -1,5 +1,7 @@ package mod.acgaming.spackenmobs.entities; +import java.util.UUID; + import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityCreeper; @@ -10,87 +12,92 @@ import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import java.util.UUID; - public class EntityMZTEWolf extends EntityWolf { - public EntityMZTEWolf(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 0.85F); - this.setTamed(false); - } + public EntityMZTEWolf(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 0.85F); + this.setTamed(false); + } - @Override - public EntityMZTEWolf createChild(EntityAgeable ageable) - { - EntityMZTEWolf entitymztewolf = new EntityMZTEWolf(this.world); - UUID uuid = this.getOwnerId(); + @Override + public EntityMZTEWolf createChild(EntityAgeable ageable) + { + EntityMZTEWolf entitymztewolf = new EntityMZTEWolf(this.world); + UUID uuid = this.getOwnerId(); - if (uuid != null) - { - entitymztewolf.setOwnerId(uuid); - entitymztewolf.setTamed(true); - } + if (uuid != null) + { + entitymztewolf.setOwnerId(uuid); + entitymztewolf.setTamed(true); + } - return entitymztewolf; - } + return entitymztewolf; + } - @Override - public boolean canMateWith(EntityAnimal otherAnimal) - { - if (otherAnimal == this) - { - return false; - } else if (!this.isTamed()) - { - return false; - } else if (!(otherAnimal instanceof EntityMZTEWolf)) - { - return false; - } else - { - EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) otherAnimal; + @Override + public boolean canMateWith(EntityAnimal otherAnimal) + { + if (otherAnimal == this) + { + return false; + } + else if (!this.isTamed()) + { + return false; + } + else if (!(otherAnimal instanceof EntityMZTEWolf)) + { + return false; + } + else + { + EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) otherAnimal; - if (!entitymztewolf.isTamed()) - { - return false; - } else if (entitymztewolf.isSitting()) - { - return false; - } else - { - return this.isInLove() && entitymztewolf.isInLove(); - } - } - } + if (!entitymztewolf.isTamed()) + { + return false; + } + else if (entitymztewolf.isSitting()) + { + return false; + } + else + { + return this.isInLove() && entitymztewolf.isInLove(); + } + } + } - @Override - public boolean shouldAttackEntity(EntityLivingBase target, EntityLivingBase owner) - { - if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast)) - { - if (target instanceof EntityMZTEWolf) - { - EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) target; + @Override + public boolean shouldAttackEntity(EntityLivingBase target, EntityLivingBase owner) + { + if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast)) + { + if (target instanceof EntityMZTEWolf) + { + EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) target; - if (entitymztewolf.isTamed() && entitymztewolf.getOwner() == owner) - { - return false; - } - } + if (entitymztewolf.isTamed() && entitymztewolf.getOwner() == owner) + { + return false; + } + } - if (target instanceof EntityPlayer && owner instanceof EntityPlayer - && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target)) - { - return false; - } else - { - return !(target instanceof AbstractHorse) || !((AbstractHorse) target).isTame(); - } - } else - { - return false; - } - } + if (target instanceof EntityPlayer && owner instanceof EntityPlayer + && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target)) + { + return false; + } + else + { + return !(target instanceof AbstractHorse) || !((AbstractHorse) target).isTame(); + } + } + else + { + return false; + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityMarcellDAvis.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityMarcellDAvis.java index f00671d..c6dc712 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityMarcellDAvis.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityMarcellDAvis.java @@ -1,34 +1,35 @@ package mod.acgaming.spackenmobs.entities; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.util.DamageSource; import net.minecraft.util.SoundEvent; import net.minecraft.world.World; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; + public class EntityMarcellDAvis extends EntityZombie { - public EntityMarcellDAvis(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 1.8F); - } + public EntityMarcellDAvis(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 1.8F); + } - @Override - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT; - } + @Override + protected SoundEvent getAmbientSound() + { + return ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT; + } - @Override - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return ModSoundEvents.ENTITY_MARCELLDAVIS_HURT; - } + @Override + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return ModSoundEvents.ENTITY_MARCELLDAVIS_HURT; + } - @Override - protected SoundEvent getDeathSound() - { - return ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH; - } + @Override + protected SoundEvent getDeathSound() + { + return ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH; + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityMrBean.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityMrBean.java index 57d50be..8a981a3 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityMrBean.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityMrBean.java @@ -1,34 +1,35 @@ package mod.acgaming.spackenmobs.entities; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.util.DamageSource; import net.minecraft.util.SoundEvent; import net.minecraft.world.World; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; + public class EntityMrBean extends EntityZombie { - public EntityMrBean(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 1.8F); - } + public EntityMrBean(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 1.8F); + } - @Override - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_MRBEAN_AMBIENT; - } + @Override + protected SoundEvent getAmbientSound() + { + return ModSoundEvents.ENTITY_MRBEAN_AMBIENT; + } - @Override - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return ModSoundEvents.ENTITY_MRBEAN_HURT; - } + @Override + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return ModSoundEvents.ENTITY_MRBEAN_HURT; + } - @Override - protected SoundEvent getDeathSound() - { - return ModSoundEvents.ENTITY_MRBEAN_DEATH; - } + @Override + protected SoundEvent getDeathSound() + { + return ModSoundEvents.ENTITY_MRBEAN_DEATH; + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntitySchalker.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntitySchalker.java index 3ee5004..d663bf2 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntitySchalker.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntitySchalker.java @@ -1,8 +1,11 @@ package mod.acgaming.spackenmobs.entities; +import java.util.List; +import java.util.UUID; +import javax.annotation.Nullable; + import com.google.common.base.Optional; import com.google.common.base.Predicate; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; @@ -32,819 +35,834 @@ import net.minecraft.world.storage.loot.LootTableList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import javax.annotation.Nullable; -import java.util.List; -import java.util.UUID; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; public class EntitySchalker extends EntityGolem implements IMob { - public static final EnumDyeColor DEFAULT_COLOR = EnumDyeColor.PURPLE; - protected static final DataParameter ATTACHED_FACE = EntityDataManager - .createKey(EntitySchalker.class, DataSerializers.FACING); - protected static final DataParameter> ATTACHED_BLOCK_POS = EntityDataManager - .createKey(EntitySchalker.class, DataSerializers.OPTIONAL_BLOCK_POS); - protected static final DataParameter PEEK_TICK = EntityDataManager.createKey(EntitySchalker.class, - DataSerializers.BYTE); - protected static final DataParameter COLOR = EntityDataManager.createKey(EntitySchalker.class, - DataSerializers.BYTE); - private static final UUID COVERED_ARMOR_BONUS_ID = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F"); - private static final AttributeModifier COVERED_ARMOR_BONUS_MODIFIER = (new AttributeModifier(COVERED_ARMOR_BONUS_ID, - "Covered armor bonus", 20.0D, 0)).setSaved(false); - private float prevPeekAmount; - private float peekAmount; - private BlockPos currentAttachmentPosition; - private int clientSideTeleportInterpolation; - - public EntitySchalker(World worldIn) - { - super(worldIn); - this.setSize(1.0F, 1.0F); - this.prevRenderYawOffset = 180.0F; - this.renderYawOffset = 180.0F; - this.isImmuneToFire = true; - this.currentAttachmentPosition = null; - this.experienceValue = 5; - } - - @Override - @Nullable - public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) - { - this.renderYawOffset = 180.0F; - this.prevRenderYawOffset = 180.0F; - this.rotationYaw = 180.0F; - this.prevRotationYaw = 180.0F; - this.rotationYawHead = 180.0F; - this.prevRotationYawHead = 180.0F; - return super.onInitialSpawn(difficulty, livingdata); - } - - @Override - protected void initEntityAI() - { - this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(4, new EntitySchalker.AIAttack()); - this.tasks.addTask(7, new EntitySchalker.AIPeek()); - this.tasks.addTask(8, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - this.targetTasks.addTask(2, new EntitySchalker.AIAttackNearest(this)); - this.targetTasks.addTask(3, new EntitySchalker.AIDefenseAttack(this)); - } - - @Override - protected boolean canTriggerWalking() - { - return false; - } - - @Override - public SoundCategory getSoundCategory() - { - return SoundCategory.HOSTILE; - } - - @Override - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_SCHALKER_AMBIENT; - } - - @Override - public void playLivingSound() - { - if (!this.isClosed()) - { - super.playLivingSound(); - } - } - - @Override - protected SoundEvent getDeathSound() - { - return ModSoundEvents.ENTITY_SCHALKER_DEATH; - } - - @Override - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return this.isClosed() ? SoundEvents.ENTITY_SHULKER_HURT_CLOSED : SoundEvents.ENTITY_SHULKER_HURT; - } - - @Override - protected void entityInit() - { - super.entityInit(); - this.dataManager.register(ATTACHED_FACE, EnumFacing.DOWN); - this.dataManager.register(ATTACHED_BLOCK_POS, Optional.absent()); - this.dataManager.register(PEEK_TICK, (byte) 0); - this.dataManager.register(COLOR, (byte) DEFAULT_COLOR.getMetadata()); - } - - @Override - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D); - } - - @Override - protected EntityBodyHelper createBodyHelper() - { - return new BodyHelper(this); - } - - @Override - public void readEntityFromNBT(NBTTagCompound compound) - { - super.readEntityFromNBT(compound); - this.dataManager.set(ATTACHED_FACE, EnumFacing.getFront(compound.getByte("AttachFace"))); - this.dataManager.set(PEEK_TICK, compound.getByte("Peek")); - this.dataManager.set(COLOR, compound.getByte("Color")); - - if (compound.hasKey("APX")) - { - int i = compound.getInteger("APX"); - int j = compound.getInteger("APY"); - int k = compound.getInteger("APZ"); - this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(new BlockPos(i, j, k))); - } else - { - this.dataManager.set(ATTACHED_BLOCK_POS, Optional.absent()); - } - } - - @Override - public void writeEntityToNBT(NBTTagCompound compound) - { - super.writeEntityToNBT(compound); - compound.setByte("AttachFace", (byte) this.dataManager.get(ATTACHED_FACE).getIndex()); - compound.setByte("Peek", this.dataManager.get(PEEK_TICK)); - compound.setByte("Color", this.dataManager.get(COLOR)); - BlockPos blockpos = this.getAttachmentPos(); - - if (blockpos != null) - { - compound.setInteger("APX", blockpos.getX()); - compound.setInteger("APY", blockpos.getY()); - compound.setInteger("APZ", blockpos.getZ()); - } - } - - @Override - public void onUpdate() - { - super.onUpdate(); - BlockPos blockpos = this.dataManager.get(ATTACHED_BLOCK_POS).orNull(); - - if (blockpos == null && !this.world.isRemote) - { - blockpos = new BlockPos(this); - this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos)); - } - - if (this.isRiding()) - { - blockpos = null; - float f = this.getRidingEntity().rotationYaw; - this.rotationYaw = f; - this.renderYawOffset = f; - this.prevRenderYawOffset = f; - this.clientSideTeleportInterpolation = 0; - } else if (!this.world.isRemote) - { - IBlockState iblockstate = this.world.getBlockState(blockpos); - - if (iblockstate.getMaterial() != Material.AIR) - { - if (iblockstate.getBlock() == Blocks.PISTON_EXTENSION) - { - EnumFacing enumfacing = iblockstate.getValue(BlockDirectional.FACING); - - if (this.world.isAirBlock(blockpos.offset(enumfacing))) - { - blockpos = blockpos.offset(enumfacing); - this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos)); - } else - { - this.tryTeleportToNewPosition(); - } - } else if (iblockstate.getBlock() == Blocks.PISTON_HEAD) - { - EnumFacing enumfacing3 = iblockstate.getValue(BlockDirectional.FACING); - - if (this.world.isAirBlock(blockpos.offset(enumfacing3))) - { - blockpos = blockpos.offset(enumfacing3); - this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos)); - } else - { - this.tryTeleportToNewPosition(); - } - } else - { - this.tryTeleportToNewPosition(); - } - } - - BlockPos blockpos1 = blockpos.offset(this.getAttachmentFacing()); - - if (!this.world.isBlockNormalCube(blockpos1, false)) - { - boolean flag = false; - - for (EnumFacing enumfacing1 : EnumFacing.values()) - { - blockpos1 = blockpos.offset(enumfacing1); - - if (this.world.isBlockNormalCube(blockpos1, false)) - { - this.dataManager.set(ATTACHED_FACE, enumfacing1); - flag = true; - break; - } - } - - if (!flag) - { - this.tryTeleportToNewPosition(); - } - } - - BlockPos blockpos2 = blockpos.offset(this.getAttachmentFacing().getOpposite()); - - if (this.world.isBlockNormalCube(blockpos2, false)) - { - this.tryTeleportToNewPosition(); - } - } - - float f1 = this.getPeekTick() * 0.01F; - this.prevPeekAmount = this.peekAmount; - - if (this.peekAmount > f1) - { - this.peekAmount = MathHelper.clamp(this.peekAmount - 0.05F, f1, 1.0F); - } else if (this.peekAmount < f1) - { - this.peekAmount = MathHelper.clamp(this.peekAmount + 0.05F, 0.0F, f1); - } - - if (blockpos != null) - { - if (this.world.isRemote) - { - if (this.clientSideTeleportInterpolation > 0 && this.currentAttachmentPosition != null) - { - --this.clientSideTeleportInterpolation; - } else - { - this.currentAttachmentPosition = blockpos; - } - } - - this.posX = blockpos.getX() + 0.5D; - this.posY = blockpos.getY(); - this.posZ = blockpos.getZ() + 0.5D; - if (this.isAddedToWorld() && !this.world.isRemote) - this.world.updateEntityWithOptionalForce(this, false); // Forge - // - - // Process - // chunk - // registration - // after - // moving. - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.lastTickPosX = this.posX; - this.lastTickPosY = this.posY; - this.lastTickPosZ = this.posZ; - double d3 = 0.5D - MathHelper.sin((0.5F + this.peekAmount) * (float) Math.PI) * 0.5D; - double d4 = 0.5D - MathHelper.sin((0.5F + this.prevPeekAmount) * (float) Math.PI) * 0.5D; - double d5 = d3 - d4; - double d0 = 0.0D; - double d1 = 0.0D; - double d2 = 0.0D; - EnumFacing enumfacing2 = this.getAttachmentFacing(); - - switch (enumfacing2) - { - case DOWN: - this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY, this.posZ - 0.5D, - this.posX + 0.5D, this.posY + 1.0D + d3, this.posZ + 0.5D)); - d1 = d5; - break; - case UP: - this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY - d3, this.posZ - 0.5D, - this.posX + 0.5D, this.posY + 1.0D, this.posZ + 0.5D)); - d1 = -d5; - break; - case NORTH: - this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY, this.posZ - 0.5D, - this.posX + 0.5D, this.posY + 1.0D, this.posZ + 0.5D + d3)); - d2 = d5; - break; - case SOUTH: - this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY, this.posZ - 0.5D - d3, - this.posX + 0.5D, this.posY + 1.0D, this.posZ + 0.5D)); - d2 = -d5; - break; - case WEST: - this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY, this.posZ - 0.5D, - this.posX + 0.5D + d3, this.posY + 1.0D, this.posZ + 0.5D)); - d0 = d5; - break; - case EAST: - this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D - d3, this.posY, this.posZ - 0.5D, - this.posX + 0.5D, this.posY + 1.0D, this.posZ + 0.5D)); - d0 = -d5; - } - - if (d5 > 0.0D) - { - List list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()); - - if (!list.isEmpty()) - { - for (Entity entity : list) - { - if (!(entity instanceof EntitySchalker) && !entity.noClip) - { - entity.move(MoverType.SHULKER, d0, d1, d2); - } - } - } - } - } - } - - @Override - public void move(MoverType type, double x, double y, double z) - { - if (type == MoverType.SHULKER_BOX) - { - this.tryTeleportToNewPosition(); - } else - { - super.move(type, x, y, z); - } - } - - @Override - public void setPosition(double x, double y, double z) - { - super.setPosition(x, y, z); - - if (this.dataManager != null && this.ticksExisted != 0) - { - Optional optional = this.dataManager.get(ATTACHED_BLOCK_POS); - Optional optional1 = Optional.of(new BlockPos(x, y, z)); - - if (!optional1.equals(optional)) - { - this.dataManager.set(ATTACHED_BLOCK_POS, optional1); - this.dataManager.set(PEEK_TICK, (byte) 0); - this.isAirBorne = true; - } - } - } - - protected boolean tryTeleportToNewPosition() - { - if (!this.isAIDisabled() && this.isEntityAlive()) - { - BlockPos blockpos = new BlockPos(this); - - for (int i = 0; i < 5; ++i) - { - BlockPos blockpos1 = blockpos.add(8 - this.rand.nextInt(17), 8 - this.rand.nextInt(17), - 8 - this.rand.nextInt(17)); - - if (blockpos1.getY() > 0 && this.world.isAirBlock(blockpos1) && this.world.isInsideWorldBorder(this) - && this.world.getCollisionBoxes(this, new AxisAlignedBB(blockpos1)).isEmpty()) - { - boolean flag = false; - - for (EnumFacing enumfacing : EnumFacing.values()) - { - if (this.world.isBlockNormalCube(blockpos1.offset(enumfacing), false)) - { - this.dataManager.set(ATTACHED_FACE, enumfacing); - flag = true; - break; - } - } - - if (flag) - { - net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent( - this, blockpos1.getX(), blockpos1.getY(), blockpos1.getZ(), 0); - if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) - flag = false; - blockpos1 = new BlockPos(event.getTargetX(), event.getTargetY(), event.getTargetZ()); - } - - if (flag) - { - this.playSound(SoundEvents.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F); - this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos1)); - this.dataManager.set(PEEK_TICK, (byte) 0); - this.setAttackTarget(null); - return true; - } - } - } - - return false; - } else - { - return true; - } - } - - @Override - public void onLivingUpdate() - { - super.onLivingUpdate(); - this.motionX = 0.0D; - this.motionY = 0.0D; - this.motionZ = 0.0D; - this.prevRenderYawOffset = 180.0F; - this.renderYawOffset = 180.0F; - this.rotationYaw = 180.0F; - } - - @Override - public void notifyDataManagerChange(DataParameter key) - { - if (ATTACHED_BLOCK_POS.equals(key) && this.world.isRemote && !this.isRiding()) - { - BlockPos blockpos = this.getAttachmentPos(); - - if (blockpos != null) - { - if (this.currentAttachmentPosition == null) - { - this.currentAttachmentPosition = blockpos; - } else - { - this.clientSideTeleportInterpolation = 6; - } - - this.posX = blockpos.getX() + 0.5D; - this.posY = blockpos.getY(); - this.posZ = blockpos.getZ() + 0.5D; - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.lastTickPosX = this.posX; - this.lastTickPosY = this.posY; - this.lastTickPosZ = this.posZ; - } - } - - super.notifyDataManagerChange(key); - } - - @Override - @SideOnly(Side.CLIENT) - public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, - int posRotationIncrements, boolean teleport) - { - this.newPosRotationIncrements = 0; - } - - @Override - public boolean attackEntityFrom(DamageSource source, float amount) - { - if (this.isClosed()) - { - Entity entity = source.getImmediateSource(); - - if (entity instanceof EntityArrow) - { - return false; - } - } - - if (super.attackEntityFrom(source, amount)) - { - if (this.getHealth() < this.getMaxHealth() * 0.5D && this.rand.nextInt(4) == 0) - { - this.tryTeleportToNewPosition(); - } - - return true; - } else - { - return false; - } - } - - private boolean isClosed() - { - return this.getPeekTick() == 0; - } - - @Override - @Nullable - public AxisAlignedBB getCollisionBoundingBox() - { - return this.isEntityAlive() ? this.getEntityBoundingBox() : null; - } - - public EnumFacing getAttachmentFacing() - { - return this.dataManager.get(ATTACHED_FACE); - } - - @Nullable - public BlockPos getAttachmentPos() - { - return this.dataManager.get(ATTACHED_BLOCK_POS).orNull(); - } - - public int getPeekTick() - { - return this.dataManager.get(PEEK_TICK); - } - - public void updateArmorModifier(int p_184691_1_) - { - if (!this.world.isRemote) - { - this.getEntityAttribute(SharedMonsterAttributes.ARMOR).removeModifier(COVERED_ARMOR_BONUS_MODIFIER); - - if (p_184691_1_ == 0) - { - this.getEntityAttribute(SharedMonsterAttributes.ARMOR).applyModifier(COVERED_ARMOR_BONUS_MODIFIER); - this.playSound(SoundEvents.ENTITY_SHULKER_CLOSE, 1.0F, 1.0F); - } else - { - this.playSound(ModSoundEvents.ENTITY_SCHALKER_OPEN, 1.0F, 1.0F); - } - } - - this.dataManager.set(PEEK_TICK, (byte) p_184691_1_); - } - - @SideOnly(Side.CLIENT) - public float getClientPeekAmount(float p_184688_1_) - { - return this.prevPeekAmount + (this.peekAmount - this.prevPeekAmount) * p_184688_1_; - } - - @SideOnly(Side.CLIENT) - public int getClientTeleportInterp() - { - return this.clientSideTeleportInterpolation; - } - - @SideOnly(Side.CLIENT) - public BlockPos getOldAttachPos() - { - return this.currentAttachmentPosition; - } - - @Override - public float getEyeHeight() - { - return 0.5F; - } - - @Override - public int getVerticalFaceSpeed() - { - return 180; - } - - @Override - public int getHorizontalFaceSpeed() - { - return 180; - } - - @Override - public void applyEntityCollision(Entity entityIn) - { - } - - @Override - public float getCollisionBorderSize() - { - return 0.0F; - } - - @SideOnly(Side.CLIENT) - public boolean isAttachedToBlock() - { - return this.currentAttachmentPosition != null && this.getAttachmentPos() != null; - } - - @Override - @Nullable - protected ResourceLocation getLootTable() - { - return LootTableList.ENTITIES_SHULKER; - } - - @SideOnly(Side.CLIENT) - public EnumDyeColor getColor() - { - return EnumDyeColor.byMetadata(this.dataManager.get(COLOR)); - } - - static class AIDefenseAttack extends EntityAINearestAttackableTarget - { - public AIDefenseAttack(EntitySchalker schalker) - { - super(schalker, EntityLivingBase.class, 10, true, false, new Predicate() - { - @Override - public boolean apply(@Nullable EntityLivingBase p_apply_1_) - { - return p_apply_1_ instanceof IMob; - } - }); - } - - @Override - public boolean shouldExecute() - { - return this.taskOwner.getTeam() != null && super.shouldExecute(); - } - - @Override - protected AxisAlignedBB getTargetableArea(double targetDistance) - { - EnumFacing enumfacing = ((EntitySchalker) this.taskOwner).getAttachmentFacing(); - - if (enumfacing.getAxis() == EnumFacing.Axis.X) - { - return this.taskOwner.getEntityBoundingBox().grow(4.0D, targetDistance, targetDistance); - } else - { - return enumfacing.getAxis() == EnumFacing.Axis.Z - ? this.taskOwner.getEntityBoundingBox().grow(targetDistance, targetDistance, 4.0D) - : this.taskOwner.getEntityBoundingBox().grow(targetDistance, 4.0D, targetDistance); - } - } - } - - static class BodyHelper extends EntityBodyHelper - { - public BodyHelper(EntityLivingBase theEntity) - { - super(theEntity); - } - - @Override - public void updateRenderAngles() - { - } - } - - class AIAttack extends EntityAIBase - { - private int attackTime; - - public AIAttack() - { - this.setMutexBits(3); - } - - @Override - public boolean shouldExecute() - { - EntityLivingBase entitylivingbase = EntitySchalker.this.getAttackTarget(); - - if (entitylivingbase != null && entitylivingbase.isEntityAlive()) - { - return EntitySchalker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL; - } else - { - return false; - } - } - - @Override - public void startExecuting() - { - this.attackTime = 20; - EntitySchalker.this.updateArmorModifier(100); - } - - @Override - public void resetTask() - { - EntitySchalker.this.updateArmorModifier(0); - } - - @Override - public void updateTask() - { - if (EntitySchalker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL) - { - --this.attackTime; - EntityLivingBase entitylivingbase = EntitySchalker.this.getAttackTarget(); - EntitySchalker.this.getLookHelper().setLookPositionWithEntity(entitylivingbase, 180.0F, 180.0F); - double d0 = EntitySchalker.this.getDistanceSq(entitylivingbase); - - if (d0 < 400.0D) - { - if (this.attackTime <= 0) - { - this.attackTime = 20 + EntitySchalker.this.rand.nextInt(10) * 20 / 2; - EntityShulkerBullet entityshulkerbullet = new EntityShulkerBullet( - EntitySchalker.this.world, - EntitySchalker.this, entitylivingbase, - EntitySchalker.this.getAttachmentFacing().getAxis() - ); - EntitySchalker.this.world.spawnEntity(entityshulkerbullet); - EntitySchalker.this.playSound(ModSoundEvents.ENTITY_SCHALKER_SHOOT, 2.0F, - (EntitySchalker.this.rand.nextFloat() - EntitySchalker.this.rand.nextFloat()) * 0.2F - + 1.0F); - } - } else - { - EntitySchalker.this.setAttackTarget(null); - } - - super.updateTask(); - } - } - } - - class AIAttackNearest extends EntityAINearestAttackableTarget - { - public AIAttackNearest(EntitySchalker schalker) - { - super(schalker, EntityPlayer.class, true); - } - - @Override - public boolean shouldExecute() - { - return EntitySchalker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL && super.shouldExecute(); - } - - @Override - protected AxisAlignedBB getTargetableArea(double targetDistance) - { - EnumFacing enumfacing = ((EntitySchalker) this.taskOwner).getAttachmentFacing(); - - if (enumfacing.getAxis() == EnumFacing.Axis.X) - { - return this.taskOwner.getEntityBoundingBox().grow(4.0D, targetDistance, targetDistance); - } else - { - return enumfacing.getAxis() == EnumFacing.Axis.Z - ? this.taskOwner.getEntityBoundingBox().grow(targetDistance, targetDistance, 4.0D) - : this.taskOwner.getEntityBoundingBox().grow(targetDistance, 4.0D, targetDistance); - } - } - } - - class AIPeek extends EntityAIBase - { - private int peekTime; - - private AIPeek() - { - } - - @Override - public boolean shouldExecute() - { - return EntitySchalker.this.getAttackTarget() == null && EntitySchalker.this.rand.nextInt(40) == 0; - } - - @Override - public boolean shouldContinueExecuting() - { - return EntitySchalker.this.getAttackTarget() == null && this.peekTime > 0; - } - - @Override - public void startExecuting() - { - this.peekTime = 20 * (1 + EntitySchalker.this.rand.nextInt(3)); - EntitySchalker.this.updateArmorModifier(30); - } - - @Override - public void resetTask() - { - if (EntitySchalker.this.getAttackTarget() == null) - { - EntitySchalker.this.updateArmorModifier(0); - } - } - - @Override - public void updateTask() - { - --this.peekTime; - } - } + public static final EnumDyeColor DEFAULT_COLOR = EnumDyeColor.PURPLE; + protected static final DataParameter ATTACHED_FACE = EntityDataManager + .createKey(EntitySchalker.class, DataSerializers.FACING); + protected static final DataParameter> ATTACHED_BLOCK_POS = EntityDataManager + .createKey(EntitySchalker.class, DataSerializers.OPTIONAL_BLOCK_POS); + protected static final DataParameter PEEK_TICK = EntityDataManager.createKey(EntitySchalker.class, + DataSerializers.BYTE); + protected static final DataParameter COLOR = EntityDataManager.createKey(EntitySchalker.class, + DataSerializers.BYTE); + private static final UUID COVERED_ARMOR_BONUS_ID = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F"); + private static final AttributeModifier COVERED_ARMOR_BONUS_MODIFIER = (new AttributeModifier(COVERED_ARMOR_BONUS_ID, + "Covered armor bonus", 20.0D, 0)).setSaved(false); + private float prevPeekAmount; + private float peekAmount; + private BlockPos currentAttachmentPosition; + private int clientSideTeleportInterpolation; + + public EntitySchalker(World worldIn) + { + super(worldIn); + this.setSize(1.0F, 1.0F); + this.prevRenderYawOffset = 180.0F; + this.renderYawOffset = 180.0F; + this.isImmuneToFire = true; + this.currentAttachmentPosition = null; + this.experienceValue = 5; + } + + @Override + public void setPosition(double x, double y, double z) + { + super.setPosition(x, y, z); + + if (this.dataManager != null && this.ticksExisted != 0) + { + Optional optional = this.dataManager.get(ATTACHED_BLOCK_POS); + Optional optional1 = Optional.of(new BlockPos(x, y, z)); + + if (!optional1.equals(optional)) + { + this.dataManager.set(ATTACHED_BLOCK_POS, optional1); + this.dataManager.set(PEEK_TICK, (byte) 0); + this.isAirBorne = true; + } + } + } + + @Override + public void move(MoverType type, double x, double y, double z) + { + if (type == MoverType.SHULKER_BOX) + { + this.tryTeleportToNewPosition(); + } + else + { + super.move(type, x, y, z); + } + } + + @Override + protected boolean canTriggerWalking() + { + return false; + } + + @Override + @Nullable + public AxisAlignedBB getCollisionBoundingBox() + { + return this.isEntityAlive() ? this.getEntityBoundingBox() : null; + } + + @Override + public void applyEntityCollision(Entity entityIn) + { + } + + @Override + public float getCollisionBorderSize() + { + return 0.0F; + } + + @Override + public float getEyeHeight() + { + return 0.5F; + } + + @Override + public SoundCategory getSoundCategory() + { + return SoundCategory.HOSTILE; + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isClosed()) + { + Entity entity = source.getImmediateSource(); + + if (entity instanceof EntityArrow) + { + return false; + } + } + + if (super.attackEntityFrom(source, amount)) + { + if (this.getHealth() < this.getMaxHealth() * 0.5D && this.rand.nextInt(4) == 0) + { + this.tryTeleportToNewPosition(); + } + + return true; + } + else + { + return false; + } + } + + @Override + @SideOnly(Side.CLIENT) + public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, + int posRotationIncrements, boolean teleport) + { + this.newPosRotationIncrements = 0; + } + + @Override + public void notifyDataManagerChange(DataParameter key) + { + if (ATTACHED_BLOCK_POS.equals(key) && this.world.isRemote && !this.isRiding()) + { + BlockPos blockpos = this.getAttachmentPos(); + + if (blockpos != null) + { + if (this.currentAttachmentPosition == null) + { + this.currentAttachmentPosition = blockpos; + } + else + { + this.clientSideTeleportInterpolation = 6; + } + + this.posX = blockpos.getX() + 0.5D; + this.posY = blockpos.getY(); + this.posZ = blockpos.getZ() + 0.5D; + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + } + } + + super.notifyDataManagerChange(key); + } + + public EnumFacing getAttachmentFacing() + { + return this.dataManager.get(ATTACHED_FACE); + } + + @Nullable + public BlockPos getAttachmentPos() + { + return this.dataManager.get(ATTACHED_BLOCK_POS).orNull(); + } + + public int getPeekTick() + { + return this.dataManager.get(PEEK_TICK); + } + + public void updateArmorModifier(int p_184691_1_) + { + if (!this.world.isRemote) + { + this.getEntityAttribute(SharedMonsterAttributes.ARMOR).removeModifier(COVERED_ARMOR_BONUS_MODIFIER); + + if (p_184691_1_ == 0) + { + this.getEntityAttribute(SharedMonsterAttributes.ARMOR).applyModifier(COVERED_ARMOR_BONUS_MODIFIER); + this.playSound(SoundEvents.ENTITY_SHULKER_CLOSE, 1.0F, 1.0F); + } + else + { + this.playSound(ModSoundEvents.ENTITY_SCHALKER_OPEN, 1.0F, 1.0F); + } + } + + this.dataManager.set(PEEK_TICK, (byte) p_184691_1_); + } + + @SideOnly(Side.CLIENT) + public float getClientPeekAmount(float p_184688_1_) + { + return this.prevPeekAmount + (this.peekAmount - this.prevPeekAmount) * p_184688_1_; + } + + @SideOnly(Side.CLIENT) + public int getClientTeleportInterp() + { + return this.clientSideTeleportInterpolation; + } + + @SideOnly(Side.CLIENT) + public BlockPos getOldAttachPos() + { + return this.currentAttachmentPosition; + } + + @SideOnly(Side.CLIENT) + public boolean isAttachedToBlock() + { + return this.currentAttachmentPosition != null && this.getAttachmentPos() != null; + } + + @SideOnly(Side.CLIENT) + public EnumDyeColor getColor() + { + return EnumDyeColor.byMetadata(this.dataManager.get(COLOR)); + } + + @Override + protected void initEntityAI() + { + this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(4, new EntitySchalker.AIAttack()); + this.tasks.addTask(7, new EntitySchalker.AIPeek()); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(2, new EntitySchalker.AIAttackNearest(this)); + this.targetTasks.addTask(3, new EntitySchalker.AIDefenseAttack(this)); + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D); + } + + @Override + protected EntityBodyHelper createBodyHelper() + { + return new BodyHelper(this); + } + + @Override + protected void entityInit() + { + super.entityInit(); + this.dataManager.register(ATTACHED_FACE, EnumFacing.DOWN); + this.dataManager.register(ATTACHED_BLOCK_POS, Optional.absent()); + this.dataManager.register(PEEK_TICK, (byte) 0); + this.dataManager.register(COLOR, (byte) DEFAULT_COLOR.getMetadata()); + } + + @Override + public void playLivingSound() + { + if (!this.isClosed()) + { + super.playLivingSound(); + } + } + + @Override + public void onUpdate() + { + super.onUpdate(); + BlockPos blockpos = this.dataManager.get(ATTACHED_BLOCK_POS).orNull(); + + if (blockpos == null && !this.world.isRemote) + { + blockpos = new BlockPos(this); + this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos)); + } + + if (this.isRiding()) + { + blockpos = null; + float f = this.getRidingEntity().rotationYaw; + this.rotationYaw = f; + this.renderYawOffset = f; + this.prevRenderYawOffset = f; + this.clientSideTeleportInterpolation = 0; + } + else if (!this.world.isRemote) + { + IBlockState iblockstate = this.world.getBlockState(blockpos); + + if (iblockstate.getMaterial() != Material.AIR) + { + if (iblockstate.getBlock() == Blocks.PISTON_EXTENSION) + { + EnumFacing enumfacing = iblockstate.getValue(BlockDirectional.FACING); + + if (this.world.isAirBlock(blockpos.offset(enumfacing))) + { + blockpos = blockpos.offset(enumfacing); + this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos)); + } + else + { + this.tryTeleportToNewPosition(); + } + } + else if (iblockstate.getBlock() == Blocks.PISTON_HEAD) + { + EnumFacing enumfacing3 = iblockstate.getValue(BlockDirectional.FACING); + + if (this.world.isAirBlock(blockpos.offset(enumfacing3))) + { + blockpos = blockpos.offset(enumfacing3); + this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos)); + } + else + { + this.tryTeleportToNewPosition(); + } + } + else + { + this.tryTeleportToNewPosition(); + } + } + + BlockPos blockpos1 = blockpos.offset(this.getAttachmentFacing()); + + if (!this.world.isBlockNormalCube(blockpos1, false)) + { + boolean flag = false; + + for (EnumFacing enumfacing1 : EnumFacing.values()) + { + blockpos1 = blockpos.offset(enumfacing1); + + if (this.world.isBlockNormalCube(blockpos1, false)) + { + this.dataManager.set(ATTACHED_FACE, enumfacing1); + flag = true; + break; + } + } + + if (!flag) + { + this.tryTeleportToNewPosition(); + } + } + + BlockPos blockpos2 = blockpos.offset(this.getAttachmentFacing().getOpposite()); + + if (this.world.isBlockNormalCube(blockpos2, false)) + { + this.tryTeleportToNewPosition(); + } + } + + float f1 = this.getPeekTick() * 0.01F; + this.prevPeekAmount = this.peekAmount; + + if (this.peekAmount > f1) + { + this.peekAmount = MathHelper.clamp(this.peekAmount - 0.05F, f1, 1.0F); + } + else if (this.peekAmount < f1) + { + this.peekAmount = MathHelper.clamp(this.peekAmount + 0.05F, 0.0F, f1); + } + + if (blockpos != null) + { + if (this.world.isRemote) + { + if (this.clientSideTeleportInterpolation > 0 && this.currentAttachmentPosition != null) + { + --this.clientSideTeleportInterpolation; + } + else + { + this.currentAttachmentPosition = blockpos; + } + } + + this.posX = blockpos.getX() + 0.5D; + this.posY = blockpos.getY(); + this.posZ = blockpos.getZ() + 0.5D; + if (this.isAddedToWorld() && !this.world.isRemote) + this.world.updateEntityWithOptionalForce(this, false); // Forge + // - + // Process + // chunk + // registration + // after + // moving. + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + double d3 = 0.5D - MathHelper.sin((0.5F + this.peekAmount) * (float) Math.PI) * 0.5D; + double d4 = 0.5D - MathHelper.sin((0.5F + this.prevPeekAmount) * (float) Math.PI) * 0.5D; + double d5 = d3 - d4; + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + EnumFacing enumfacing2 = this.getAttachmentFacing(); + + switch (enumfacing2) + { + case DOWN: + this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY, this.posZ - 0.5D, + this.posX + 0.5D, this.posY + 1.0D + d3, this.posZ + 0.5D)); + d1 = d5; + break; + case UP: + this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY - d3, this.posZ - 0.5D, + this.posX + 0.5D, this.posY + 1.0D, this.posZ + 0.5D)); + d1 = -d5; + break; + case NORTH: + this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY, this.posZ - 0.5D, + this.posX + 0.5D, this.posY + 1.0D, this.posZ + 0.5D + d3)); + d2 = d5; + break; + case SOUTH: + this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY, this.posZ - 0.5D - d3, + this.posX + 0.5D, this.posY + 1.0D, this.posZ + 0.5D)); + d2 = -d5; + break; + case WEST: + this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D, this.posY, this.posZ - 0.5D, + this.posX + 0.5D + d3, this.posY + 1.0D, this.posZ + 0.5D)); + d0 = d5; + break; + case EAST: + this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.5D - d3, this.posY, this.posZ - 0.5D, + this.posX + 0.5D, this.posY + 1.0D, this.posZ + 0.5D)); + d0 = -d5; + } + + if (d5 > 0.0D) + { + List list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()); + + if (!list.isEmpty()) + { + for (Entity entity : list) + { + if (!(entity instanceof EntitySchalker) && !entity.noClip) + { + entity.move(MoverType.SHULKER, d0, d1, d2); + } + } + } + } + } + } + + @Override + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); + compound.setByte("AttachFace", (byte) this.dataManager.get(ATTACHED_FACE).getIndex()); + compound.setByte("Peek", this.dataManager.get(PEEK_TICK)); + compound.setByte("Color", this.dataManager.get(COLOR)); + BlockPos blockpos = this.getAttachmentPos(); + + if (blockpos != null) + { + compound.setInteger("APX", blockpos.getX()); + compound.setInteger("APY", blockpos.getY()); + compound.setInteger("APZ", blockpos.getZ()); + } + } + + @Override + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); + this.dataManager.set(ATTACHED_FACE, EnumFacing.getFront(compound.getByte("AttachFace"))); + this.dataManager.set(PEEK_TICK, compound.getByte("Peek")); + this.dataManager.set(COLOR, compound.getByte("Color")); + + if (compound.hasKey("APX")) + { + int i = compound.getInteger("APX"); + int j = compound.getInteger("APY"); + int k = compound.getInteger("APZ"); + this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(new BlockPos(i, j, k))); + } + else + { + this.dataManager.set(ATTACHED_BLOCK_POS, Optional.absent()); + } + } + + @Override + @Nullable + protected ResourceLocation getLootTable() + { + return LootTableList.ENTITIES_SHULKER; + } + + @Override + public void onLivingUpdate() + { + super.onLivingUpdate(); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevRenderYawOffset = 180.0F; + this.renderYawOffset = 180.0F; + this.rotationYaw = 180.0F; + } + + @Override + public int getVerticalFaceSpeed() + { + return 180; + } + + @Override + public int getHorizontalFaceSpeed() + { + return 180; + } + + @Override + @Nullable + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) + { + this.renderYawOffset = 180.0F; + this.prevRenderYawOffset = 180.0F; + this.rotationYaw = 180.0F; + this.prevRotationYaw = 180.0F; + this.rotationYawHead = 180.0F; + this.prevRotationYawHead = 180.0F; + return super.onInitialSpawn(difficulty, livingdata); + } + + @Override + protected SoundEvent getAmbientSound() + { + return ModSoundEvents.ENTITY_SCHALKER_AMBIENT; + } + + @Override + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return this.isClosed() ? SoundEvents.ENTITY_SHULKER_HURT_CLOSED : SoundEvents.ENTITY_SHULKER_HURT; + } + + @Override + protected SoundEvent getDeathSound() + { + return ModSoundEvents.ENTITY_SCHALKER_DEATH; + } + + protected boolean tryTeleportToNewPosition() + { + if (!this.isAIDisabled() && this.isEntityAlive()) + { + BlockPos blockpos = new BlockPos(this); + + for (int i = 0; i < 5; ++i) + { + BlockPos blockpos1 = blockpos.add(8 - this.rand.nextInt(17), 8 - this.rand.nextInt(17), + 8 - this.rand.nextInt(17)); + + if (blockpos1.getY() > 0 && this.world.isAirBlock(blockpos1) && this.world.isInsideWorldBorder(this) + && this.world.getCollisionBoxes(this, new AxisAlignedBB(blockpos1)).isEmpty()) + { + boolean flag = false; + + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (this.world.isBlockNormalCube(blockpos1.offset(enumfacing), false)) + { + this.dataManager.set(ATTACHED_FACE, enumfacing); + flag = true; + break; + } + } + + if (flag) + { + net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent( + this, blockpos1.getX(), blockpos1.getY(), blockpos1.getZ(), 0); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) + flag = false; + blockpos1 = new BlockPos(event.getTargetX(), event.getTargetY(), event.getTargetZ()); + } + + if (flag) + { + this.playSound(SoundEvents.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F); + this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos1)); + this.dataManager.set(PEEK_TICK, (byte) 0); + this.setAttackTarget(null); + return true; + } + } + } + + return false; + } + else + { + return true; + } + } + + private boolean isClosed() + { + return this.getPeekTick() == 0; + } + + static class AIDefenseAttack extends EntityAINearestAttackableTarget + { + public AIDefenseAttack(EntitySchalker schalker) + { + super(schalker, EntityLivingBase.class, 10, true, false, new Predicate() + { + @Override + public boolean apply(@Nullable EntityLivingBase p_apply_1_) + { + return p_apply_1_ instanceof IMob; + } + }); + } + + @Override + public boolean shouldExecute() + { + return this.taskOwner.getTeam() != null && super.shouldExecute(); + } + + @Override + protected AxisAlignedBB getTargetableArea(double targetDistance) + { + EnumFacing enumfacing = ((EntitySchalker) this.taskOwner).getAttachmentFacing(); + + if (enumfacing.getAxis() == EnumFacing.Axis.X) + { + return this.taskOwner.getEntityBoundingBox().grow(4.0D, targetDistance, targetDistance); + } + else + { + return enumfacing.getAxis() == EnumFacing.Axis.Z + ? this.taskOwner.getEntityBoundingBox().grow(targetDistance, targetDistance, 4.0D) + : this.taskOwner.getEntityBoundingBox().grow(targetDistance, 4.0D, targetDistance); + } + } + } + + static class BodyHelper extends EntityBodyHelper + { + public BodyHelper(EntityLivingBase theEntity) + { + super(theEntity); + } + + @Override + public void updateRenderAngles() + { + } + } + + class AIAttack extends EntityAIBase + { + private int attackTime; + + public AIAttack() + { + this.setMutexBits(3); + } + + @Override + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = EntitySchalker.this.getAttackTarget(); + + if (entitylivingbase != null && entitylivingbase.isEntityAlive()) + { + return EntitySchalker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL; + } + else + { + return false; + } + } + + @Override + public void startExecuting() + { + this.attackTime = 20; + EntitySchalker.this.updateArmorModifier(100); + } + + @Override + public void resetTask() + { + EntitySchalker.this.updateArmorModifier(0); + } + + @Override + public void updateTask() + { + if (EntitySchalker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL) + { + --this.attackTime; + EntityLivingBase entitylivingbase = EntitySchalker.this.getAttackTarget(); + EntitySchalker.this.getLookHelper().setLookPositionWithEntity(entitylivingbase, 180.0F, 180.0F); + double d0 = EntitySchalker.this.getDistanceSq(entitylivingbase); + + if (d0 < 400.0D) + { + if (this.attackTime <= 0) + { + this.attackTime = 20 + EntitySchalker.this.rand.nextInt(10) * 20 / 2; + EntityShulkerBullet entityshulkerbullet = new EntityShulkerBullet( + EntitySchalker.this.world, + EntitySchalker.this, entitylivingbase, + EntitySchalker.this.getAttachmentFacing().getAxis() + ); + EntitySchalker.this.world.spawnEntity(entityshulkerbullet); + EntitySchalker.this.playSound(ModSoundEvents.ENTITY_SCHALKER_SHOOT, 2.0F, + (EntitySchalker.this.rand.nextFloat() - EntitySchalker.this.rand.nextFloat()) * 0.2F + + 1.0F); + } + } + else + { + EntitySchalker.this.setAttackTarget(null); + } + + super.updateTask(); + } + } + } + + class AIAttackNearest extends EntityAINearestAttackableTarget + { + public AIAttackNearest(EntitySchalker schalker) + { + super(schalker, EntityPlayer.class, true); + } + + @Override + public boolean shouldExecute() + { + return EntitySchalker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL && super.shouldExecute(); + } + + @Override + protected AxisAlignedBB getTargetableArea(double targetDistance) + { + EnumFacing enumfacing = ((EntitySchalker) this.taskOwner).getAttachmentFacing(); + + if (enumfacing.getAxis() == EnumFacing.Axis.X) + { + return this.taskOwner.getEntityBoundingBox().grow(4.0D, targetDistance, targetDistance); + } + else + { + return enumfacing.getAxis() == EnumFacing.Axis.Z + ? this.taskOwner.getEntityBoundingBox().grow(targetDistance, targetDistance, 4.0D) + : this.taskOwner.getEntityBoundingBox().grow(targetDistance, 4.0D, targetDistance); + } + } + } + + class AIPeek extends EntityAIBase + { + private int peekTime; + + private AIPeek() + { + } + + @Override + public boolean shouldExecute() + { + return EntitySchalker.this.getAttackTarget() == null && EntitySchalker.this.rand.nextInt(40) == 0; + } + + @Override + public boolean shouldContinueExecuting() + { + return EntitySchalker.this.getAttackTarget() == null && this.peekTime > 0; + } + + @Override + public void startExecuting() + { + this.peekTime = 20 * (1 + EntitySchalker.this.rand.nextInt(3)); + EntitySchalker.this.updateArmorModifier(30); + } + + @Override + public void resetTask() + { + if (EntitySchalker.this.getAttackTarget() == null) + { + EntitySchalker.this.updateArmorModifier(0); + } + } + + @Override + public void updateTask() + { + --this.peekTime; + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntitySmavaCreeper.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntitySmavaCreeper.java index ba3feb8..7af1370 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntitySmavaCreeper.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntitySmavaCreeper.java @@ -1,7 +1,8 @@ package mod.acgaming.spackenmobs.entities; -import mod.acgaming.spackenmobs.entities.ai.EntityAISmavaCreeperSwell; -import mod.acgaming.spackenmobs.misc.ModSoundEvents; +import java.util.Collection; +import javax.annotation.Nullable; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAreaEffectCloud; import net.minecraft.entity.SharedMonsterAttributes; @@ -29,285 +30,286 @@ import net.minecraft.world.storage.loot.LootTableList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import javax.annotation.Nullable; -import java.util.Collection; +import mod.acgaming.spackenmobs.entities.ai.EntityAISmavaCreeperSwell; +import mod.acgaming.spackenmobs.misc.ModSoundEvents; public class EntitySmavaCreeper extends EntityMob { - private static final DataParameter STATE = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.VARINT); - private static final DataParameter POWERED = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN); - private static final DataParameter IGNITED = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN); - private int lastActiveTime; - private int timeSinceIgnited; - private int fuseTime = 20; - private int explosionRadius = 6; - private int droppedSkulls; + private static final DataParameter STATE = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.VARINT); + private static final DataParameter POWERED = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN); + private static final DataParameter IGNITED = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN); + private int lastActiveTime; + private int timeSinceIgnited; + private int fuseTime = 20; + private int explosionRadius = 6; + private int droppedSkulls; - public EntitySmavaCreeper(World worldIn) - { - super(worldIn); - this.setSize(0.6F, 1.7F); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D); - } + public EntitySmavaCreeper(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 1.7F); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D); + } - protected void initEntityAI() - { - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAISmavaCreeperSwell(this)); - this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); - this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false)); - this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D)); - this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(6, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); - this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); - } + public void onUpdate() + { + if (this.isEntityAlive()) + { + this.lastActiveTime = this.timeSinceIgnited; - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); - } + if (this.hasIgnited()) + { + this.setCreeperState(1); + } - public int getMaxFallHeight() - { - return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); - } + int i = this.getCreeperState(); - public void fall(float distance, float damageMultiplier) - { - super.fall(distance, damageMultiplier); - this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F); + if (i > 0 && this.timeSinceIgnited == 0) + { + this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE, 1.0F, 1.0F); + } - if (this.timeSinceIgnited > this.fuseTime - 5) - { - this.timeSinceIgnited = this.fuseTime - 5; - } - } + this.timeSinceIgnited += i; - protected void entityInit() - { - super.entityInit(); - this.dataManager.register(STATE, -1); - this.dataManager.register(POWERED, Boolean.FALSE); - this.dataManager.register(IGNITED, Boolean.FALSE); - } + if (this.timeSinceIgnited < 0) + { + this.timeSinceIgnited = 0; + } - public void writeEntityToNBT(NBTTagCompound compound) - { - super.writeEntityToNBT(compound); + if (this.timeSinceIgnited >= this.fuseTime) + { + this.timeSinceIgnited = this.fuseTime; + this.explode(); + } + } + super.onUpdate(); + } - if (this.dataManager.get(POWERED)) - { - compound.setBoolean("powered", true); - } + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return ModSoundEvents.ENTITY_SMAVACREEPER_HURT; + } - compound.setShort("Fuse", (short) this.fuseTime); - compound.setByte("ExplosionRadius", (byte) this.explosionRadius); - compound.setBoolean("ignited", this.hasIgnited()); - } + protected SoundEvent getDeathSound() + { + return SoundEvents.ENTITY_CREEPER_DEATH; + } - public void readEntityFromNBT(NBTTagCompound compound) - { - super.readEntityFromNBT(compound); - this.dataManager.set(POWERED, compound.getBoolean("powered")); + public boolean attackEntityAsMob(Entity entityIn) + { + return true; + } - if (compound.hasKey("Fuse", 99)) - { - this.fuseTime = compound.getShort("Fuse"); - } + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); + } - if (compound.hasKey("ExplosionRadius", 99)) - { - this.explosionRadius = compound.getByte("ExplosionRadius"); - } + public void onDeath(DamageSource cause) + { + super.onDeath(cause); - if (compound.getBoolean("ignited")) - { - this.ignite(); - } - } + if (this.world.getGameRules().getBoolean("doMobLoot")) + { + if (cause.getTrueSource() instanceof EntitySkeleton) + { + int i = Item.getIdFromItem(Items.RECORD_13); + int j = Item.getIdFromItem(Items.RECORD_WAIT); + int k = i + this.rand.nextInt(j - i + 1); + this.dropItem(Item.getItemById(k), 1); + } + else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntitySmavaCreeper && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).ableToCauseSkullDrop()) + { + ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).incrementDroppedSkulls(); + this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F); + } + } + } - public void onUpdate() - { - if (this.isEntityAlive()) - { - this.lastActiveTime = this.timeSinceIgnited; + public void fall(float distance, float damageMultiplier) + { + super.fall(distance, damageMultiplier); + this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F); - if (this.hasIgnited()) - { - this.setCreeperState(1); - } + if (this.timeSinceIgnited > this.fuseTime - 5) + { + this.timeSinceIgnited = this.fuseTime - 5; + } + } - int i = this.getCreeperState(); + public boolean getPowered() + { + return this.dataManager.get(POWERED); + } - if (i > 0 && this.timeSinceIgnited == 0) - { - this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE, 1.0F, 1.0F); - } + @SideOnly(Side.CLIENT) + public float getCreeperFlashIntensity(float p_70831_1_) + { + return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2); + } - this.timeSinceIgnited += i; + public int getCreeperState() + { + return this.dataManager.get(STATE); + } - if (this.timeSinceIgnited < 0) - { - this.timeSinceIgnited = 0; - } + public void setCreeperState(int state) + { + this.dataManager.set(STATE, state); + } - if (this.timeSinceIgnited >= this.fuseTime) - { - this.timeSinceIgnited = this.fuseTime; - this.explode(); - } - } - super.onUpdate(); - } + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + super.onStruckByLightning(lightningBolt); + this.dataManager.set(POWERED, Boolean.TRUE); + } - protected SoundEvent getAmbientSound() - { - return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT; - } + public boolean hasIgnited() + { + return this.dataManager.get(IGNITED); + } - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return ModSoundEvents.ENTITY_SMAVACREEPER_HURT; - } + public void ignite() + { + this.dataManager.set(IGNITED, Boolean.TRUE); + } - protected SoundEvent getDeathSound() - { - return SoundEvents.ENTITY_CREEPER_DEATH; - } + public boolean ableToCauseSkullDrop() + { + return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot"); + } - public void onDeath(DamageSource cause) - { - super.onDeath(cause); + public void incrementDroppedSkulls() + { + ++this.droppedSkulls; + } - if (this.world.getGameRules().getBoolean("doMobLoot")) - { - if (cause.getTrueSource() instanceof EntitySkeleton) - { - int i = Item.getIdFromItem(Items.RECORD_13); - int j = Item.getIdFromItem(Items.RECORD_WAIT); - int k = i + this.rand.nextInt(j - i + 1); - this.dropItem(Item.getItemById(k), 1); - } else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntitySmavaCreeper && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).ableToCauseSkullDrop()) - { - ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).incrementDroppedSkulls(); - this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F); - } - } - } + protected void initEntityAI() + { + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAISmavaCreeperSwell(this)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false)); + this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + } - public boolean attackEntityAsMob(Entity entityIn) - { - return true; - } + protected void entityInit() + { + super.entityInit(); + this.dataManager.register(STATE, -1); + this.dataManager.register(POWERED, Boolean.FALSE); + this.dataManager.register(IGNITED, Boolean.FALSE); + } - public boolean getPowered() - { - return this.dataManager.get(POWERED); - } + protected SoundEvent getAmbientSound() + { + return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT; + } - @SideOnly(Side.CLIENT) - public float getCreeperFlashIntensity(float p_70831_1_) - { - return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2); - } + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); - @Nullable - protected ResourceLocation getLootTable() - { - return LootTableList.ENTITIES_CREEPER; - } + if (this.dataManager.get(POWERED)) + { + compound.setBoolean("powered", true); + } - public int getCreeperState() - { - return this.dataManager.get(STATE); - } + compound.setShort("Fuse", (short) this.fuseTime); + compound.setByte("ExplosionRadius", (byte) this.explosionRadius); + compound.setBoolean("ignited", this.hasIgnited()); + } - public void setCreeperState(int state) - { - this.dataManager.set(STATE, state); - } + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); + this.dataManager.set(POWERED, compound.getBoolean("powered")); - public void onStruckByLightning(EntityLightningBolt lightningBolt) - { - super.onStruckByLightning(lightningBolt); - this.dataManager.set(POWERED, Boolean.TRUE); - } + if (compound.hasKey("Fuse", 99)) + { + this.fuseTime = compound.getShort("Fuse"); + } - protected boolean processInteract(EntityPlayer player, EnumHand hand) - { - ItemStack itemstack = player.getHeldItem(hand); + if (compound.hasKey("ExplosionRadius", 99)) + { + this.explosionRadius = compound.getByte("ExplosionRadius"); + } - if (itemstack.getItem() == Items.FLINT_AND_STEEL) - { - this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); - player.swingArm(hand); + if (compound.getBoolean("ignited")) + { + this.ignite(); + } + } - if (!this.world.isRemote) - { - this.ignite(); - itemstack.damageItem(1, player); - return true; - } - } + @Nullable + protected ResourceLocation getLootTable() + { + return LootTableList.ENTITIES_CREEPER; + } - return super.processInteract(player, hand); - } + public int getMaxFallHeight() + { + return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); + } - private void explode() - { - if (!this.world.isRemote) - { - boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this); - float f = this.getPowered() ? 2.0F : 1.0F; - this.dead = true; - this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_SMAVACREEPER_BLOW, getSoundCategory(), 5.0F, 1.0F); - this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag); - this.setDead(); - this.spawnLingeringCloud(); - } - } + protected boolean processInteract(EntityPlayer player, EnumHand hand) + { + ItemStack itemstack = player.getHeldItem(hand); - private void spawnLingeringCloud() - { - Collection collection = this.getActivePotionEffects(); + if (itemstack.getItem() == Items.FLINT_AND_STEEL) + { + this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); + player.swingArm(hand); - if (!collection.isEmpty()) - { - EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ); - entityareaeffectcloud.setRadius(2.5F); - entityareaeffectcloud.setRadiusOnUse(-0.5F); - entityareaeffectcloud.setWaitTime(10); - entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2); - entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration()); + if (!this.world.isRemote) + { + this.ignite(); + itemstack.damageItem(1, player); + return true; + } + } - for (PotionEffect potioneffect : collection) - { - entityareaeffectcloud.addEffect(new PotionEffect(potioneffect)); - } + return super.processInteract(player, hand); + } - this.world.spawnEntity(entityareaeffectcloud); - } - } + private void explode() + { + if (!this.world.isRemote) + { + boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this); + float f = this.getPowered() ? 2.0F : 1.0F; + this.dead = true; + this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_SMAVACREEPER_BLOW, getSoundCategory(), 5.0F, 1.0F); + this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag); + this.setDead(); + this.spawnLingeringCloud(); + } + } - public boolean hasIgnited() - { - return this.dataManager.get(IGNITED); - } + private void spawnLingeringCloud() + { + Collection collection = this.getActivePotionEffects(); - public void ignite() - { - this.dataManager.set(IGNITED, Boolean.TRUE); - } + if (!collection.isEmpty()) + { + EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ); + entityareaeffectcloud.setRadius(2.5F); + entityareaeffectcloud.setRadiusOnUse(-0.5F); + entityareaeffectcloud.setWaitTime(10); + entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2); + entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration()); - public boolean ableToCauseSkullDrop() - { - return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot"); - } + for (PotionEffect potioneffect : collection) + { + entityareaeffectcloud.addEffect(new PotionEffect(potioneffect)); + } - public void incrementDroppedSkulls() - { - ++this.droppedSkulls; - } + this.world.spawnEntity(entityareaeffectcloud); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/EntityTileraGhast.java b/src/main/java/mod/acgaming/spackenmobs/entities/EntityTileraGhast.java index 9392228..27195fe 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/EntityTileraGhast.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/EntityTileraGhast.java @@ -1,5 +1,8 @@ package mod.acgaming.spackenmobs.entities; +import java.util.Random; +import javax.annotation.Nullable; + import net.minecraft.entity.EntityFlying; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -28,347 +31,350 @@ import net.minecraft.world.storage.loot.LootTableList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import javax.annotation.Nullable; -import java.util.Random; - public class EntityTileraGhast extends EntityFlying implements IMob { - private static final DataParameter ATTACKING = EntityDataManager.createKey(EntityTileraGhast.class, DataSerializers.BOOLEAN); - private int explosionStrength = 1; + private static final DataParameter ATTACKING = EntityDataManager.createKey(EntityTileraGhast.class, DataSerializers.BOOLEAN); + private int explosionStrength = 1; - public EntityTileraGhast(World worldIn) - { - super(worldIn); - this.setSize(4.0F, 4.0F); - this.isImmuneToFire = true; - this.experienceValue = 5; - this.moveHelper = new GhastMoveHelper(this); - } + public EntityTileraGhast(World worldIn) + { + super(worldIn); + this.setSize(4.0F, 4.0F); + this.isImmuneToFire = true; + this.experienceValue = 5; + this.moveHelper = new GhastMoveHelper(this); + } - protected void initEntityAI() - { - this.tasks.addTask(5, new AIRandomFly(this)); - this.tasks.addTask(7, new AILookAround(this)); - this.tasks.addTask(7, new AIFireballAttack(this)); - this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); - } + @SideOnly(Side.CLIENT) + public boolean isAttacking() + { + return this.dataManager.get(ATTACKING); + } - @SideOnly(Side.CLIENT) - public boolean isAttacking() - { - return this.dataManager.get(ATTACKING); - } + public void setAttacking(boolean attacking) + { + this.dataManager.set(ATTACKING, attacking); + } - public void setAttacking(boolean attacking) - { - this.dataManager.set(ATTACKING, attacking); - } + public int getFireballStrength() + { + return this.explosionStrength; + } - public int getFireballStrength() - { - return this.explosionStrength; - } + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (source.getImmediateSource() instanceof EntityLargeFireball && source.getTrueSource() instanceof EntityPlayer) + { + super.attackEntityFrom(source, 1000.0F); + return true; + } + else + { + return super.attackEntityFrom(source, amount); + } + } - public void onUpdate() - { - super.onUpdate(); + protected SoundEvent getHurtSound(DamageSource damageSourceIn) + { + return SoundEvents.ENTITY_GHAST_HURT; + } - if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL) - { - this.setDead(); - } - } + protected SoundEvent getDeathSound() + { + return SoundEvents.ENTITY_GHAST_DEATH; + } - public boolean attackEntityFrom(DamageSource source, float amount) - { - if (this.isEntityInvulnerable(source)) - { - return false; - } else if (source.getImmediateSource() instanceof EntityLargeFireball && source.getTrueSource() instanceof EntityPlayer) - { - super.attackEntityFrom(source, 1000.0F); - return true; - } else - { - return super.attackEntityFrom(source, amount); - } - } + protected float getSoundVolume() + { + return 10.0F; + } - protected void entityInit() - { - super.entityInit(); - this.dataManager.register(ATTACKING, Boolean.FALSE); - } + public float getEyeHeight() + { + return 2.6F; + } - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); - this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(100.0D); - } + public SoundCategory getSoundCategory() + { + return SoundCategory.HOSTILE; + } - public SoundCategory getSoundCategory() - { - return SoundCategory.HOSTILE; - } + protected void initEntityAI() + { + this.tasks.addTask(5, new AIRandomFly(this)); + this.tasks.addTask(7, new AILookAround(this)); + this.tasks.addTask(7, new AIFireballAttack(this)); + this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); + } - protected SoundEvent getAmbientSound() - { - return SoundEvents.ENTITY_GHAST_AMBIENT; - } + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(100.0D); + } - protected SoundEvent getHurtSound(DamageSource damageSourceIn) - { - return SoundEvents.ENTITY_GHAST_HURT; - } + protected void entityInit() + { + super.entityInit(); + this.dataManager.register(ATTACKING, Boolean.FALSE); + } - protected SoundEvent getDeathSound() - { - return SoundEvents.ENTITY_GHAST_DEATH; - } + public void onUpdate() + { + super.onUpdate(); - @Nullable - protected ResourceLocation getLootTable() - { - return LootTableList.ENTITIES_GHAST; - } + if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL) + { + this.setDead(); + } + } - protected float getSoundVolume() - { - return 10.0F; - } + protected SoundEvent getAmbientSound() + { + return SoundEvents.ENTITY_GHAST_AMBIENT; + } - public boolean getCanSpawnHere() - { - return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.world.getDifficulty() != EnumDifficulty.PEACEFUL; - } + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); + compound.setInteger("ExplosionPower", this.explosionStrength); + } - public int getMaxSpawnedInChunk() - { - return 1; - } + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); - public void writeEntityToNBT(NBTTagCompound compound) - { - super.writeEntityToNBT(compound); - compound.setInteger("ExplosionPower", this.explosionStrength); - } + if (compound.hasKey("ExplosionPower", 99)) + { + this.explosionStrength = compound.getInteger("ExplosionPower"); + } + } - public void readEntityFromNBT(NBTTagCompound compound) - { - super.readEntityFromNBT(compound); + @Nullable + protected ResourceLocation getLootTable() + { + return LootTableList.ENTITIES_GHAST; + } - if (compound.hasKey("ExplosionPower", 99)) - { - this.explosionStrength = compound.getInteger("ExplosionPower"); - } - } + public boolean getCanSpawnHere() + { + return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.world.getDifficulty() != EnumDifficulty.PEACEFUL; + } - public float getEyeHeight() - { - return 2.6F; - } + public int getMaxSpawnedInChunk() + { + return 1; + } - static class AIFireballAttack extends EntityAIBase - { - private final EntityTileraGhast parentEntity; - public int attackTimer; + static class AIFireballAttack extends EntityAIBase + { + private final EntityTileraGhast parentEntity; + public int attackTimer; - public AIFireballAttack(EntityTileraGhast ghast) - { - this.parentEntity = ghast; - } + public AIFireballAttack(EntityTileraGhast ghast) + { + this.parentEntity = ghast; + } - public boolean shouldExecute() - { - return this.parentEntity.getAttackTarget() != null; - } + public boolean shouldExecute() + { + return this.parentEntity.getAttackTarget() != null; + } - public void startExecuting() - { - this.attackTimer = 0; - } + public void startExecuting() + { + this.attackTimer = 0; + } - public void resetTask() - { - this.parentEntity.setAttacking(false); - } + public void resetTask() + { + this.parentEntity.setAttacking(false); + } - public void updateTask() - { - EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget(); - double d0 = 64.0D; + public void updateTask() + { + EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget(); + double d0 = 64.0D; - if (entitylivingbase.getDistanceSq(this.parentEntity) < 4096.0D && this.parentEntity.canEntityBeSeen(entitylivingbase)) - { - World world = this.parentEntity.world; - ++this.attackTimer; + if (entitylivingbase.getDistanceSq(this.parentEntity) < 4096.0D && this.parentEntity.canEntityBeSeen(entitylivingbase)) + { + World world = this.parentEntity.world; + ++this.attackTimer; - if (this.attackTimer == 10) - { - world.playEvent(null, 1015, new BlockPos(this.parentEntity), 0); - } + if (this.attackTimer == 10) + { + world.playEvent(null, 1015, new BlockPos(this.parentEntity), 0); + } - if (this.attackTimer == 20) - { - double d1 = 4.0D; - Vec3d vec3d = this.parentEntity.getLook(1.0F); - double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3d.x * 4.0D); - double d3 = entitylivingbase.getEntityBoundingBox().minY + (double) (entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F)); - double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3d.z * 4.0D); - world.playEvent(null, 1016, new BlockPos(this.parentEntity), 0); - EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4); - entitylargefireball.explosionPower = this.parentEntity.getFireballStrength(); - entitylargefireball.posX = this.parentEntity.posX + vec3d.x * 4.0D; - entitylargefireball.posY = this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F) + 0.5D; - entitylargefireball.posZ = this.parentEntity.posZ + vec3d.z * 4.0D; - world.spawnEntity(entitylargefireball); - this.attackTimer = -40; - } - } else if (this.attackTimer > 0) - { - --this.attackTimer; - } + if (this.attackTimer == 20) + { + double d1 = 4.0D; + Vec3d vec3d = this.parentEntity.getLook(1.0F); + double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3d.x * 4.0D); + double d3 = entitylivingbase.getEntityBoundingBox().minY + (double) (entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F)); + double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3d.z * 4.0D); + world.playEvent(null, 1016, new BlockPos(this.parentEntity), 0); + EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4); + entitylargefireball.explosionPower = this.parentEntity.getFireballStrength(); + entitylargefireball.posX = this.parentEntity.posX + vec3d.x * 4.0D; + entitylargefireball.posY = this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F) + 0.5D; + entitylargefireball.posZ = this.parentEntity.posZ + vec3d.z * 4.0D; + world.spawnEntity(entitylargefireball); + this.attackTimer = -40; + } + } + else if (this.attackTimer > 0) + { + --this.attackTimer; + } - this.parentEntity.setAttacking(this.attackTimer > 10); - } - } + this.parentEntity.setAttacking(this.attackTimer > 10); + } + } - static class AILookAround extends EntityAIBase - { - private final EntityTileraGhast parentEntity; + static class AILookAround extends EntityAIBase + { + private final EntityTileraGhast parentEntity; - public AILookAround(EntityTileraGhast ghast) - { - this.parentEntity = ghast; - this.setMutexBits(2); - } + public AILookAround(EntityTileraGhast ghast) + { + this.parentEntity = ghast; + this.setMutexBits(2); + } - public boolean shouldExecute() - { - return true; - } + public boolean shouldExecute() + { + return true; + } - public void updateTask() - { - if (this.parentEntity.getAttackTarget() == null) - { - this.parentEntity.rotationYaw = -((float) MathHelper.atan2(this.parentEntity.motionX, this.parentEntity.motionZ)) * (180F / (float) Math.PI); - this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw; - } else - { - EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget(); - double d0 = 64.0D; + public void updateTask() + { + if (this.parentEntity.getAttackTarget() == null) + { + this.parentEntity.rotationYaw = -((float) MathHelper.atan2(this.parentEntity.motionX, this.parentEntity.motionZ)) * (180F / (float) Math.PI); + this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw; + } + else + { + EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget(); + double d0 = 64.0D; - if (entitylivingbase.getDistanceSq(this.parentEntity) < 4096.0D) - { - double d1 = entitylivingbase.posX - this.parentEntity.posX; - double d2 = entitylivingbase.posZ - this.parentEntity.posZ; - this.parentEntity.rotationYaw = -((float) MathHelper.atan2(d1, d2)) * (180F / (float) Math.PI); - this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw; - } - } - } - } + if (entitylivingbase.getDistanceSq(this.parentEntity) < 4096.0D) + { + double d1 = entitylivingbase.posX - this.parentEntity.posX; + double d2 = entitylivingbase.posZ - this.parentEntity.posZ; + this.parentEntity.rotationYaw = -((float) MathHelper.atan2(d1, d2)) * (180F / (float) Math.PI); + this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw; + } + } + } + } - static class AIRandomFly extends EntityAIBase - { - private final EntityTileraGhast parentEntity; + static class AIRandomFly extends EntityAIBase + { + private final EntityTileraGhast parentEntity; - public AIRandomFly(EntityTileraGhast ghast) - { - this.parentEntity = ghast; - this.setMutexBits(1); - } + public AIRandomFly(EntityTileraGhast ghast) + { + this.parentEntity = ghast; + this.setMutexBits(1); + } - public boolean shouldExecute() - { - EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper(); + public boolean shouldExecute() + { + EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper(); - if (!entitymovehelper.isUpdating()) - { - return true; - } else - { - double d0 = entitymovehelper.getX() - this.parentEntity.posX; - double d1 = entitymovehelper.getY() - this.parentEntity.posY; - double d2 = entitymovehelper.getZ() - this.parentEntity.posZ; - double d3 = d0 * d0 + d1 * d1 + d2 * d2; - return d3 < 1.0D || d3 > 3600.0D; - } - } + if (!entitymovehelper.isUpdating()) + { + return true; + } + else + { + double d0 = entitymovehelper.getX() - this.parentEntity.posX; + double d1 = entitymovehelper.getY() - this.parentEntity.posY; + double d2 = entitymovehelper.getZ() - this.parentEntity.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + return d3 < 1.0D || d3 > 3600.0D; + } + } - public boolean shouldContinueExecuting() - { - return false; - } + public boolean shouldContinueExecuting() + { + return false; + } - public void startExecuting() - { - Random random = this.parentEntity.getRNG(); - double d0 = this.parentEntity.posX + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); - double d1 = this.parentEntity.posY + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); - double d2 = this.parentEntity.posZ + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); - this.parentEntity.getMoveHelper().setMoveTo(d0, d1, d2, 1.0D); - } - } + public void startExecuting() + { + Random random = this.parentEntity.getRNG(); + double d0 = this.parentEntity.posX + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + double d1 = this.parentEntity.posY + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + double d2 = this.parentEntity.posZ + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.parentEntity.getMoveHelper().setMoveTo(d0, d1, d2, 1.0D); + } + } - static class GhastMoveHelper extends EntityMoveHelper - { - private final EntityTileraGhast parentEntity; - private int courseChangeCooldown; + static class GhastMoveHelper extends EntityMoveHelper + { + private final EntityTileraGhast parentEntity; + private int courseChangeCooldown; - public GhastMoveHelper(EntityTileraGhast ghast) - { - super(ghast); - this.parentEntity = ghast; - } + public GhastMoveHelper(EntityTileraGhast ghast) + { + super(ghast); + this.parentEntity = ghast; + } - public void onUpdateMoveHelper() - { - if (this.action == EntityMoveHelper.Action.MOVE_TO) - { - double d0 = this.posX - this.parentEntity.posX; - double d1 = this.posY - this.parentEntity.posY; - double d2 = this.posZ - this.parentEntity.posZ; - double d3 = d0 * d0 + d1 * d1 + d2 * d2; + public void onUpdateMoveHelper() + { + if (this.action == EntityMoveHelper.Action.MOVE_TO) + { + double d0 = this.posX - this.parentEntity.posX; + double d1 = this.posY - this.parentEntity.posY; + double d2 = this.posZ - this.parentEntity.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; - if (this.courseChangeCooldown-- <= 0) - { - this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2; - d3 = MathHelper.sqrt(d3); + if (this.courseChangeCooldown-- <= 0) + { + this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2; + d3 = MathHelper.sqrt(d3); - if (this.isNotColliding(this.posX, this.posY, this.posZ, d3)) - { - this.parentEntity.motionX += d0 / d3 * 0.1D; - this.parentEntity.motionY += d1 / d3 * 0.1D; - this.parentEntity.motionZ += d2 / d3 * 0.1D; - } else - { - this.action = EntityMoveHelper.Action.WAIT; - } - } - } - } + if (this.isNotColliding(this.posX, this.posY, this.posZ, d3)) + { + this.parentEntity.motionX += d0 / d3 * 0.1D; + this.parentEntity.motionY += d1 / d3 * 0.1D; + this.parentEntity.motionZ += d2 / d3 * 0.1D; + } + else + { + this.action = EntityMoveHelper.Action.WAIT; + } + } + } + } - private boolean isNotColliding(double x, double y, double z, double p_179926_7_) - { - double d0 = (x - this.parentEntity.posX) / p_179926_7_; - double d1 = (y - this.parentEntity.posY) / p_179926_7_; - double d2 = (z - this.parentEntity.posZ) / p_179926_7_; - AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox(); + private boolean isNotColliding(double x, double y, double z, double p_179926_7_) + { + double d0 = (x - this.parentEntity.posX) / p_179926_7_; + double d1 = (y - this.parentEntity.posY) / p_179926_7_; + double d2 = (z - this.parentEntity.posZ) / p_179926_7_; + AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox(); - for (int i = 1; (double) i < p_179926_7_; ++i) - { - axisalignedbb = axisalignedbb.offset(d0, d1, d2); + for (int i = 1; (double) i < p_179926_7_; ++i) + { + axisalignedbb = axisalignedbb.offset(d0, d1, d2); - if (!this.parentEntity.world.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty()) - { - return false; - } - } + if (!this.parentEntity.world.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty()) + { + return false; + } + } - return true; - } - } + return true; + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIBakaMitaiCreeperSwell.java b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIBakaMitaiCreeperSwell.java index 07c6dae..ed9b706 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIBakaMitaiCreeperSwell.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIBakaMitaiCreeperSwell.java @@ -1,51 +1,55 @@ package mod.acgaming.spackenmobs.entities.ai; -import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.EntityAIBase; +import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper; + public class EntityAIBakaMitaiCreeperSwell extends EntityAIBase { - EntityBakaMitaiCreeper swellingCreeper; - EntityLivingBase creeperAttackTarget; + EntityBakaMitaiCreeper swellingCreeper; + EntityLivingBase creeperAttackTarget; - public EntityAIBakaMitaiCreeperSwell(EntityBakaMitaiCreeper entitycreeperIn) - { - this.swellingCreeper = entitycreeperIn; - this.setMutexBits(1); - } + public EntityAIBakaMitaiCreeperSwell(EntityBakaMitaiCreeper entitycreeperIn) + { + this.swellingCreeper = entitycreeperIn; + this.setMutexBits(1); + } - public boolean shouldExecute() - { - EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); - return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D; - } + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); + return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D; + } - public void startExecuting() - { - this.swellingCreeper.getNavigator().clearPath(); - this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); - } + public void startExecuting() + { + this.swellingCreeper.getNavigator().clearPath(); + this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); + } - public void resetTask() - { - this.creeperAttackTarget = null; - } + public void resetTask() + { + this.creeperAttackTarget = null; + } - public void updateTask() - { - if (this.creeperAttackTarget == null) - { - this.swellingCreeper.setCreeperState(-1); - } else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D) - { - this.swellingCreeper.setCreeperState(-1); - } else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) - { - this.swellingCreeper.setCreeperState(-1); - } else - { - this.swellingCreeper.setCreeperState(1); - } - } + public void updateTask() + { + if (this.creeperAttackTarget == null) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) + { + this.swellingCreeper.setCreeperState(-1); + } + else + { + this.swellingCreeper.setCreeperState(1); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIDance.java b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIDance.java index 499b4f6..a0011e1 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIDance.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIDance.java @@ -1,86 +1,87 @@ package mod.acgaming.spackenmobs.entities.ai; -import mod.acgaming.spackenmobs.entities.EntityJens; import net.minecraft.block.BlockJukebox; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.init.Blocks; +import mod.acgaming.spackenmobs.entities.EntityJens; + // Thanks to Akrivus! public class EntityAIDance extends EntityAIBase { - private final EntityJens jens; + private final EntityJens jens; - private final int searchRadius; + private final int searchRadius; - private int lastDanceMoveTime = 0; + private int lastDanceMoveTime = 0; - private int danceStage = 0; + private int danceStage = 0; - public EntityAIDance(EntityJens jens, int searchRadius) - { - this.jens = jens; - this.searchRadius = searchRadius; - } + public EntityAIDance(EntityJens jens, int searchRadius) + { + this.jens = jens; + this.searchRadius = searchRadius; + } - @Override - public void resetTask() - { - this.lastDanceMoveTime = 0; - this.danceStage = 0; - } + @Override + public boolean shouldExecute() + { + for (int x = -this.searchRadius; x <= this.searchRadius; x++) + { + for (int y = -2; y <= 2; y++) + { + for (int z = -this.searchRadius; z <= this.searchRadius; z++) + { + if (this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getBlock() == Blocks.JUKEBOX && this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getValue(BlockJukebox.HAS_RECORD)) + return true; + } + } + } + return false; + } - @Override - public boolean shouldContinueExecuting() - { - return shouldExecute(); - } + @Override + public boolean shouldContinueExecuting() + { + return shouldExecute(); + } - @Override - public boolean shouldExecute() - { - for (int x = -this.searchRadius; x <= this.searchRadius; x++) - { - for (int y = -2; y <= 2; y++) - { - for (int z = -this.searchRadius; z <= this.searchRadius; z++) - { - if (this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getBlock() == Blocks.JUKEBOX && this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getValue(BlockJukebox.HAS_RECORD)) - return true; - } - } - } - return false; - } + @Override + public void startExecuting() + { + this.danceStage = 1; + } - @Override - public void startExecuting() - { - this.danceStage = 1; - } + @Override + public void resetTask() + { + this.lastDanceMoveTime = 0; + this.danceStage = 0; + } - @Override - public void updateTask() - { - if (this.lastDanceMoveTime <= 0) - { - switch (this.danceStage) - { - case 1: - this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2; - this.jens.motionY = 0.42D; - break; - case 2: - this.jens.setSneaking(true); - this.jens.motionY = -3.0D; - this.danceStage = 3; - break; - case 3: - this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2; - this.jens.setSneaking(false); - break; - } - this.lastDanceMoveTime = this.jens.world.rand.nextInt(20) + 10; - } - this.lastDanceMoveTime--; - } + @Override + public void updateTask() + { + if (this.lastDanceMoveTime <= 0) + { + switch (this.danceStage) + { + case 1: + this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2; + this.jens.motionY = 0.42D; + break; + case 2: + this.jens.setSneaking(true); + this.jens.motionY = -3.0D; + this.danceStage = 3; + break; + case 3: + this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2; + this.jens.setSneaking(false); + break; + } + this.lastDanceMoveTime = this.jens.world.rand.nextInt(20) + 10; + } + this.lastDanceMoveTime--; + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIEatDroppedFish.java b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIEatDroppedFish.java index 1bb5184..6d46baf 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIEatDroppedFish.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIEatDroppedFish.java @@ -1,76 +1,77 @@ package mod.acgaming.spackenmobs.entities.ai; -import mod.acgaming.spackenmobs.entities.EntityJens; +import java.util.List; + import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; -import java.util.List; +import mod.acgaming.spackenmobs.entities.EntityJens; public class EntityAIEatDroppedFish extends EntityAIBase { - private final EntityJens jens; - private final World world; - double searchDistance = 10.0D; + private final EntityJens jens; + private final World world; + double searchDistance = 10.0D; - public EntityAIEatDroppedFish(EntityJens jens) - { - this.jens = jens; - this.world = jens.world; - } + public EntityAIEatDroppedFish(EntityJens jens) + { + this.jens = jens; + this.world = jens.world; + } - public EntityItem getNearbyFood() - { - List items = getItems(); - for (EntityItem item : items) - { - return item; - } - return null; - } + public EntityItem getNearbyFood() + { + List items = getItems(); + for (EntityItem item : items) + { + return item; + } + return null; + } - List getItems() - { - return this.world.getEntitiesWithinAABB(EntityItem.class, - new AxisAlignedBB(this.jens.posX - this.searchDistance, this.jens.posY - this.searchDistance, - this.jens.posZ - this.searchDistance, this.jens.posX + this.searchDistance, - this.jens.posY + this.searchDistance, this.jens.posZ + this.searchDistance)); - } + @Override + public boolean shouldExecute() + { + EntityItem getNearbyFood = getNearbyFood(); + if (getNearbyFood != null && !this.jens.isChild() && !this.jens.digesting + && this.jens.isFishItem(getNearbyFood.getItem())) + { + execute(this.jens, getNearbyFood); + } + return false; + } - @Override - public boolean shouldExecute() - { - EntityItem getNearbyFood = getNearbyFood(); - if (getNearbyFood != null && !this.jens.isChild() && !this.jens.digesting - && this.jens.isFishItem(getNearbyFood.getItem())) - { - execute(this.jens, getNearbyFood); - } - return false; - } + public boolean execute(EntityJens jens, EntityItem item) + { + if (jens.getNavigator().tryMoveToXYZ(item.posX, item.posY, item.posZ, 1.25D)) + { + if (jens.getDistance(item) < 1.0F) + { + eatItem(item); + jens.digestFish(); + } + } + return true; + } - public boolean execute(EntityJens jens, EntityItem item) - { - if (jens.getNavigator().tryMoveToXYZ(item.posX, item.posY, item.posZ, 1.25D)) - { - if (jens.getDistance(item) < 1.0F) - { - eatItem(item); - jens.digestFish(); - } - } - return true; - } + public void eatItem(EntityItem item) + { + ItemStack stack = item.getItem(); + stack.setCount(stack.getCount() - 1); + if (stack.getCount() == 0) + { + item.setDead(); + } + } - public void eatItem(EntityItem item) - { - ItemStack stack = item.getItem(); - stack.setCount(stack.getCount() - 1); - if (stack.getCount() == 0) - { - item.setDead(); - } - } + List getItems() + { + return this.world.getEntitiesWithinAABB(EntityItem.class, + new AxisAlignedBB(this.jens.posX - this.searchDistance, this.jens.posY - this.searchDistance, + this.jens.posZ - this.searchDistance, this.jens.posX + this.searchDistance, + this.jens.posY + this.searchDistance, this.jens.posZ + this.searchDistance)); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIIslamistSwell.java b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIIslamistSwell.java index 41057ef..3c0aba6 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIIslamistSwell.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAIIslamistSwell.java @@ -1,51 +1,55 @@ package mod.acgaming.spackenmobs.entities.ai; -import mod.acgaming.spackenmobs.entities.EntityIslamist; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.EntityAIBase; +import mod.acgaming.spackenmobs.entities.EntityIslamist; + public class EntityAIIslamistSwell extends EntityAIBase { - EntityIslamist swellingCreeper; - EntityLivingBase creeperAttackTarget; + EntityIslamist swellingCreeper; + EntityLivingBase creeperAttackTarget; - public EntityAIIslamistSwell(EntityIslamist entitycreeperIn) - { - this.swellingCreeper = entitycreeperIn; - this.setMutexBits(1); - } + public EntityAIIslamistSwell(EntityIslamist entitycreeperIn) + { + this.swellingCreeper = entitycreeperIn; + this.setMutexBits(1); + } - public boolean shouldExecute() - { - EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); - return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D; - } + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); + return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D; + } - public void startExecuting() - { - this.swellingCreeper.getNavigator().clearPath(); - this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); - } + public void startExecuting() + { + this.swellingCreeper.getNavigator().clearPath(); + this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); + } - public void resetTask() - { - this.creeperAttackTarget = null; - } + public void resetTask() + { + this.creeperAttackTarget = null; + } - public void updateTask() - { - if (this.creeperAttackTarget == null) - { - this.swellingCreeper.setCreeperState(-1); - } else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D) - { - this.swellingCreeper.setCreeperState(-1); - } else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) - { - this.swellingCreeper.setCreeperState(-1); - } else - { - this.swellingCreeper.setCreeperState(1); - } - } + public void updateTask() + { + if (this.creeperAttackTarget == null) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) + { + this.swellingCreeper.setCreeperState(-1); + } + else + { + this.swellingCreeper.setCreeperState(1); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAISmavaCreeperSwell.java b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAISmavaCreeperSwell.java index e58c477..9f9c992 100644 --- a/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAISmavaCreeperSwell.java +++ b/src/main/java/mod/acgaming/spackenmobs/entities/ai/EntityAISmavaCreeperSwell.java @@ -1,51 +1,55 @@ package mod.acgaming.spackenmobs.entities.ai; -import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.EntityAIBase; +import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper; + public class EntityAISmavaCreeperSwell extends EntityAIBase { - EntitySmavaCreeper swellingCreeper; - EntityLivingBase creeperAttackTarget; + EntitySmavaCreeper swellingCreeper; + EntityLivingBase creeperAttackTarget; - public EntityAISmavaCreeperSwell(EntitySmavaCreeper entitycreeperIn) - { - this.swellingCreeper = entitycreeperIn; - this.setMutexBits(1); - } + public EntityAISmavaCreeperSwell(EntitySmavaCreeper entitycreeperIn) + { + this.swellingCreeper = entitycreeperIn; + this.setMutexBits(1); + } - public boolean shouldExecute() - { - EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); - return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D; - } + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); + return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D; + } - public void startExecuting() - { - this.swellingCreeper.getNavigator().clearPath(); - this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); - } + public void startExecuting() + { + this.swellingCreeper.getNavigator().clearPath(); + this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); + } - public void resetTask() - { - this.creeperAttackTarget = null; - } + public void resetTask() + { + this.creeperAttackTarget = null; + } - public void updateTask() - { - if (this.creeperAttackTarget == null) - { - this.swellingCreeper.setCreeperState(-1); - } else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D) - { - this.swellingCreeper.setCreeperState(-1); - } else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) - { - this.swellingCreeper.setCreeperState(-1); - } else - { - this.swellingCreeper.setCreeperState(1); - } - } + public void updateTask() + { + if (this.creeperAttackTarget == null) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) + { + this.swellingCreeper.setCreeperState(-1); + } + else + { + this.swellingCreeper.setCreeperState(1); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/events/SurstroemmingSmellsBadEvent.java b/src/main/java/mod/acgaming/spackenmobs/events/SurstroemmingSmellsBadEvent.java index 529bf97..8c3af8c 100644 --- a/src/main/java/mod/acgaming/spackenmobs/events/SurstroemmingSmellsBadEvent.java +++ b/src/main/java/mod/acgaming/spackenmobs/events/SurstroemmingSmellsBadEvent.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.events; -import mod.acgaming.spackenmobs.misc.ModItems; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; import net.minecraft.item.ItemStack; @@ -8,18 +7,20 @@ import net.minecraft.potion.PotionEffect; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent; +import mod.acgaming.spackenmobs.misc.ModItems; + public class SurstroemmingSmellsBadEvent { - @SubscribeEvent - public void onEvent(PlayerTickEvent event) - { - if (event.player != null) - { - EntityPlayer player = event.player; - if (player.inventory.hasItemStack(new ItemStack(ModItems.SURSTROEMMING))) - { - player.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 100)); - } - } - } + @SubscribeEvent + public void onEvent(PlayerTickEvent event) + { + if (event.player != null) + { + EntityPlayer player = event.player; + if (player.inventory.hasItemStack(new ItemStack(ModItems.SURSTROEMMING))) + { + player.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 100)); + } + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/items/ModItemBase.java b/src/main/java/mod/acgaming/spackenmobs/items/ModItemBase.java index 938f9d7..56daed3 100644 --- a/src/main/java/mod/acgaming/spackenmobs/items/ModItemBase.java +++ b/src/main/java/mod/acgaming/spackenmobs/items/ModItemBase.java @@ -1,27 +1,18 @@ package mod.acgaming.spackenmobs.items; +import net.minecraft.item.Item; + import mod.acgaming.spackenmobs.Spackenmobs; import mod.acgaming.spackenmobs.misc.ModItems; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.Item; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; public class ModItemBase extends Item { - public ModItemBase(String name) - { - setUnlocalizedName(name); - setRegistryName(name); - setCreativeTab(Spackenmobs.SPACKENMOBS_TAB); + public ModItemBase(String name) + { + setUnlocalizedName(name); + setRegistryName(name); + setCreativeTab(Spackenmobs.SPACKENMOBS_TAB); - ModItems.ITEMS.add(this); - } - - @SideOnly(Side.CLIENT) - public void initModel() - { - ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); - } + ModItems.ITEMS.add(this); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodBase.java b/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodBase.java index 2752048..0117bfe 100644 --- a/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodBase.java +++ b/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodBase.java @@ -1,28 +1,19 @@ package mod.acgaming.spackenmobs.items; +import net.minecraft.item.ItemFood; + import mod.acgaming.spackenmobs.Spackenmobs; import mod.acgaming.spackenmobs.misc.ModItems; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.ItemFood; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; public class ModItemFoodBase extends ItemFood { - public ModItemFoodBase(String name, int amount, float saturation, boolean isAnimalFood) - { - super(amount, saturation, isAnimalFood); - setUnlocalizedName(name); - setRegistryName(name); - setCreativeTab(Spackenmobs.SPACKENMOBS_TAB); + public ModItemFoodBase(String name, int amount, float saturation, boolean isAnimalFood) + { + super(amount, saturation, isAnimalFood); + setUnlocalizedName(name); + setRegistryName(name); + setCreativeTab(Spackenmobs.SPACKENMOBS_TAB); - ModItems.ITEMS.add(this); - } - - @SideOnly(Side.CLIENT) - public void initModel() - { - ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); - } + ModItems.ITEMS.add(this); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodDrink.java b/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodDrink.java index fa58ba5..29922f7 100644 --- a/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodDrink.java +++ b/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodDrink.java @@ -9,29 +9,29 @@ import net.minecraft.world.World; public class ModItemFoodDrink extends ModItemFoodBase { - PotionEffect effect; + PotionEffect effect; - public ModItemFoodDrink(String name, int amount, float saturation, boolean isAnimalFood, PotionEffect effect) - { - super(name, amount, saturation, isAnimalFood); - setAlwaysEdible(); + public ModItemFoodDrink(String name, int amount, float saturation, boolean isAnimalFood, PotionEffect effect) + { + super(name, amount, saturation, isAnimalFood); + setAlwaysEdible(); - this.effect = effect; - } + this.effect = effect; + } - @Override - protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) - { - if (!worldIn.isRemote) - { - player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles())); - player.inventory.addItemStackToInventory(new ItemStack(Items.GLASS_BOTTLE)); - } - } + @Override + protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) + { + if (!worldIn.isRemote) + { + player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles())); + player.inventory.addItemStackToInventory(new ItemStack(Items.GLASS_BOTTLE)); + } + } - @Override - public EnumAction getItemUseAction(ItemStack stack) - { - return EnumAction.DRINK; - } + @Override + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.DRINK; + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodEffect.java b/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodEffect.java index 6b28aa9..b17143e 100644 --- a/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodEffect.java +++ b/src/main/java/mod/acgaming/spackenmobs/items/ModItemFoodEffect.java @@ -7,22 +7,22 @@ import net.minecraft.world.World; public class ModItemFoodEffect extends ModItemFoodBase { - PotionEffect effect; + PotionEffect effect; - public ModItemFoodEffect(String name, int amount, float saturation, boolean isAnimalFood, PotionEffect effect) - { - super(name, amount, saturation, isAnimalFood); - setAlwaysEdible(); + public ModItemFoodEffect(String name, int amount, float saturation, boolean isAnimalFood, PotionEffect effect) + { + super(name, amount, saturation, isAnimalFood); + setAlwaysEdible(); - this.effect = effect; - } + this.effect = effect; + } - @Override - protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) - { - if (!worldIn.isRemote) - { - player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles())); - } - } + @Override + protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) + { + if (!worldIn.isRemote) + { + player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles())); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/BiomeHelper.java b/src/main/java/mod/acgaming/spackenmobs/misc/BiomeHelper.java index 06b433d..0385248 100644 --- a/src/main/java/mod/acgaming/spackenmobs/misc/BiomeHelper.java +++ b/src/main/java/mod/acgaming/spackenmobs/misc/BiomeHelper.java @@ -1,46 +1,46 @@ package mod.acgaming.spackenmobs.misc; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome.SpawnListEntry; -import java.util.ArrayList; -import java.util.List; - // Thanks to Vazkii! public class BiomeHelper { - public static Biome[] getBiomesWithMonster(Class clazz) - { - List biomes = new ArrayList<>(); - for (Biome b : Biome.REGISTRY) - { - List spawnList = b.getSpawnableList(EnumCreatureType.MONSTER); - for (SpawnListEntry e : spawnList) - if (e.entityClass == clazz) - { - biomes.add(b); - break; - } - } - return biomes.toArray(new Biome[0]); - } + public static Biome[] getBiomesWithMonster(Class clazz) + { + List biomes = new ArrayList<>(); + for (Biome b : Biome.REGISTRY) + { + List spawnList = b.getSpawnableList(EnumCreatureType.MONSTER); + for (SpawnListEntry e : spawnList) + if (e.entityClass == clazz) + { + biomes.add(b); + break; + } + } + return biomes.toArray(new Biome[0]); + } - public static Biome[] getBiomesWithCreature(Class clazz) - { - List biomes = new ArrayList<>(); - for (Biome b : Biome.REGISTRY) - { - List spawnList = b.getSpawnableList(EnumCreatureType.CREATURE); - for (SpawnListEntry e : spawnList) - if (e.entityClass == clazz) - { - biomes.add(b); - break; - } - } - return biomes.toArray(new Biome[0]); - } + public static Biome[] getBiomesWithCreature(Class clazz) + { + List biomes = new ArrayList<>(); + for (Biome b : Biome.REGISTRY) + { + List spawnList = b.getSpawnableList(EnumCreatureType.CREATURE); + for (SpawnListEntry e : spawnList) + if (e.entityClass == clazz) + { + biomes.add(b); + break; + } + } + return biomes.toArray(new Biome[0]); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/ModConfigs.java b/src/main/java/mod/acgaming/spackenmobs/misc/ModConfigs.java index f2dd649..1528ccb 100644 --- a/src/main/java/mod/acgaming/spackenmobs/misc/ModConfigs.java +++ b/src/main/java/mod/acgaming/spackenmobs/misc/ModConfigs.java @@ -12,143 +12,135 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @LangKey("spackenmobs.config.title") public class ModConfigs { - @Name("Allow ApoRed to spawn?") - public static boolean ApoRed_spawn = true; - @Name("Allow Baka Mitai Creeper to spawn?") - public static boolean BakaMitaiCreeper_spawn = true; - @Name("Allow Drachenlord to spawn?") - public static boolean Drachenlord_spawn = true; - @Name("Allow Friedrich Liechtenstein to spawn?") - public static boolean Friedrich_spawn = true; - @Name("Allow Holzstammhuhn to spawn?") - public static boolean Holzstammhuhn_spawn = true; - @Name("Allow Islamist to spawn?") - public static boolean Islamist_spawn = true; - @Name("Allow Jens to spawn?") - public static boolean Jens_spawn = true; - @Name("Allow Marcell D'Avis to spawn?") - public static boolean MarcellDAvis_spawn = true; - @Name("Allow Mr. Bean to spawn?") - public static boolean MrBean_spawn = true; - @Name("Allow Schalker to spawn?") - public static boolean Schalker_spawn = true; - @Name("Allow Smava Creeper to spawn?") - public static boolean SmavaCreeper_spawn = true; - @Name("Allow MZTEWolf to spawn?") - public static boolean MZTEWolf_spawn = true; - @Name("Allow Latin Teacher to spawn?") - public static boolean LatinTeacher_spawn = true; - @Name("Allow ITbyHF to spawn?") - public static boolean ITbyHF_spawn = true; - @Name("Allow tilera Ghast to spawn?") - public static boolean tileraGhast_spawn = true; + @Name("Allow ApoRed to spawn?") + public static boolean ApoRed_spawn = true; + @Name("Allow Baka Mitai Creeper to spawn?") + public static boolean BakaMitaiCreeper_spawn = true; + @Name("Allow Drachenlord to spawn?") + public static boolean Drachenlord_spawn = true; + @Name("Allow Friedrich Liechtenstein to spawn?") + public static boolean Friedrich_spawn = true; + @Name("Allow Holzstammhuhn to spawn?") + public static boolean Holzstammhuhn_spawn = true; + @Name("Allow Islamist to spawn?") + public static boolean Islamist_spawn = true; + @Name("Allow Jens to spawn?") + public static boolean Jens_spawn = true; + @Name("Allow Marcell D'Avis to spawn?") + public static boolean MarcellDAvis_spawn = true; + @Name("Allow Mr. Bean to spawn?") + public static boolean MrBean_spawn = true; + @Name("Allow Schalker to spawn?") + public static boolean Schalker_spawn = true; + @Name("Allow Smava Creeper to spawn?") + public static boolean SmavaCreeper_spawn = true; + @Name("Allow MZTEWolf to spawn?") + public static boolean MZTEWolf_spawn = true; + @Name("Allow Gisela to spawn?") + public static boolean Gisela_spawn = true; + @Name("Allow tilera Ghast to spawn?") + public static boolean tileraGhast_spawn = true; - @Name("ApoRed spawn probability:") - public static int ApoRed_weight = 15; - @Name("ApoRed min group size:") - public static int ApoRed_min = 1; - @Name("ApoRed max group size:") - public static int ApoRed_max = 2; - @Name("Baka Mitai Creeper spawn probability:") - public static int BakaMitaiCreeper_weight = 10; - @Name("Baka Mitai Creeper min group size:") - public static int BakaMitaiCreeper_min = 1; - @Name("Baka Mitai Creeper max group size:") - public static int BakaMitaiCreeper_max = 2; - @Name("Drachenlord spawn probability:") - public static int Drachenlord_weight = 15; - @Name("Drachenlord min group size:") - public static int Drachenlord_min = 1; - @Name("Drachenlord max group size:") - public static int Drachenlord_max = 2; - @Name("Friedrich Liechtenstein spawn probability:") - public static int Friedrich_weight = 15; - @Name("Friedrich Liechtenstein min group size:") - public static int Friedrich_min = 1; - @Name("Friedrich Liechtenstein max group size:") - public static int Friedrich_max = 2; - @Name("Holzstammhuhn spawn probability:") - public static int Holzstammhuhn_weight = 15; - @Name("Holzstammhuhn min group size:") - public static int Holzstammhuhn_min = 1; - @Name("Holzstammhuhn max group size:") - public static int Holzstammhuhn_max = 2; - @Name("Islamist spawn probability:") - public static int Islamist_weight = 15; - @Name("Islamist min group size:") - public static int Islamist_min = 1; - @Name("Islamist max group size:") - public static int Islamist_max = 2; - @Name("Jens spawn probability:") - public static int Jens_weight = 15; - @Name("Jens min group size:") - public static int Jens_min = 1; - @Name("Jens max group size:") - public static int Jens_max = 2; - @Name("Marcell D'Avis spawn probability:") - public static int MarcellDAvis_weight = 15; - @Name("Marcell D'Avis min group size:") - public static int MarcellDAvis_min = 1; - @Name("Marcell D'Avis max group size:") - public static int MarcellDAvis_max = 2; - @Name("Mr. Bean spawn probability:") - public static int MrBean_weight = 15; - @Name("Mr. Bean min group size:") - public static int MrBean_min = 1; - @Name("Mr. Bean max group size:") - public static int MrBean_max = 2; - @Name("Schalker spawn probability:") - public static int Schalker_weight = 10; - @Name("Schalker min group size:") - public static int Schalker_min = 1; - @Name("Schalker max group size:") - public static int Schalker_max = 2; - @Name("Smava Creeper spawn probability:") - public static int SmavaCreeper_weight = 15; - @Name("Smava Creeper min group size:") - public static int SmavaCreeper_min = 1; - @Name("Smava Creeper max group size:") - public static int SmavaCreeper_max = 2; - @Name("MZTEWolf spawn probability:") - public static int MZTEWolf_weight = 15; - @Name("MZTEWolf min group size:") - public static int MZTEWolf_min = 1; - @Name("MZTEWolf max group size:") - public static int MZTEWolf_max = 2; - @Name("Latin Teacher spawn probability:") - public static int LatinTeacher_weight = 15; - @Name("Latin Teacher min group size:") - public static int LatinTeacher_min = 1; - @Name("Latin Teacher max group size:") - public static int LatinTeacher_max = 2; - @Name("ITbyHF spawn probability:") - public static int ITbyHF_weight = 15; - @Name("ITbyHF min group size:") - public static int ITbyHF_min = 1; - @Name("ITbyHF max group size:") - public static int ITbyHF_max = 2; - @Name("tilera Ghast spawn probability:") - public static int tileraGhast_weight = 15; - @Name("tilera Ghast min group size:") - public static int tileraGhast_min = 1; - @Name("tilera Ghast max group size:") - public static int tileraGhast_max = 2; + @Name("ApoRed spawn probability:") + public static int ApoRed_weight = 15; + @Name("ApoRed min group size:") + public static int ApoRed_min = 1; + @Name("ApoRed max group size:") + public static int ApoRed_max = 2; + @Name("Baka Mitai Creeper spawn probability:") + public static int BakaMitaiCreeper_weight = 10; + @Name("Baka Mitai Creeper min group size:") + public static int BakaMitaiCreeper_min = 1; + @Name("Baka Mitai Creeper max group size:") + public static int BakaMitaiCreeper_max = 2; + @Name("Drachenlord spawn probability:") + public static int Drachenlord_weight = 15; + @Name("Drachenlord min group size:") + public static int Drachenlord_min = 1; + @Name("Drachenlord max group size:") + public static int Drachenlord_max = 2; + @Name("Friedrich Liechtenstein spawn probability:") + public static int Friedrich_weight = 15; + @Name("Friedrich Liechtenstein min group size:") + public static int Friedrich_min = 1; + @Name("Friedrich Liechtenstein max group size:") + public static int Friedrich_max = 2; + @Name("Holzstammhuhn spawn probability:") + public static int Holzstammhuhn_weight = 15; + @Name("Holzstammhuhn min group size:") + public static int Holzstammhuhn_min = 1; + @Name("Holzstammhuhn max group size:") + public static int Holzstammhuhn_max = 2; + @Name("Islamist spawn probability:") + public static int Islamist_weight = 15; + @Name("Islamist min group size:") + public static int Islamist_min = 1; + @Name("Islamist max group size:") + public static int Islamist_max = 2; + @Name("Jens spawn probability:") + public static int Jens_weight = 15; + @Name("Jens min group size:") + public static int Jens_min = 1; + @Name("Jens max group size:") + public static int Jens_max = 2; + @Name("Marcell D'Avis spawn probability:") + public static int MarcellDAvis_weight = 15; + @Name("Marcell D'Avis min group size:") + public static int MarcellDAvis_min = 1; + @Name("Marcell D'Avis max group size:") + public static int MarcellDAvis_max = 2; + @Name("Mr. Bean spawn probability:") + public static int MrBean_weight = 15; + @Name("Mr. Bean min group size:") + public static int MrBean_min = 1; + @Name("Mr. Bean max group size:") + public static int MrBean_max = 2; + @Name("Schalker spawn probability:") + public static int Schalker_weight = 10; + @Name("Schalker min group size:") + public static int Schalker_min = 1; + @Name("Schalker max group size:") + public static int Schalker_max = 2; + @Name("Smava Creeper spawn probability:") + public static int SmavaCreeper_weight = 15; + @Name("Smava Creeper min group size:") + public static int SmavaCreeper_min = 1; + @Name("Smava Creeper max group size:") + public static int SmavaCreeper_max = 2; + @Name("MZTEWolf spawn probability:") + public static int MZTEWolf_weight = 15; + @Name("MZTEWolf min group size:") + public static int MZTEWolf_min = 1; + @Name("MZTEWolf max group size:") + public static int MZTEWolf_max = 2; + @Name("Gisela spawn probability:") + public static int Gisela_weight = 15; + @Name("Gisela min group size:") + public static int Gisela_min = 1; + @Name("Gisela max group size:") + public static int Gisela_max = 2; + @Name("tilera Ghast spawn probability:") + public static int tileraGhast_weight = 15; + @Name("tilera Ghast min group size:") + public static int tileraGhast_min = 1; + @Name("tilera Ghast max group size:") + public static int tileraGhast_max = 2; - @Name("Time in seconds Jens needs to digest:") - public static int Jens_digest_time = 120; - @Name("Maximum distance in blocks Jens can search:") - public static int Jens_search_distance = 16; + @Name("Time in seconds Jens needs to digest:") + public static int Jens_digest_time = 120; + @Name("Maximum distance in blocks Jens can search:") + public static int Jens_search_distance = 16; - @EventBusSubscriber(modid = "spackenmobs") - private static class EventHandler - { - @SubscribeEvent - public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) - { - if (event.getModID().equals("spackenmobs")) - { - ConfigManager.sync("spackenmobs", Config.Type.INSTANCE); - } - } - } + @EventBusSubscriber(modid = "spackenmobs") + private static class EventHandler + { + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.getModID().equals("spackenmobs")) + { + ConfigManager.sync("spackenmobs", Config.Type.INSTANCE); + } + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/ModEntities.java b/src/main/java/mod/acgaming/spackenmobs/misc/ModEntities.java index bd412b4..3857ae5 100644 --- a/src/main/java/mod/acgaming/spackenmobs/misc/ModEntities.java +++ b/src/main/java/mod/acgaming/spackenmobs/misc/ModEntities.java @@ -1,27 +1,27 @@ package mod.acgaming.spackenmobs.misc; +import net.minecraftforge.fml.client.registry.RenderingRegistry; + import mod.acgaming.spackenmobs.entities.*; import mod.acgaming.spackenmobs.render.*; -import net.minecraftforge.fml.client.registry.RenderingRegistry; public class ModEntities { - public static void initModels() - { - RenderingRegistry.registerEntityRenderingHandler(EntityApoRed.class, RenderApoRed.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityBakaMitaiCreeper.class, RenderBakaMitaiCreeper.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityDrachenlord.class, RenderDrachenlord.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityFriedrichLiechtenstein.class, RenderFriedrichLiechtenstein.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityHolzstammhuhn.class, RenderHolzstammhuhn.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityIslamist.class, RenderIslamist.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityITbyHF.class, RenderITbyHF.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityJens.class, RenderJens.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityLatinTeacher.class, RenderLatinTeacher.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityMZTEWolf.class, RenderMZTEWolf.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityMarcellDAvis.class, RenderMarcellDAvis.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityMrBean.class, RenderMrBean.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntitySchalker.class, RenderSchalker.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntitySmavaCreeper.class, RenderSmavaCreeper.FACTORY); - RenderingRegistry.registerEntityRenderingHandler(EntityTileraGhast.class, RenderTileraGhast.FACTORY); - } + public static void initModels() + { + RenderingRegistry.registerEntityRenderingHandler(EntityApoRed.class, RenderApoRed.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityBakaMitaiCreeper.class, RenderBakaMitaiCreeper.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityDrachenlord.class, RenderDrachenlord.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityFriedrichLiechtenstein.class, RenderFriedrichLiechtenstein.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityGisela.class, RenderGisela.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityHolzstammhuhn.class, RenderHolzstammhuhn.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityIslamist.class, RenderIslamist.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityJens.class, RenderJens.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityMZTEWolf.class, RenderMZTEWolf.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityMarcellDAvis.class, RenderMarcellDAvis.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityMrBean.class, RenderMrBean.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntitySchalker.class, RenderSchalker.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntitySmavaCreeper.class, RenderSmavaCreeper.FACTORY); + RenderingRegistry.registerEntityRenderingHandler(EntityTileraGhast.class, RenderTileraGhast.FACTORY); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/ModItems.java b/src/main/java/mod/acgaming/spackenmobs/misc/ModItems.java index ae548de..5bbd98a 100644 --- a/src/main/java/mod/acgaming/spackenmobs/misc/ModItems.java +++ b/src/main/java/mod/acgaming/spackenmobs/misc/ModItems.java @@ -1,22 +1,23 @@ package mod.acgaming.spackenmobs.misc; -import mod.acgaming.spackenmobs.items.ModItemBase; -import mod.acgaming.spackenmobs.items.ModItemFoodDrink; -import mod.acgaming.spackenmobs.items.ModItemFoodEffect; -import net.minecraft.init.MobEffects; -import net.minecraft.item.Item; -import net.minecraft.potion.PotionEffect; - import java.util.ArrayList; import java.util.List; +import net.minecraft.init.MobEffects; +import net.minecraft.item.Item; +import net.minecraft.potion.PotionEffect; + +import mod.acgaming.spackenmobs.items.ModItemBase; +import mod.acgaming.spackenmobs.items.ModItemFoodDrink; +import mod.acgaming.spackenmobs.items.ModItemFoodEffect; + public class ModItems { - public static final List ITEMS = new ArrayList<>(); + public static final List ITEMS = new ArrayList<>(); - public static final Item RAM = new ModItemBase("ram"); - public static final Item RAM_ON_A_STICK = new ModItemBase("ram_on_a_stick"); - public static final Item SURSTROEMMING = new ModItemBase("surstroemming"); - public static final Item AHOJ_BRAUSE = new ModItemFoodEffect("ahoj_brause", 2, 0.15F, false, new PotionEffect(MobEffects.SPEED, 200, 5, false, true)); - public static final Item AHOJ_BRAUSE_DRINK = new ModItemFoodDrink("ahoj_brause_drink", 4, 0.3F, false, new PotionEffect(MobEffects.SPEED, 400, 10, false, true)); + public static final Item RAM = new ModItemBase("ram"); + public static final Item RAM_ON_A_STICK = new ModItemBase("ram_on_a_stick"); + public static final Item SURSTROEMMING = new ModItemBase("surstroemming"); + public static final Item AHOJ_BRAUSE = new ModItemFoodEffect("ahoj_brause", 2, 0.15F, false, new PotionEffect(MobEffects.SPEED, 200, 5, false, true)); + public static final Item AHOJ_BRAUSE_DRINK = new ModItemFoodDrink("ahoj_brause_drink", 4, 0.3F, false, new PotionEffect(MobEffects.SPEED, 400, 10, false, true)); } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/ModLootTableList.java b/src/main/java/mod/acgaming/spackenmobs/misc/ModLootTableList.java index 2bd3bc0..4dbab24 100644 --- a/src/main/java/mod/acgaming/spackenmobs/misc/ModLootTableList.java +++ b/src/main/java/mod/acgaming/spackenmobs/misc/ModLootTableList.java @@ -1,54 +1,55 @@ package mod.acgaming.spackenmobs.misc; +import java.util.Collections; +import java.util.Set; + import com.google.common.collect.Sets; import net.minecraft.util.ResourceLocation; import net.minecraft.world.storage.loot.LootTable; import net.minecraft.world.storage.loot.LootTableManager; -import java.util.Collections; -import java.util.Set; - public class ModLootTableList { - private static final Set LOOT_TABLES = Sets.newHashSet(); - public static final ResourceLocation EMPTY = register("empty"); - public static final ResourceLocation ENTITIES_JENS = register("entities/jens"); - public static final ResourceLocation ENTITIES_FRIEDRICH = register("entities/friedrich"); - private static final Set READ_ONLY_LOOT_TABLES = Collections.unmodifiableSet(LOOT_TABLES); + private static final Set LOOT_TABLES = Sets.newHashSet(); + public static final ResourceLocation EMPTY = register("empty"); + public static final ResourceLocation ENTITIES_JENS = register("entities/jens"); + public static final ResourceLocation ENTITIES_FRIEDRICH = register("entities/friedrich"); + private static final Set READ_ONLY_LOOT_TABLES = Collections.unmodifiableSet(LOOT_TABLES); - public static Set getAll() - { - return READ_ONLY_LOOT_TABLES; - } + public static Set getAll() + { + return READ_ONLY_LOOT_TABLES; + } - public static ResourceLocation register(ResourceLocation id) - { - if (LOOT_TABLES.add(id)) - { - return id; - } else - { - throw new IllegalArgumentException(id + " is already a registered built-in loot table"); - } - } + public static ResourceLocation register(ResourceLocation id) + { + if (LOOT_TABLES.add(id)) + { + return id; + } + else + { + throw new IllegalArgumentException(id + " is already a registered built-in loot table"); + } + } - private static ResourceLocation register(String id) - { - return register(new ResourceLocation("spackenmobs", id)); - } + public static boolean test() + { + LootTableManager loottablemanager = new LootTableManager(null); - public static boolean test() - { - LootTableManager loottablemanager = new LootTableManager(null); + for (ResourceLocation resourcelocation : READ_ONLY_LOOT_TABLES) + { + if (loottablemanager.getLootTableFromLocation(resourcelocation) == LootTable.EMPTY_LOOT_TABLE) + { + return false; + } + } - for (ResourceLocation resourcelocation : READ_ONLY_LOOT_TABLES) - { - if (loottablemanager.getLootTableFromLocation(resourcelocation) == LootTable.EMPTY_LOOT_TABLE) - { - return false; - } - } + return true; + } - return true; - } + private static ResourceLocation register(String id) + { + return register(new ResourceLocation("spackenmobs", id)); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/ModSoundEvents.java b/src/main/java/mod/acgaming/spackenmobs/misc/ModSoundEvents.java index 143676e..67371ae 100644 --- a/src/main/java/mod/acgaming/spackenmobs/misc/ModSoundEvents.java +++ b/src/main/java/mod/acgaming/spackenmobs/misc/ModSoundEvents.java @@ -1,57 +1,60 @@ package mod.acgaming.spackenmobs.misc; -import mod.acgaming.spackenmobs.Spackenmobs; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder; +import mod.acgaming.spackenmobs.Spackenmobs; + @ObjectHolder(Spackenmobs.MODID) public class ModSoundEvents { - public static final SoundEvent ENTITY_SMAVACREEPER_FUSE = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.fuse")); - public static final SoundEvent ENTITY_SMAVACREEPER_BLOW = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.blow")); - public static final SoundEvent ENTITY_SMAVACREEPER_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt")); - public static final SoundEvent ENTITY_SMAVACREEPER_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient")); + public static final SoundEvent ENTITY_SMAVACREEPER_FUSE = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.fuse")); + public static final SoundEvent ENTITY_SMAVACREEPER_BLOW = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.blow")); + public static final SoundEvent ENTITY_SMAVACREEPER_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt")); + public static final SoundEvent ENTITY_SMAVACREEPER_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient")); - public static final SoundEvent ENTITY_MARCELLDAVIS_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient")); - public static final SoundEvent ENTITY_MARCELLDAVIS_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt")); - public static final SoundEvent ENTITY_MARCELLDAVIS_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.death")); + public static final SoundEvent ENTITY_MARCELLDAVIS_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient")); + public static final SoundEvent ENTITY_MARCELLDAVIS_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt")); + public static final SoundEvent ENTITY_MARCELLDAVIS_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.death")); - public static final SoundEvent ENTITY_ISLAMIST_FUSE = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.fuse")); - public static final SoundEvent ENTITY_ISLAMIST_BLOW = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.blow")); - public static final SoundEvent ENTITY_ISLAMIST_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.hurt")); - public static final SoundEvent ENTITY_ISLAMIST_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.ambient")); + public static final SoundEvent ENTITY_ISLAMIST_FUSE = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.fuse")); + public static final SoundEvent ENTITY_ISLAMIST_BLOW = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.blow")); + public static final SoundEvent ENTITY_ISLAMIST_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.hurt")); + public static final SoundEvent ENTITY_ISLAMIST_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.ambient")); - public static final SoundEvent ENTITY_APORED_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.ambient")); - public static final SoundEvent ENTITY_APORED_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.hurt")); - public static final SoundEvent ENTITY_APORED_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.death")); + public static final SoundEvent ENTITY_APORED_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.ambient")); + public static final SoundEvent ENTITY_APORED_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.hurt")); + public static final SoundEvent ENTITY_APORED_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.death")); - public static final SoundEvent ENTITY_MRBEAN_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.ambient")); - public static final SoundEvent ENTITY_MRBEAN_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.hurt")); - public static final SoundEvent ENTITY_MRBEAN_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.death")); + public static final SoundEvent ENTITY_MRBEAN_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.ambient")); + public static final SoundEvent ENTITY_MRBEAN_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.hurt")); + public static final SoundEvent ENTITY_MRBEAN_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.death")); - public static final SoundEvent ENTITY_DRACHENLORD_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.ambient")); - public static final SoundEvent ENTITY_DRACHENLORD_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.hurt")); - public static final SoundEvent ENTITY_DRACHENLORD_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.death")); - public static final SoundEvent ENTITY_DRACHENLORD_ANGRY = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.angry")); + public static final SoundEvent ENTITY_DRACHENLORD_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.ambient")); + public static final SoundEvent ENTITY_DRACHENLORD_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.hurt")); + public static final SoundEvent ENTITY_DRACHENLORD_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.death")); + public static final SoundEvent ENTITY_DRACHENLORD_ANGRY = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.angry")); - public static final SoundEvent ENTITY_SCHALKER_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.ambient")); - public static final SoundEvent ENTITY_SCHALKER_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.death")); - public static final SoundEvent ENTITY_SCHALKER_OPEN = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.open")); - public static final SoundEvent ENTITY_SCHALKER_SHOOT = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.shoot")); + public static final SoundEvent ENTITY_SCHALKER_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.ambient")); + public static final SoundEvent ENTITY_SCHALKER_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.death")); + public static final SoundEvent ENTITY_SCHALKER_OPEN = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.open")); + public static final SoundEvent ENTITY_SCHALKER_SHOOT = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.shoot")); - public static final SoundEvent ENTITY_JENS_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.ambient")); - public static final SoundEvent ENTITY_JENS_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.hurt")); - public static final SoundEvent ENTITY_JENS_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.death")); - public static final SoundEvent ENTITY_JENS_EAT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.eat")); - public static final SoundEvent ENTITY_JENS_POOP = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.poop")); + public static final SoundEvent ENTITY_JENS_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.ambient")); + public static final SoundEvent ENTITY_JENS_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.hurt")); + public static final SoundEvent ENTITY_JENS_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.death")); + public static final SoundEvent ENTITY_JENS_EAT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.eat")); + public static final SoundEvent ENTITY_JENS_POOP = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.poop")); - public static final SoundEvent ENTITY_BAKAMITAICREEPER_FUSE = new SoundEvent(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.fuse")); - public static final SoundEvent ENTITY_BAKAMITAICREEPER_BLOW = new SoundEvent(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.blow")); + public static final SoundEvent ENTITY_BAKAMITAICREEPER_FUSE = new SoundEvent(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.fuse")); + public static final SoundEvent ENTITY_BAKAMITAICREEPER_BLOW = new SoundEvent(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.blow")); - public static final SoundEvent ENTITY_FRIEDRICH_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.friedrich.ambient")); - public static final SoundEvent ENTITY_FRIEDRICH_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.friedrich.hurt")); - public static final SoundEvent ENTITY_FRIEDRICH_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.friedrich.death")); + public static final SoundEvent ENTITY_FRIEDRICH_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.friedrich.ambient")); + public static final SoundEvent ENTITY_FRIEDRICH_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.friedrich.hurt")); + public static final SoundEvent ENTITY_FRIEDRICH_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.friedrich.death")); - public static final SoundEvent ENTITY_LATINTEACHER_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.latin_teacher.ambient")); + public static final SoundEvent ENTITY_GISELA_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.gisela.ambient")); + public static final SoundEvent ENTITY_GISELA_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.gisela.hurt")); + public static final SoundEvent ENTITY_GISELA_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.gisela.death")); } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/RegHandler.java b/src/main/java/mod/acgaming/spackenmobs/misc/RegHandler.java deleted file mode 100644 index 26d648b..0000000 --- a/src/main/java/mod/acgaming/spackenmobs/misc/RegHandler.java +++ /dev/null @@ -1,242 +0,0 @@ -package mod.acgaming.spackenmobs.misc; - -import mod.acgaming.spackenmobs.Spackenmobs; -import mod.acgaming.spackenmobs.entities.*; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.monster.*; -import net.minecraft.entity.passive.*; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.SoundEvent; -import net.minecraft.world.biome.Biome; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.event.RegistryEvent.Register; -import net.minecraftforge.fml.common.Mod.EventBusSubscriber; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.registry.EntityEntry; -import net.minecraftforge.fml.common.registry.EntityRegistry; - -@EventBusSubscriber(modid = Spackenmobs.MODID) -public class RegHandler -{ - @SubscribeEvent - public static void registerEntities(Register event) - { - int id = 1; - - // Smava Creeper - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:smava_creeper"), EntitySmavaCreeper.class, "smava_creeper", id++, Spackenmobs.instance, 64, 1, true, 7649828, 11053224); - if (ModConfigs.SmavaCreeper_spawn) - { - EntityRegistry.addSpawn(EntitySmavaCreeper.class, ModConfigs.SmavaCreeper_weight, ModConfigs.SmavaCreeper_min, ModConfigs.SmavaCreeper_max, EnumCreatureType.MONSTER, - BiomeHelper.getBiomesWithMonster(EntityCreeper.class)); - } - - // Marcell D'Avis - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:marcell_davis"), EntityMarcellDAvis.class, "marcell_davis", id++, Spackenmobs.instance, 64, 1, true, 15759, 16777215); - if (ModConfigs.MarcellDAvis_spawn) - { - EntityRegistry.addSpawn(EntityMarcellDAvis.class, ModConfigs.MarcellDAvis_weight, ModConfigs.MarcellDAvis_min, ModConfigs.MarcellDAvis_max, EnumCreatureType.MONSTER, - BiomeHelper.getBiomesWithMonster(EntityZombie.class)); - } - - // Islamist - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist", id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548); - if (ModConfigs.Islamist_spawn) - { - EntityRegistry.addSpawn(EntityIslamist.class, ModConfigs.Islamist_weight, ModConfigs.Islamist_min, ModConfigs.Islamist_max, EnumCreatureType.MONSTER, - BiomeHelper.getBiomesWithMonster(EntityCreeper.class)); - } - - // ApoRed - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++, Spackenmobs.instance, 64, 1, true, 2039583, 16711680); - if (ModConfigs.ApoRed_spawn) - { - EntityRegistry.addSpawn(EntityApoRed.class, ModConfigs.ApoRed_weight, ModConfigs.ApoRed_min, ModConfigs.ApoRed_max, EnumCreatureType.MONSTER, - BiomeHelper.getBiomesWithMonster(EntitySkeleton.class)); - } - - // Mr. Bean - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mr_bean"), EntityMrBean.class, "mr_bean", id++, Spackenmobs.instance, 64, 1, true, 4802350, 3220238); - if (ModConfigs.MrBean_spawn) - { - EntityRegistry.addSpawn(EntityMrBean.class, ModConfigs.MrBean_weight, ModConfigs.MrBean_min, ModConfigs.MrBean_max, EnumCreatureType.MONSTER, - BiomeHelper.getBiomesWithMonster(EntityZombie.class)); - } - - // Drachenlord - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class, "drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878); - if (ModConfigs.Drachenlord_spawn) - { - EntityRegistry.addSpawn(EntityDrachenlord.class, ModConfigs.Drachenlord_weight, ModConfigs.Drachenlord_min, ModConfigs.Drachenlord_max, EnumCreatureType.MONSTER, - BiomeHelper.getBiomesWithMonster(EntityPigZombie.class)); - } - - // Schalker - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker", id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215); - if (ModConfigs.Schalker_spawn) - { - EntityRegistry.addSpawn(EntitySchalker.class, ModConfigs.Schalker_weight, ModConfigs.Schalker_min, ModConfigs.Schalker_max, EnumCreatureType.MONSTER, - BiomeDictionary.getBiomes(BiomeDictionary.Type.END).toArray(new Biome[0])); - } - - // Jens - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++, Spackenmobs.instance, 64, 1, true, 6704526, 6767911); - if (ModConfigs.Jens_spawn) - { - EntityRegistry.addSpawn(EntityJens.class, ModConfigs.Jens_weight, ModConfigs.Jens_min, ModConfigs.Jens_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityPig.class)); - } - - // MZTEWolf - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mztewolf"), EntityMZTEWolf.class, "mztewolf", id++, Spackenmobs.instance, 64, 1, true, 16711680, 0); - if (ModConfigs.MZTEWolf_spawn) - { - EntityRegistry.addSpawn(EntityMZTEWolf.class, ModConfigs.MZTEWolf_weight, ModConfigs.MZTEWolf_min, ModConfigs.MZTEWolf_max, EnumCreatureType.CREATURE, - BiomeHelper.getBiomesWithCreature(EntityWolf.class)); - } - - // Holzstammhuhn - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class, "holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899); - if (ModConfigs.Holzstammhuhn_spawn) - { - EntityRegistry.addSpawn(EntityHolzstammhuhn.class, ModConfigs.Holzstammhuhn_weight, ModConfigs.Holzstammhuhn_min, ModConfigs.Holzstammhuhn_max, EnumCreatureType.CREATURE, - BiomeHelper.getBiomesWithCreature(EntityChicken.class)); - } - - // Baka Mitai Creeper - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:bakamitai_creeper"), EntityBakaMitaiCreeper.class, "bakamitai_creeper", id++, Spackenmobs.instance, 64, 1, true, 826890, 0); - if (ModConfigs.BakaMitaiCreeper_spawn) - { - EntityRegistry.addSpawn(EntityBakaMitaiCreeper.class, ModConfigs.BakaMitaiCreeper_weight, ModConfigs.BakaMitaiCreeper_min, ModConfigs.BakaMitaiCreeper_max, EnumCreatureType.MONSTER, - BiomeHelper.getBiomesWithMonster(EntityCreeper.class)); - } - - // Friedrich Liechtenstein - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:friedrich"), EntityFriedrichLiechtenstein.class, "friedrich", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595); - if (ModConfigs.Friedrich_spawn) - { - EntityRegistry.addSpawn(EntityFriedrichLiechtenstein.class, ModConfigs.Friedrich_weight, ModConfigs.Friedrich_min, ModConfigs.Friedrich_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityCow.class)); - } - - // Latin Teacher - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:latin_teacher"), EntityLatinTeacher.class, "latin_teacher", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595); - if (ModConfigs.LatinTeacher_spawn) - { - EntityRegistry.addSpawn(EntityLatinTeacher.class, ModConfigs.LatinTeacher_weight, ModConfigs.LatinTeacher_min, ModConfigs.LatinTeacher_max, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityWitch.class)); - } - - // ITbyHF - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:itbyhf"), EntityITbyHF.class, "itbyhf", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595); - if (ModConfigs.ITbyHF_spawn) - { - EntityRegistry.addSpawn(EntityITbyHF.class, ModConfigs.ITbyHF_weight, ModConfigs.ITbyHF_min, ModConfigs.ITbyHF_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntitySheep.class)); - } - - // tilera Ghast - EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:tilera_ghast"), EntityTileraGhast.class, "tilera_ghast", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595); - if (ModConfigs.tileraGhast_spawn) - { - EntityRegistry.addSpawn(EntityTileraGhast.class, ModConfigs.tileraGhast_weight, ModConfigs.tileraGhast_min, ModConfigs.tileraGhast_max, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityGhast.class)); - } - } - - @SubscribeEvent - public static void registerItems(Register event) - { - event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0])); - } - - @SubscribeEvent - public static void registerSounds(Register event) - { - // Smava Creeper - ModSoundEvents.ENTITY_SMAVACREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.fuse")); - event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE); - ModSoundEvents.ENTITY_SMAVACREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.blow")); - event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_BLOW); - ModSoundEvents.ENTITY_SMAVACREEPER_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt")); - event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_HURT); - ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT); - - // Islamist - ModSoundEvents.ENTITY_ISLAMIST_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.fuse")); - event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_FUSE); - ModSoundEvents.ENTITY_ISLAMIST_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.blow")); - event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_BLOW); - ModSoundEvents.ENTITY_ISLAMIST_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.hurt")); - event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_HURT); - ModSoundEvents.ENTITY_ISLAMIST_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_AMBIENT); - - // Marcell D'Avis - ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT); - ModSoundEvents.ENTITY_MARCELLDAVIS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt")); - event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_HURT); - ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.death")); - event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH); - - // Mr. Bean - ModSoundEvents.ENTITY_MRBEAN_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_AMBIENT); - ModSoundEvents.ENTITY_MRBEAN_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.hurt")); - event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_HURT); - ModSoundEvents.ENTITY_MRBEAN_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.death")); - event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_DEATH); - - // ApoRed - ModSoundEvents.ENTITY_APORED_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_APORED_AMBIENT); - ModSoundEvents.ENTITY_APORED_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.hurt")); - event.getRegistry().register(ModSoundEvents.ENTITY_APORED_HURT); - ModSoundEvents.ENTITY_APORED_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.death")); - event.getRegistry().register(ModSoundEvents.ENTITY_APORED_DEATH); - - // Drachenlord - ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT); - ModSoundEvents.ENTITY_DRACHENLORD_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.hurt")); - event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_HURT); - ModSoundEvents.ENTITY_DRACHENLORD_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.death")); - event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_DEATH); - ModSoundEvents.ENTITY_DRACHENLORD_ANGRY.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.angry")); - event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_ANGRY); - - // Schalker - ModSoundEvents.ENTITY_SCHALKER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_AMBIENT); - ModSoundEvents.ENTITY_SCHALKER_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.death")); - event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_DEATH); - ModSoundEvents.ENTITY_SCHALKER_OPEN.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.open")); - event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_OPEN); - ModSoundEvents.ENTITY_SCHALKER_SHOOT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.shoot")); - event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_SHOOT); - - // Jens - ModSoundEvents.ENTITY_JENS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_JENS_AMBIENT); - ModSoundEvents.ENTITY_JENS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.hurt")); - event.getRegistry().register(ModSoundEvents.ENTITY_JENS_HURT); - ModSoundEvents.ENTITY_JENS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.death")); - event.getRegistry().register(ModSoundEvents.ENTITY_JENS_DEATH); - ModSoundEvents.ENTITY_JENS_EAT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.eat")); - event.getRegistry().register(ModSoundEvents.ENTITY_JENS_EAT); - ModSoundEvents.ENTITY_JENS_POOP.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.poop")); - event.getRegistry().register(ModSoundEvents.ENTITY_JENS_POOP); - - // Baka Mitai Creeper - ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.fuse")); - event.getRegistry().register(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE); - ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.blow")); - event.getRegistry().register(ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW); - - // Friedrich Liechtenstein - ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.ambient")); - event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT); - ModSoundEvents.ENTITY_FRIEDRICH_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.hurt")); - event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_HURT); - ModSoundEvents.ENTITY_FRIEDRICH_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.death")); - event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_DEATH); - } -} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/RegHandlerModels.java b/src/main/java/mod/acgaming/spackenmobs/misc/RegHandlerModels.java deleted file mode 100644 index 3e7bb6e..0000000 --- a/src/main/java/mod/acgaming/spackenmobs/misc/RegHandlerModels.java +++ /dev/null @@ -1,30 +0,0 @@ -package mod.acgaming.spackenmobs.misc; - -import mod.acgaming.spackenmobs.Spackenmobs; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.Item; -import net.minecraftforge.client.event.ModelRegistryEvent; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.fml.common.Mod.EventBusSubscriber; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.relauncher.Side; - -@EventBusSubscriber(value = Side.CLIENT, modid = Spackenmobs.MODID) -public class RegHandlerModels -{ - @SubscribeEvent - public static void registerModels(ModelRegistryEvent event) - { - registerModel(ModItems.RAM, 0); - registerModel(ModItems.RAM_ON_A_STICK, 0); - registerModel(ModItems.SURSTROEMMING, 0); - registerModel(ModItems.AHOJ_BRAUSE, 0); - registerModel(ModItems.AHOJ_BRAUSE_DRINK, 0); - } - - private static void registerModel(Item item, int meta) - { - ModelLoader.setCustomModelResourceLocation(item, meta, - new ModelResourceLocation(item.getRegistryName(), "inventory")); - } -} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/RegistryHandler.java b/src/main/java/mod/acgaming/spackenmobs/misc/RegistryHandler.java new file mode 100644 index 0000000..22da356 --- /dev/null +++ b/src/main/java/mod/acgaming/spackenmobs/misc/RegistryHandler.java @@ -0,0 +1,244 @@ +package mod.acgaming.spackenmobs.misc; + +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.monster.*; +import net.minecraft.entity.passive.*; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; +import net.minecraft.world.biome.Biome; +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.event.RegistryEvent.Register; +import net.minecraftforge.fml.common.Mod.EventBusSubscriber; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.registry.EntityEntry; +import net.minecraftforge.fml.common.registry.EntityRegistry; + +import mod.acgaming.spackenmobs.Spackenmobs; +import mod.acgaming.spackenmobs.entities.*; + +@EventBusSubscriber(modid = Spackenmobs.MODID) +public class RegistryHandler +{ + @SubscribeEvent + public static void registerEntities(Register event) + { + int id = 1; + + // Smava Creeper + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:smava_creeper"), EntitySmavaCreeper.class, "smava_creeper", id++, Spackenmobs.instance, 64, 1, true, 7649828, 11053224); + if (ModConfigs.SmavaCreeper_spawn) + { + EntityRegistry.addSpawn(EntitySmavaCreeper.class, ModConfigs.SmavaCreeper_weight, ModConfigs.SmavaCreeper_min, ModConfigs.SmavaCreeper_max, EnumCreatureType.MONSTER, + BiomeHelper.getBiomesWithMonster(EntityCreeper.class)); + } + + // Marcell D'Avis + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:marcell_davis"), EntityMarcellDAvis.class, "marcell_davis", id++, Spackenmobs.instance, 64, 1, true, 15759, 16777215); + if (ModConfigs.MarcellDAvis_spawn) + { + EntityRegistry.addSpawn(EntityMarcellDAvis.class, ModConfigs.MarcellDAvis_weight, ModConfigs.MarcellDAvis_min, ModConfigs.MarcellDAvis_max, EnumCreatureType.MONSTER, + BiomeHelper.getBiomesWithMonster(EntityZombie.class)); + } + + // Islamist + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist", id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548); + if (ModConfigs.Islamist_spawn) + { + EntityRegistry.addSpawn(EntityIslamist.class, ModConfigs.Islamist_weight, ModConfigs.Islamist_min, ModConfigs.Islamist_max, EnumCreatureType.MONSTER, + BiomeHelper.getBiomesWithMonster(EntityCreeper.class)); + } + + // ApoRed + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++, Spackenmobs.instance, 64, 1, true, 2039583, 16711680); + if (ModConfigs.ApoRed_spawn) + { + EntityRegistry.addSpawn(EntityApoRed.class, ModConfigs.ApoRed_weight, ModConfigs.ApoRed_min, ModConfigs.ApoRed_max, EnumCreatureType.MONSTER, + BiomeHelper.getBiomesWithMonster(EntitySkeleton.class)); + } + + // Mr. Bean + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mr_bean"), EntityMrBean.class, "mr_bean", id++, Spackenmobs.instance, 64, 1, true, 4802350, 3220238); + if (ModConfigs.MrBean_spawn) + { + EntityRegistry.addSpawn(EntityMrBean.class, ModConfigs.MrBean_weight, ModConfigs.MrBean_min, ModConfigs.MrBean_max, EnumCreatureType.MONSTER, + BiomeHelper.getBiomesWithMonster(EntityZombie.class)); + } + + // Drachenlord + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class, "drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878); + if (ModConfigs.Drachenlord_spawn) + { + EntityRegistry.addSpawn(EntityDrachenlord.class, ModConfigs.Drachenlord_weight, ModConfigs.Drachenlord_min, ModConfigs.Drachenlord_max, EnumCreatureType.MONSTER, + BiomeHelper.getBiomesWithMonster(EntityPigZombie.class)); + } + + // Schalker + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker", id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215); + if (ModConfigs.Schalker_spawn) + { + EntityRegistry.addSpawn(EntitySchalker.class, ModConfigs.Schalker_weight, ModConfigs.Schalker_min, ModConfigs.Schalker_max, EnumCreatureType.MONSTER, + BiomeDictionary.getBiomes(BiomeDictionary.Type.END).toArray(new Biome[0])); + } + + // Jens + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++, Spackenmobs.instance, 64, 1, true, 6704526, 6767911); + if (ModConfigs.Jens_spawn) + { + EntityRegistry.addSpawn(EntityJens.class, ModConfigs.Jens_weight, ModConfigs.Jens_min, ModConfigs.Jens_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityPig.class)); + } + + // MZTEWolf + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mztewolf"), EntityMZTEWolf.class, "mztewolf", id++, Spackenmobs.instance, 64, 1, true, 16711680, 0); + if (ModConfigs.MZTEWolf_spawn) + { + EntityRegistry.addSpawn(EntityMZTEWolf.class, ModConfigs.MZTEWolf_weight, ModConfigs.MZTEWolf_min, ModConfigs.MZTEWolf_max, EnumCreatureType.CREATURE, + BiomeHelper.getBiomesWithCreature(EntityWolf.class)); + } + + // Holzstammhuhn + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class, "holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899); + if (ModConfigs.Holzstammhuhn_spawn) + { + EntityRegistry.addSpawn(EntityHolzstammhuhn.class, ModConfigs.Holzstammhuhn_weight, ModConfigs.Holzstammhuhn_min, ModConfigs.Holzstammhuhn_max, EnumCreatureType.CREATURE, + BiomeHelper.getBiomesWithCreature(EntityChicken.class)); + } + + // Baka Mitai Creeper + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:bakamitai_creeper"), EntityBakaMitaiCreeper.class, "bakamitai_creeper", id++, Spackenmobs.instance, 64, 1, true, 826890, 0); + if (ModConfigs.BakaMitaiCreeper_spawn) + { + EntityRegistry.addSpawn(EntityBakaMitaiCreeper.class, ModConfigs.BakaMitaiCreeper_weight, ModConfigs.BakaMitaiCreeper_min, ModConfigs.BakaMitaiCreeper_max, EnumCreatureType.MONSTER, + BiomeHelper.getBiomesWithMonster(EntityCreeper.class)); + } + + // Friedrich Liechtenstein + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:friedrich"), EntityFriedrichLiechtenstein.class, "friedrich", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595); + if (ModConfigs.Friedrich_spawn) + { + EntityRegistry.addSpawn(EntityFriedrichLiechtenstein.class, ModConfigs.Friedrich_weight, ModConfigs.Friedrich_min, ModConfigs.Friedrich_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityCow.class)); + } + + // Gisela + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:gisela"), EntityGisela.class, "gisela", id++, Spackenmobs.instance, 64, 1, true, 39835, 16448250); + if (ModConfigs.Gisela_spawn) + { + EntityRegistry.addSpawn(EntityGisela.class, ModConfigs.Gisela_weight, ModConfigs.Gisela_min, ModConfigs.Gisela_max, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithCreature(EntitySheep.class)); + } + + // tilera Ghast + EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:tilera_ghast"), EntityTileraGhast.class, "tilera_ghast", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595); + if (ModConfigs.tileraGhast_spawn) + { + EntityRegistry.addSpawn(EntityTileraGhast.class, ModConfigs.tileraGhast_weight, ModConfigs.tileraGhast_min, ModConfigs.tileraGhast_max, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityGhast.class)); + } + } + + @SubscribeEvent + public static void registerItems(Register event) + { + event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0])); + } + + @SubscribeEvent + public static void registerSounds(Register event) + { + // Smava Creeper + ModSoundEvents.ENTITY_SMAVACREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.fuse")); + event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE); + ModSoundEvents.ENTITY_SMAVACREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.blow")); + event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_BLOW); + ModSoundEvents.ENTITY_SMAVACREEPER_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_HURT); + ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT); + + // Islamist + ModSoundEvents.ENTITY_ISLAMIST_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.fuse")); + event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_FUSE); + ModSoundEvents.ENTITY_ISLAMIST_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.blow")); + event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_BLOW); + ModSoundEvents.ENTITY_ISLAMIST_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_HURT); + ModSoundEvents.ENTITY_ISLAMIST_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_AMBIENT); + + // Marcell D'Avis + ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT); + ModSoundEvents.ENTITY_MARCELLDAVIS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_HURT); + ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.death")); + event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH); + + // Mr. Bean + ModSoundEvents.ENTITY_MRBEAN_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_AMBIENT); + ModSoundEvents.ENTITY_MRBEAN_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_HURT); + ModSoundEvents.ENTITY_MRBEAN_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.death")); + event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_DEATH); + + // ApoRed + ModSoundEvents.ENTITY_APORED_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_APORED_AMBIENT); + ModSoundEvents.ENTITY_APORED_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_APORED_HURT); + ModSoundEvents.ENTITY_APORED_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.death")); + event.getRegistry().register(ModSoundEvents.ENTITY_APORED_DEATH); + + // Drachenlord + ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT); + ModSoundEvents.ENTITY_DRACHENLORD_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_HURT); + ModSoundEvents.ENTITY_DRACHENLORD_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.death")); + event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_DEATH); + ModSoundEvents.ENTITY_DRACHENLORD_ANGRY.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.angry")); + event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_ANGRY); + + // Schalker + ModSoundEvents.ENTITY_SCHALKER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_AMBIENT); + ModSoundEvents.ENTITY_SCHALKER_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.death")); + event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_DEATH); + ModSoundEvents.ENTITY_SCHALKER_OPEN.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.open")); + event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_OPEN); + ModSoundEvents.ENTITY_SCHALKER_SHOOT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.shoot")); + event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_SHOOT); + + // Jens + ModSoundEvents.ENTITY_JENS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_JENS_AMBIENT); + ModSoundEvents.ENTITY_JENS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_JENS_HURT); + ModSoundEvents.ENTITY_JENS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.death")); + event.getRegistry().register(ModSoundEvents.ENTITY_JENS_DEATH); + ModSoundEvents.ENTITY_JENS_EAT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.eat")); + event.getRegistry().register(ModSoundEvents.ENTITY_JENS_EAT); + ModSoundEvents.ENTITY_JENS_POOP.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.poop")); + event.getRegistry().register(ModSoundEvents.ENTITY_JENS_POOP); + + // Baka Mitai Creeper + ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.fuse")); + event.getRegistry().register(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE); + ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.blow")); + event.getRegistry().register(ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW); + + // Friedrich Liechtenstein + ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT); + ModSoundEvents.ENTITY_FRIEDRICH_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_HURT); + ModSoundEvents.ENTITY_FRIEDRICH_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.death")); + event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_DEATH); + + // Gisela + ModSoundEvents.ENTITY_GISELA_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.gisela.ambient")); + event.getRegistry().register(ModSoundEvents.ENTITY_GISELA_AMBIENT); + ModSoundEvents.ENTITY_GISELA_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.gisela.hurt")); + event.getRegistry().register(ModSoundEvents.ENTITY_GISELA_HURT); + ModSoundEvents.ENTITY_GISELA_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.gisela.death")); + event.getRegistry().register(ModSoundEvents.ENTITY_GISELA_DEATH); + } +} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/misc/RegistryHandlerClient.java b/src/main/java/mod/acgaming/spackenmobs/misc/RegistryHandlerClient.java new file mode 100644 index 0000000..56bf0f5 --- /dev/null +++ b/src/main/java/mod/acgaming/spackenmobs/misc/RegistryHandlerClient.java @@ -0,0 +1,30 @@ +package mod.acgaming.spackenmobs.misc; + +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.item.Item; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.Mod.EventBusSubscriber; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; + +import mod.acgaming.spackenmobs.Spackenmobs; + +@EventBusSubscriber(value = Side.CLIENT, modid = Spackenmobs.MODID) +public class RegistryHandlerClient +{ + @SubscribeEvent + public static void registerModels(ModelRegistryEvent event) + { + registerModel(ModItems.RAM, 0); + registerModel(ModItems.RAM_ON_A_STICK, 0); + registerModel(ModItems.SURSTROEMMING, 0); + registerModel(ModItems.AHOJ_BRAUSE, 0); + registerModel(ModItems.AHOJ_BRAUSE_DRINK, 0); + } + + private static void registerModel(Item item, int meta) + { + ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory")); + } +} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/LayerHeldItemLatinTeacher.java b/src/main/java/mod/acgaming/spackenmobs/render/LayerHeldItemLatinTeacher.java deleted file mode 100644 index 52ba4cd..0000000 --- a/src/main/java/mod/acgaming/spackenmobs/render/LayerHeldItemLatinTeacher.java +++ /dev/null @@ -1,97 +0,0 @@ -package mod.acgaming.spackenmobs.render; - -import mod.acgaming.spackenmobs.entities.EntityLatinTeacher; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.entity.layers.LayerRenderer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class LayerHeldItemLatinTeacher implements LayerRenderer -{ - private final RenderLatinTeacher latinTeacherRenderer; - - public LayerHeldItemLatinTeacher(RenderLatinTeacher latinTeacherRendererIn) - { - this.latinTeacherRenderer = latinTeacherRendererIn; - } - - public void doRenderLayer(EntityLatinTeacher entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) - { - ItemStack itemstack = entitylivingbaseIn.getHeldItemMainhand(); - - if (!itemstack.isEmpty()) - { - GlStateManager.color(1.0F, 1.0F, 1.0F); - GlStateManager.pushMatrix(); - - if (this.latinTeacherRenderer.getMainModel().isChild) - { - GlStateManager.translate(0.0F, 0.625F, 0.0F); - GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F); - float f = 0.5F; - GlStateManager.scale(0.5F, 0.5F, 0.5F); - } - - this.latinTeacherRenderer.getMainModel().villagerNose.postRender(0.0625F); - GlStateManager.translate(-0.0625F, 0.53125F, 0.21875F); - Item item = itemstack.getItem(); - Minecraft minecraft = Minecraft.getMinecraft(); - - if (Block.getBlockFromItem(item).getDefaultState().getRenderType() == EnumBlockRenderType.ENTITYBLOCK_ANIMATED) - { - GlStateManager.translate(0.0F, 0.0625F, -0.25F); - GlStateManager.rotate(30.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(-5.0F, 0.0F, 1.0F, 0.0F); - float f1 = 0.375F; - GlStateManager.scale(0.375F, -0.375F, 0.375F); - } else if (item instanceof net.minecraft.item.ItemBow) - { - GlStateManager.translate(0.0F, 0.125F, -0.125F); - GlStateManager.rotate(-45.0F, 0.0F, 1.0F, 0.0F); - float f2 = 0.625F; - GlStateManager.scale(0.625F, -0.625F, 0.625F); - GlStateManager.rotate(-100.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(-20.0F, 0.0F, 1.0F, 0.0F); - } else if (item.isFull3D()) - { - if (item.shouldRotateAroundWhenRendering()) - { - GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); - GlStateManager.translate(0.0F, -0.0625F, 0.0F); - } - - this.latinTeacherRenderer.transformHeldFull3DItemLayer(); - GlStateManager.translate(0.0625F, -0.125F, 0.0F); - float f3 = 0.625F; - GlStateManager.scale(0.625F, -0.625F, 0.625F); - GlStateManager.rotate(0.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(0.0F, 0.0F, 1.0F, 0.0F); - } else - { - GlStateManager.translate(0.1875F, 0.1875F, 0.0F); - float f4 = 0.875F; - GlStateManager.scale(0.875F, 0.875F, 0.875F); - GlStateManager.rotate(-20.0F, 0.0F, 0.0F, 1.0F); - GlStateManager.rotate(-60.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(-30.0F, 0.0F, 0.0F, 1.0F); - } - - GlStateManager.rotate(-15.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(40.0F, 0.0F, 0.0F, 1.0F); - minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND); - GlStateManager.popMatrix(); - } - } - - public boolean shouldCombineTextures() - { - return false; - } -} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/LayerJensWitherAura.java b/src/main/java/mod/acgaming/spackenmobs/render/LayerJensWitherAura.java index 8ec9da3..1bc48f5 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/LayerJensWitherAura.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/LayerJensWitherAura.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityJensWither; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelWither; import net.minecraft.client.renderer.GlStateManager; @@ -10,51 +9,53 @@ import net.minecraft.util.math.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityJensWither; + @SideOnly(Side.CLIENT) public class LayerJensWitherAura implements LayerRenderer { - private static final ResourceLocation WITHER_ARMOR = new ResourceLocation("textures/entity/wither/wither_armor.png"); - private final RenderJensWither witherRenderer; - private final ModelWither witherModel = new ModelWither(0.5F); + private static final ResourceLocation WITHER_ARMOR = new ResourceLocation("textures/entity/wither/wither_armor.png"); + private final RenderJensWither witherRenderer; + private final ModelWither witherModel = new ModelWither(0.5F); - public LayerJensWitherAura(RenderJensWither witherRendererIn) - { - this.witherRenderer = witherRendererIn; - } + public LayerJensWitherAura(RenderJensWither witherRendererIn) + { + this.witherRenderer = witherRendererIn; + } - public void doRenderLayer(EntityJensWither entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) - { - if (entitylivingbaseIn.isArmored()) - { - GlStateManager.depthMask(!entitylivingbaseIn.isInvisible()); - this.witherRenderer.bindTexture(WITHER_ARMOR); - GlStateManager.matrixMode(5890); - GlStateManager.loadIdentity(); - float f = (float) entitylivingbaseIn.ticksExisted + partialTicks; - float f1 = MathHelper.cos(f * 0.02F) * 3.0F; - float f2 = f * 0.01F; - GlStateManager.translate(f1, f2, 0.0F); - GlStateManager.matrixMode(5888); - GlStateManager.enableBlend(); - float f3 = 0.5F; - GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F); - GlStateManager.disableLighting(); - GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE); - this.witherModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks); - this.witherModel.setModelAttributes(this.witherRenderer.getMainModel()); - Minecraft.getMinecraft().entityRenderer.setupFogColor(true); - this.witherModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); - Minecraft.getMinecraft().entityRenderer.setupFogColor(false); - GlStateManager.matrixMode(5890); - GlStateManager.loadIdentity(); - GlStateManager.matrixMode(5888); - GlStateManager.enableLighting(); - GlStateManager.disableBlend(); - } - } + public void doRenderLayer(EntityJensWither entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) + { + if (entitylivingbaseIn.isArmored()) + { + GlStateManager.depthMask(!entitylivingbaseIn.isInvisible()); + this.witherRenderer.bindTexture(WITHER_ARMOR); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + float f = (float) entitylivingbaseIn.ticksExisted + partialTicks; + float f1 = MathHelper.cos(f * 0.02F) * 3.0F; + float f2 = f * 0.01F; + GlStateManager.translate(f1, f2, 0.0F); + GlStateManager.matrixMode(5888); + GlStateManager.enableBlend(); + float f3 = 0.5F; + GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F); + GlStateManager.disableLighting(); + GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE); + this.witherModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks); + this.witherModel.setModelAttributes(this.witherRenderer.getMainModel()); + Minecraft.getMinecraft().entityRenderer.setupFogColor(true); + this.witherModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); + Minecraft.getMinecraft().entityRenderer.setupFogColor(false); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + } + } - public boolean shouldCombineTextures() - { - return false; - } + public boolean shouldCombineTextures() + { + return false; + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/ModelSchalker.java b/src/main/java/mod/acgaming/spackenmobs/render/ModelSchalker.java index 480e940..c9f0563 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/ModelSchalker.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/ModelSchalker.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntitySchalker; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; @@ -8,62 +7,65 @@ import net.minecraft.util.math.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntitySchalker; + @SideOnly(Side.CLIENT) public class ModelSchalker extends ModelBase { - public final ModelRenderer base; - public final ModelRenderer lid; - public ModelRenderer head; + public final ModelRenderer base; + public final ModelRenderer lid; + public ModelRenderer head; - public ModelSchalker() - { - this.textureHeight = 64; - this.textureWidth = 64; - this.lid = new ModelRenderer(this); - this.base = new ModelRenderer(this); - this.head = new ModelRenderer(this); - this.lid.setTextureOffset(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16, 12, 16); - this.lid.setRotationPoint(0.0F, 24.0F, 0.0F); - this.base.setTextureOffset(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16, 8, 16); - this.base.setRotationPoint(0.0F, 24.0F, 0.0F); - this.head.setTextureOffset(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6, 6, 6); - this.head.setRotationPoint(0.0F, 12.0F, 0.0F); - } + public ModelSchalker() + { + this.textureHeight = 64; + this.textureWidth = 64; + this.lid = new ModelRenderer(this); + this.base = new ModelRenderer(this); + this.head = new ModelRenderer(this); + this.lid.setTextureOffset(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16, 12, 16); + this.lid.setRotationPoint(0.0F, 24.0F, 0.0F); + this.base.setTextureOffset(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16, 8, 16); + this.base.setRotationPoint(0.0F, 24.0F, 0.0F); + this.head.setTextureOffset(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6, 6, 6); + this.head.setRotationPoint(0.0F, 12.0F, 0.0F); + } - @Override - public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, - float headPitch, float scaleFactor, Entity entityIn) - { - EntitySchalker EntitySchalker = (EntitySchalker) entityIn; - float f = ageInTicks - EntitySchalker.ticksExisted; - float f1 = (0.5F + EntitySchalker.getClientPeekAmount(f)) * (float) Math.PI; - float f2 = -1.0F + MathHelper.sin(f1); - float f3 = 0.0F; + @Override + public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, + float headPitch, float scale) + { + this.base.render(scale); + this.lid.render(scale); + } - if (f1 > (float) Math.PI) - { - f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F; - } + @Override + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, + float headPitch, float scaleFactor, Entity entityIn) + { + EntitySchalker EntitySchalker = (EntitySchalker) entityIn; + float f = ageInTicks - EntitySchalker.ticksExisted; + float f1 = (0.5F + EntitySchalker.getClientPeekAmount(f)) * (float) Math.PI; + float f2 = -1.0F + MathHelper.sin(f1); + float f3 = 0.0F; - this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F); + if (f1 > (float) Math.PI) + { + f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F; + } - if (EntitySchalker.getClientPeekAmount(f) > 0.3F) - { - this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; - } else - { - this.lid.rotateAngleY = 0.0F; - } + this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F); - this.head.rotateAngleX = headPitch * 0.017453292F; - this.head.rotateAngleY = netHeadYaw * 0.017453292F; - } + if (EntitySchalker.getClientPeekAmount(f) > 0.3F) + { + this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; + } + else + { + this.lid.rotateAngleY = 0.0F; + } - @Override - public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, - float headPitch, float scale) - { - this.base.render(scale); - this.lid.render(scale); - } + this.head.rotateAngleX = headPitch * 0.017453292F; + this.head.rotateAngleY = netHeadYaw * 0.017453292F; + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderApoRed.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderApoRed.java index f403715..7a5dcc6 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderApoRed.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderApoRed.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityApoRed; import net.minecraft.client.model.ModelSkeleton; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; @@ -14,46 +13,48 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityApoRed; + @SideOnly(Side.CLIENT) public class RenderApoRed extends RenderSkeleton { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation APORED_TEXTURE = new ResourceLocation( - "spackenmobs:textures/entities/apored.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation APORED_TEXTURE = new ResourceLocation( + "spackenmobs:textures/entities/apored.png"); - public RenderApoRed(RenderManager renderManagerIn) - { - super(renderManagerIn); - this.addLayer(new LayerHeldItem(this)); - this.addLayer(new LayerBipedArmor(this) - { - @Override - protected void initArmor() - { - this.modelLeggings = new ModelSkeleton(0.5F, true); - this.modelArmor = new ModelSkeleton(1.0F, true); - } - }); - } + public RenderApoRed(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.addLayer(new LayerHeldItem(this)); + this.addLayer(new LayerBipedArmor(this) + { + @Override + protected void initArmor() + { + this.modelLeggings = new ModelSkeleton(0.5F, true); + this.modelArmor = new ModelSkeleton(1.0F, true); + } + }); + } - @Override - public void transformHeldFull3DItemLayer() - { - GlStateManager.translate(0.09375F, 0.1875F, 0.0F); - } + @Override + public void transformHeldFull3DItemLayer() + { + GlStateManager.translate(0.09375F, 0.1875F, 0.0F); + } - @Override - protected ResourceLocation getEntityTexture(AbstractSkeleton entity) - { - return APORED_TEXTURE; - } + @Override + protected ResourceLocation getEntityTexture(AbstractSkeleton entity) + { + return APORED_TEXTURE; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderApoRed(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderApoRed(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderBakaMitaiCreeper.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderBakaMitaiCreeper.java index df65e6e..3e7d3d1 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderBakaMitaiCreeper.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderBakaMitaiCreeper.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper; import net.minecraft.client.model.ModelCreeper; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; @@ -12,58 +11,61 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper; + @SideOnly(Side.CLIENT) public class RenderBakaMitaiCreeper extends RenderLiving { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation CREEPER_TEXTURE = new ResourceLocation("textures/entity/creeper/creeper.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation CREEPER_TEXTURE = new ResourceLocation("textures/entity/creeper/creeper.png"); - public RenderBakaMitaiCreeper(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelCreeper(), 0.5F); - } + public RenderBakaMitaiCreeper(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelCreeper(), 0.5F); + } - @Override - protected int getColorMultiplier(EntityBakaMitaiCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) - { - float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); + @Override + protected int getColorMultiplier(EntityBakaMitaiCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) + { + float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); - if ((int) (f * 10.0F) % 2 == 0) - { - return 0; - } else - { - int i = (int) (f * 0.2F * 255.0F); - i = MathHelper.clamp(i, 0, 255); - return i << 24 | 822083583; - } - } + if ((int) (f * 10.0F) % 2 == 0) + { + return 0; + } + else + { + int i = (int) (f * 0.2F * 255.0F); + i = MathHelper.clamp(i, 0, 255); + return i << 24 | 822083583; + } + } - @Override - protected ResourceLocation getEntityTexture(EntityBakaMitaiCreeper entity) - { - return CREEPER_TEXTURE; - } + @Override + protected void preRenderCallback(EntityBakaMitaiCreeper entitylivingbaseIn, float partialTickTime) + { + float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); + float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F; + f = MathHelper.clamp(f, 0.0F, 1.0F); + f = f * f; + f = f * f; + float f2 = (1.0F + f * 0.4F) * f1; + float f3 = (1.0F + f * 0.1F) / f1; + GlStateManager.scale(f2, f3, f2); + } - @Override - protected void preRenderCallback(EntityBakaMitaiCreeper entitylivingbaseIn, float partialTickTime) - { - float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); - float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F; - f = MathHelper.clamp(f, 0.0F, 1.0F); - f = f * f; - f = f * f; - float f2 = (1.0F + f * 0.4F) * f1; - float f3 = (1.0F + f * 0.1F) / f1; - GlStateManager.scale(f2, f3, f2); - } + @Override + protected ResourceLocation getEntityTexture(EntityBakaMitaiCreeper entity) + { + return CREEPER_TEXTURE; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderBakaMitaiCreeper(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderBakaMitaiCreeper(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderDrachenlord.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderDrachenlord.java index f04598a..53c4eb3 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderDrachenlord.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderDrachenlord.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityDrachenlord; import net.minecraft.client.model.ModelZombie; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; @@ -12,39 +11,41 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityDrachenlord; + @SideOnly(Side.CLIENT) public class RenderDrachenlord extends RenderZombie { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation DRACHENLORD_TEXTURE = new ResourceLocation( - "spackenmobs:textures/entities/drachenlord.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation DRACHENLORD_TEXTURE = new ResourceLocation( + "spackenmobs:textures/entities/drachenlord.png"); - public RenderDrachenlord(RenderManager renderManagerIn) - { - super(renderManagerIn); - this.addLayer(new LayerBipedArmor(this) - { - @Override - protected void initArmor() - { - this.modelLeggings = new ModelZombie(0.5F, true); - this.modelArmor = new ModelZombie(1.0F, true); - } - }); - } + public RenderDrachenlord(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.addLayer(new LayerBipedArmor(this) + { + @Override + protected void initArmor() + { + this.modelLeggings = new ModelZombie(0.5F, true); + this.modelArmor = new ModelZombie(1.0F, true); + } + }); + } - @Override - protected ResourceLocation getEntityTexture(EntityZombie entity) - { - return DRACHENLORD_TEXTURE; - } + @Override + protected ResourceLocation getEntityTexture(EntityZombie entity) + { + return DRACHENLORD_TEXTURE; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderDrachenlord(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderDrachenlord(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderFriedrichLiechtenstein.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderFriedrichLiechtenstein.java index b8f98b5..9a79b3c 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderFriedrichLiechtenstein.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderFriedrichLiechtenstein.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityFriedrichLiechtenstein; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderBiped; @@ -10,29 +9,31 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityFriedrichLiechtenstein; + @SideOnly(Side.CLIENT) public class RenderFriedrichLiechtenstein extends RenderBiped { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation FRIEDRICH_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/friedrich.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation FRIEDRICH_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/friedrich.png"); - public RenderFriedrichLiechtenstein(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelBiped(), 0.25F); - } + public RenderFriedrichLiechtenstein(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelBiped(), 0.25F); + } - @Override - protected ResourceLocation getEntityTexture(EntityFriedrichLiechtenstein entity) - { - return FRIEDRICH_TEXTURE; - } + @Override + protected ResourceLocation getEntityTexture(EntityFriedrichLiechtenstein entity) + { + return FRIEDRICH_TEXTURE; + } - private static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderFriedrichLiechtenstein(manager); - } - } + private static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderFriedrichLiechtenstein(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderGisela.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderGisela.java new file mode 100644 index 0000000..172055c --- /dev/null +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderGisela.java @@ -0,0 +1,39 @@ +package mod.acgaming.spackenmobs.render; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderBiped; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.client.registry.IRenderFactory; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import mod.acgaming.spackenmobs.entities.EntityGisela; + +@SideOnly(Side.CLIENT) +public class RenderGisela extends RenderBiped +{ + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation GISELA_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/gisela.png"); + + public RenderGisela(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelBiped(), 0.25F); + } + + @Override + protected ResourceLocation getEntityTexture(EntityGisela entity) + { + return GISELA_TEXTURE; + } + + private static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderGisela(manager); + } + } +} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderHolzstammhuhn.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderHolzstammhuhn.java index 5ee204b..abf9251 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderHolzstammhuhn.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderHolzstammhuhn.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityHolzstammhuhn; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderChicken; import net.minecraft.client.renderer.entity.RenderManager; @@ -10,30 +9,32 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityHolzstammhuhn; + @SideOnly(Side.CLIENT) public class RenderHolzstammhuhn extends RenderChicken { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation HOLZSTAMMHUHN_TEXTURE = new ResourceLocation( - "spackenmobs:textures/entities/holzstammhuhn.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation HOLZSTAMMHUHN_TEXTURE = new ResourceLocation( + "spackenmobs:textures/entities/holzstammhuhn.png"); - public RenderHolzstammhuhn(RenderManager renderManagerIn) - { - super(renderManagerIn); - } + public RenderHolzstammhuhn(RenderManager renderManagerIn) + { + super(renderManagerIn); + } - @Override - protected ResourceLocation getEntityTexture(EntityChicken entity) - { - return HOLZSTAMMHUHN_TEXTURE; - } + @Override + protected ResourceLocation getEntityTexture(EntityChicken entity) + { + return HOLZSTAMMHUHN_TEXTURE; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderHolzstammhuhn(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderHolzstammhuhn(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderITbyHF.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderITbyHF.java deleted file mode 100644 index dca87aa..0000000 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderITbyHF.java +++ /dev/null @@ -1,38 +0,0 @@ -package mod.acgaming.spackenmobs.render; - -import mod.acgaming.spackenmobs.entities.EntityITbyHF; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.registry.IRenderFactory; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderITbyHF extends RenderBiped -{ - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation ITBYHF_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/itbyhf.png"); - - public RenderITbyHF(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelBiped(), 0.25F); - } - - @Override - protected ResourceLocation getEntityTexture(EntityITbyHF entity) - { - return ITBYHF_TEXTURE; - } - - private static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderITbyHF(manager); - } - } -} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderIslamist.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderIslamist.java index 576d787..f0b24d7 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderIslamist.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderIslamist.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityIslamist; import net.minecraft.client.model.ModelCreeper; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; @@ -12,58 +11,61 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityIslamist; + @SideOnly(Side.CLIENT) public class RenderIslamist extends RenderLiving { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation ISLAMIST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/islamist.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation ISLAMIST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/islamist.png"); - public RenderIslamist(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelCreeper(), 0.5F); - } + public RenderIslamist(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelCreeper(), 0.5F); + } - @Override - protected int getColorMultiplier(EntityIslamist entitylivingbaseIn, float lightBrightness, float partialTickTime) - { - float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); + @Override + protected int getColorMultiplier(EntityIslamist entitylivingbaseIn, float lightBrightness, float partialTickTime) + { + float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); - if ((int) (f * 10.0F) % 2 == 0) - { - return 0; - } else - { - int i = (int) (f * 0.2F * 255.0F); - i = MathHelper.clamp(i, 0, 255); - return i << 24 | 822083583; - } - } + if ((int) (f * 10.0F) % 2 == 0) + { + return 0; + } + else + { + int i = (int) (f * 0.2F * 255.0F); + i = MathHelper.clamp(i, 0, 255); + return i << 24 | 822083583; + } + } - @Override - protected ResourceLocation getEntityTexture(EntityIslamist entity) - { - return ISLAMIST_TEXTURE; - } + @Override + protected void preRenderCallback(EntityIslamist entitylivingbaseIn, float partialTickTime) + { + float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); + float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F; + f = MathHelper.clamp(f, 0.0F, 1.0F); + f = f * f; + f = f * f; + float f2 = (1.0F + f * 0.4F) * f1; + float f3 = (1.0F + f * 0.1F) / f1; + GlStateManager.scale(f2, f3, f2); + } - @Override - protected void preRenderCallback(EntityIslamist entitylivingbaseIn, float partialTickTime) - { - float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); - float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F; - f = MathHelper.clamp(f, 0.0F, 1.0F); - f = f * f; - f = f * f; - float f2 = (1.0F + f * 0.4F) * f1; - float f3 = (1.0F + f * 0.1F) / f1; - GlStateManager.scale(f2, f3, f2); - } + @Override + protected ResourceLocation getEntityTexture(EntityIslamist entity) + { + return ISLAMIST_TEXTURE; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderIslamist(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderIslamist(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderJens.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderJens.java index e7f9a69..b37dae8 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderJens.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderJens.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityJens; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderBiped; @@ -10,29 +9,31 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityJens; + @SideOnly(Side.CLIENT) public class RenderJens extends RenderBiped { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation JENS_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation JENS_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens.png"); - public RenderJens(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelBiped(), 0.25F); - } + public RenderJens(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelBiped(), 0.25F); + } - @Override - protected ResourceLocation getEntityTexture(EntityJens entity) - { - return JENS_TEXTURE; - } + @Override + protected ResourceLocation getEntityTexture(EntityJens entity) + { + return JENS_TEXTURE; + } - private static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderJens(manager); - } - } + private static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderJens(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderJensWither.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderJensWither.java index c2dbf1c..e9ae56f 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderJensWither.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderJensWither.java @@ -1,42 +1,58 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityJensWither; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.model.ModelWither; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityJensWither; + @SideOnly(Side.CLIENT) public class RenderJensWither extends RenderLiving { - private static final ResourceLocation INVULNERABLE_JENS_WITHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens_wither_inv.png"); - private static final ResourceLocation JENS_WITHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens_wither.png"); + private static final ResourceLocation INVULNERABLE_JENS_WITHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens_wither_inv.png"); + private static final ResourceLocation JENS_WITHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens_wither.png"); - public RenderJensWither(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelWither(0.0F), 1.0F); - this.addLayer(new LayerJensWitherAura(this)); - } + public RenderJensWither(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelWither(0.0F), 1.0F); + this.addLayer(new LayerJensWitherAura(this)); + } - protected ResourceLocation getEntityTexture(EntityJensWither entity) - { - int i = entity.getInvulTime(); - return i > 0 && (i > 80 || i / 5 % 2 != 1) ? INVULNERABLE_JENS_WITHER_TEXTURE : JENS_WITHER_TEXTURE; - } + public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving) + { + if (!worldIn.isRemote && (double) state.getBlockHardness(worldIn, pos) != 0.0D) + { + stack.damageItem(1, entityLiving); + } - protected void preRenderCallback(EntityJensWither entitylivingbaseIn, float partialTickTime) - { - float f = 2.0F; - int i = entitylivingbaseIn.getInvulTime(); + return true; + } - if (i > 0) - { - f -= ((float) i - partialTickTime) / 220.0F * 0.5F; - } + protected ResourceLocation getEntityTexture(EntityJensWither entity) + { + int i = entity.getInvulTime(); + return i > 0 && (i > 80 || i / 5 % 2 != 1) ? INVULNERABLE_JENS_WITHER_TEXTURE : JENS_WITHER_TEXTURE; + } - GlStateManager.scale(f, f, f); - } + protected void preRenderCallback(EntityJensWither entitylivingbaseIn, float partialTickTime) + { + float f = 2.0F; + int i = entitylivingbaseIn.getInvulTime(); + + if (i > 0) + { + f -= ((float) i - partialTickTime) / 220.0F * 0.5F; + } + + GlStateManager.scale(f, f, f); + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderLatinTeacher.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderLatinTeacher.java deleted file mode 100644 index ba19d7c..0000000 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderLatinTeacher.java +++ /dev/null @@ -1,61 +0,0 @@ -package mod.acgaming.spackenmobs.render; - -import mod.acgaming.spackenmobs.entities.EntityLatinTeacher; -import net.minecraft.client.model.ModelWitch; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.registry.IRenderFactory; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderLatinTeacher extends RenderLiving -{ - public static final RenderLatinTeacher.Factory FACTORY = new RenderLatinTeacher.Factory(); - private static final ResourceLocation LATINTEACHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/latin_teacher.png"); - - public RenderLatinTeacher(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelWitch(0.0F), 0.5F); - this.addLayer(new LayerHeldItemLatinTeacher(this)); - } - - public ModelWitch getMainModel() - { - return (ModelWitch) super.getMainModel(); - } - - public void doRender(EntityLatinTeacher entity, double x, double y, double z, float entityYaw, float partialTicks) - { - ((ModelWitch) this.mainModel).holdingItem = !entity.getHeldItemMainhand().isEmpty(); - super.doRender(entity, x, y, z, entityYaw, partialTicks); - } - - protected ResourceLocation getEntityTexture(EntityLatinTeacher entity) - { - return LATINTEACHER_TEXTURE; - } - - public void transformHeldFull3DItemLayer() - { - GlStateManager.translate(0.0F, 0.1875F, 0.0F); - } - - protected void preRenderCallback(EntityLatinTeacher entitylivingbaseIn, float partialTickTime) - { - float f = 0.9375F; - GlStateManager.scale(0.9375F, 0.9375F, 0.9375F); - } - - private static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderLatinTeacher(manager); - } - } -} \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderMZTEWolf.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderMZTEWolf.java index feba709..21e553b 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderMZTEWolf.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderMZTEWolf.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityMZTEWolf; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; @@ -12,59 +11,62 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityMZTEWolf; + @SideOnly(Side.CLIENT) public class RenderMZTEWolf extends RenderWolf { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation MZTEWOLF_TEXTURE = new ResourceLocation( - "spackenmobs:textures/entities/mztewolf.png"); - private static final ResourceLocation TAMED_MZTEWOLF_TEXTURE = new ResourceLocation( - "spackenmobs:textures/entities/mztewolf_tame.png"); - private static final ResourceLocation ANRGY_MZTEWOLF_TEXTURE = new ResourceLocation( - "spackenmobs:textures/entities/mztewolf_angry.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation MZTEWOLF_TEXTURE = new ResourceLocation( + "spackenmobs:textures/entities/mztewolf.png"); + private static final ResourceLocation TAMED_MZTEWOLF_TEXTURE = new ResourceLocation( + "spackenmobs:textures/entities/mztewolf_tame.png"); + private static final ResourceLocation ANRGY_MZTEWOLF_TEXTURE = new ResourceLocation( + "spackenmobs:textures/entities/mztewolf_angry.png"); - public RenderMZTEWolf(RenderManager renderManagerIn) - { - super(renderManagerIn); - this.addLayer(new LayerWolfCollar(this)); - } + public RenderMZTEWolf(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.addLayer(new LayerWolfCollar(this)); + } - @Override - protected float handleRotationFloat(EntityWolf livingBase, float partialTicks) - { - return livingBase.getTailRotation(); - } + @Override + protected float handleRotationFloat(EntityWolf livingBase, float partialTicks) + { + return livingBase.getTailRotation(); + } - @Override - public void doRender(EntityWolf entity, double x, double y, double z, float entityYaw, float partialTicks) - { - if (entity.isWolfWet()) - { - float f = entity.getBrightness() * entity.getShadingWhileWet(partialTicks); - GlStateManager.color(f, f, f); - } + @Override + public void doRender(EntityWolf entity, double x, double y, double z, float entityYaw, float partialTicks) + { + if (entity.isWolfWet()) + { + float f = entity.getBrightness() * entity.getShadingWhileWet(partialTicks); + GlStateManager.color(f, f, f); + } - super.doRender(entity, x, y, z, entityYaw, partialTicks); - } + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } - @Override - protected ResourceLocation getEntityTexture(EntityWolf entity) - { - if (entity.isTamed()) - { - return TAMED_MZTEWOLF_TEXTURE; - } else - { - return entity.isAngry() ? ANRGY_MZTEWOLF_TEXTURE : MZTEWOLF_TEXTURE; - } - } + @Override + protected ResourceLocation getEntityTexture(EntityWolf entity) + { + if (entity.isTamed()) + { + return TAMED_MZTEWOLF_TEXTURE; + } + else + { + return entity.isAngry() ? ANRGY_MZTEWOLF_TEXTURE : MZTEWOLF_TEXTURE; + } + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderMZTEWolf(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderMZTEWolf(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderMarcellDAvis.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderMarcellDAvis.java index e2a0418..6cf8811 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderMarcellDAvis.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderMarcellDAvis.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityMarcellDAvis; import net.minecraft.client.model.ModelZombie; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; @@ -12,40 +11,42 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityMarcellDAvis; + @SideOnly(Side.CLIENT) public class RenderMarcellDAvis extends RenderZombie { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation MARCELLDAVIS_TEXTURE = new ResourceLocation( - "spackenmobs:textures/entities/marcell_davis.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation MARCELLDAVIS_TEXTURE = new ResourceLocation( + "spackenmobs:textures/entities/marcell_davis.png"); - public RenderMarcellDAvis(RenderManager renderManagerIn) - { - super(renderManagerIn); - LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) - { - @Override - protected void initArmor() - { - this.modelLeggings = new ModelZombie(0.5F, true); - this.modelArmor = new ModelZombie(1.0F, true); - } - }; - this.addLayer(layerbipedarmor); - } + public RenderMarcellDAvis(RenderManager renderManagerIn) + { + super(renderManagerIn); + LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) + { + @Override + protected void initArmor() + { + this.modelLeggings = new ModelZombie(0.5F, true); + this.modelArmor = new ModelZombie(1.0F, true); + } + }; + this.addLayer(layerbipedarmor); + } - @Override - protected ResourceLocation getEntityTexture(EntityZombie entity) - { - return MARCELLDAVIS_TEXTURE; - } + @Override + protected ResourceLocation getEntityTexture(EntityZombie entity) + { + return MARCELLDAVIS_TEXTURE; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderMarcellDAvis(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderMarcellDAvis(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderMrBean.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderMrBean.java index 3d0e635..288b140 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderMrBean.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderMrBean.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityMrBean; import net.minecraft.client.model.ModelZombie; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; @@ -12,40 +11,42 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityMrBean; + @SideOnly(Side.CLIENT) public class RenderMrBean extends RenderZombie { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation MRBEAN_TEXTURE = new ResourceLocation( - "spackenmobs:textures/entities/mr_bean.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation MRBEAN_TEXTURE = new ResourceLocation( + "spackenmobs:textures/entities/mr_bean.png"); - public RenderMrBean(RenderManager renderManagerIn) - { - super(renderManagerIn); - LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) - { - @Override - protected void initArmor() - { - this.modelLeggings = new ModelZombie(0.5F, true); - this.modelArmor = new ModelZombie(1.0F, true); - } - }; - this.addLayer(layerbipedarmor); - } + public RenderMrBean(RenderManager renderManagerIn) + { + super(renderManagerIn); + LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) + { + @Override + protected void initArmor() + { + this.modelLeggings = new ModelZombie(0.5F, true); + this.modelArmor = new ModelZombie(1.0F, true); + } + }; + this.addLayer(layerbipedarmor); + } - @Override - protected ResourceLocation getEntityTexture(EntityZombie entity) - { - return MRBEAN_TEXTURE; - } + @Override + protected ResourceLocation getEntityTexture(EntityZombie entity) + { + return MRBEAN_TEXTURE; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderMrBean(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderMrBean(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderSchalker.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderSchalker.java index 844498d..d7c235b 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderSchalker.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderSchalker.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntitySchalker; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.culling.ICamera; @@ -16,199 +15,203 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntitySchalker; + @SideOnly(Side.CLIENT) public class RenderSchalker extends RenderLiving { - public static final ResourceLocation[] SCHALKER_TEXTURE = new ResourceLocation[]{ - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png"), - new ResourceLocation("spackenmobs:textures/entities/schalker.png")}; - public static final Factory FACTORY = new Factory(); + public static final ResourceLocation[] SCHALKER_TEXTURE = new ResourceLocation[] { + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png"), + new ResourceLocation("spackenmobs:textures/entities/schalker.png")}; + public static final Factory FACTORY = new Factory(); - public RenderSchalker(RenderManager p_i47194_1_) - { - super(p_i47194_1_, new ModelSchalker(), 0.0F); - this.addLayer(new RenderSchalker.HeadLayer()); - } + public RenderSchalker(RenderManager p_i47194_1_) + { + super(p_i47194_1_, new ModelSchalker(), 0.0F); + this.addLayer(new RenderSchalker.HeadLayer()); + } - @Override - public ModelSchalker getMainModel() - { - return (ModelSchalker) super.getMainModel(); - } + @Override + public ModelSchalker getMainModel() + { + return (ModelSchalker) super.getMainModel(); + } - @Override - public void doRender(EntitySchalker entity, double x, double y, double z, float entityYaw, float partialTicks) - { - int i = entity.getClientTeleportInterp(); + @Override + protected void applyRotations(EntitySchalker entityLiving, float p_77043_2_, float rotationYaw, + float partialTicks) + { + super.applyRotations(entityLiving, p_77043_2_, rotationYaw, partialTicks); - if (i > 0 && entity.isAttachedToBlock()) - { - BlockPos blockpos = entity.getAttachmentPos(); - BlockPos blockpos1 = entity.getOldAttachPos(); - double d0 = (i - partialTicks) / 6.0D; - d0 = d0 * d0; - double d1 = (blockpos.getX() - blockpos1.getX()) * d0; - double d2 = (blockpos.getY() - blockpos1.getY()) * d0; - double d3 = (blockpos.getZ() - blockpos1.getZ()) * d0; - super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks); - } else - { - super.doRender(entity, x, y, z, entityYaw, partialTicks); - } - } + switch (entityLiving.getAttachmentFacing()) + { + case DOWN: + default: + break; + case EAST: + GlStateManager.translate(0.5F, 0.5F, 0.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + break; + case WEST: + GlStateManager.translate(-0.5F, 0.5F, 0.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F); + break; + case NORTH: + GlStateManager.translate(0.0F, 0.5F, -0.5F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + break; + case SOUTH: + GlStateManager.translate(0.0F, 0.5F, 0.5F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + break; + case UP: + GlStateManager.translate(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + } + } - @Override - public boolean shouldRender(EntitySchalker livingEntity, ICamera camera, double camX, double camY, double camZ) - { - if (super.shouldRender(livingEntity, camera, camX, camY, camZ)) - { - return true; - } else - { - if (livingEntity.getClientTeleportInterp() > 0 && livingEntity.isAttachedToBlock()) - { - BlockPos blockpos = livingEntity.getOldAttachPos(); - BlockPos blockpos1 = livingEntity.getAttachmentPos(); - Vec3d vec3d = new Vec3d(blockpos1.getX(), blockpos1.getY(), blockpos1.getZ()); - Vec3d vec3d1 = new Vec3d(blockpos.getX(), blockpos.getY(), blockpos.getZ()); + @Override + protected void preRenderCallback(EntitySchalker entitylivingbaseIn, float partialTickTime) + { + float f = 0.999F; + GlStateManager.scale(0.999F, 0.999F, 0.999F); + } - return camera.isBoundingBoxInFrustum( - new AxisAlignedBB(vec3d1.x, vec3d1.y, vec3d1.z, vec3d.x, vec3d.y, vec3d.z)); - } + @Override + public boolean shouldRender(EntitySchalker livingEntity, ICamera camera, double camX, double camY, double camZ) + { + if (super.shouldRender(livingEntity, camera, camX, camY, camZ)) + { + return true; + } + else + { + if (livingEntity.getClientTeleportInterp() > 0 && livingEntity.isAttachedToBlock()) + { + BlockPos blockpos = livingEntity.getOldAttachPos(); + BlockPos blockpos1 = livingEntity.getAttachmentPos(); + Vec3d vec3d = new Vec3d(blockpos1.getX(), blockpos1.getY(), blockpos1.getZ()); + Vec3d vec3d1 = new Vec3d(blockpos.getX(), blockpos.getY(), blockpos.getZ()); - return false; - } - } + return camera.isBoundingBoxInFrustum( + new AxisAlignedBB(vec3d1.x, vec3d1.y, vec3d1.z, vec3d.x, vec3d.y, vec3d.z)); + } - @Override - protected ResourceLocation getEntityTexture(EntitySchalker entity) - { - return SCHALKER_TEXTURE[entity.getColor().getMetadata()]; - } + return false; + } + } - @Override - protected void applyRotations(EntitySchalker entityLiving, float p_77043_2_, float rotationYaw, - float partialTicks) - { - super.applyRotations(entityLiving, p_77043_2_, rotationYaw, partialTicks); + @Override + public void doRender(EntitySchalker entity, double x, double y, double z, float entityYaw, float partialTicks) + { + int i = entity.getClientTeleportInterp(); - switch (entityLiving.getAttachmentFacing()) - { - case DOWN: - default: - break; - case EAST: - GlStateManager.translate(0.5F, 0.5F, 0.0F); - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); - break; - case WEST: - GlStateManager.translate(-0.5F, 0.5F, 0.0F); - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F); - break; - case NORTH: - GlStateManager.translate(0.0F, 0.5F, -0.5F); - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - break; - case SOUTH: - GlStateManager.translate(0.0F, 0.5F, 0.5F); - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); - break; - case UP: - GlStateManager.translate(0.0F, 1.0F, 0.0F); - GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); - } - } + if (i > 0 && entity.isAttachedToBlock()) + { + BlockPos blockpos = entity.getAttachmentPos(); + BlockPos blockpos1 = entity.getOldAttachPos(); + double d0 = (i - partialTicks) / 6.0D; + d0 = d0 * d0; + double d1 = (blockpos.getX() - blockpos1.getX()) * d0; + double d2 = (blockpos.getY() - blockpos1.getY()) * d0; + double d3 = (blockpos.getZ() - blockpos1.getZ()) * d0; + super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks); + } + else + { + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + } - @Override - protected void preRenderCallback(EntitySchalker entitylivingbaseIn, float partialTickTime) - { - float f = 0.999F; - GlStateManager.scale(0.999F, 0.999F, 0.999F); - } + @Override + protected ResourceLocation getEntityTexture(EntitySchalker entity) + { + return SCHALKER_TEXTURE[entity.getColor().getMetadata()]; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderSchalker(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderSchalker(manager); + } + } - @SideOnly(Side.CLIENT) - class HeadLayer implements LayerRenderer - { - private HeadLayer() - { - } + @SideOnly(Side.CLIENT) + class HeadLayer implements LayerRenderer + { + private HeadLayer() + { + } - @Override - public void doRenderLayer(EntitySchalker entitylivingbaseIn, float limbSwing, float limbSwingAmount, - float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) - { - GlStateManager.pushMatrix(); + @Override + public void doRenderLayer(EntitySchalker entitylivingbaseIn, float limbSwing, float limbSwingAmount, + float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) + { + GlStateManager.pushMatrix(); - switch (entitylivingbaseIn.getAttachmentFacing()) - { - case DOWN: - default: - break; - case EAST: - GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.translate(1.0F, -1.0F, 0.0F); - GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); - break; - case WEST: - GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F); - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.translate(-1.0F, -1.0F, 0.0F); - GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); - break; - case NORTH: - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.translate(0.0F, -1.0F, -1.0F); - break; - case SOUTH: - GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.translate(0.0F, -1.0F, 1.0F); - break; - case UP: - GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.translate(0.0F, -2.0F, 0.0F); - } + switch (entitylivingbaseIn.getAttachmentFacing()) + { + case DOWN: + default: + break; + case EAST: + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(1.0F, -1.0F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + break; + case WEST: + GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(-1.0F, -1.0F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + break; + case NORTH: + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0.0F, -1.0F, -1.0F); + break; + case SOUTH: + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0.0F, -1.0F, 1.0F); + break; + case UP: + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0.0F, -2.0F, 0.0F); + } - ModelRenderer modelrenderer = RenderSchalker.this.getMainModel().head; - modelrenderer.rotateAngleY = netHeadYaw * 0.017453292F; - modelrenderer.rotateAngleX = headPitch * 0.017453292F; - RenderSchalker.this - .bindTexture(RenderSchalker.SCHALKER_TEXTURE[entitylivingbaseIn.getColor().getMetadata()]); - modelrenderer.render(scale); - GlStateManager.popMatrix(); - } + ModelRenderer modelrenderer = RenderSchalker.this.getMainModel().head; + modelrenderer.rotateAngleY = netHeadYaw * 0.017453292F; + modelrenderer.rotateAngleX = headPitch * 0.017453292F; + RenderSchalker.this + .bindTexture(RenderSchalker.SCHALKER_TEXTURE[entitylivingbaseIn.getColor().getMetadata()]); + modelrenderer.render(scale); + GlStateManager.popMatrix(); + } - @Override - public boolean shouldCombineTextures() - { - return false; - } - } + @Override + public boolean shouldCombineTextures() + { + return false; + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderSmavaCreeper.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderSmavaCreeper.java index bad8022..b4bdeb8 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderSmavaCreeper.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderSmavaCreeper.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper; import net.minecraft.client.model.ModelCreeper; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; @@ -12,58 +11,61 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper; + @SideOnly(Side.CLIENT) public class RenderSmavaCreeper extends RenderLiving { - public static final Factory FACTORY = new Factory(); - private static final ResourceLocation SMAVA_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/smava_creeper.png"); + public static final Factory FACTORY = new Factory(); + private static final ResourceLocation SMAVA_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/smava_creeper.png"); - public RenderSmavaCreeper(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelCreeper(), 0.5F); - } + public RenderSmavaCreeper(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelCreeper(), 0.5F); + } - @Override - protected int getColorMultiplier(EntitySmavaCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) - { - float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); + @Override + protected int getColorMultiplier(EntitySmavaCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) + { + float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); - if ((int) (f * 10.0F) % 2 == 0) - { - return 0; - } else - { - int i = (int) (f * 0.2F * 255.0F); - i = MathHelper.clamp(i, 0, 255); - return i << 24 | 822083583; - } - } + if ((int) (f * 10.0F) % 2 == 0) + { + return 0; + } + else + { + int i = (int) (f * 0.2F * 255.0F); + i = MathHelper.clamp(i, 0, 255); + return i << 24 | 822083583; + } + } - @Override - protected ResourceLocation getEntityTexture(EntitySmavaCreeper entity) - { - return SMAVA_TEXTURE; - } + @Override + protected void preRenderCallback(EntitySmavaCreeper entitylivingbaseIn, float partialTickTime) + { + float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); + float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F; + f = MathHelper.clamp(f, 0.0F, 1.0F); + f = f * f; + f = f * f; + float f2 = (1.0F + f * 0.4F) * f1; + float f3 = (1.0F + f * 0.1F) / f1; + GlStateManager.scale(f2, f3, f2); + } - @Override - protected void preRenderCallback(EntitySmavaCreeper entitylivingbaseIn, float partialTickTime) - { - float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); - float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F; - f = MathHelper.clamp(f, 0.0F, 1.0F); - f = f * f; - f = f * f; - float f2 = (1.0F + f * 0.4F) * f1; - float f3 = (1.0F + f * 0.1F) / f1; - GlStateManager.scale(f2, f3, f2); - } + @Override + protected ResourceLocation getEntityTexture(EntitySmavaCreeper entity) + { + return SMAVA_TEXTURE; + } - public static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderSmavaCreeper(manager); - } - } + public static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderSmavaCreeper(manager); + } + } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/spackenmobs/render/RenderTileraGhast.java b/src/main/java/mod/acgaming/spackenmobs/render/RenderTileraGhast.java index d8dd584..b8f57c7 100644 --- a/src/main/java/mod/acgaming/spackenmobs/render/RenderTileraGhast.java +++ b/src/main/java/mod/acgaming/spackenmobs/render/RenderTileraGhast.java @@ -1,6 +1,5 @@ package mod.acgaming.spackenmobs.render; -import mod.acgaming.spackenmobs.entities.EntityTileraGhast; import net.minecraft.client.model.ModelGhast; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; @@ -11,38 +10,40 @@ import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import mod.acgaming.spackenmobs.entities.EntityTileraGhast; + @SideOnly(Side.CLIENT) public class RenderTileraGhast extends RenderLiving { - public static final RenderTileraGhast.Factory FACTORY = new RenderTileraGhast.Factory(); - private static final ResourceLocation TILERA_GHAST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/tilera_ghast.png"); - private static final ResourceLocation TILERA_GHAST_SHOOTING_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/tilera_ghast_shooting.png"); + public static final RenderTileraGhast.Factory FACTORY = new RenderTileraGhast.Factory(); + private static final ResourceLocation TILERA_GHAST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/tilera_ghast.png"); + private static final ResourceLocation TILERA_GHAST_SHOOTING_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/tilera_ghast_shooting.png"); - public RenderTileraGhast(RenderManager renderManagerIn) - { - super(renderManagerIn, new ModelGhast(), 0.5F); - } + public RenderTileraGhast(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelGhast(), 0.5F); + } - protected ResourceLocation getEntityTexture(EntityTileraGhast entity) - { - return entity.isAttacking() ? TILERA_GHAST_SHOOTING_TEXTURE : TILERA_GHAST_TEXTURE; - } + protected ResourceLocation getEntityTexture(EntityTileraGhast entity) + { + return entity.isAttacking() ? TILERA_GHAST_SHOOTING_TEXTURE : TILERA_GHAST_TEXTURE; + } - protected void preRenderCallback(EntityTileraGhast entitylivingbaseIn, float partialTickTime) - { - float f = 1.0F; - float f1 = 4.5F; - float f2 = 4.5F; - GlStateManager.scale(4.5F, 4.5F, 4.5F); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - } + protected void preRenderCallback(EntityTileraGhast entitylivingbaseIn, float partialTickTime) + { + float f = 1.0F; + float f1 = 4.5F; + float f2 = 4.5F; + GlStateManager.scale(4.5F, 4.5F, 4.5F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } - private static class Factory implements IRenderFactory - { - @Override - public Render createRenderFor(RenderManager manager) - { - return new RenderTileraGhast(manager); - } - } + private static class Factory implements IRenderFactory + { + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderTileraGhast(manager); + } + } } \ No newline at end of file diff --git a/src/main/resources/assets/spackenmobs/lang/de_de.lang b/src/main/resources/assets/spackenmobs/lang/de_de.lang index 6d51d23..e857711 100644 --- a/src/main/resources/assets/spackenmobs/lang/de_de.lang +++ b/src/main/resources/assets/spackenmobs/lang/de_de.lang @@ -14,12 +14,11 @@ entity.apored.name=ApoRed entity.bakamitai_creeper.name=Baka Mitai-Creeper entity.drachenlord.name=Drachenlord entity.friedrich.name=Friedrich Liechtenstein +entity.gisela.name=Gisela entity.holzstammhuhn.name=Holzstammhuhn entity.islamist.name=Islamist -entity.itbyhf.name=ITbyHF entity.jens.name=Jens entity.jens_wither.name=Jens-Wither -entity.latin_teacher.name=Lateinlehrerin entity.marcell_davis.name=Marcell D'Avis entity.mr_bean.name=Mr. Bean entity.mztewolf.name=MZTEWolf diff --git a/src/main/resources/assets/spackenmobs/lang/en_us.lang b/src/main/resources/assets/spackenmobs/lang/en_us.lang index 6749eb5..b8de517 100644 --- a/src/main/resources/assets/spackenmobs/lang/en_us.lang +++ b/src/main/resources/assets/spackenmobs/lang/en_us.lang @@ -14,12 +14,11 @@ entity.apored.name=ApoRed entity.bakamitai_creeper.name=Baka Mitai Creeper entity.drachenlord.name=Drachenlord entity.friedrich.name=Friedrich Liechtenstein +entity.gisela.name=Gisela entity.holzstammhuhn.name=Holzstammhuhn entity.islamist.name=Islamist -entity.itbyhf.name=ITbyHF entity.jens.name=Jens entity.jens_wither.name=Jens Wither -entity.latin_teacher.name=Latin Teacher entity.marcell_davis.name=Marcell D'Avis entity.mr_bean.name=Mr. Bean entity.mztewolf.name=MZTEWolf @@ -32,4 +31,4 @@ item.ram.name=RAM item.ram_on_a_stick.name=RAM on a Stick item.surstroemming.name=Surströmming itemGroup.spackenmobs=Spackenmobs -spackenmobs.config.title=Spackenmobs settings \ No newline at end of file +spackenmobs.config.title=Spackenmobs Settings \ No newline at end of file diff --git a/src/main/resources/assets/spackenmobs/textures/entities/gisela.png b/src/main/resources/assets/spackenmobs/textures/entities/gisela.png new file mode 100644 index 0000000000000000000000000000000000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*let#)G5jeoSt*OMC|3u;>$!84smBb)++4Q{f)lFI(_KuYiX}wlE7m#26Tl@PL`ui`8cU2dv zK-rt^0ELb3m2N)Zm^hX(v(2!+S_mC&F#|5;Z6Ime3Qg2bQATNGyjDdPST}XXAgt1f zg^m&7F|YFmHkB0^{fLFz)I(02;EduAR@|oOHtvC^Af&_H>&A_inBv9V6ZluN`P-&D zs9%1p8N#gv0*S+%so<7_0*YcYmW$iSCKkq16}Uk;oEmyI*aq-yp5FXqibqjCsZ1%e zS5?70#^T+?(}yOr^3JOS*=W?&sUY|C@3(2=!lU|BYsm&kh9ey9-NJHJop_(`^E6xh zT-UX*mg54zZESb^_)9#1DEwu*Tnc}`;sZnL$3M(p<7kONx({PCROKA++P%7(Zt z$^hVYg?7>V_##5cu<=#0#6rvRYLUZm3e!NO&VUQg` z7;e3zqZ3YiNg%-WZr@JLi;H8!TUuM&2}nuZK@NDW#1k9iq*Fv3OcL9>y6iOmjG;Th za#xhy<*R@DDJ|amB77cmKD>@0b4fX{&K$y?kE3&BPG!0j3=$?0hao%A^1HoEQ@AXS zT}1`YE`wD?%CJh!NKL_#KJ3A1gY}C2VmoC z)C^9lLU5P!wz07>OzhI7<~#cO(Zp+titx_v?$>#fleTy!=A&1yUWEnX@f~-pfRnVg zwu0z98$X-ab9%Qo%w{_}et1Ccx1=jHy zc`xtkAFF#b>uLcKO1{i1XzMmaSEh-utE=NHH@=tu4y`_t(1pde?mvPq=M~R8fId}5 z#&tRdfX*VdmXj*%S)uW0m)rn-=dRg+&gZ{q>fcF(|I-YVAgU{_v}7a(an+Z|b@SC5 zk@(aLc+HqgSCKMGN-&R+NPPe$l-JrRAj6D%Ba*|)&dUrV$axeKvA1r4M~l>(^4q=~ zxig!V$C&{p>KlxB>&J6%``r2 cSJOed=}87dAzDI!8ys>&332`HHPc7`0lQ~wApigX literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/spackenmobs/textures/entities/itbyhf.png b/src/main/resources/assets/spackenmobs/textures/entities/itbyhf.png deleted file mode 100644 index 2d43813525b1ad205f60ec980a2b0e42e64e4a0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15705 zcmeI3e{37o9l$TNg)}5m8&FzMG)_jFw!!&+`26FpwuxgWO*WjSZBX596+PcQJ4bDw z@m*pk>!?XbwW5dtQ$^^8RH1FCqATTBS5&G&DPz*msxeL4CZw%&TN#BCR%vUgMEB0W z{o=f3qSF3(mVbTU_kF+L_deh6``-O?dq+pscXiy_K~YrK@K9tE{OyAuy8U|i{q$20 zd>8(#%nofeDeA_X>`xoD|3_;nYF$_#i&?Sg-Lh(=or-3}fwPd#!r2t%zpIc{)E&U0 z;~=SL0*;T5|H47*TEMZz9p$3gFc{Z|rgLEP^vIYxy+f5W$6dh=e?f*0(!f&aLOPW( z4|!BnmpN>Mb{1r`XXkwrfgO!g>r`c zaIbPW2NcW5jTuHNSgx|sDndFOwyVlZe|d|Z(Tu$L6+erb)bm~U1|o_Df&wRS3=iMZ z7%$1ZSLVb!I6>yP1}Ej2h>xhD>4~WpK130gb)%1lnWztVel*2WmgJ>zZi639l@mrT ztyn=ltt0`P%_RM7eXwC>t*Yd(kuq{{Ss>{0v#o|(T15lw6+;6qpBVCm!hY61qHtn8dZhv?~gB&;~B48go}y`8pFAOi%V#6N#OZXr8b+_307QJqgPzpTjjiogb??LjL*v@7)})d zqlf}vG_NP_atXW|ml9Ri4dx46Z^-HJa-yUf=2U6^FCkjESrBSSx9e`Ixj;&Fw;9~u zJX){2Qsd7mITP4zE#Rp3wc3@UTx69}E44>iQSD1cP_?@b(EM!EXnk2VOMiKSzA%AH zL$JVn@fi7Wkim7Wva8ap#hsW&!pbW-5K6-Hyp)Do_S$TQx^I0hu1O+HW%Bc-VQJ^+ z^QEDw@&EtQU;{5lSI3o15@Ti%n=t)Nheh731Y**7NTtLA2S z4-JAIx7+3Rv*<8tF{&3pDi+b{JNf}^Mpwo{ZmM^S5x$M1b}kfPci9gc*?3V-@=?)i~7`a1Un z9(%UGd+#gHy;Xd)uh>T~@BG>O{r4O^{rbt*im_EUh1Z`tIocEJUxVhcJ*6NcK+q^ zzvyKj_Pl&+&+E43s=Ig1-uCJby1%r$C-`Z{_n*4?Z06xBXP0l-_RyJ!_dR{7>&UU= z$5tG9qC0ccF}to~%?|#s_lf&oUVV0QUA*mA7kdva+y7qA`JUG{4zB%Zz3<*_C;v7* z``ggWX=TsxZC|H$o-V#IJO98>=ik{}IG-%|hPhi_n%{Zf#_MK2-tzO+k8jw!Z|+dn z*JjRS9{RQaho4^g!7*fB*5fJ1?yI$sK#Tij!}4bHh{Tx?|ffzSzEha_xh= zKD(2aPR)7Wox61Q)!pBG@ekeEw&InyKS_2TxNqeUrO!N@Tz&IV{&)Yr^v4xneb;lI c+Sx^YwCm`;*;M1& diff --git a/src/main/resources/assets/spackenmobs/textures/entities/latin_teacher.png b/src/main/resources/assets/spackenmobs/textures/entities/latin_teacher.png deleted file mode 100644 index 0e6075fc0f8258f326567dabd59ff8cb8c225229..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23710 zcmeHv2{@GN-~WRo9622)iY#$jHO4YyGBK1W91*e%gTY{CFk)oO)~1fcDQ%++CfQNV%`h(mcO+UmR>rTXxmE3S%ct1Vmk%}5+CA^28vK`!9-Q3?0 z=Z)VT7J#!3+hgM%Ms(NlP}WC@>4qRd1->{kRw=~S$1e~WqNhBk7YTmn4nvid=2*x? zJ>~6OgG%=1mP&@C0GtwBO&j8_p|w>Bp`)e&*V(EG+oGhYuAvQ8*MVxlAnF=ObseO- zhSH~|j1mLC=>~XsBCU2Be=-O5^pw5HWPcsnTxPOuH4+`*^o0^9^6z7BU#rcr~K{<^d%K3Yf$fQ7T(m$B|LjFg? zU`))-zu5lae0_a?XgZK=bO40l6QnW372LcQCaR01& zf%tc-Eduahna27o;Ni~x|JB3~)O=@ZH=Y~MP#)m9(Xhtt|913iJm(6kKQ_w!=Q-(m+R+(`u{HsT)^k8 zyL)5(yl@^U=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