2
1
Fork 1
mirror of https://github.com/ACGaming/Spackenmobs synced 2024-06-02 10:40:05 +02:00

Compare commits

...

3 commits

Author SHA1 Message Date
ACGaming 4d2572db2c Fix Gisela, nerf spawn rates 2021-09-13 20:00:16 +02:00
ACGaming 0c3f8dfe27 Merge 1.16 sounds, bump version 2021-09-13 19:11:25 +02:00
ACGaming e85e6a4e30 Backport Gisela, reformatting, misc 2021-09-13 19:03:13 +02:00
100 changed files with 5202 additions and 5388 deletions

View file

@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = "RC7"
version = "RC8"
group = "mod.acgaming.spackenmobs" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Spackenmobs-1.12.2"

View file

@ -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,11 +10,13 @@ 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 VERSION = "RC8";
public static final CreativeTabs SPACKENMOBS_TAB = new SpackenmobsTab();

View file

@ -1,11 +1,12 @@
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()

View file

@ -1,11 +1,12 @@
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)

View file

@ -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,8 +30,8 @@ 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
{
@ -49,84 +50,6 @@ public class EntityBakaMitaiCreeper extends EntityMob
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));
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
public void onUpdate()
{
if (this.isEntityAlive())
@ -171,6 +94,17 @@ public class EntityBakaMitaiCreeper extends EntityMob
return SoundEvents.ENTITY_CREEPER_DEATH;
}
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
@ -183,7 +117,8 @@ public class EntityBakaMitaiCreeper extends EntityMob
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())
}
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);
@ -191,9 +126,15 @@ public class EntityBakaMitaiCreeper extends EntityMob
}
}
public boolean attackEntityAsMob(Entity entityIn)
public void fall(float distance, float damageMultiplier)
{
return true;
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
public boolean getPowered()
@ -207,12 +148,6 @@ public class EntityBakaMitaiCreeper extends EntityMob
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2);
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
public int getCreeperState()
{
return this.dataManager.get(STATE);
@ -229,6 +164,93 @@ public class EntityBakaMitaiCreeper extends EntityMob
this.dataManager.set(POWERED, Boolean.TRUE);
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
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));
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
@ -284,24 +306,4 @@ public class EntityBakaMitaiCreeper extends EntityMob
this.world.spawnEntity(entityareaeffectcloud);
}
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
}

View file

@ -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,8 +26,7 @@ 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
{
@ -54,56 +55,6 @@ public class EntityDrachenlord extends EntityZombie
}
}
@Override
protected void applyEntityAI()
{
this.targetTasks.addTask(1, new EntityDrachenlord.AIHurtByAggressor(this));
this.targetTasks.addTask(2, new EntityDrachenlord.AITargetAggressor(this));
}
@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
protected void updateAITasks()
{
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);
if (this.isAngry())
{
if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
{
iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER);
}
--this.angerLevel;
} else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
{
iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER);
}
if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0)
{
this.playSound(ModSoundEvents.ENTITY_DRACHENLORD_ANGRY, this.getSoundVolume() * 2.0F, 1.0F);
}
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();
}
super.updateAITasks();
}
@Override
public boolean getCanSpawnHere()
{
@ -111,66 +62,9 @@ public class EntityDrachenlord extends EntityZombie
}
@Override
public boolean isNotColliding()
public boolean isPreventingPlayerRest(EntityPlayer playerIn)
{
return this.world.checkNoEntityCollision(this.getEntityBoundingBox(), this)
&& this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty()
&& !this.world.containsAnyLiquid(this.getEntityBoundingBox());
}
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setShort("Anger", (short) this.angerLevel);
if (this.angerTargetUUID != null)
{
compound.setString("HurtBy", this.angerTargetUUID.toString());
} else
{
compound.setString("HurtBy", "");
}
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.angerLevel = compound.getShort("Anger");
String s = compound.getString("HurtBy");
if (!s.isEmpty())
{
this.angerTargetUUID = UUID.fromString(s);
EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID);
this.setRevengeTarget(entityplayer);
if (entityplayer != null)
{
this.attackingPlayer = entityplayer;
this.recentlyHit = this.getRevengeTimer();
}
}
}
@Override
public boolean attackEntityFrom(DamageSource source, float amount)
{
if (this.isEntityInvulnerable(source))
{
return false;
} else
{
Entity entity = source.getTrueSource();
if (entity instanceof EntityPlayer)
{
this.becomeAngryAt(entity);
}
return super.attackEntityFrom(source, amount);
}
return this.isAngry();
}
public void becomeAngryAt(Entity p_70835_1_)
@ -189,6 +83,42 @@ public class EntityDrachenlord extends EntityZombie
return this.angerLevel > 0;
}
@Override
protected void applyEntityAI()
{
this.targetTasks.addTask(1, new EntityDrachenlord.AIHurtByAggressor(this));
this.targetTasks.addTask(2, new EntityDrachenlord.AITargetAggressor(this));
}
@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 attackEntityFrom(DamageSource source, float amount)
{
if (this.isEntityInvulnerable(source))
{
return false;
}
else
{
Entity entity = source.getTrueSource();
if (entity instanceof EntityPlayer)
{
this.becomeAngryAt(entity);
}
return super.attackEntityFrom(source, amount);
}
}
@Override
protected SoundEvent getAmbientSound()
{
@ -214,18 +144,49 @@ public class EntityDrachenlord extends EntityZombie
return LootTableList.ENTITIES_ZOMBIE_PIGMAN;
}
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
return false;
}
@Override
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
{
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_AXE));
}
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setShort("Anger", (short) this.angerLevel);
if (this.angerTargetUUID != null)
{
compound.setString("HurtBy", this.angerTargetUUID.toString());
}
else
{
compound.setString("HurtBy", "");
}
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.angerLevel = compound.getShort("Anger");
String s = compound.getString("HurtBy");
if (!s.isEmpty())
{
this.angerTargetUUID = UUID.fromString(s);
EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID);
this.setRevengeTarget(entityplayer);
if (entityplayer != null)
{
this.attackingPlayer = entityplayer;
this.recentlyHit = this.getRevengeTimer();
}
}
}
@Override
protected ItemStack getSkullDrop()
{
@ -233,9 +194,52 @@ public class EntityDrachenlord extends EntityZombie
}
@Override
public boolean isPreventingPlayerRest(EntityPlayer playerIn)
protected void updateAITasks()
{
return this.isAngry();
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);
if (this.isAngry())
{
if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
{
iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER);
}
--this.angerLevel;
}
else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
{
iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER);
}
if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0)
{
this.playSound(ModSoundEvents.ENTITY_DRACHENLORD_ANGRY, this.getSoundVolume() * 2.0F, 1.0F);
}
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();
}
super.updateAITasks();
}
@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 processInteract(EntityPlayer player, EnumHand hand)
{
return false;
}
static class AIHurtByAggressor extends EntityAIHurtByTarget

View file

@ -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,6 +16,10 @@ 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)
@ -49,6 +50,18 @@ public class EntityFriedrichLiechtenstein extends EntityCreature implements IMer
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT;
}
@Override
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_FRIEDRICH;
}
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
@ -70,13 +83,15 @@ public class EntityFriedrichLiechtenstein extends EntityCreature implements IMer
if (itemstack.isEmpty())
{
player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK));
} else if (!player.inventory.addItemStackToInventory(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 if (itemstack.getItem() == Items.PAPER)
}
else if (itemstack.getItem() == Items.PAPER)
{
player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT, 1.0F, 1.0F);
for (int i = 0; i < 7; ++i)
@ -91,30 +106,20 @@ public class EntityFriedrichLiechtenstein extends EntityCreature implements IMer
if (itemstack.isEmpty())
{
player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE));
} else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE)))
}
else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE)))
{
player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE), false);
}
return true;
} else
}
else
{
return super.processInteract(player, hand);
}
}
@Override
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_FRIEDRICH;
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{

View file

@ -0,0 +1,71 @@
package mod.acgaming.spackenmobs.entities;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
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;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
public class EntityGisela extends EntityAnimal
{
public EntityGisela(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.8F);
}
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, false));
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));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<>(this, EntityLiving.class, true));
}
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 ModSoundEvents.ENTITY_GISELA_AMBIENT;
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_GISELA_HURT;
}
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_GISELA_HURT;
}
protected void playStepSound(BlockPos pos, Block blockIn)
{
this.playSound(SoundEvents.ENTITY_COW_STEP, 0.15F, 1.0F);
}
}

View file

@ -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,8 +18,6 @@ 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<Item> TEMPTATION_ITEMS = Sets.newHashSet(Items.STICK);
@ -43,12 +43,6 @@ public class EntityHolzstammhuhn extends EntityChicken
this.tasks.addTask(7, new EntityAILookIdle(this));
}
@Override
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
@Override
protected SoundEvent getAmbientSound()
{
@ -78,4 +72,10 @@ public class EntityHolzstammhuhn extends EntityChicken
{
return new EntityHolzstammhuhn(this.world);
}
@Override
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
}

View file

@ -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;
}
}

View file

@ -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,8 +30,8 @@ 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
{
@ -49,84 +50,6 @@ public class EntityIslamist extends EntityMob
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));
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
public void onUpdate()
{
if (this.isEntityAlive())
@ -171,6 +94,17 @@ public class EntityIslamist extends EntityMob
return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT;
}
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
@ -183,7 +117,8 @@ public class EntityIslamist extends EntityMob
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())
}
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);
@ -191,9 +126,15 @@ public class EntityIslamist extends EntityMob
}
}
public boolean attackEntityAsMob(Entity entityIn)
public void fall(float distance, float damageMultiplier)
{
return true;
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
public boolean getPowered()
@ -207,12 +148,6 @@ public class EntityIslamist extends EntityMob
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2);
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
public int getCreeperState()
{
return this.dataManager.get(STATE);
@ -229,6 +164,93 @@ public class EntityIslamist extends EntityMob
this.dataManager.set(POWERED, Boolean.TRUE);
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
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));
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
@ -284,24 +306,4 @@ public class EntityIslamist extends EntityMob
this.world.spawnEntity(entityareaeffectcloud);
}
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
}

View file

@ -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,8 +26,12 @@ 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
{
@ -52,92 +53,14 @@ public class EntityJens extends EntityAnimal
}
@Override
protected void initEntityAI()
public void onDeath(DamageSource cause)
{
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));
}
super.onDeath(cause);
@Override
protected void applyEntityAttributes()
if (!this.world.isRemote)
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Nullable
public Entity getControllingPassenger()
{
return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
}
@Override
public boolean canBeSteered()
{
Entity entity = this.getControllingPassenger();
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
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);
}
super.notifyDataManagerChange(key);
}
@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 writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setBoolean("Digesting", this.digesting);
compound.setInteger("DigestTime", this.digestTime);
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.digesting = compound.getBoolean("Digesting");
this.digestTime = compound.getInteger("DigestTime");
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_JENS_AMBIENT;
}
@Override
@ -152,62 +75,6 @@ public class EntityJens extends EntityAnimal
return ModSoundEvents.ENTITY_JENS_DEATH;
}
@Override
protected void playStepSound(BlockPos pos, Block blockIn)
{
this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F);
}
@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 void onDeath(DamageSource cause)
{
super.onDeath(cause);
if (!this.world.isRemote)
{
}
}
@Override
@Nullable
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_JENS;
}
@Override
public void travel(float strafe, float vertical, float forward)
{
@ -240,7 +107,8 @@ public class EntityJens extends EntityAnimal
this.setAIMoveSpeed(f);
super.travel(0.0F, 0.0F, 1.0F);
} else
}
else
{
this.motionX = 0.0D;
this.motionY = 0.0D;
@ -259,7 +127,8 @@ public class EntityJens extends EntityAnimal
this.limbSwingAmount += (f1 - this.limbSwingAmount) * 0.4F;
this.limbSwing += this.limbSwingAmount;
} else
}
else
{
this.stepHeight = 0.5F;
this.jumpMovementFactor = 0.02F;
@ -272,7 +141,8 @@ public class EntityJens extends EntityAnimal
if (this.boosting)
{
return false;
} else
}
else
{
this.boosting = true;
this.boostTime = 0;
@ -289,9 +159,25 @@ public class EntityJens extends EntityAnimal
}
@Override
public boolean isBreedingItem(ItemStack stack)
protected void entityInit()
{
return TEMPTATION_ITEMS.contains(stack.getItem());
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);
}
super.notifyDataManagerChange(key);
}
public boolean isFishItem(ItemStack stack)
@ -331,6 +217,64 @@ public class EntityJens extends EntityAnimal
}
}
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setBoolean("Digesting", this.digesting);
compound.setInteger("DigestTime", this.digestTime);
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.digesting = compound.getBoolean("Digesting");
this.digestTime = compound.getInteger("DigestTime");
}
@Override
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
@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 void digestFish()
{
this.playSound(SoundEvents.ENTITY_PLAYER_BURP, 1.0F, 1.0F);
@ -352,4 +296,69 @@ public class EntityJens extends EntityAnimal
this.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, ModConfigs.Jens_digest_time * 20));
}
@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
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_JENS_AMBIENT;
}
@Override
@Nullable
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_JENS;
}
@Override
public boolean canBeSteered()
{
Entity entity = this.getControllingPassenger();
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 void playStepSound(BlockPos pos, Block blockIn)
{
this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F);
}
@Nullable
public Entity getControllingPassenger()
{
return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
}
}

View file

@ -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,19 +36,23 @@ 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<Integer> FIRST_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT);
private static final DataParameter<Integer> SECOND_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT);
private static final DataParameter<Integer> THIRD_HEAD_TARGET = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT);
private static final DataParameter<Integer>[] HEAD_TARGETS = new DataParameter[]{FIRST_HEAD_TARGET, SECOND_HEAD_TARGET, THIRD_HEAD_TARGET};
private static final DataParameter<Integer>[] HEAD_TARGETS = new DataParameter[] {FIRST_HEAD_TARGET, SECOND_HEAD_TARGET, THIRD_HEAD_TARGET};
private static final DataParameter<Integer> INVULNERABILITY_TIME = EntityDataManager.createKey(EntityJensWither.class, DataSerializers.VARINT);
/**
* Selector used to determine the entities a wither boss should attack.
*/
private static final Predicate<Entity> 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];
@ -69,79 +75,6 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
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.
@ -215,7 +148,8 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
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
}
else
{
this.yRotationHeads[j] = this.rotlerp(this.yRotationHeads[j], this.renderYawOffset, 10.0F);
}
@ -245,6 +179,292 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
}
}
/**
* 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)
@ -263,7 +483,8 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
{
this.heal(10.0F);
}
} else
}
else
{
super.updateAITasks();
@ -302,17 +523,20 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.disableDamage)
{
this.updateWatchedTargetId(i, 0);
} else
}
else
{
this.launchWitherSkullToEntity(i + 1, (EntityLivingBase) entity);
this.nextHeadUpdate[i - 1] = this.ticksExisted + 40 + this.rand.nextInt(20);
this.idleHeadUpdates[i - 1] = 0;
}
} else
}
else
{
this.updateWatchedTargetId(i, 0);
}
} else
}
else
{
List<EntityLivingBase> list = this.world.getEntitiesWithinAABB(EntityLivingBase.class, this.getEntityBoundingBox().grow(20.0D, 8.0D, 20.0D), Predicates.and(NOT_UNDEAD, EntitySelectors.NOT_SPECTATING));
@ -328,7 +552,8 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
{
this.updateWatchedTargetId(i, entitylivingbase.getEntityId());
}
} else
}
else
{
this.updateWatchedTargetId(i, entitylivingbase.getEntityId());
}
@ -345,7 +570,8 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
if (this.getAttackTarget() != null)
{
this.updateWatchedTargetId(0, this.getAttackTarget().getEntityId());
} else
}
else
{
this.updateWatchedTargetId(0, 0);
}
@ -398,48 +624,13 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
}
}
/**
* 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
}
else
{
float f = (this.renderYawOffset + (float) (180 * (p_82214_1_ - 1))) * 0.017453292F;
float f1 = MathHelper.cos(f);
@ -457,7 +648,8 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
if (p_82213_1_ <= 0)
{
return this.posZ;
} else
}
else
{
float f = (this.renderYawOffset + (float) (180 * (p_82213_1_ - 1))) * 0.017453292F;
float f1 = MathHelper.sin(f);
@ -512,184 +704,6 @@ public class EntityJensWither extends EntityMob implements IRangedAttackMob
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()

View file

@ -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<Boolean> 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<PotionEffect> 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)
{
}
}

View file

@ -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,8 +12,6 @@ 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)
@ -42,23 +42,28 @@ public class EntityMZTEWolf extends EntityWolf
if (otherAnimal == this)
{
return false;
} else if (!this.isTamed())
}
else if (!this.isTamed())
{
return false;
} else if (!(otherAnimal instanceof EntityMZTEWolf))
}
else if (!(otherAnimal instanceof EntityMZTEWolf))
{
return false;
} else
}
else
{
EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) otherAnimal;
if (!entitymztewolf.isTamed())
{
return false;
} else if (entitymztewolf.isSitting())
}
else if (entitymztewolf.isSitting())
{
return false;
} else
}
else
{
return this.isInLove() && entitymztewolf.isInLove();
}
@ -84,11 +89,13 @@ public class EntityMZTEWolf extends EntityWolf
&& !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target))
{
return false;
} else
}
else
{
return !(target instanceof AbstractHorse) || !((AbstractHorse) target).isTame();
}
} else
}
else
{
return false;
}

View file

@ -1,11 +1,12 @@
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)

View file

@ -1,11 +1,12 @@
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)

View file

@ -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,9 +35,7 @@ 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
{
@ -67,16 +68,206 @@ public class EntitySchalker extends EntityGolem implements IMob
}
@Override
@Nullable
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata)
public void setPosition(double x, double y, double z)
{
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);
super.setPosition(x, y, z);
if (this.dataManager != null && this.ticksExisted != 0)
{
Optional<BlockPos> optional = this.dataManager.get(ATTACHED_BLOCK_POS);
Optional<BlockPos> 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
@ -91,55 +282,6 @@ public class EntitySchalker extends EntityGolem implements IMob
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()
{
@ -154,39 +296,21 @@ public class EntitySchalker extends EntityGolem implements IMob
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
protected void entityInit()
{
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());
}
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 writeEntityToNBT(NBTTagCompound compound)
public void playLivingSound()
{
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)
if (!this.isClosed())
{
compound.setInteger("APX", blockpos.getX());
compound.setInteger("APY", blockpos.getY());
compound.setInteger("APZ", blockpos.getZ());
super.playLivingSound();
}
}
@ -210,7 +334,8 @@ public class EntitySchalker extends EntityGolem implements IMob
this.renderYawOffset = f;
this.prevRenderYawOffset = f;
this.clientSideTeleportInterpolation = 0;
} else if (!this.world.isRemote)
}
else if (!this.world.isRemote)
{
IBlockState iblockstate = this.world.getBlockState(blockpos);
@ -224,11 +349,13 @@ public class EntitySchalker extends EntityGolem implements IMob
{
blockpos = blockpos.offset(enumfacing);
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos));
} else
}
else
{
this.tryTeleportToNewPosition();
}
} else if (iblockstate.getBlock() == Blocks.PISTON_HEAD)
}
else if (iblockstate.getBlock() == Blocks.PISTON_HEAD)
{
EnumFacing enumfacing3 = iblockstate.getValue(BlockDirectional.FACING);
@ -236,11 +363,13 @@ public class EntitySchalker extends EntityGolem implements IMob
{
blockpos = blockpos.offset(enumfacing3);
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos));
} else
}
else
{
this.tryTeleportToNewPosition();
}
} else
}
else
{
this.tryTeleportToNewPosition();
}
@ -284,7 +413,8 @@ public class EntitySchalker extends EntityGolem implements IMob
if (this.peekAmount > f1)
{
this.peekAmount = MathHelper.clamp(this.peekAmount - 0.05F, f1, 1.0F);
} else if (this.peekAmount < f1)
}
else if (this.peekAmount < f1)
{
this.peekAmount = MathHelper.clamp(this.peekAmount + 0.05F, 0.0F, f1);
}
@ -296,7 +426,8 @@ public class EntitySchalker extends EntityGolem implements IMob
if (this.clientSideTeleportInterpolation > 0 && this.currentAttachmentPosition != null)
{
--this.clientSideTeleportInterpolation;
} else
}
else
{
this.currentAttachmentPosition = blockpos;
}
@ -379,34 +510,103 @@ public class EntitySchalker extends EntityGolem implements IMob
}
@Override
public void move(MoverType type, double x, double y, double z)
public void writeEntityToNBT(NBTTagCompound compound)
{
if (type == MoverType.SHULKER_BOX)
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)
{
this.tryTeleportToNewPosition();
} else
{
super.move(type, x, y, z);
compound.setInteger("APX", blockpos.getX());
compound.setInteger("APY", blockpos.getY());
compound.setInteger("APZ", blockpos.getZ());
}
}
@Override
public void setPosition(double x, double y, double z)
public void readEntityFromNBT(NBTTagCompound compound)
{
super.setPosition(x, y, z);
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 (this.dataManager != null && this.ticksExisted != 0)
if (compound.hasKey("APX"))
{
Optional<BlockPos> optional = this.dataManager.get(ATTACHED_BLOCK_POS);
Optional<BlockPos> optional1 = Optional.of(new BlockPos(x, y, z));
if (!optional1.equals(optional))
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, optional1);
this.dataManager.set(PEEK_TICK, (byte) 0);
this.isAirBorne = true;
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()
@ -456,204 +656,18 @@ public class EntitySchalker extends EntityGolem implements IMob
}
return false;
} else
}
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<EntityLivingBase>
{
public AIDefenseAttack(EntitySchalker schalker)
@ -682,7 +696,8 @@ public class EntitySchalker extends EntityGolem implements IMob
if (enumfacing.getAxis() == EnumFacing.Axis.X)
{
return this.taskOwner.getEntityBoundingBox().grow(4.0D, targetDistance, targetDistance);
} else
}
else
{
return enumfacing.getAxis() == EnumFacing.Axis.Z
? this.taskOwner.getEntityBoundingBox().grow(targetDistance, targetDistance, 4.0D)
@ -721,7 +736,8 @@ public class EntitySchalker extends EntityGolem implements IMob
if (entitylivingbase != null && entitylivingbase.isEntityAlive())
{
return EntitySchalker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL;
} else
}
else
{
return false;
}
@ -765,7 +781,8 @@ public class EntitySchalker extends EntityGolem implements IMob
(EntitySchalker.this.rand.nextFloat() - EntitySchalker.this.rand.nextFloat()) * 0.2F
+ 1.0F);
}
} else
}
else
{
EntitySchalker.this.setAttackTarget(null);
}
@ -796,7 +813,8 @@ public class EntitySchalker extends EntityGolem implements IMob
if (enumfacing.getAxis() == EnumFacing.Axis.X)
{
return this.taskOwner.getEntityBoundingBox().grow(4.0D, targetDistance, targetDistance);
} else
}
else
{
return enumfacing.getAxis() == EnumFacing.Axis.Z
? this.taskOwner.getEntityBoundingBox().grow(targetDistance, targetDistance, 4.0D)

View file

@ -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,8 +30,8 @@ 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
{
@ -50,17 +51,53 @@ public class EntitySmavaCreeper extends EntityMob
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
protected void initEntityAI()
public void onUpdate()
{
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));
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
if (this.hasIgnited())
{
this.setCreeperState(1);
}
int i = this.getCreeperState();
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE, 1.0F, 1.0F);
}
this.timeSinceIgnited += i;
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_SMAVACREEPER_HURT;
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_CREEPER_DEATH;
}
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
protected void applyEntityAttributes()
@ -69,9 +106,25 @@ public class EntitySmavaCreeper extends EntityMob
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
public int getMaxFallHeight()
public void onDeath(DamageSource cause)
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
super.onDeath(cause);
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 fall(float distance, float damageMultiplier)
@ -85,6 +138,66 @@ public class EntitySmavaCreeper extends EntityMob
}
}
public boolean getPowered()
{
return this.dataManager.get(POWERED);
}
@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 int getCreeperState()
{
return this.dataManager.get(STATE);
}
public void setCreeperState(int state)
{
this.dataManager.set(STATE, state);
}
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.TRUE);
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
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));
}
protected void entityInit()
{
super.entityInit();
@ -93,6 +206,11 @@ public class EntitySmavaCreeper extends EntityMob
this.dataManager.register(IGNITED, Boolean.FALSE);
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT;
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
@ -128,111 +246,15 @@ public class EntitySmavaCreeper extends EntityMob
}
}
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
if (this.hasIgnited())
{
this.setCreeperState(1);
}
int i = this.getCreeperState();
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE, 1.0F, 1.0F);
}
this.timeSinceIgnited += i;
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT;
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_SMAVACREEPER_HURT;
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_CREEPER_DEATH;
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
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 boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
public boolean getPowered()
{
return this.dataManager.get(POWERED);
}
@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);
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
public int getCreeperState()
public int getMaxFallHeight()
{
return this.dataManager.get(STATE);
}
public void setCreeperState(int state)
{
this.dataManager.set(STATE, state);
}
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.TRUE);
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
@ -290,24 +312,4 @@ public class EntitySmavaCreeper extends EntityMob
this.world.spawnEntity(entityareaeffectcloud);
}
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
}

View file

@ -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,9 +31,6 @@ 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<Boolean> ATTACKING = EntityDataManager.createKey(EntityTileraGhast.class, DataSerializers.BOOLEAN);
@ -45,14 +45,6 @@ public class EntityTileraGhast extends EntityFlying implements IMob
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()
{
@ -69,54 +61,23 @@ public class EntityTileraGhast extends EntityFlying implements IMob
return this.explosionStrength;
}
public void onUpdate()
{
super.onUpdate();
if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL)
{
this.setDead();
}
}
public boolean attackEntityFrom(DamageSource source, float amount)
{
if (this.isEntityInvulnerable(source))
{
return false;
} else if (source.getImmediateSource() instanceof EntityLargeFireball && source.getTrueSource() instanceof EntityPlayer)
}
else if (source.getImmediateSource() instanceof EntityLargeFireball && source.getTrueSource() instanceof EntityPlayer)
{
super.attackEntityFrom(source, 1000.0F);
return true;
} else
}
else
{
return super.attackEntityFrom(source, amount);
}
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(ATTACKING, Boolean.FALSE);
}
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;
}
protected SoundEvent getAmbientSound()
{
return SoundEvents.ENTITY_GHAST_AMBIENT;
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_GHAST_HURT;
@ -127,25 +88,55 @@ public class EntityTileraGhast extends EntityFlying implements IMob
return SoundEvents.ENTITY_GHAST_DEATH;
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_GHAST;
}
protected float getSoundVolume()
{
return 10.0F;
}
public boolean getCanSpawnHere()
public float getEyeHeight()
{
return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.world.getDifficulty() != EnumDifficulty.PEACEFUL;
return 2.6F;
}
public int getMaxSpawnedInChunk()
public SoundCategory getSoundCategory()
{
return 1;
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 void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(100.0D);
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(ATTACKING, Boolean.FALSE);
}
public void onUpdate()
{
super.onUpdate();
if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL)
{
this.setDead();
}
}
protected SoundEvent getAmbientSound()
{
return SoundEvents.ENTITY_GHAST_AMBIENT;
}
public void writeEntityToNBT(NBTTagCompound compound)
@ -164,9 +155,20 @@ public class EntityTileraGhast extends EntityFlying implements IMob
}
}
public float getEyeHeight()
@Nullable
protected ResourceLocation getLootTable()
{
return 2.6F;
return LootTableList.ENTITIES_GHAST;
}
public boolean getCanSpawnHere()
{
return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.world.getDifficulty() != EnumDifficulty.PEACEFUL;
}
public int getMaxSpawnedInChunk()
{
return 1;
}
static class AIFireballAttack extends EntityAIBase
@ -225,7 +227,8 @@ public class EntityTileraGhast extends EntityFlying implements IMob
world.spawnEntity(entitylargefireball);
this.attackTimer = -40;
}
} else if (this.attackTimer > 0)
}
else if (this.attackTimer > 0)
{
--this.attackTimer;
}
@ -255,7 +258,8 @@ public class EntityTileraGhast extends EntityFlying implements IMob
{
this.parentEntity.rotationYaw = -((float) MathHelper.atan2(this.parentEntity.motionX, this.parentEntity.motionZ)) * (180F / (float) Math.PI);
this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw;
} else
}
else
{
EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
double d0 = 64.0D;
@ -288,7 +292,8 @@ public class EntityTileraGhast extends EntityFlying implements IMob
if (!entitymovehelper.isUpdating())
{
return true;
} else
}
else
{
double d0 = entitymovehelper.getX() - this.parentEntity.posX;
double d1 = entitymovehelper.getY() - this.parentEntity.posY;
@ -343,7 +348,8 @@ public class EntityTileraGhast extends EntityFlying implements IMob
this.parentEntity.motionX += d0 / d3 * 0.1D;
this.parentEntity.motionY += d1 / d3 * 0.1D;
this.parentEntity.motionZ += d2 / d3 * 0.1D;
} else
}
else
{
this.action = EntityMoveHelper.Action.WAIT;
}

View file

@ -1,9 +1,10 @@
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;
@ -37,13 +38,16 @@ public class EntityAIBakaMitaiCreeperSwell extends EntityAIBase
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
} else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
}
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
} else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
}
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
} else
}
else
{
this.swellingCreeper.setCreeperState(1);
}

View file

@ -1,10 +1,11 @@
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
{
@ -22,19 +23,6 @@ public class EntityAIDance extends EntityAIBase
this.searchRadius = searchRadius;
}
@Override
public void resetTask()
{
this.lastDanceMoveTime = 0;
this.danceStage = 0;
}
@Override
public boolean shouldContinueExecuting()
{
return shouldExecute();
}
@Override
public boolean shouldExecute()
{
@ -52,12 +40,25 @@ public class EntityAIDance extends EntityAIBase
return false;
}
@Override
public boolean shouldContinueExecuting()
{
return shouldExecute();
}
@Override
public void startExecuting()
{
this.danceStage = 1;
}
@Override
public void resetTask()
{
this.lastDanceMoveTime = 0;
this.danceStage = 0;
}
@Override
public void updateTask()
{

View file

@ -1,13 +1,14 @@
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
{
@ -31,14 +32,6 @@ public class EntityAIEatDroppedFish extends EntityAIBase
return null;
}
List<EntityItem> 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()
{
@ -73,4 +66,12 @@ public class EntityAIEatDroppedFish extends EntityAIBase
item.setDead();
}
}
List<EntityItem> 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));
}
}

View file

@ -1,9 +1,10 @@
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;
@ -37,13 +38,16 @@ public class EntityAIIslamistSwell extends EntityAIBase
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
} else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
}
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
} else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
}
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
} else
}
else
{
this.swellingCreeper.setCreeperState(1);
}

View file

@ -1,9 +1,10 @@
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;
@ -37,13 +38,16 @@ public class EntityAISmavaCreeperSwell extends EntityAIBase
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
} else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
}
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
} else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
}
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
} else
}
else
{
this.swellingCreeper.setCreeperState(1);
}

View file

@ -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,6 +7,8 @@ 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

View file

@ -1,12 +1,9 @@
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
{
@ -18,10 +15,4 @@ public class ModItemBase extends Item
ModItems.ITEMS.add(this);
}
@SideOnly(Side.CLIENT)
public void initModel()
{
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
}

View file

@ -1,12 +1,9 @@
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
{
@ -19,10 +16,4 @@ public class ModItemFoodBase extends ItemFood
ModItems.ITEMS.add(this);
}
@SideOnly(Side.CLIENT)
public void initModel()
{
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
}

View file

@ -1,13 +1,13 @@
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
{

View file

@ -36,103 +36,95 @@ public class ModConfigs
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 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 spawn weight:")
public static int ApoRed_weight = 10;
@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 ApoRed_max = 1;
@Name("Baka Mitai Creeper spawn weight:")
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;
public static int BakaMitaiCreeper_max = 1;
@Name("Drachenlord spawn weight:")
public static int Drachenlord_weight = 10;
@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;
public static int Drachenlord_max = 1;
@Name("Friedrich Liechtenstein spawn weight:")
public static int Friedrich_weight = 10;
@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;
public static int Friedrich_max = 1;
@Name("Holzstammhuhn spawn weight:")
public static int Holzstammhuhn_weight = 10;
@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;
public static int Holzstammhuhn_max = 1;
@Name("Islamist spawn weight:")
public static int Islamist_weight = 10;
@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;
public static int Islamist_max = 1;
@Name("Jens spawn weight:")
public static int Jens_weight = 10;
@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;
public static int Jens_max = 1;
@Name("Marcell D'Avis spawn weight:")
public static int MarcellDAvis_weight = 10;
@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;
public static int MarcellDAvis_max = 1;
@Name("Mr. Bean spawn weight:")
public static int MrBean_weight = 10;
@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 MrBean_max = 1;
@Name("Schalker spawn weight:")
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;
public static int Schalker_max = 1;
@Name("Smava Creeper spawn weight:")
public static int SmavaCreeper_weight = 10;
@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;
public static int SmavaCreeper_max = 1;
@Name("MZTEWolf spawn weight:")
public static int MZTEWolf_weight = 10;
@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;
public static int MZTEWolf_max = 1;
@Name("Gisela spawn weight:")
public static int Gisela_weight = 10;
@Name("Gisela min group size:")
public static int Gisela_min = 1;
@Name("Gisela max group size:")
public static int Gisela_max = 1;
@Name("tilera Ghast spawn weight:")
public static int tileraGhast_weight = 10;
@Name("tilera Ghast min group size:")
public static int tileraGhast_min = 1;
@Name("tilera Ghast max group size:")
public static int tileraGhast_max = 2;
public static int tileraGhast_max = 1;
@Name("Time in seconds Jens needs to digest:")
public static int Jens_digest_time = 120;

View file

@ -1,8 +1,9 @@
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
{
@ -12,11 +13,10 @@ public class ModEntities
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(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);

View file

@ -1,14 +1,15 @@
package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.items.ModItemBase;
import mod.acgaming.spackenmobs.items.ModItemFoodDrink;
import mod.acgaming.spackenmobs.items.ModItemFoodEffect;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.init.MobEffects;
import net.minecraft.item.Item;
import net.minecraft.potion.PotionEffect;
import java.util.ArrayList;
import java.util.List;
import mod.acgaming.spackenmobs.items.ModItemBase;
import mod.acgaming.spackenmobs.items.ModItemFoodDrink;
import mod.acgaming.spackenmobs.items.ModItemFoodEffect;
public class ModItems
{

View file

@ -1,13 +1,13 @@
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<ResourceLocation> LOOT_TABLES = Sets.newHashSet();
@ -26,17 +26,13 @@ public class ModLootTableList
if (LOOT_TABLES.add(id))
{
return id;
} else
}
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);
@ -51,4 +47,9 @@ public class ModLootTableList
return true;
}
private static ResourceLocation register(String id)
{
return register(new ResourceLocation("spackenmobs", id));
}
}

View file

@ -1,10 +1,11 @@
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
{
@ -53,5 +54,6 @@ public class ModSoundEvents
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"));
}

View file

@ -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<EntityEntry> 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<Item> event)
{
event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
}
@SubscribeEvent
public static void registerSounds(Register<SoundEvent> 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);
}
}

View file

@ -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"));
}
}

View file

@ -0,0 +1,242 @@
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<EntityEntry> 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<Item> event)
{
event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
}
@SubscribeEvent
public static void registerSounds(Register<SoundEvent> 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);
}
}

View file

@ -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"));
}
}

View file

@ -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<EntityLatinTeacher>
{
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;
}
}

View file

@ -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,6 +9,8 @@ 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<EntityJensWither>
{

View file

@ -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,6 +7,8 @@ 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
{
@ -30,6 +31,14 @@ public class ModelSchalker extends ModelBase
this.head.setRotationPoint(0.0F, 12.0F, 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);
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw,
float headPitch, float scaleFactor, Entity entityIn)
@ -50,7 +59,8 @@ public class ModelSchalker extends ModelBase
if (EntitySchalker.getClientPeekAmount(f) > 0.3F)
{
this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F;
} else
}
else
{
this.lid.rotateAngleY = 0.0F;
}
@ -58,12 +68,4 @@ public class ModelSchalker extends ModelBase
this.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
}
@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);
}
}

View file

@ -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,6 +13,8 @@ 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
{

View file

@ -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,6 +11,8 @@ 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<EntityBakaMitaiCreeper>
{
@ -31,7 +32,8 @@ public class RenderBakaMitaiCreeper extends RenderLiving<EntityBakaMitaiCreeper>
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
} else
}
else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
@ -39,12 +41,6 @@ public class RenderBakaMitaiCreeper extends RenderLiving<EntityBakaMitaiCreeper>
}
}
@Override
protected ResourceLocation getEntityTexture(EntityBakaMitaiCreeper entity)
{
return CREEPER_TEXTURE;
}
@Override
protected void preRenderCallback(EntityBakaMitaiCreeper entitylivingbaseIn, float partialTickTime)
{
@ -58,6 +54,12 @@ public class RenderBakaMitaiCreeper extends RenderLiving<EntityBakaMitaiCreeper>
GlStateManager.scale(f2, f3, f2);
}
@Override
protected ResourceLocation getEntityTexture(EntityBakaMitaiCreeper entity)
{
return CREEPER_TEXTURE;
}
public static class Factory implements IRenderFactory<EntityBakaMitaiCreeper>
{
@Override

View file

@ -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,6 +11,8 @@ 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
{

View file

@ -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,6 +9,8 @@ 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<EntityFriedrichLiechtenstein>
{

View file

@ -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<EntityGisela>
{
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<EntityGisela>
{
@Override
public Render<? super EntityGisela> createRenderFor(RenderManager manager)
{
return new RenderGisela(manager);
}
}
}

View file

@ -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,6 +9,8 @@ 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
{

View file

@ -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<EntityITbyHF>
{
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<EntityITbyHF>
{
@Override
public Render<? super EntityITbyHF> createRenderFor(RenderManager manager)
{
return new RenderITbyHF(manager);
}
}
}

View file

@ -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,6 +11,8 @@ 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<EntityIslamist>
{
@ -31,7 +32,8 @@ public class RenderIslamist extends RenderLiving<EntityIslamist>
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
} else
}
else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
@ -39,12 +41,6 @@ public class RenderIslamist extends RenderLiving<EntityIslamist>
}
}
@Override
protected ResourceLocation getEntityTexture(EntityIslamist entity)
{
return ISLAMIST_TEXTURE;
}
@Override
protected void preRenderCallback(EntityIslamist entitylivingbaseIn, float partialTickTime)
{
@ -58,6 +54,12 @@ public class RenderIslamist extends RenderLiving<EntityIslamist>
GlStateManager.scale(f2, f3, f2);
}
@Override
protected ResourceLocation getEntityTexture(EntityIslamist entity)
{
return ISLAMIST_TEXTURE;
}
public static class Factory implements IRenderFactory<EntityIslamist>
{
@Override

View file

@ -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,6 +9,8 @@ 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<EntityJens>
{

View file

@ -1,14 +1,20 @@
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<EntityJensWither>
{
@ -21,6 +27,16 @@ public class RenderJensWither extends RenderLiving<EntityJensWither>
this.addLayer(new LayerJensWitherAura(this));
}
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);
}
return true;
}
protected ResourceLocation getEntityTexture(EntityJensWither entity)
{
int i = entity.getInvulTime();

View file

@ -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<EntityLatinTeacher>
{
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<EntityLatinTeacher>
{
@Override
public Render<? super EntityLatinTeacher> createRenderFor(RenderManager manager)
{
return new RenderLatinTeacher(manager);
}
}
}

View file

@ -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,6 +11,8 @@ 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
{
@ -53,7 +54,8 @@ public class RenderMZTEWolf extends RenderWolf
if (entity.isTamed())
{
return TAMED_MZTEWOLF_TEXTURE;
} else
}
else
{
return entity.isAngry() ? ANRGY_MZTEWOLF_TEXTURE : MZTEWOLF_TEXTURE;
}

View file

@ -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,6 +11,8 @@ 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
{

View file

@ -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,6 +11,8 @@ 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
{

View file

@ -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,10 +15,12 @@ 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<EntitySchalker>
{
public static final ResourceLocation[] SCHALKER_TEXTURE = new ResourceLocation[]{
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"),
@ -50,56 +51,6 @@ public class RenderSchalker extends RenderLiving<EntitySchalker>
return (ModelSchalker) super.getMainModel();
}
@Override
public void doRender(EntitySchalker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
int i = entity.getClientTeleportInterp();
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
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 camera.isBoundingBoxInFrustum(
new AxisAlignedBB(vec3d1.x, vec3d1.y, vec3d1.z, vec3d.x, vec3d.y, vec3d.z));
}
return false;
}
}
@Override
protected ResourceLocation getEntityTexture(EntitySchalker entity)
{
return SCHALKER_TEXTURE[entity.getColor().getMetadata()];
}
@Override
protected void applyRotations(EntitySchalker entityLiving, float p_77043_2_, float rotationYaw,
float partialTicks)
@ -143,6 +94,58 @@ public class RenderSchalker extends RenderLiving<EntitySchalker>
GlStateManager.scale(0.999F, 0.999F, 0.999F);
}
@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 camera.isBoundingBoxInFrustum(
new AxisAlignedBB(vec3d1.x, vec3d1.y, vec3d1.z, vec3d.x, vec3d.y, vec3d.z));
}
return false;
}
}
@Override
public void doRender(EntitySchalker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
int i = entity.getClientTeleportInterp();
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 ResourceLocation getEntityTexture(EntitySchalker entity)
{
return SCHALKER_TEXTURE[entity.getColor().getMetadata()];
}
public static class Factory implements IRenderFactory<EntitySchalker>
{
@Override

View file

@ -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,6 +11,8 @@ 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<EntitySmavaCreeper>
{
@ -31,7 +32,8 @@ public class RenderSmavaCreeper extends RenderLiving<EntitySmavaCreeper>
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
} else
}
else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
@ -39,12 +41,6 @@ public class RenderSmavaCreeper extends RenderLiving<EntitySmavaCreeper>
}
}
@Override
protected ResourceLocation getEntityTexture(EntitySmavaCreeper entity)
{
return SMAVA_TEXTURE;
}
@Override
protected void preRenderCallback(EntitySmavaCreeper entitylivingbaseIn, float partialTickTime)
{
@ -58,6 +54,12 @@ public class RenderSmavaCreeper extends RenderLiving<EntitySmavaCreeper>
GlStateManager.scale(f2, f3, f2);
}
@Override
protected ResourceLocation getEntityTexture(EntitySmavaCreeper entity)
{
return SMAVA_TEXTURE;
}
public static class Factory implements IRenderFactory<EntitySmavaCreeper>
{
@Override

View file

@ -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,6 +10,8 @@ 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<EntityTileraGhast>
{

View file

@ -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

View file

@ -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
spackenmobs.config.title=Spackenmobs Settings

View file

@ -889,7 +889,10 @@
"entities.jens.poop": {
"sounds": [
{
"name": "spackenmobs:jens/poop"
"name": "spackenmobs:jens/poop1"
},
{
"name": "spackenmobs:jens/poop2"
}
]
},
@ -951,5 +954,110 @@
"name": "spackenmobs:friedrich/hurt"
}
]
},
"entities.gisela.ambient": {
"sounds": [
{
"name": "spackenmobs:gisela/say1"
},
{
"name": "spackenmobs:gisela/say2"
},
{
"name": "spackenmobs:gisela/say3"
},
{
"name": "spackenmobs:gisela/say4"
},
{
"name": "spackenmobs:gisela/say5"
},
{
"name": "spackenmobs:gisela/say6"
},
{
"name": "spackenmobs:gisela/say7"
},
{
"name": "spackenmobs:gisela/say8"
},
{
"name": "spackenmobs:gisela/say9"
},
{
"name": "spackenmobs:gisela/say10"
},
{
"name": "spackenmobs:gisela/say11"
},
{
"name": "spackenmobs:gisela/say12"
},
{
"name": "spackenmobs:gisela/say13"
},
{
"name": "spackenmobs:gisela/say14"
},
{
"name": "spackenmobs:gisela/say15"
},
{
"name": "spackenmobs:gisela/say16"
},
{
"name": "spackenmobs:gisela/say17"
},
{
"name": "spackenmobs:gisela/say18"
},
{
"name": "spackenmobs:gisela/say19"
},
{
"name": "spackenmobs:gisela/say20"
},
{
"name": "spackenmobs:gisela/say21"
},
{
"name": "spackenmobs:gisela/say22"
},
{
"name": "spackenmobs:gisela/say23"
}
]
},
"entities.gisela.hurt": {
"sounds": [
{
"name": "spackenmobs:gisela/hurt1"
},
{
"name": "spackenmobs:gisela/hurt2"
},
{
"name": "spackenmobs:gisela/hurt3"
},
{
"name": "spackenmobs:gisela/hurt4"
},
{
"name": "spackenmobs:gisela/hurt5"
}
]
},
"entities.mztewolf.ambient": {
"sounds": [
{
"name": "spackenmobs:mztewolf/say1"
},
{
"name": "spackenmobs:mztewolf/say2"
},
{
"name": "spackenmobs:mztewolf/say3"
}
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View file

@ -3,7 +3,7 @@
"modid": "spackenmobs",
"name": "Spackenmobs",
"description": "The most important mobs in the history of Minecraft! [citation needed]",
"version": "RC7",
"version": "RC8",
"mcversion": "1.12.2",
"url": "https://github.com/ACGaming/Spackenmobs",
"updateUrl": "",