Auto-formatting, clean up and Jens AI

This commit is contained in:
ACGaming 2020-08-23 10:30:02 +02:00
parent 5a57851970
commit 639724c474
34 changed files with 2256 additions and 2329 deletions

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs; package mod.acgaming.spackenmobs;
import mod.acgaming.spackenmobs.misc.ModEntities; import mod.acgaming.spackenmobs.misc.ModEntities;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
@ -11,38 +12,33 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@Mod(modid = "spackenmobs", version = "1.0", acceptedMinecraftVersions = "[1.12.2]") @Mod(modid = "spackenmobs", version = "1.0", acceptedMinecraftVersions = "[1.12.2]")
public class Spackenmobs public class Spackenmobs {
{ public static final String MODID = "spackenmobs";
public static final String MODID = "spackenmobs"; public static final String VERSION = "1.0";
public static final String VERSION = "1.0";
public static final CreativeTabs SPACKENMOBS_TAB = new SpackenmobsTab();
public static final CreativeTabs SPACKENMOBS_TAB = new SpackenmobsTab();
@Instance
@Instance public static Spackenmobs instance;
public static Spackenmobs instance;
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT) @EventHandler
@EventHandler public void preInitClient(FMLPreInitializationEvent event) {
public void preInitClient(FMLPreInitializationEvent event) ModEntities.initModels();
{ }
ModEntities.initModels();
} @EventHandler
public void preInit(FMLPreInitializationEvent event) {
@EventHandler
public void preInit(FMLPreInitializationEvent event) }
{
@EventHandler
} public void init(FMLInitializationEvent event) {
@EventHandler }
public void init(FMLInitializationEvent event)
{ @EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
}
} }

View file

@ -1,21 +1,19 @@
package mod.acgaming.spackenmobs; package mod.acgaming.spackenmobs;
import mod.acgaming.spackenmobs.misc.ModItems; import mod.acgaming.spackenmobs.misc.ModItems;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
public class SpackenmobsTab extends CreativeTabs public class SpackenmobsTab extends CreativeTabs {
{ public SpackenmobsTab() {
public SpackenmobsTab() super(Spackenmobs.MODID);
{ }
super(Spackenmobs.MODID);
} @SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT) public ItemStack getTabIconItem() {
@Override return new ItemStack(ModItems.RAM);
public ItemStack getTabIconItem() }
{
return new ItemStack(ModItems.RAM);
}
} }

View file

@ -0,0 +1,68 @@
package mod.acgaming.spackenmobs.entities;
import java.util.List;
import java.util.Random;
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;
public class EntityAIEatDroppedFish extends EntityAIBase {
private EntityJens jens;
private Random rand = new Random();
private World world = null;
double searchDistance = 10.0D;
public EntityAIEatDroppedFish(EntityJens jens) {
this.jens = jens;
this.world = jens.world;
}
public EntityItem getNearbyFood() {
List<EntityItem> items = getItems();
for (EntityItem item : items) {
EntityItem stack = item;
if (items != null) {
return stack;
}
}
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() {
EntityItem getNearbyFood = getNearbyFood();
if (getNearbyFood != null && !this.jens.isChild() && this.jens.yummy_in_tummy == false
&& this.jens.isFishItem(getNearbyFood.getItem())) {
execute(this.jens, getNearbyFood);
}
return false;
}
public boolean execute(EntityJens jens, EntityItem item) {
if (jens.getNavigator().tryMoveToXYZ(item.posX, item.posY, item.posZ, 1.25D)) {
if (jens.getDistance(item) < 1.0F) {
eatItem(item);
jens.digestFish();
}
}
return true;
}
public void eatItem(EntityItem item) {
ItemStack stack = item.getItem();
stack.setCount(stack.getCount() - 1);
if (stack.getCount() == 0) {
item.setDead();
}
}
}

View file

@ -1,29 +1,28 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.misc.ModSoundEvents; import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityApoRed extends EntitySkeleton public class EntityApoRed extends EntitySkeleton {
{ public EntityApoRed(World worldIn) {
public EntityApoRed(World worldIn) super(worldIn);
{
super(worldIn);
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_APORED_AMBIENT;
} }
protected SoundEvent getHurtSound(DamageSource damageSourceIn) @Override
{ protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_APORED_HURT; return ModSoundEvents.ENTITY_APORED_AMBIENT;
} }
protected SoundEvent getDeathSound() @Override
{ protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_APORED_DEATH; return ModSoundEvents.ENTITY_APORED_HURT;
}
@Override
protected SoundEvent getDeathSound() {
return ModSoundEvents.ENTITY_APORED_DEATH;
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -29,232 +30,209 @@ import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList; import net.minecraft.world.storage.loot.LootTableList;
public class EntityDrachenlord extends EntityZombie public class EntityDrachenlord extends EntityZombie {
{ private static final UUID ATTACK_SPEED_BOOST_MODIFIER_UUID = UUID
private static final UUID ATTACK_SPEED_BOOST_MODIFIER_UUID = UUID.fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); .fromString("49455A49-7EC5-45BA-B886-3B90B23A1718");
private static final AttributeModifier ATTACK_SPEED_BOOST_MODIFIER = (new AttributeModifier(ATTACK_SPEED_BOOST_MODIFIER_UUID, "Attacking speed boost", 0.05D, 0)).setSaved(false); private static final AttributeModifier ATTACK_SPEED_BOOST_MODIFIER = (new AttributeModifier(
ATTACK_SPEED_BOOST_MODIFIER_UUID, "Attacking speed boost", 0.05D, 0)).setSaved(false);
private int angerLevel; private int angerLevel;
private int randomSoundDelay; private int randomSoundDelay;
private UUID angerTargetUUID; private UUID angerTargetUUID;
public EntityDrachenlord(World worldIn) public EntityDrachenlord(World worldIn) {
{ super(worldIn);
super(worldIn); this.isImmuneToFire = true;
this.isImmuneToFire = true;
}
public void setRevengeTarget(@Nullable EntityLivingBase livingBase)
{
super.setRevengeTarget(livingBase);
if (livingBase != null)
{
this.angerTargetUUID = livingBase.getUniqueID();
}
} }
protected void applyEntityAI() @Override
{ public void setRevengeTarget(@Nullable EntityLivingBase livingBase) {
this.targetTasks.addTask(1, new EntityDrachenlord.AIHurtByAggressor(this)); super.setRevengeTarget(livingBase);
this.targetTasks.addTask(2, new EntityDrachenlord.AITargetAggressor(this));
if (livingBase != null) {
this.angerTargetUUID = livingBase.getUniqueID();
}
} }
protected void applyEntityAttributes() @Override
{ protected void applyEntityAI() {
super.applyEntityAttributes(); this.targetTasks.addTask(1, new EntityDrachenlord.AIHurtByAggressor(this));
this.getEntityAttribute(SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(0.0D); this.targetTasks.addTask(2, new EntityDrachenlord.AITargetAggressor(this));
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D);
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D);
} }
protected void updateAITasks() @Override
{ protected void applyEntityAttributes() {
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED); super.applyEntityAttributes();
this.getEntityAttribute(SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(0.0D);
if (this.isAngry()) this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D);
{ this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D);
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();
} }
public boolean getCanSpawnHere() @Override
{ protected void updateAITasks() {
return this.world.getDifficulty() != EnumDifficulty.PEACEFUL; 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();
} }
public boolean isNotColliding() @Override
{ public boolean getCanSpawnHere() {
return this.world.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.world.containsAnyLiquid(this.getEntityBoundingBox()); return this.world.getDifficulty() != EnumDifficulty.PEACEFUL;
} }
public static void registerFixesPigZombie(DataFixer fixer) @Override
{ public boolean isNotColliding() {
EntityLiving.registerFixesMob(fixer, EntityDrachenlord.class); return this.world.checkNoEntityCollision(this.getEntityBoundingBox(), this)
&& this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty()
&& !this.world.containsAnyLiquid(this.getEntityBoundingBox());
} }
public void writeEntityToNBT(NBTTagCompound compound) public static void registerFixesPigZombie(DataFixer fixer) {
{ EntityLiving.registerFixesMob(fixer, EntityDrachenlord.class);
super.writeEntityToNBT(compound);
compound.setShort("Anger", (short)this.angerLevel);
if (this.angerTargetUUID != null)
{
compound.setString("HurtBy", this.angerTargetUUID.toString());
}
else
{
compound.setString("HurtBy", "");
}
} }
public void readEntityFromNBT(NBTTagCompound compound) @Override
{ public void writeEntityToNBT(NBTTagCompound compound) {
super.readEntityFromNBT(compound); super.writeEntityToNBT(compound);
this.angerLevel = compound.getShort("Anger"); compound.setShort("Anger", (short) this.angerLevel);
String s = compound.getString("HurtBy");
if (!s.isEmpty()) if (this.angerTargetUUID != null) {
{ compound.setString("HurtBy", this.angerTargetUUID.toString());
this.angerTargetUUID = UUID.fromString(s); } else {
EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID); compound.setString("HurtBy", "");
this.setRevengeTarget(entityplayer); }
if (entityplayer != null)
{
this.attackingPlayer = entityplayer;
this.recentlyHit = this.getRevengeTimer();
}
}
} }
public boolean attackEntityFrom(DamageSource source, float amount) @Override
{ public void readEntityFromNBT(NBTTagCompound compound) {
if (this.isEntityInvulnerable(source)) super.readEntityFromNBT(compound);
{ this.angerLevel = compound.getShort("Anger");
return false; String s = compound.getString("HurtBy");
}
else
{
Entity entity = source.getTrueSource();
if (entity instanceof EntityPlayer) if (!s.isEmpty()) {
{ this.angerTargetUUID = UUID.fromString(s);
this.becomeAngryAt(entity); EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID);
} this.setRevengeTarget(entityplayer);
return super.attackEntityFrom(source, amount); if (entityplayer != null) {
} this.attackingPlayer = entityplayer;
this.recentlyHit = this.getRevengeTimer();
}
}
} }
private void becomeAngryAt(Entity p_70835_1_) @Override
{ public boolean attackEntityFrom(DamageSource source, float amount) {
this.angerLevel = 400 + this.rand.nextInt(400); if (this.isEntityInvulnerable(source)) {
this.randomSoundDelay = this.rand.nextInt(40); return false;
} else {
Entity entity = source.getTrueSource();
if (p_70835_1_ instanceof EntityLivingBase) if (entity instanceof EntityPlayer) {
{ this.becomeAngryAt(entity);
this.setRevengeTarget((EntityLivingBase)p_70835_1_); }
}
return super.attackEntityFrom(source, amount);
}
} }
public boolean isAngry() private void becomeAngryAt(Entity p_70835_1_) {
{ this.angerLevel = 400 + this.rand.nextInt(400);
return this.angerLevel > 0; this.randomSoundDelay = this.rand.nextInt(40);
if (p_70835_1_ instanceof EntityLivingBase) {
this.setRevengeTarget((EntityLivingBase) p_70835_1_);
}
} }
protected SoundEvent getAmbientSound() public boolean isAngry() {
{ return this.angerLevel > 0;
return ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT;
} }
protected SoundEvent getHurtSound(DamageSource damageSourceIn) @Override
{ protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_DRACHENLORD_HURT; return ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT;
} }
protected SoundEvent getDeathSound() @Override
{ protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_DRACHENLORD_DEATH; return ModSoundEvents.ENTITY_DRACHENLORD_HURT;
} }
@Override
protected SoundEvent getDeathSound() {
return ModSoundEvents.ENTITY_DRACHENLORD_DEATH;
}
@Override
@Nullable @Nullable
protected ResourceLocation getLootTable() protected ResourceLocation getLootTable() {
{ return LootTableList.ENTITIES_ZOMBIE_PIGMAN;
return LootTableList.ENTITIES_ZOMBIE_PIGMAN;
} }
public boolean processInteract(EntityPlayer player, EnumHand hand) @Override
{ public boolean processInteract(EntityPlayer player, EnumHand hand) {
return false; return false;
} }
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) @Override
{ protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) {
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_AXE)); this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_AXE));
} }
protected ItemStack getSkullDrop() @Override
{ protected ItemStack getSkullDrop() {
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
public boolean isPreventingPlayerRest(EntityPlayer playerIn) @Override
{ public boolean isPreventingPlayerRest(EntityPlayer playerIn) {
return this.isAngry(); return this.isAngry();
} }
static class AIHurtByAggressor extends EntityAIHurtByTarget static class AIHurtByAggressor extends EntityAIHurtByTarget {
{ public AIHurtByAggressor(EntityDrachenlord p_i45828_1_) {
public AIHurtByAggressor(EntityDrachenlord p_i45828_1_) super(p_i45828_1_, true);
{ }
super(p_i45828_1_, true);
}
protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) @Override
{ protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) {
super.setEntityAttackTarget(creatureIn, entityLivingBaseIn); super.setEntityAttackTarget(creatureIn, entityLivingBaseIn);
if (creatureIn instanceof EntityDrachenlord) if (creatureIn instanceof EntityDrachenlord) {
{ ((EntityDrachenlord) creatureIn).becomeAngryAt(entityLivingBaseIn);
((EntityDrachenlord)creatureIn).becomeAngryAt(entityLivingBaseIn); }
} }
} }
}
static class AITargetAggressor extends EntityAINearestAttackableTarget<EntityPlayer> static class AITargetAggressor extends EntityAINearestAttackableTarget<EntityPlayer> {
{ public AITargetAggressor(EntityDrachenlord p_i45829_1_) {
public AITargetAggressor(EntityDrachenlord p_i45829_1_) super(p_i45829_1_, EntityPlayer.class, true);
{ }
super(p_i45829_1_, EntityPlayer.class, true);
}
public boolean shouldExecute() @Override
{ public boolean shouldExecute() {
return ((EntityDrachenlord)this.taskOwner).isAngry() && super.shouldExecute(); return ((EntityDrachenlord) this.taskOwner).isAngry() && super.shouldExecute();
} }
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import java.util.Set; import java.util.Set;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@ -25,57 +26,55 @@ import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityHolzstammhuhn extends EntityChicken public class EntityHolzstammhuhn extends EntityChicken {
{ private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(Items.STICK);
private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(Items.STICK);
public EntityHolzstammhuhn(World worldIn) {
public EntityHolzstammhuhn(World worldIn) super(worldIn);
{ this.setSize(0.4F, 0.7F);
super(worldIn); this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
this.setSize(0.4F, 0.7F); this.setPathPriority(PathNodeType.WATER, 0.0F);
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
this.setPathPriority(PathNodeType.WATER, 0.0F);
}
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 1.4D));
this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
this.tasks.addTask(3, new EntityAITempt(this, 1.0D, false, TEMPTATION_ITEMS));
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(7, new EntityAILookIdle(this));
}
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
protected SoundEvent getAmbientSound()
{
return SoundEvents.BLOCK_WOOD_PLACE;
} }
protected SoundEvent getHurtSound(DamageSource damageSourceIn) @Override
{ protected void initEntityAI() {
return SoundEvents.BLOCK_WOOD_HIT; this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 1.4D));
this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
this.tasks.addTask(3, new EntityAITempt(this, 1.0D, false, TEMPTATION_ITEMS));
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(7, new EntityAILookIdle(this));
} }
protected SoundEvent getDeathSound() @Override
{ public boolean isBreedingItem(ItemStack stack) {
return SoundEvents.BLOCK_WOOD_BREAK; return TEMPTATION_ITEMS.contains(stack.getItem());
} }
protected void playStepSound(BlockPos pos, Block blockIn) @Override
{ protected SoundEvent getAmbientSound() {
this.playSound(SoundEvents.BLOCK_WOOD_STEP, 0.15F, 1.0F); return SoundEvents.BLOCK_WOOD_PLACE;
} }
public EntityHolzstammhuhn createChild(EntityAgeable ageable) @Override
{ protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return new EntityHolzstammhuhn(this.world); return SoundEvents.BLOCK_WOOD_HIT;
}
@Override
protected SoundEvent getDeathSound() {
return SoundEvents.BLOCK_WOOD_BREAK;
}
@Override
protected void playStepSound(BlockPos pos, Block blockIn) {
this.playSound(SoundEvents.BLOCK_WOOD_STEP, 0.15F, 1.0F);
}
@Override
public EntityHolzstammhuhn createChild(EntityAgeable ageable) {
return new EntityHolzstammhuhn(this.world);
} }
} }

View file

@ -1,78 +1,71 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.misc.ModSoundEvents; import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityIslamist extends EntityCreeper public class EntityIslamist extends EntityCreeper {
{
private int lastActiveTime; private int lastActiveTime;
private int timeSinceIgnited; private int timeSinceIgnited;
private int fuseTime = 30; private int fuseTime = 30;
private int explosionRadius = 3; private int explosionRadius = 6;
public EntityIslamist(World worldIn) public EntityIslamist(World worldIn) {
{ super(worldIn);
super(worldIn); this.setSize(0.6F, 1.7F);
this.setSize(0.6F, 1.7F);
}
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_ISLAMIST_FUSE, 1.0F, 0.5F);
}
this.timeSinceIgnited += i;
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
private void explode()
{
if (!this.world.isRemote)
{
boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_ISLAMIST_BLOW, getSoundCategory(), 1.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius * f, flag);
this.setDead();
}
} }
protected SoundEvent getHurtSound(DamageSource damageSourceIn) @Override
{ public void onUpdate() {
return ModSoundEvents.ENTITY_ISLAMIST_HURT; 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_ISLAMIST_FUSE, 1.0F, 0.5F);
}
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() private void explode() {
{ if (!this.world.isRemote) {
return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT; boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_ISLAMIST_BLOW, getSoundCategory(), 1.0F,
1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, this.explosionRadius * f, flag);
this.setDead();
}
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_ISLAMIST_HURT;
}
@Override
protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT;
} }
} }

View file

@ -1,12 +1,15 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import java.util.Set; import java.util.Set;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import mod.acgaming.spackenmobs.misc.ModItems; import mod.acgaming.spackenmobs.misc.ModItems;
import mod.acgaming.spackenmobs.misc.ModSoundEvents; import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIFollowParent; import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate; import net.minecraft.entity.ai.EntityAIMate;
@ -26,114 +29,137 @@ import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityJens extends EntityAnimal public class EntityJens extends EntityAnimal {
{ private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(ModItems.RAM);
private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(ModItems.RAM); private static final Set<Item> FISH_ITEMS = Sets.newHashSet(Items.FISH);
public boolean yummy_in_tummy = false;
public int time_until_surstroemming = 0;
public EntityJens(World worldIn)
{
super(worldIn);
setSize(0.6F, 2.2F);
}
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, ModItems.RAM_ON_A_STICK, 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));
}
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
public boolean canBeSteered()
{
Entity entity = this.getControllingPassenger();
if (!(entity instanceof EntityPlayer)) public boolean yummy_in_tummy = false;
{ public int time_until_surstroemming = 0;
return false;
} Minecraft MINECRAFT = Minecraft.getMinecraft();
else
{ public EntityJens(World worldIn) {
EntityPlayer entityplayer = (EntityPlayer)entity; super(worldIn);
return entityplayer.getHeldItemMainhand().getItem() == ModItems.RAM_ON_A_STICK || entityplayer.getHeldItemOffhand().getItem() == ModItems.RAM_ON_A_STICK; setSize(0.6F, 2.2F);
}
} }
public EntityJens createChild(EntityAgeable ageable)
{
return new EntityJens(this.world);
}
@Override @Override
public boolean processInteract(EntityPlayer player, EnumHand hand) protected void initEntityAI() {
{ this.tasks.addTask(0, new EntityAISwimming(this));
ItemStack itemstack = player.getHeldItem(hand); this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
EnumParticleTypes enumparticletypes = EnumParticleTypes.HEART; this.tasks.addTask(2, new EntityAIEatDroppedFish(this));
this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
if (itemstack.getItem() == Items.FISH && !player.capabilities.isCreativeMode && !this.isChild() && this.yummy_in_tummy == false) this.tasks.addTask(4, new EntityAITempt(this, 1.2D, false, TEMPTATION_ITEMS));
{ this.tasks.addTask(4, new EntityAITempt(this, 1.2D, ModItems.RAM_ON_A_STICK, false));
player.playSound(ModSoundEvents.ENTITY_JENS_EAT, 1.0F, 1.0F); this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
itemstack.shrink(1); this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 1.0D));
this.yummy_in_tummy = true; this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.time_until_surstroemming = 100; this.tasks.addTask(8, new EntityAILookIdle(this));
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(enumparticletypes, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
}
return true;
}
else
{
return super.processInteract(player, hand);
}
}
public void onLivingUpdate()
{
super.onLivingUpdate();
if (!this.world.isRemote && this.yummy_in_tummy == true && this.time_until_surstroemming > 0)
{
this.time_until_surstroemming--;
}
if (!this.world.isRemote && this.yummy_in_tummy == true && this.time_until_surstroemming <= 0)
{
this.playSound(ModSoundEvents.ENTITY_JENS_POOP, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
this.dropItem(ModItems.SURSTROEMMING, 1);
this.yummy_in_tummy = false;
this.time_until_surstroemming = 0;
}
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_JENS_AMBIENT;
} }
protected SoundEvent getHurtSound(DamageSource damageSourceIn) @Override
{ protected void applyEntityAttributes() {
return ModSoundEvents.ENTITY_JENS_HURT; super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
} }
protected SoundEvent getDeathSound() @Override
{ public boolean isBreedingItem(ItemStack stack) {
return ModSoundEvents.ENTITY_JENS_DEATH; return TEMPTATION_ITEMS.contains(stack.getItem());
}
public boolean isFishItem(ItemStack stack) {
return FISH_ITEMS.contains(stack.getItem());
}
@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 EntityJens createChild(EntityAgeable ageable) {
return new EntityJens(this.world);
}
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand) {
ItemStack itemstack = player.getHeldItem(hand);
if (itemstack.getItem() == Items.FISH && !player.capabilities.isCreativeMode && !this.isChild()
&& this.yummy_in_tummy == false) {
itemstack.shrink(1);
digestFish();
return true;
} else {
return super.processInteract(player, hand);
}
}
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if (!this.world.isRemote && this.yummy_in_tummy == true && this.time_until_surstroemming > 0) {
this.time_until_surstroemming--;
}
if (!this.world.isRemote && this.yummy_in_tummy == true && this.time_until_surstroemming <= 0) {
for (int i = 0; i < 7; ++i) {
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
MINECRAFT.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width,
this.posY + 0.5D + this.rand.nextFloat() * this.height,
this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
this.playSound(ModSoundEvents.ENTITY_JENS_POOP, 1.0F,
(this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
this.dropItem(ModItems.SURSTROEMMING, 1);
this.yummy_in_tummy = false;
this.time_until_surstroemming = 0;
}
}
public void digestFish() {
this.playSound(ModSoundEvents.ENTITY_JENS_EAT, 1.0F, 1.0F);
this.yummy_in_tummy = true;
this.time_until_surstroemming = 200;
for (int i = 0; i < 7; ++i) {
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
MINECRAFT.world.spawnParticle(EnumParticleTypes.HEART,
this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width,
this.posY + 0.5D + this.rand.nextFloat() * this.height,
this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
}
@Override
protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_JENS_AMBIENT;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_JENS_HURT;
}
@Override
protected SoundEvent getDeathSound() {
return ModSoundEvents.ENTITY_JENS_DEATH;
} }
} }

View file

@ -1,30 +1,29 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.misc.ModSoundEvents; import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityMarcellDAvis extends EntityZombie public class EntityMarcellDAvis extends EntityZombie {
{ public EntityMarcellDAvis(World worldIn) {
public EntityMarcellDAvis(World worldIn) super(worldIn);
{ this.setSize(0.6F, 1.95F);
super(worldIn);
this.setSize(0.6F, 1.95F);
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT;
} }
protected SoundEvent getHurtSound(DamageSource damageSourceIn) @Override
{ protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_MARCELLDAVIS_HURT; return ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT;
} }
protected SoundEvent getDeathSound() @Override
{ protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH; return ModSoundEvents.ENTITY_MARCELLDAVIS_HURT;
}
@Override
protected SoundEvent getDeathSound() {
return ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH;
} }
} }

View file

@ -1,30 +1,29 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.misc.ModSoundEvents; import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityMrBean extends EntityZombie public class EntityMrBean extends EntityZombie {
{ public EntityMrBean(World worldIn) {
public EntityMrBean(World worldIn) super(worldIn);
{ this.setSize(0.6F, 1.95F);
super(worldIn);
this.setSize(0.6F, 1.95F);
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_MRBEAN_AMBIENT;
} }
protected SoundEvent getHurtSound(DamageSource damageSourceIn) @Override
{ protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_MRBEAN_HURT; return ModSoundEvents.ENTITY_MRBEAN_AMBIENT;
} }
protected SoundEvent getDeathSound() @Override
{ protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_MRBEAN_DEATH; return ModSoundEvents.ENTITY_MRBEAN_HURT;
}
@Override
protected SoundEvent getDeathSound() {
return ModSoundEvents.ENTITY_MRBEAN_DEATH;
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -29,8 +30,7 @@ import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
public class EntitySchalkerBullet extends Entity public class EntitySchalkerBullet extends Entity {
{
private EntityLivingBase owner; private EntityLivingBase owner;
private Entity target; private Entity target;
@Nullable @Nullable
@ -46,406 +46,355 @@ public class EntitySchalkerBullet extends Entity
private UUID targetUniqueId; private UUID targetUniqueId;
private BlockPos targetBlockPos; private BlockPos targetBlockPos;
public EntitySchalkerBullet(World worldIn) public EntitySchalkerBullet(World worldIn) {
{ super(worldIn);
super(worldIn); this.setSize(0.3125F, 0.3125F);
this.setSize(0.3125F, 0.3125F); this.noClip = true;
this.noClip = true;
} }
public SoundCategory getSoundCategory() @Override
{ public SoundCategory getSoundCategory() {
return SoundCategory.HOSTILE; return SoundCategory.HOSTILE;
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public EntitySchalkerBullet(World worldIn, double x, double y, double z, double motionXIn, double motionYIn, double motionZIn) public EntitySchalkerBullet(World worldIn, double x, double y, double z, double motionXIn, double motionYIn,
{ double motionZIn) {
this(worldIn); this(worldIn);
this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch); this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch);
this.motionX = motionXIn; this.motionX = motionXIn;
this.motionY = motionYIn; this.motionY = motionYIn;
this.motionZ = motionZIn; this.motionZ = motionZIn;
} }
public EntitySchalkerBullet(World worldIn, EntityLivingBase ownerIn, Entity targetIn, EnumFacing.Axis p_i46772_4_) public EntitySchalkerBullet(World worldIn, EntityLivingBase ownerIn, Entity targetIn, EnumFacing.Axis p_i46772_4_) {
{ this(worldIn);
this(worldIn); this.owner = ownerIn;
this.owner = ownerIn; BlockPos blockpos = new BlockPos(ownerIn);
BlockPos blockpos = new BlockPos(ownerIn); double d0 = blockpos.getX() + 0.5D;
double d0 = (double)blockpos.getX() + 0.5D; double d1 = blockpos.getY() + 0.5D;
double d1 = (double)blockpos.getY() + 0.5D; double d2 = blockpos.getZ() + 0.5D;
double d2 = (double)blockpos.getZ() + 0.5D; this.setLocationAndAngles(d0, d1, d2, this.rotationYaw, this.rotationPitch);
this.setLocationAndAngles(d0, d1, d2, this.rotationYaw, this.rotationPitch); this.target = targetIn;
this.target = targetIn; this.direction = EnumFacing.UP;
this.direction = EnumFacing.UP; this.selectNextMoveDirection(p_i46772_4_);
this.selectNextMoveDirection(p_i46772_4_);
} }
/** /**
* (abstract) Protected helper method to write subclass entity data to NBT. * (abstract) Protected helper method to write subclass entity data to NBT.
*/ */
protected void writeEntityToNBT(NBTTagCompound compound) @Override
{ protected void writeEntityToNBT(NBTTagCompound compound) {
if (this.owner != null) if (this.owner != null) {
{ BlockPos blockpos = new BlockPos(this.owner);
BlockPos blockpos = new BlockPos(this.owner); NBTTagCompound nbttagcompound = NBTUtil.createUUIDTag(this.owner.getUniqueID());
NBTTagCompound nbttagcompound = NBTUtil.createUUIDTag(this.owner.getUniqueID()); nbttagcompound.setInteger("X", blockpos.getX());
nbttagcompound.setInteger("X", blockpos.getX()); nbttagcompound.setInteger("Y", blockpos.getY());
nbttagcompound.setInteger("Y", blockpos.getY()); nbttagcompound.setInteger("Z", blockpos.getZ());
nbttagcompound.setInteger("Z", blockpos.getZ()); compound.setTag("Owner", nbttagcompound);
compound.setTag("Owner", nbttagcompound); }
}
if (this.target != null) if (this.target != null) {
{ BlockPos blockpos1 = new BlockPos(this.target);
BlockPos blockpos1 = new BlockPos(this.target); NBTTagCompound nbttagcompound1 = NBTUtil.createUUIDTag(this.target.getUniqueID());
NBTTagCompound nbttagcompound1 = NBTUtil.createUUIDTag(this.target.getUniqueID()); nbttagcompound1.setInteger("X", blockpos1.getX());
nbttagcompound1.setInteger("X", blockpos1.getX()); nbttagcompound1.setInteger("Y", blockpos1.getY());
nbttagcompound1.setInteger("Y", blockpos1.getY()); nbttagcompound1.setInteger("Z", blockpos1.getZ());
nbttagcompound1.setInteger("Z", blockpos1.getZ()); compound.setTag("Target", nbttagcompound1);
compound.setTag("Target", nbttagcompound1); }
}
if (this.direction != null) if (this.direction != null) {
{ compound.setInteger("Dir", this.direction.getIndex());
compound.setInteger("Dir", this.direction.getIndex()); }
}
compound.setInteger("Steps", this.steps); compound.setInteger("Steps", this.steps);
compound.setDouble("TXD", this.targetDeltaX); compound.setDouble("TXD", this.targetDeltaX);
compound.setDouble("TYD", this.targetDeltaY); compound.setDouble("TYD", this.targetDeltaY);
compound.setDouble("TZD", this.targetDeltaZ); compound.setDouble("TZD", this.targetDeltaZ);
} }
/** /**
* (abstract) Protected helper method to read subclass entity data from NBT. * (abstract) Protected helper method to read subclass entity data from NBT.
*/ */
protected void readEntityFromNBT(NBTTagCompound compound) @Override
{ protected void readEntityFromNBT(NBTTagCompound compound) {
this.steps = compound.getInteger("Steps"); this.steps = compound.getInteger("Steps");
this.targetDeltaX = compound.getDouble("TXD"); this.targetDeltaX = compound.getDouble("TXD");
this.targetDeltaY = compound.getDouble("TYD"); this.targetDeltaY = compound.getDouble("TYD");
this.targetDeltaZ = compound.getDouble("TZD"); this.targetDeltaZ = compound.getDouble("TZD");
if (compound.hasKey("Dir", 99)) if (compound.hasKey("Dir", 99)) {
{ this.direction = EnumFacing.getFront(compound.getInteger("Dir"));
this.direction = EnumFacing.getFront(compound.getInteger("Dir")); }
}
if (compound.hasKey("Owner", 10)) if (compound.hasKey("Owner", 10)) {
{ NBTTagCompound nbttagcompound = compound.getCompoundTag("Owner");
NBTTagCompound nbttagcompound = compound.getCompoundTag("Owner"); this.ownerUniqueId = NBTUtil.getUUIDFromTag(nbttagcompound);
this.ownerUniqueId = NBTUtil.getUUIDFromTag(nbttagcompound); this.ownerBlockPos = new BlockPos(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Y"),
this.ownerBlockPos = new BlockPos(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Y"), nbttagcompound.getInteger("Z")); nbttagcompound.getInteger("Z"));
} }
if (compound.hasKey("Target", 10)) if (compound.hasKey("Target", 10)) {
{ NBTTagCompound nbttagcompound1 = compound.getCompoundTag("Target");
NBTTagCompound nbttagcompound1 = compound.getCompoundTag("Target"); this.targetUniqueId = NBTUtil.getUUIDFromTag(nbttagcompound1);
this.targetUniqueId = NBTUtil.getUUIDFromTag(nbttagcompound1); this.targetBlockPos = new BlockPos(nbttagcompound1.getInteger("X"), nbttagcompound1.getInteger("Y"),
this.targetBlockPos = new BlockPos(nbttagcompound1.getInteger("X"), nbttagcompound1.getInteger("Y"), nbttagcompound1.getInteger("Z")); nbttagcompound1.getInteger("Z"));
} }
} }
protected void entityInit() @Override
{ protected void entityInit() {
} }
private void setDirection(@Nullable EnumFacing directionIn) private void setDirection(@Nullable EnumFacing directionIn) {
{ this.direction = directionIn;
this.direction = directionIn;
} }
private void selectNextMoveDirection(@Nullable EnumFacing.Axis p_184569_1_) private void selectNextMoveDirection(@Nullable EnumFacing.Axis p_184569_1_) {
{ double d0 = 0.5D;
double d0 = 0.5D; BlockPos blockpos;
BlockPos blockpos;
if (this.target == null) if (this.target == null) {
{ blockpos = (new BlockPos(this)).down();
blockpos = (new BlockPos(this)).down(); } else {
} d0 = this.target.height * 0.5D;
else blockpos = new BlockPos(this.target.posX, this.target.posY + d0, this.target.posZ);
{ }
d0 = (double)this.target.height * 0.5D;
blockpos = new BlockPos(this.target.posX, this.target.posY + d0, this.target.posZ);
}
double d1 = (double)blockpos.getX() + 0.5D; double d1 = blockpos.getX() + 0.5D;
double d2 = (double)blockpos.getY() + d0; double d2 = blockpos.getY() + d0;
double d3 = (double)blockpos.getZ() + 0.5D; double d3 = blockpos.getZ() + 0.5D;
EnumFacing enumfacing = null; EnumFacing enumfacing = null;
if (blockpos.distanceSqToCenter(this.posX, this.posY, this.posZ) >= 4.0D) if (blockpos.distanceSqToCenter(this.posX, this.posY, this.posZ) >= 4.0D) {
{ BlockPos blockpos1 = new BlockPos(this);
BlockPos blockpos1 = new BlockPos(this); List<EnumFacing> list = Lists.<EnumFacing>newArrayList();
List<EnumFacing> list = Lists.<EnumFacing>newArrayList();
if (p_184569_1_ != EnumFacing.Axis.X) if (p_184569_1_ != EnumFacing.Axis.X) {
{ if (blockpos1.getX() < blockpos.getX() && this.world.isAirBlock(blockpos1.east())) {
if (blockpos1.getX() < blockpos.getX() && this.world.isAirBlock(blockpos1.east())) list.add(EnumFacing.EAST);
{ } else if (blockpos1.getX() > blockpos.getX() && this.world.isAirBlock(blockpos1.west())) {
list.add(EnumFacing.EAST); list.add(EnumFacing.WEST);
} }
else if (blockpos1.getX() > blockpos.getX() && this.world.isAirBlock(blockpos1.west())) }
{
list.add(EnumFacing.WEST);
}
}
if (p_184569_1_ != EnumFacing.Axis.Y) if (p_184569_1_ != EnumFacing.Axis.Y) {
{ if (blockpos1.getY() < blockpos.getY() && this.world.isAirBlock(blockpos1.up())) {
if (blockpos1.getY() < blockpos.getY() && this.world.isAirBlock(blockpos1.up())) list.add(EnumFacing.UP);
{ } else if (blockpos1.getY() > blockpos.getY() && this.world.isAirBlock(blockpos1.down())) {
list.add(EnumFacing.UP); list.add(EnumFacing.DOWN);
} }
else if (blockpos1.getY() > blockpos.getY() && this.world.isAirBlock(blockpos1.down())) }
{
list.add(EnumFacing.DOWN);
}
}
if (p_184569_1_ != EnumFacing.Axis.Z) if (p_184569_1_ != EnumFacing.Axis.Z) {
{ if (blockpos1.getZ() < blockpos.getZ() && this.world.isAirBlock(blockpos1.south())) {
if (blockpos1.getZ() < blockpos.getZ() && this.world.isAirBlock(blockpos1.south())) list.add(EnumFacing.SOUTH);
{ } else if (blockpos1.getZ() > blockpos.getZ() && this.world.isAirBlock(blockpos1.north())) {
list.add(EnumFacing.SOUTH); list.add(EnumFacing.NORTH);
} }
else if (blockpos1.getZ() > blockpos.getZ() && this.world.isAirBlock(blockpos1.north())) }
{
list.add(EnumFacing.NORTH);
}
}
enumfacing = EnumFacing.random(this.rand); enumfacing = EnumFacing.random(this.rand);
if (list.isEmpty()) if (list.isEmpty()) {
{ for (int i = 5; !this.world.isAirBlock(blockpos1.offset(enumfacing)) && i > 0; --i) {
for (int i = 5; !this.world.isAirBlock(blockpos1.offset(enumfacing)) && i > 0; --i) enumfacing = EnumFacing.random(this.rand);
{ }
enumfacing = EnumFacing.random(this.rand); } else {
} enumfacing = list.get(this.rand.nextInt(list.size()));
} }
else
{
enumfacing = list.get(this.rand.nextInt(list.size()));
}
d1 = this.posX + (double)enumfacing.getFrontOffsetX(); d1 = this.posX + enumfacing.getFrontOffsetX();
d2 = this.posY + (double)enumfacing.getFrontOffsetY(); d2 = this.posY + enumfacing.getFrontOffsetY();
d3 = this.posZ + (double)enumfacing.getFrontOffsetZ(); d3 = this.posZ + enumfacing.getFrontOffsetZ();
} }
this.setDirection(enumfacing); this.setDirection(enumfacing);
double d6 = d1 - this.posX; double d6 = d1 - this.posX;
double d7 = d2 - this.posY; double d7 = d2 - this.posY;
double d4 = d3 - this.posZ; double d4 = d3 - this.posZ;
double d5 = (double)MathHelper.sqrt(d6 * d6 + d7 * d7 + d4 * d4); double d5 = MathHelper.sqrt(d6 * d6 + d7 * d7 + d4 * d4);
if (d5 == 0.0D) if (d5 == 0.0D) {
{ this.targetDeltaX = 0.0D;
this.targetDeltaX = 0.0D; this.targetDeltaY = 0.0D;
this.targetDeltaY = 0.0D; this.targetDeltaZ = 0.0D;
this.targetDeltaZ = 0.0D; } else {
} this.targetDeltaX = d6 / d5 * 0.15D;
else this.targetDeltaY = d7 / d5 * 0.15D;
{ this.targetDeltaZ = d4 / d5 * 0.15D;
this.targetDeltaX = d6 / d5 * 0.15D; }
this.targetDeltaY = d7 / d5 * 0.15D;
this.targetDeltaZ = d4 / d5 * 0.15D;
}
this.isAirBorne = true; this.isAirBorne = true;
this.steps = 10 + this.rand.nextInt(5) * 10; this.steps = 10 + this.rand.nextInt(5) * 10;
} }
/** /**
* Called to update the entity's position/logic. * Called to update the entity's position/logic.
*/ */
public void onUpdate() @Override
{ public void onUpdate() {
if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL) if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL) {
{ this.setDead();
this.setDead(); } else {
} super.onUpdate();
else
{
super.onUpdate();
if (!this.world.isRemote) if (!this.world.isRemote) {
{ if (this.target == null && this.targetUniqueId != null) {
if (this.target == null && this.targetUniqueId != null) for (EntityLivingBase entitylivingbase : this.world.getEntitiesWithinAABB(EntityLivingBase.class,
{ new AxisAlignedBB(this.targetBlockPos.add(-2, -2, -2), this.targetBlockPos.add(2, 2, 2)))) {
for (EntityLivingBase entitylivingbase : this.world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(this.targetBlockPos.add(-2, -2, -2), this.targetBlockPos.add(2, 2, 2)))) if (entitylivingbase.getUniqueID().equals(this.targetUniqueId)) {
{ this.target = entitylivingbase;
if (entitylivingbase.getUniqueID().equals(this.targetUniqueId)) break;
{ }
this.target = entitylivingbase; }
break;
}
}
this.targetUniqueId = null; this.targetUniqueId = null;
} }
if (this.owner == null && this.ownerUniqueId != null) if (this.owner == null && this.ownerUniqueId != null) {
{ for (EntityLivingBase entitylivingbase1 : this.world.getEntitiesWithinAABB(EntityLivingBase.class,
for (EntityLivingBase entitylivingbase1 : this.world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(this.ownerBlockPos.add(-2, -2, -2), this.ownerBlockPos.add(2, 2, 2)))) new AxisAlignedBB(this.ownerBlockPos.add(-2, -2, -2), this.ownerBlockPos.add(2, 2, 2)))) {
{ if (entitylivingbase1.getUniqueID().equals(this.ownerUniqueId)) {
if (entitylivingbase1.getUniqueID().equals(this.ownerUniqueId)) this.owner = entitylivingbase1;
{ break;
this.owner = entitylivingbase1; }
break; }
}
}
this.ownerUniqueId = null; this.ownerUniqueId = null;
} }
if (this.target == null || !this.target.isEntityAlive() || this.target instanceof EntityPlayer && ((EntityPlayer)this.target).isSpectator()) if (this.target == null || !this.target.isEntityAlive()
{ || this.target instanceof EntityPlayer && ((EntityPlayer) this.target).isSpectator()) {
if (!this.hasNoGravity()) if (!this.hasNoGravity()) {
{ this.motionY -= 0.04D;
this.motionY -= 0.04D; }
} } else {
} this.targetDeltaX = MathHelper.clamp(this.targetDeltaX * 1.025D, -1.0D, 1.0D);
else this.targetDeltaY = MathHelper.clamp(this.targetDeltaY * 1.025D, -1.0D, 1.0D);
{ this.targetDeltaZ = MathHelper.clamp(this.targetDeltaZ * 1.025D, -1.0D, 1.0D);
this.targetDeltaX = MathHelper.clamp(this.targetDeltaX * 1.025D, -1.0D, 1.0D); this.motionX += (this.targetDeltaX - this.motionX) * 0.2D;
this.targetDeltaY = MathHelper.clamp(this.targetDeltaY * 1.025D, -1.0D, 1.0D); this.motionY += (this.targetDeltaY - this.motionY) * 0.2D;
this.targetDeltaZ = MathHelper.clamp(this.targetDeltaZ * 1.025D, -1.0D, 1.0D); this.motionZ += (this.targetDeltaZ - this.motionZ) * 0.2D;
this.motionX += (this.targetDeltaX - this.motionX) * 0.2D; }
this.motionY += (this.targetDeltaY - this.motionY) * 0.2D;
this.motionZ += (this.targetDeltaZ - this.motionZ) * 0.2D;
}
RayTraceResult raytraceresult = ProjectileHelper.forwardsRaycast(this, true, false, this.owner); RayTraceResult raytraceresult = ProjectileHelper.forwardsRaycast(this, true, false, this.owner);
if (raytraceresult != null && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) if (raytraceresult != null
{ && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
this.bulletHit(raytraceresult); this.bulletHit(raytraceresult);
} }
} }
this.setPosition(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); this.setPosition(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
ProjectileHelper.rotateTowardsMovement(this, 0.5F); ProjectileHelper.rotateTowardsMovement(this, 0.5F);
if (this.world.isRemote) if (this.world.isRemote) {
{ this.world.spawnParticle(EnumParticleTypes.END_ROD, this.posX - this.motionX,
this.world.spawnParticle(EnumParticleTypes.END_ROD, this.posX - this.motionX, this.posY - this.motionY + 0.15D, this.posZ - this.motionZ, 0.0D, 0.0D, 0.0D); this.posY - this.motionY + 0.15D, this.posZ - this.motionZ, 0.0D, 0.0D, 0.0D);
} } else if (this.target != null && !this.target.isDead) {
else if (this.target != null && !this.target.isDead) if (this.steps > 0) {
{ --this.steps;
if (this.steps > 0)
{
--this.steps;
if (this.steps == 0) if (this.steps == 0) {
{ this.selectNextMoveDirection(this.direction == null ? null : this.direction.getAxis());
this.selectNextMoveDirection(this.direction == null ? null : this.direction.getAxis()); }
} }
}
if (this.direction != null) if (this.direction != null) {
{ BlockPos blockpos = new BlockPos(this);
BlockPos blockpos = new BlockPos(this); EnumFacing.Axis enumfacing$axis = this.direction.getAxis();
EnumFacing.Axis enumfacing$axis = this.direction.getAxis();
if (this.world.isBlockNormalCube(blockpos.offset(this.direction), false)) if (this.world.isBlockNormalCube(blockpos.offset(this.direction), false)) {
{ this.selectNextMoveDirection(enumfacing$axis);
this.selectNextMoveDirection(enumfacing$axis); } else {
} BlockPos blockpos1 = new BlockPos(this.target);
else
{
BlockPos blockpos1 = new BlockPos(this.target);
if (enumfacing$axis == EnumFacing.Axis.X && blockpos.getX() == blockpos1.getX() || enumfacing$axis == EnumFacing.Axis.Z && blockpos.getZ() == blockpos1.getZ() || enumfacing$axis == EnumFacing.Axis.Y && blockpos.getY() == blockpos1.getY()) if (enumfacing$axis == EnumFacing.Axis.X && blockpos.getX() == blockpos1.getX()
{ || enumfacing$axis == EnumFacing.Axis.Z && blockpos.getZ() == blockpos1.getZ()
this.selectNextMoveDirection(enumfacing$axis); || enumfacing$axis == EnumFacing.Axis.Y && blockpos.getY() == blockpos1.getY()) {
} this.selectNextMoveDirection(enumfacing$axis);
} }
} }
} }
} }
}
} }
/** /**
* Returns true if the entity is on fire. Used by render to add the fire effect on rendering. * Returns true if the entity is on fire. Used by render to add the fire effect
* on rendering.
*/ */
public boolean isBurning() @Override
{ public boolean isBurning() {
return false; return false;
} }
/** /**
* Checks if the entity is in range to render. * Checks if the entity is in range to render.
*/ */
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance) public boolean isInRangeToRenderDist(double distance) {
{ return distance < 16384.0D;
return distance < 16384.0D;
} }
/** /**
* Gets how bright this entity is. * Gets how bright this entity is.
*/ */
public float getBrightness() @Override
{ public float getBrightness() {
return 1.0F; return 1.0F;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getBrightnessForRender() public int getBrightnessForRender() {
{ return 15728880;
return 15728880;
} }
protected void bulletHit(RayTraceResult result) protected void bulletHit(RayTraceResult result) {
{ if (result.entityHit == null) {
if (result.entityHit == null) ((WorldServer) this.world).spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ,
{ 2, 0.2D, 0.2D, 0.2D, 0.0D);
((WorldServer)this.world).spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 2, 0.2D, 0.2D, 0.2D, 0.0D); this.playSound(SoundEvents.ENTITY_SHULKER_BULLET_HIT, 1.0F, 1.0F);
this.playSound(SoundEvents.ENTITY_SHULKER_BULLET_HIT, 1.0F, 1.0F); } else {
} boolean flag = result.entityHit
else .attackEntityFrom(DamageSource.causeIndirectDamage(this, this.owner).setProjectile(), 4.0F);
{
boolean flag = result.entityHit.attackEntityFrom(DamageSource.causeIndirectDamage(this, this.owner).setProjectile(), 4.0F);
if (flag) if (flag) {
{ this.applyEnchantments(this.owner, result.entityHit);
this.applyEnchantments(this.owner, result.entityHit);
if (result.entityHit instanceof EntityLivingBase) if (result.entityHit instanceof EntityLivingBase) {
{ ((EntityLivingBase) result.entityHit).addPotionEffect(new PotionEffect(MobEffects.LEVITATION, 200));
((EntityLivingBase)result.entityHit).addPotionEffect(new PotionEffect(MobEffects.LEVITATION, 200)); }
} }
} }
}
this.setDead(); this.setDead();
} }
/** /**
* Returns true if other Entities should be prevented from moving through this Entity. * Returns true if other Entities should be prevented from moving through this
* Entity.
*/ */
public boolean canBeCollidedWith() @Override
{ public boolean canBeCollidedWith() {
return true; return true;
} }
/** /**
* Called when the entity is attacked. * Called when the entity is attacked.
*/ */
public boolean attackEntityFrom(DamageSource source, float amount) @Override
{ public boolean attackEntityFrom(DamageSource source, float amount) {
if (!this.world.isRemote) if (!this.world.isRemote) {
{ this.playSound(SoundEvents.ENTITY_SHULKER_BULLET_HURT, 1.0F, 1.0F);
this.playSound(SoundEvents.ENTITY_SHULKER_BULLET_HURT, 1.0F, 1.0F); ((WorldServer) this.world).spawnParticle(EnumParticleTypes.CRIT, this.posX, this.posY, this.posZ, 15, 0.2D,
((WorldServer)this.world).spawnParticle(EnumParticleTypes.CRIT, this.posX, this.posY, this.posZ, 15, 0.2D, 0.2D, 0.2D, 0.0D); 0.2D, 0.2D, 0.0D);
this.setDead(); this.setDead();
} }
return true; return true;
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.misc.ModSoundEvents; import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityCreeper;
@ -6,75 +7,67 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntitySmavaCreeper extends EntityCreeper public class EntitySmavaCreeper extends EntityCreeper {
{ private int lastActiveTime;
private int lastActiveTime; private int timeSinceIgnited;
private int timeSinceIgnited; private int fuseTime = 20;
private int fuseTime = 20; private int explosionRadius = 6;
private int explosionRadius = 6;
public EntitySmavaCreeper(World worldIn) {
public EntitySmavaCreeper(World worldIn) super(worldIn);
{ setSize(0.6F, 1.7F);
super(worldIn); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
setSize(0.6F, 1.7F);
getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
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();
}
private void explode()
{
if (!this.world.isRemote)
{
boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_SMAVACREEPER_BLOW, getSoundCategory(), 5.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius * f, flag);
this.setDead();
}
} }
protected SoundEvent getHurtSound(DamageSource damageSourceIn) @Override
{ public void onUpdate() {
return ModSoundEvents.ENTITY_SMAVACREEPER_HURT; 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() private void explode() {
{ if (!this.world.isRemote) {
return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT; boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_SMAVACREEPER_BLOW, getSoundCategory(), 5.0F,
1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, this.explosionRadius * f, flag);
this.setDead();
}
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_SMAVACREEPER_HURT;
}
@Override
protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT;
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.entities; package mod.acgaming.spackenmobs.entities;
import java.util.UUID; import java.util.UUID;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -17,147 +18,123 @@ import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityWolfMZTE extends EntityWolf public class EntityWolfMZTE extends EntityWolf {
{ private static final DataParameter<Float> DATA_HEALTH_ID = EntityDataManager.<Float>createKey(EntityWolf.class,
private static final DataParameter<Float> DATA_HEALTH_ID = EntityDataManager.<Float>createKey(EntityWolf.class, DataSerializers.FLOAT); DataSerializers.FLOAT);
private static final DataParameter<Boolean> BEGGING = EntityDataManager.<Boolean>createKey(EntityWolf.class, DataSerializers.BOOLEAN); private static final DataParameter<Boolean> BEGGING = EntityDataManager.<Boolean>createKey(EntityWolf.class,
private static final DataParameter<Integer> COLLAR_COLOR = EntityDataManager.<Integer>createKey(EntityWolf.class, DataSerializers.VARINT); DataSerializers.BOOLEAN);
private static final DataParameter<Integer> COLLAR_COLOR = EntityDataManager.<Integer>createKey(EntityWolf.class,
DataSerializers.VARINT);
private float headRotationCourse; private float headRotationCourse;
private float headRotationCourseOld; private float headRotationCourseOld;
private boolean isWet; private boolean isWet;
private boolean isShaking; private boolean isShaking;
private float timeWolfIsShaking; private float timeWolfIsShaking;
private float prevTimeWolfIsShaking; private float prevTimeWolfIsShaking;
public EntityWolfMZTE(World worldIn) public EntityWolfMZTE(World worldIn) {
{ super(worldIn);
super(worldIn); this.setSize(0.6F, 0.85F);
this.setSize(0.6F, 0.85F); this.setTamed(false);
this.setTamed(false);
} }
public EntityWolfMZTE createChild(EntityAgeable ageable)
{
EntityWolfMZTE entitywolfmzte = new EntityWolfMZTE(this.world);
UUID uuid = this.getOwnerId();
if (uuid != null) @Override
{ public EntityWolfMZTE createChild(EntityAgeable ageable) {
entitywolfmzte.setOwnerId(uuid); EntityWolfMZTE entitywolfmzte = new EntityWolfMZTE(this.world);
entitywolfmzte.setTamed(true); UUID uuid = this.getOwnerId();
}
return entitywolfmzte; if (uuid != null) {
entitywolfmzte.setOwnerId(uuid);
entitywolfmzte.setTamed(true);
}
return entitywolfmzte;
} }
public boolean canMateWith(EntityAnimal otherAnimal)
{
if (otherAnimal == this)
{
return false;
}
else if (!this.isTamed())
{
return false;
}
else if (!(otherAnimal instanceof EntityWolfMZTE))
{
return false;
}
else
{
EntityWolfMZTE entitywolfmzte = (EntityWolfMZTE)otherAnimal;
if (!entitywolfmzte.isTamed()) @Override
{ public boolean canMateWith(EntityAnimal otherAnimal) {
return false; if (otherAnimal == this) {
} return false;
else if (entitywolfmzte.isSitting()) } else if (!this.isTamed()) {
{ return false;
return false; } else if (!(otherAnimal instanceof EntityWolfMZTE)) {
} return false;
else } else {
{ EntityWolfMZTE entitywolfmzte = (EntityWolfMZTE) otherAnimal;
return this.isInLove() && entitywolfmzte.isInLove();
} if (!entitywolfmzte.isTamed()) {
} return false;
} else if (entitywolfmzte.isSitting()) {
return false;
} else {
return this.isInLove() && entitywolfmzte.isInLove();
}
}
} }
public boolean shouldAttackEntity(EntityLivingBase target, EntityLivingBase owner)
{
if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast))
{
if (target instanceof EntityWolfMZTE)
{
EntityWolfMZTE entitywolfmzte = (EntityWolfMZTE)target;
if (entitywolfmzte.isTamed() && entitywolfmzte.getOwner() == owner) @Override
{ public boolean shouldAttackEntity(EntityLivingBase target, EntityLivingBase owner) {
return false; if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast)) {
} if (target instanceof EntityWolfMZTE) {
} EntityWolfMZTE entitywolfmzte = (EntityWolfMZTE) target;
if (target instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer)owner).canAttackPlayer((EntityPlayer)target)) if (entitywolfmzte.isTamed() && entitywolfmzte.getOwner() == owner) {
{ return false;
return false; }
} }
else
{ if (target instanceof EntityPlayer && owner instanceof EntityPlayer
return !(target instanceof AbstractHorse) || !((AbstractHorse)target).isTame(); && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target)) {
} return false;
} } else {
else return !(target instanceof AbstractHorse) || !((AbstractHorse) target).isTame();
{ }
return false; } else {
} return false;
}
} }
class AIAvoidEntity<T extends Entity> extends EntityAIAvoidEntity<T>
{
private final EntityWolfMZTE wolf;
public AIAvoidEntity(EntityWolfMZTE wolfIn, Class<T> p_i47251_3_, float p_i47251_4_, double p_i47251_5_, double p_i47251_7_) class AIAvoidEntity<T extends Entity> extends EntityAIAvoidEntity<T> {
{ private final EntityWolfMZTE wolf;
super(wolfIn, p_i47251_3_, p_i47251_4_, p_i47251_5_, p_i47251_7_);
this.wolf = wolfIn;
}
/** public AIAvoidEntity(EntityWolfMZTE wolfIn, Class<T> p_i47251_3_, float p_i47251_4_, double p_i47251_5_,
* Returns whether the EntityAIBase should begin execution. double p_i47251_7_) {
*/ super(wolfIn, p_i47251_3_, p_i47251_4_, p_i47251_5_, p_i47251_7_);
public boolean shouldExecute() this.wolf = wolfIn;
{ }
if (super.shouldExecute() && this.closestLivingEntity instanceof EntityLlama)
{
return !this.wolf.isTamed() && this.avoidLlama((EntityLlama)this.closestLivingEntity);
}
else
{
return false;
}
}
private boolean avoidLlama(EntityLlama p_190854_1_) /**
{ * Returns whether the EntityAIBase should begin execution.
return p_190854_1_.getStrength() >= EntityWolfMZTE.this.rand.nextInt(5); */
} @Override
public boolean shouldExecute() {
if (super.shouldExecute() && this.closestLivingEntity instanceof EntityLlama) {
return !this.wolf.isTamed() && this.avoidLlama((EntityLlama) this.closestLivingEntity);
} else {
return false;
}
}
/** private boolean avoidLlama(EntityLlama p_190854_1_) {
* Execute a one shot task or start executing a continuous task return p_190854_1_.getStrength() >= EntityWolfMZTE.this.rand.nextInt(5);
*/ }
public void startExecuting()
{
EntityWolfMZTE.this.setAttackTarget((EntityLivingBase)null);
super.startExecuting();
}
/** /**
* Keep ticking a continuous task that has already been started * Execute a one shot task or start executing a continuous task
*/ */
public void updateTask() @Override
{ public void startExecuting() {
EntityWolfMZTE.this.setAttackTarget((EntityLivingBase)null); EntityWolfMZTE.this.setAttackTarget((EntityLivingBase) null);
super.updateTask(); super.startExecuting();
} }
/**
* Keep ticking a continuous task that has already been started
*/
@Override
public void updateTask() {
EntityWolfMZTE.this.setAttackTarget((EntityLivingBase) null);
super.updateTask();
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.items; package mod.acgaming.spackenmobs.items;
import mod.acgaming.spackenmobs.Spackenmobs; import mod.acgaming.spackenmobs.Spackenmobs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@ -7,18 +8,15 @@ import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemBase extends Item public class ItemBase extends Item {
{ public ItemBase(String name, CreativeTabs tab) {
public ItemBase(String name, CreativeTabs tab) setRegistryName(name);
{ setUnlocalizedName(Spackenmobs.MODID + "." + name);
setRegistryName(name); setCreativeTab(tab);
setUnlocalizedName(Spackenmobs.MODID + "." + name);
setCreativeTab(tab);
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void initModel() public void initModel() {
{ ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
} }
} }

View file

@ -1,13 +1,12 @@
package mod.acgaming.spackenmobs.items; package mod.acgaming.spackenmobs.items;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
public class ItemPotion extends Potion public class ItemPotion extends Potion {
{ public ItemPotion(String name, boolean isBadPotion, int color, int iconIndexX, int iconIndexY) {
public ItemPotion(String name, boolean isBadPotion, int color, int iconIndexX, int iconIndexY) super(isBadPotion, color);
{ setPotionName("effect." + name);
super(isBadPotion, color); setIconIndex(iconIndexX, iconIndexY);
setPotionName("effect." + name); setRegistryName(name);
setIconIndex(iconIndexX, iconIndexY); }
setRegistryName(name);
}
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.misc; package mod.acgaming.spackenmobs.misc;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -8,38 +9,31 @@ import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biome.SpawnListEntry; import net.minecraft.world.biome.Biome.SpawnListEntry;
// Thanks to Vazkii! // Thanks to Vazkii!
public class BiomeHelper public class BiomeHelper {
{
public static Biome[] getBiomesWithMonster(Class<? extends Entity> clazz) public static Biome[] getBiomesWithMonster(Class<? extends Entity> clazz) {
{ List<Biome> biomes = new ArrayList<>();
List<Biome> biomes = new ArrayList<>(); for (Biome b : Biome.REGISTRY) {
for (Biome b : Biome.REGISTRY) List<SpawnListEntry> spawnList = b.getSpawnableList(EnumCreatureType.MONSTER);
{ for (SpawnListEntry e : spawnList)
List<SpawnListEntry> spawnList = b.getSpawnableList(EnumCreatureType.MONSTER); if (e.entityClass == clazz) {
for (SpawnListEntry e : spawnList) biomes.add(b);
if (e.entityClass == clazz) break;
{
biomes.add(b);
break;
}
} }
return biomes.toArray(new Biome[0]);
} }
return biomes.toArray(new Biome[0]);
public static Biome[] getBiomesWithCreature(Class<? extends Entity> clazz) }
{
List<Biome> biomes = new ArrayList<>(); public static Biome[] getBiomesWithCreature(Class<? extends Entity> clazz) {
for (Biome b : Biome.REGISTRY) List<Biome> biomes = new ArrayList<>();
{ for (Biome b : Biome.REGISTRY) {
List<SpawnListEntry> spawnList = b.getSpawnableList(EnumCreatureType.CREATURE); List<SpawnListEntry> spawnList = b.getSpawnableList(EnumCreatureType.CREATURE);
for (SpawnListEntry e : spawnList) for (SpawnListEntry e : spawnList)
if (e.entityClass == clazz) if (e.entityClass == clazz) {
{ biomes.add(b);
biomes.add(b); break;
break;
}
} }
return biomes.toArray(new Biome[0]);
} }
return biomes.toArray(new Biome[0]);
}
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.misc; package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.entities.EntityApoRed; import mod.acgaming.spackenmobs.entities.EntityApoRed;
import mod.acgaming.spackenmobs.entities.EntityDrachenlord; import mod.acgaming.spackenmobs.entities.EntityDrachenlord;
import mod.acgaming.spackenmobs.entities.EntityHolzstammhuhn; import mod.acgaming.spackenmobs.entities.EntityHolzstammhuhn;
@ -21,19 +22,17 @@ import mod.acgaming.spackenmobs.render.RenderSmavaCreeper;
import mod.acgaming.spackenmobs.render.RenderWolfMZTE; import mod.acgaming.spackenmobs.render.RenderWolfMZTE;
import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.client.registry.RenderingRegistry;
public class ModEntities public class ModEntities {
{ public static void initModels() {
public static void initModels() RenderingRegistry.registerEntityRenderingHandler(EntityApoRed.class, RenderApoRed.FACTORY);
{ RenderingRegistry.registerEntityRenderingHandler(EntityDrachenlord.class, RenderDrachenlord.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityApoRed.class, RenderApoRed.FACTORY); RenderingRegistry.registerEntityRenderingHandler(EntityIslamist.class, RenderIslamist.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityDrachenlord.class, RenderDrachenlord.FACTORY); RenderingRegistry.registerEntityRenderingHandler(EntityJens.class, RenderJens.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityIslamist.class, RenderIslamist.FACTORY); RenderingRegistry.registerEntityRenderingHandler(EntityMarcellDAvis.class, RenderMarcellDAvis.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityJens.class, RenderJens.FACTORY); RenderingRegistry.registerEntityRenderingHandler(EntityMrBean.class, RenderMrBean.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityMarcellDAvis.class, RenderMarcellDAvis.FACTORY); RenderingRegistry.registerEntityRenderingHandler(EntitySchalker.class, RenderSchalker.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityMrBean.class, RenderMrBean.FACTORY); RenderingRegistry.registerEntityRenderingHandler(EntitySmavaCreeper.class, RenderSmavaCreeper.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntitySchalker.class, RenderSchalker.FACTORY); RenderingRegistry.registerEntityRenderingHandler(EntityWolfMZTE.class, RenderWolfMZTE.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntitySmavaCreeper.class, RenderSmavaCreeper.FACTORY); RenderingRegistry.registerEntityRenderingHandler(EntityHolzstammhuhn.class, RenderHolzstammhuhn.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityWolfMZTE.class, RenderWolfMZTE.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityHolzstammhuhn.class, RenderHolzstammhuhn.FACTORY);
} }
} }

View file

@ -1,12 +1,12 @@
package mod.acgaming.spackenmobs.misc; package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.Spackenmobs; import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.items.ItemBase; import mod.acgaming.spackenmobs.items.ItemBase;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder; import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
@ObjectHolder(Spackenmobs.MODID) @ObjectHolder(Spackenmobs.MODID)
public class ModItems public class ModItems {
{
public static final Item RAM = new ItemBase("ram", Spackenmobs.SPACKENMOBS_TAB); public static final Item RAM = new ItemBase("ram", Spackenmobs.SPACKENMOBS_TAB);
public static final Item RAM_ON_A_STICK = new ItemBase("ram_on_a_stick", Spackenmobs.SPACKENMOBS_TAB); public static final Item RAM_ON_A_STICK = new ItemBase("ram_on_a_stick", Spackenmobs.SPACKENMOBS_TAB);
public static final Item SURSTROEMMING = new ItemBase("surstroemming", Spackenmobs.SPACKENMOBS_TAB); public static final Item SURSTROEMMING = new ItemBase("surstroemming", Spackenmobs.SPACKENMOBS_TAB);

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.misc; package mod.acgaming.spackenmobs.misc;
public class ModPotions public class ModPotions {
{
} }

View file

@ -1,48 +1,79 @@
package mod.acgaming.spackenmobs.misc; package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.Spackenmobs; import mod.acgaming.spackenmobs.Spackenmobs;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder; import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
@ObjectHolder(Spackenmobs.MODID) @ObjectHolder(Spackenmobs.MODID)
public class ModSoundEvents public class ModSoundEvents {
{ public static final SoundEvent ENTITY_SMAVACREEPER_FUSE = new SoundEvent(
public static final SoundEvent ENTITY_SMAVACREEPER_FUSE = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.fuse")); new ResourceLocation("spackenmobs:entities.smava_creeper.fuse"));
public static final SoundEvent ENTITY_SMAVACREEPER_BLOW = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.blow")); public static final SoundEvent ENTITY_SMAVACREEPER_BLOW = new SoundEvent(
public static final SoundEvent ENTITY_SMAVACREEPER_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt")); new ResourceLocation("spackenmobs:entities.smava_creeper.blow"));
public static final SoundEvent ENTITY_SMAVACREEPER_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient")); public static final SoundEvent ENTITY_SMAVACREEPER_HURT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.smava_creeper.hurt"));
public static final SoundEvent ENTITY_MARCELLDAVIS_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient")); public static final SoundEvent ENTITY_SMAVACREEPER_AMBIENT = new SoundEvent(
public static final SoundEvent ENTITY_MARCELLDAVIS_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt")); new ResourceLocation("spackenmobs:entities.smava_creeper.ambient"));
public static final SoundEvent ENTITY_MARCELLDAVIS_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.marcell_davis.death"));
public static final SoundEvent ENTITY_MARCELLDAVIS_AMBIENT = new SoundEvent(
public static final SoundEvent ENTITY_ISLAMIST_FUSE = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.fuse")); new ResourceLocation("spackenmobs:entities.marcell_davis.ambient"));
public static final SoundEvent ENTITY_ISLAMIST_BLOW = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.blow")); public static final SoundEvent ENTITY_MARCELLDAVIS_HURT = new SoundEvent(
public static final SoundEvent ENTITY_ISLAMIST_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.hurt")); new ResourceLocation("spackenmobs:entities.marcell_davis.hurt"));
public static final SoundEvent ENTITY_ISLAMIST_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.islamist.ambient")); public static final SoundEvent ENTITY_MARCELLDAVIS_DEATH = new SoundEvent(
new ResourceLocation("spackenmobs:entities.marcell_davis.death"));
public static final SoundEvent ENTITY_APORED_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.ambient"));
public static final SoundEvent ENTITY_APORED_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.hurt")); public static final SoundEvent ENTITY_ISLAMIST_FUSE = new SoundEvent(
public static final SoundEvent ENTITY_APORED_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.apored.death")); new ResourceLocation("spackenmobs:entities.islamist.fuse"));
public static final SoundEvent ENTITY_ISLAMIST_BLOW = new SoundEvent(
public static final SoundEvent ENTITY_MRBEAN_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.ambient")); new ResourceLocation("spackenmobs:entities.islamist.blow"));
public static final SoundEvent ENTITY_MRBEAN_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.hurt")); public static final SoundEvent ENTITY_ISLAMIST_HURT = new SoundEvent(
public static final SoundEvent ENTITY_MRBEAN_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.mr_bean.death")); new ResourceLocation("spackenmobs:entities.islamist.hurt"));
public static final SoundEvent ENTITY_ISLAMIST_AMBIENT = new SoundEvent(
public static final SoundEvent ENTITY_DRACHENLORD_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.ambient")); new ResourceLocation("spackenmobs:entities.islamist.ambient"));
public static final SoundEvent ENTITY_DRACHENLORD_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.hurt"));
public static final SoundEvent ENTITY_DRACHENLORD_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.death")); public static final SoundEvent ENTITY_APORED_AMBIENT = new SoundEvent(
public static final SoundEvent ENTITY_DRACHENLORD_ANGRY = new SoundEvent(new ResourceLocation("spackenmobs:entities.drachenlord.angry")); new ResourceLocation("spackenmobs:entities.apored.ambient"));
public static final SoundEvent ENTITY_APORED_HURT = new SoundEvent(
public static final SoundEvent ENTITY_SCHALKER_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.ambient")); new ResourceLocation("spackenmobs:entities.apored.hurt"));
public static final SoundEvent ENTITY_SCHALKER_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.hurt")); public static final SoundEvent ENTITY_APORED_DEATH = new SoundEvent(
public static final SoundEvent ENTITY_SCHALKER_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.death")); new ResourceLocation("spackenmobs:entities.apored.death"));
public static final SoundEvent ENTITY_SCHALKER_OPEN = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.open"));
public static final SoundEvent ENTITY_SCHALKER_SHOOT = new SoundEvent(new ResourceLocation("spackenmobs:entities.schalker.shoot")); public static final SoundEvent ENTITY_MRBEAN_AMBIENT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.mr_bean.ambient"));
public static final SoundEvent ENTITY_JENS_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.ambient")); public static final SoundEvent ENTITY_MRBEAN_HURT = new SoundEvent(
public static final SoundEvent ENTITY_JENS_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.hurt")); new ResourceLocation("spackenmobs:entities.mr_bean.hurt"));
public static final SoundEvent ENTITY_JENS_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.death")); public static final SoundEvent ENTITY_MRBEAN_DEATH = new SoundEvent(
public static final SoundEvent ENTITY_JENS_EAT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.eat")); new ResourceLocation("spackenmobs:entities.mr_bean.death"));
public static final SoundEvent ENTITY_JENS_POOP = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.poop"));
public static final SoundEvent ENTITY_DRACHENLORD_AMBIENT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.drachenlord.ambient"));
public static final SoundEvent ENTITY_DRACHENLORD_HURT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.drachenlord.hurt"));
public static final SoundEvent ENTITY_DRACHENLORD_DEATH = new SoundEvent(
new ResourceLocation("spackenmobs:entities.drachenlord.death"));
public static final SoundEvent ENTITY_DRACHENLORD_ANGRY = new SoundEvent(
new ResourceLocation("spackenmobs:entities.drachenlord.angry"));
public static final SoundEvent ENTITY_SCHALKER_AMBIENT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.ambient"));
public static final SoundEvent ENTITY_SCHALKER_HURT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.hurt"));
public static final SoundEvent ENTITY_SCHALKER_DEATH = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.death"));
public static final SoundEvent ENTITY_SCHALKER_OPEN = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.open"));
public static final SoundEvent ENTITY_SCHALKER_SHOOT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.shoot"));
public static final SoundEvent ENTITY_JENS_AMBIENT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.ambient"));
public static final SoundEvent ENTITY_JENS_HURT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.hurt"));
public static final SoundEvent ENTITY_JENS_DEATH = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.death"));
public static final SoundEvent ENTITY_JENS_EAT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.eat"));
public static final SoundEvent ENTITY_JENS_POOP = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.poop"));
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.misc; package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.Spackenmobs; import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.entities.EntityApoRed; import mod.acgaming.spackenmobs.entities.EntityApoRed;
import mod.acgaming.spackenmobs.entities.EntityDrachenlord; import mod.acgaming.spackenmobs.entities.EntityDrachenlord;
@ -30,143 +31,178 @@ import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.EntityRegistry; import net.minecraftforge.fml.common.registry.EntityRegistry;
@EventBusSubscriber(modid = Spackenmobs.MODID) @EventBusSubscriber(modid = Spackenmobs.MODID)
public class RegHandler public class RegHandler {
{ @SubscribeEvent
@SubscribeEvent public static void registerItems(Register<Item> event) {
public static void registerItems(Register<Item> event) final Item[] items = {
{ new Item().setRegistryName(Spackenmobs.MODID, "ram").setUnlocalizedName(Spackenmobs.MODID + "." + "ram")
final Item[] items = .setCreativeTab(CreativeTabs.MISC),
{ new Item().setRegistryName(Spackenmobs.MODID, "ram_on_a_stick")
new Item().setRegistryName(Spackenmobs.MODID, "ram").setUnlocalizedName(Spackenmobs.MODID + "." + "ram").setCreativeTab(CreativeTabs.MISC), .setUnlocalizedName(Spackenmobs.MODID + "." + "ram_on_a_stick")
new Item().setRegistryName(Spackenmobs.MODID, "ram_on_a_stick").setUnlocalizedName(Spackenmobs.MODID + "." + "ram_on_a_stick").setCreativeTab(CreativeTabs.MISC), .setCreativeTab(CreativeTabs.MISC),
new Item().setRegistryName(Spackenmobs.MODID, "surstroemming").setUnlocalizedName(Spackenmobs.MODID + "." + "surstroemming").setCreativeTab(CreativeTabs.MISC) new Item().setRegistryName(Spackenmobs.MODID, "surstroemming")
}; .setUnlocalizedName(Spackenmobs.MODID + "." + "surstroemming")
event.getRegistry().registerAll(items); .setCreativeTab(CreativeTabs.MISC) };
} event.getRegistry().registerAll(items);
}
@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);
EntityRegistry.addSpawn(EntitySmavaCreeper.class, 25, 1, 4, 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);
EntityRegistry.addSpawn(EntityMarcellDAvis.class, 50, 1, 4, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityZombie.class));
// Islamist
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist", id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548);
EntityRegistry.addSpawn(EntityIslamist.class, 50, 1, 4, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
// ApoRed
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++, Spackenmobs.instance, 64, 1, true, 2039583, 16711680);
EntityRegistry.addSpawn(EntityApoRed.class, 50, 1, 4, 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);
EntityRegistry.addSpawn(EntityMrBean.class, 50, 1, 4, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityZombie.class));
// Drachenlord
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class, "drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878);
EntityRegistry.addSpawn(EntityDrachenlord.class, 50, 1, 4, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityPigZombie.class));
// Schalker
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker", id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215);
EntityRegistry.addSpawn(EntitySchalker.class, 50, 1, 4, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityShulker.class));
// Jens
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++, Spackenmobs.instance, 64, 1, true, 6704526, 6767911);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityPig.class));
// WolfMZTE
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:wolfmzte"), EntityWolfMZTE.class, "wolfmzte", id++, Spackenmobs.instance, 64, 1, true, 16711680, 0);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityWolf.class));
// Holzstammhuhn
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class, "holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityChicken.class));
//LootTableList.register(EntityJens.LOOT);
}
@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((SoundEvent)ModSoundEvents.ENTITY_SMAVACREEPER_FUSE);
ModSoundEvents.ENTITY_SMAVACREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.blow"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_SMAVACREEPER_BLOW);
ModSoundEvents.ENTITY_SMAVACREEPER_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_SMAVACREEPER_HURT);
ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT);
// Islamist
ModSoundEvents.ENTITY_ISLAMIST_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.fuse"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_ISLAMIST_FUSE);
ModSoundEvents.ENTITY_ISLAMIST_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.hurt"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_ISLAMIST_HURT);
// Marcell D'Avis
ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT);
ModSoundEvents.ENTITY_MARCELLDAVIS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_MARCELLDAVIS_HURT);
ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.death"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH);
// Mr. Bean
ModSoundEvents.ENTITY_MRBEAN_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.ambient"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_MRBEAN_AMBIENT);
ModSoundEvents.ENTITY_MRBEAN_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.hurt"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_MRBEAN_HURT);
ModSoundEvents.ENTITY_MRBEAN_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.death"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_MRBEAN_DEATH);
// ApoRed @SubscribeEvent
ModSoundEvents.ENTITY_APORED_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.ambient")); public static void registerEntities(Register<EntityEntry> event) {
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_APORED_AMBIENT); int id = 1;
ModSoundEvents.ENTITY_APORED_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.hurt"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_APORED_HURT);
ModSoundEvents.ENTITY_APORED_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.death"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_APORED_DEATH);
// Drachenlord // Smava Creeper
ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.ambient")); EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:smava_creeper"), EntitySmavaCreeper.class,
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT); "smava_creeper", id++, Spackenmobs.instance, 64, 1, true, 7649828, 11053224);
ModSoundEvents.ENTITY_DRACHENLORD_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.hurt")); EntityRegistry.addSpawn(EntitySmavaCreeper.class, 25, 1, 4, EnumCreatureType.MONSTER,
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_DRACHENLORD_HURT); BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
ModSoundEvents.ENTITY_DRACHENLORD_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.death"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_DRACHENLORD_DEATH);
ModSoundEvents.ENTITY_DRACHENLORD_ANGRY.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.angry"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_DRACHENLORD_ANGRY);
// Schalker // Marcell D'Avis
ModSoundEvents.ENTITY_SCHALKER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.ambient")); EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:marcell_davis"), EntityMarcellDAvis.class,
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_SCHALKER_AMBIENT); "marcell_davis", id++, Spackenmobs.instance, 64, 1, true, 15759, 16777215);
ModSoundEvents.ENTITY_SCHALKER_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.hurt")); EntityRegistry.addSpawn(EntityMarcellDAvis.class, 50, 1, 4, EnumCreatureType.MONSTER,
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_SCHALKER_HURT); BiomeHelper.getBiomesWithMonster(EntityZombie.class));
ModSoundEvents.ENTITY_SCHALKER_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.death"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_SCHALKER_DEATH);
ModSoundEvents.ENTITY_SCHALKER_OPEN.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.open"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_SCHALKER_OPEN);
ModSoundEvents.ENTITY_SCHALKER_SHOOT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.shoot"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_SCHALKER_SHOOT);
// Jens // Islamist
ModSoundEvents.ENTITY_JENS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.ambient")); EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist",
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_JENS_AMBIENT); id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548);
ModSoundEvents.ENTITY_JENS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.hurt")); EntityRegistry.addSpawn(EntityIslamist.class, 50, 1, 4, EnumCreatureType.MONSTER,
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_JENS_HURT); BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
ModSoundEvents.ENTITY_JENS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.death"));
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_JENS_DEATH); // ApoRed
ModSoundEvents.ENTITY_JENS_EAT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.eat")); EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++,
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_JENS_EAT); Spackenmobs.instance, 64, 1, true, 2039583, 16711680);
ModSoundEvents.ENTITY_JENS_POOP.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.poop")); EntityRegistry.addSpawn(EntityApoRed.class, 50, 1, 4, EnumCreatureType.MONSTER,
event.getRegistry().register((SoundEvent)ModSoundEvents.ENTITY_JENS_POOP); 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);
EntityRegistry.addSpawn(EntityMrBean.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
// Drachenlord
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class,
"drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878);
EntityRegistry.addSpawn(EntityDrachenlord.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityPigZombie.class));
// Schalker
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker",
id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215);
EntityRegistry.addSpawn(EntitySchalker.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityShulker.class));
// Jens
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++,
Spackenmobs.instance, 64, 1, true, 6704526, 6767911);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityPig.class));
// WolfMZTE
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:wolfmzte"), EntityWolfMZTE.class, "wolfmzte",
id++, Spackenmobs.instance, 64, 1, true, 16711680, 0);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityWolf.class));
// Holzstammhuhn
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class,
"holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityChicken.class));
// LootTableList.register(EntityJens.LOOT);
}
@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_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_HURT);
// 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_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_HURT);
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);
}
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.misc; package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.Spackenmobs; import mod.acgaming.spackenmobs.Spackenmobs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -9,18 +10,16 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
@EventBusSubscriber(value = Side.CLIENT, modid = Spackenmobs.MODID) @EventBusSubscriber(value = Side.CLIENT, modid = Spackenmobs.MODID)
public class RegHandlerModels public class RegHandlerModels {
{ @SubscribeEvent
@SubscribeEvent public static void registerModels(ModelRegistryEvent event) {
public static void registerModels(ModelRegistryEvent event) registerModel(ModItems.RAM, 0);
{ registerModel(ModItems.RAM_ON_A_STICK, 0);
registerModel(ModItems.RAM, 0); registerModel(ModItems.SURSTROEMMING, 0);
registerModel(ModItems.RAM_ON_A_STICK, 0); }
registerModel(ModItems.SURSTROEMMING, 0);
}
private static void registerModel(Item item, int meta) private static void registerModel(Item item, int meta) {
{ ModelLoader.setCustomModelResourceLocation(item, meta,
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory")); new ModelResourceLocation(item.getRegistryName(), "inventory"));
} }
} }

View file

@ -9,58 +9,54 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ModelSchalker extends ModelBase public class ModelSchalker extends ModelBase {
{
public final ModelRenderer base; public final ModelRenderer base;
public final ModelRenderer lid; public final ModelRenderer lid;
public ModelRenderer head; public ModelRenderer head;
public ModelSchalker() public ModelSchalker() {
{ this.textureHeight = 64;
this.textureHeight = 64; this.textureWidth = 64;
this.textureWidth = 64; this.lid = new ModelRenderer(this);
this.lid = new ModelRenderer(this); this.base = new ModelRenderer(this);
this.base = new ModelRenderer(this); this.head = new ModelRenderer(this);
this.head = new ModelRenderer(this); this.lid.setTextureOffset(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16, 12, 16);
this.lid.setTextureOffset(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16, 12, 16); this.lid.setRotationPoint(0.0F, 24.0F, 0.0F);
this.lid.setRotationPoint(0.0F, 24.0F, 0.0F); this.base.setTextureOffset(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16, 8, 16);
this.base.setTextureOffset(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16, 8, 16); this.base.setRotationPoint(0.0F, 24.0F, 0.0F);
this.base.setRotationPoint(0.0F, 24.0F, 0.0F); this.head.setTextureOffset(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6, 6, 6);
this.head.setTextureOffset(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6, 6, 6); this.head.setRotationPoint(0.0F, 12.0F, 0.0F);
this.head.setRotationPoint(0.0F, 12.0F, 0.0F);
} }
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
EntitySchalker EntitySchalker = (EntitySchalker)entityIn;
float f = ageInTicks - (float)EntitySchalker.ticksExisted;
float f1 = (0.5F + EntitySchalker.getClientPeekAmount(f)) * (float)Math.PI;
float f2 = -1.0F + MathHelper.sin(f1);
float f3 = 0.0F;
if (f1 > (float)Math.PI) @Override
{ public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw,
f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F; float headPitch, float scaleFactor, Entity entityIn) {
} EntitySchalker EntitySchalker = (EntitySchalker) entityIn;
float f = ageInTicks - EntitySchalker.ticksExisted;
float f1 = (0.5F + EntitySchalker.getClientPeekAmount(f)) * (float) Math.PI;
float f2 = -1.0F + MathHelper.sin(f1);
float f3 = 0.0F;
this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F); if (f1 > (float) Math.PI) {
f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F;
}
if (EntitySchalker.getClientPeekAmount(f) > 0.3F) this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);
{
this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F;
}
else
{
this.lid.rotateAngleY = 0.0F;
}
this.head.rotateAngleX = headPitch * 0.017453292F; if (EntitySchalker.getClientPeekAmount(f) > 0.3F) {
this.head.rotateAngleY = netHeadYaw * 0.017453292F; this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F;
} else {
this.lid.rotateAngleY = 0.0F;
}
this.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
} }
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) @Override
{ public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw,
this.base.render(scale); float headPitch, float scale) {
this.lid.render(scale); this.base.render(scale);
this.lid.render(scale);
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityApoRed; import mod.acgaming.spackenmobs.entities.EntityApoRed;
import net.minecraft.client.model.ModelSkeleton; import net.minecraft.client.model.ModelSkeleton;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -14,41 +15,37 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderApoRed extends RenderSkeleton public class RenderApoRed extends RenderSkeleton {
{ private static final ResourceLocation APORED_TEXTURE = new ResourceLocation(
private static final ResourceLocation APORED_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/apored.png"); "spackenmobs:textures/entities/apored.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderApoRed(RenderManager renderManagerIn) public RenderApoRed(RenderManager renderManagerIn) {
{ super(renderManagerIn);
super(renderManagerIn); this.addLayer(new LayerHeldItem(this));
this.addLayer(new LayerHeldItem(this)); this.addLayer(new LayerBipedArmor(this) {
this.addLayer(new LayerBipedArmor(this) @Override
{ protected void initArmor() {
protected void initArmor() this.modelLeggings = new ModelSkeleton(0.5F, true);
{ this.modelArmor = new ModelSkeleton(1.0F, true);
this.modelLeggings = new ModelSkeleton(0.5F, true); }
this.modelArmor = new ModelSkeleton(1.0F, true); });
}
});
} }
public void transformHeldFull3DItemLayer() @Override
{ public void transformHeldFull3DItemLayer() {
GlStateManager.translate(0.09375F, 0.1875F, 0.0F); GlStateManager.translate(0.09375F, 0.1875F, 0.0F);
} }
protected ResourceLocation getEntityTexture(AbstractSkeleton entity) @Override
{ protected ResourceLocation getEntityTexture(AbstractSkeleton entity) {
return APORED_TEXTURE; return APORED_TEXTURE;
} }
public static class Factory implements IRenderFactory<EntityApoRed> public static class Factory implements IRenderFactory<EntityApoRed> {
{ @Override
@Override public Render<? super EntityApoRed> createRenderFor(RenderManager manager) {
public Render<? super EntityApoRed> createRenderFor(RenderManager manager) return new RenderApoRed(manager);
{ }
return new RenderApoRed(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityDrachenlord; import mod.acgaming.spackenmobs.entities.EntityDrachenlord;
import net.minecraft.client.model.ModelZombie; import net.minecraft.client.model.ModelZombie;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
@ -12,35 +13,31 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderDrachenlord extends RenderZombie public class RenderDrachenlord extends RenderZombie {
{ private static final ResourceLocation DRACHENLORD_TEXTURE = new ResourceLocation(
private static final ResourceLocation DRACHENLORD_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/drachenlord.png"); "spackenmobs:textures/entities/drachenlord.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderDrachenlord(RenderManager renderManagerIn) public RenderDrachenlord(RenderManager renderManagerIn) {
{ super(renderManagerIn);
super(renderManagerIn); this.addLayer(new LayerBipedArmor(this) {
this.addLayer(new LayerBipedArmor(this) @Override
{ protected void initArmor() {
protected void initArmor() this.modelLeggings = new ModelZombie(0.5F, true);
{ this.modelArmor = new ModelZombie(1.0F, true);
this.modelLeggings = new ModelZombie(0.5F, true); }
this.modelArmor = new ModelZombie(1.0F, true); });
}
});
} }
protected ResourceLocation getEntityTexture(EntityZombie entity) @Override
{ protected ResourceLocation getEntityTexture(EntityZombie entity) {
return DRACHENLORD_TEXTURE; return DRACHENLORD_TEXTURE;
} }
public static class Factory implements IRenderFactory<EntityDrachenlord> public static class Factory implements IRenderFactory<EntityDrachenlord> {
{ @Override
@Override public Render<? super EntityDrachenlord> createRenderFor(RenderManager manager) {
public Render<? super EntityDrachenlord> createRenderFor(RenderManager manager) return new RenderDrachenlord(manager);
{ }
return new RenderDrachenlord(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityHolzstammhuhn; import mod.acgaming.spackenmobs.entities.EntityHolzstammhuhn;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderChicken; import net.minecraft.client.renderer.entity.RenderChicken;
@ -10,27 +11,24 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderHolzstammhuhn extends RenderChicken public class RenderHolzstammhuhn extends RenderChicken {
{ private static final ResourceLocation HOLZSTAMMHUHN_TEXTURE = new ResourceLocation(
private static final ResourceLocation HOLZSTAMMHUHN_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/holzstammhuhn.png"); "spackenmobs:textures/entities/holzstammhuhn.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderHolzstammhuhn(RenderManager renderManagerIn) public RenderHolzstammhuhn(RenderManager renderManagerIn) {
{ super(renderManagerIn);
super(renderManagerIn);
} }
protected ResourceLocation getEntityTexture(EntityChicken entity) @Override
{ protected ResourceLocation getEntityTexture(EntityChicken entity) {
return HOLZSTAMMHUHN_TEXTURE; return HOLZSTAMMHUHN_TEXTURE;
} }
public static class Factory implements IRenderFactory<EntityHolzstammhuhn> public static class Factory implements IRenderFactory<EntityHolzstammhuhn> {
{ @Override
@Override public Render<? super EntityHolzstammhuhn> createRenderFor(RenderManager manager) {
public Render<? super EntityHolzstammhuhn> createRenderFor(RenderManager manager) return new RenderHolzstammhuhn(manager);
{ }
return new RenderHolzstammhuhn(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityIslamist; import mod.acgaming.spackenmobs.entities.EntityIslamist;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderCreeper; import net.minecraft.client.renderer.entity.RenderCreeper;
@ -11,28 +12,25 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderIslamist extends RenderCreeper public class RenderIslamist extends RenderCreeper {
{ private static final ResourceLocation ISLAMIST_TEXTURE = new ResourceLocation(
private static final ResourceLocation ISLAMIST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/islamist.png"); "spackenmobs:textures/entities/islamist.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderIslamist(RenderManager renderManagerIn) public RenderIslamist(RenderManager renderManagerIn) {
{ super(renderManagerIn);
super(renderManagerIn); this.addLayer(new LayerCreeperCharge(this));
this.addLayer(new LayerCreeperCharge(this));
} }
protected ResourceLocation getEntityTexture(EntityCreeper entity) @Override
{ protected ResourceLocation getEntityTexture(EntityCreeper entity) {
return ISLAMIST_TEXTURE; return ISLAMIST_TEXTURE;
} }
public static class Factory implements IRenderFactory<EntityIslamist> public static class Factory implements IRenderFactory<EntityIslamist> {
{ @Override
@Override public Render<? super EntityIslamist> createRenderFor(RenderManager manager) {
public Render<? super EntityIslamist> createRenderFor(RenderManager manager) return new RenderIslamist(manager);
{ }
return new RenderIslamist(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityJens; import mod.acgaming.spackenmobs.entities.EntityJens;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
@ -10,27 +11,23 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderJens extends RenderBiped<EntityJens> public class RenderJens extends RenderBiped<EntityJens> {
{
private static final ResourceLocation JENS_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens.png"); private static final ResourceLocation JENS_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderJens(RenderManager renderManagerIn) public RenderJens(RenderManager renderManagerIn) {
{ super(renderManagerIn, new ModelBiped(), 0.25F);
super(renderManagerIn, new ModelBiped(), 0.25F);
} }
protected ResourceLocation getEntityTexture(EntityJens entity) @Override
{ protected ResourceLocation getEntityTexture(EntityJens entity) {
return JENS_TEXTURE; return JENS_TEXTURE;
} }
private static class Factory implements IRenderFactory<EntityJens> private static class Factory implements IRenderFactory<EntityJens> {
{ @Override
@Override public Render<? super EntityJens> createRenderFor(RenderManager manager) {
public Render<? super EntityJens> createRenderFor(RenderManager manager) return new RenderJens(manager);
{ }
return new RenderJens(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityMarcellDAvis; import mod.acgaming.spackenmobs.entities.EntityMarcellDAvis;
import net.minecraft.client.model.ModelZombie; import net.minecraft.client.model.ModelZombie;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
@ -12,36 +13,32 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderMarcellDAvis extends RenderZombie public class RenderMarcellDAvis extends RenderZombie {
{ private static final ResourceLocation MARCELLDAVIS_TEXTURE = new ResourceLocation(
private static final ResourceLocation MARCELLDAVIS_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/marcell_davis.png"); "spackenmobs:textures/entities/marcell_davis.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderMarcellDAvis(RenderManager renderManagerIn) public RenderMarcellDAvis(RenderManager renderManagerIn) {
{ super(renderManagerIn);
super(renderManagerIn); LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) @Override
{ protected void initArmor() {
protected void initArmor() this.modelLeggings = new ModelZombie(0.5F, true);
{ this.modelArmor = new ModelZombie(1.0F, true);
this.modelLeggings = new ModelZombie(0.5F, true); }
this.modelArmor = new ModelZombie(1.0F, true); };
} this.addLayer(layerbipedarmor);
};
this.addLayer(layerbipedarmor);
} }
protected ResourceLocation getEntityTexture(EntityZombie entity) @Override
{ protected ResourceLocation getEntityTexture(EntityZombie entity) {
return MARCELLDAVIS_TEXTURE; return MARCELLDAVIS_TEXTURE;
} }
public static class Factory implements IRenderFactory<EntityMarcellDAvis> public static class Factory implements IRenderFactory<EntityMarcellDAvis> {
{ @Override
@Override public Render<? super EntityMarcellDAvis> createRenderFor(RenderManager manager) {
public Render<? super EntityMarcellDAvis> createRenderFor(RenderManager manager) return new RenderMarcellDAvis(manager);
{ }
return new RenderMarcellDAvis(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityMrBean; import mod.acgaming.spackenmobs.entities.EntityMrBean;
import net.minecraft.client.model.ModelZombie; import net.minecraft.client.model.ModelZombie;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
@ -12,36 +13,32 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderMrBean extends RenderZombie public class RenderMrBean extends RenderZombie {
{ private static final ResourceLocation MRBEAN_TEXTURE = new ResourceLocation(
private static final ResourceLocation MRBEAN_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/mr_bean.png"); "spackenmobs:textures/entities/mr_bean.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderMrBean(RenderManager renderManagerIn) public RenderMrBean(RenderManager renderManagerIn) {
{ super(renderManagerIn);
super(renderManagerIn); LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) @Override
{ protected void initArmor() {
protected void initArmor() this.modelLeggings = new ModelZombie(0.5F, true);
{ this.modelArmor = new ModelZombie(1.0F, true);
this.modelLeggings = new ModelZombie(0.5F, true); }
this.modelArmor = new ModelZombie(1.0F, true); };
} this.addLayer(layerbipedarmor);
};
this.addLayer(layerbipedarmor);
} }
protected ResourceLocation getEntityTexture(EntityZombie entity) @Override
{ protected ResourceLocation getEntityTexture(EntityZombie entity) {
return MRBEAN_TEXTURE; return MRBEAN_TEXTURE;
} }
public static class Factory implements IRenderFactory<EntityMrBean> public static class Factory implements IRenderFactory<EntityMrBean> {
{ @Override
@Override public Render<? super EntityMrBean> createRenderFor(RenderManager manager) {
public Render<? super EntityMrBean> createRenderFor(RenderManager manager) return new RenderMrBean(manager);
{ }
return new RenderMrBean(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntitySchalker; import mod.acgaming.spackenmobs.entities.EntitySchalker;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -16,175 +17,179 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderSchalker extends RenderLiving<EntitySchalker> 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"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png"), new ResourceLocation("spackenmobs:textures/entities/schalker.png")}; new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png"),
new ResourceLocation("spackenmobs:textures/entities/schalker.png") };
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderSchalker(RenderManager p_i47194_1_)
{
super(p_i47194_1_, new ModelSchalker(), 0.0F);
this.addLayer(new RenderSchalker.HeadLayer());
}
public ModelSchalker getMainModel()
{
return (ModelSchalker)super.getMainModel();
}
public void doRender(EntitySchalker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
int i = entity.getClientTeleportInterp();
if (i > 0 && entity.isAttachedToBlock()) public RenderSchalker(RenderManager p_i47194_1_) {
{ super(p_i47194_1_, new ModelSchalker(), 0.0F);
BlockPos blockpos = entity.getAttachmentPos(); this.addLayer(new RenderSchalker.HeadLayer());
BlockPos blockpos1 = entity.getOldAttachPos();
double d0 = (double)((float)i - partialTicks) / 6.0D;
d0 = d0 * d0;
double d1 = (double)(blockpos.getX() - blockpos1.getX()) * d0;
double d2 = (double)(blockpos.getY() - blockpos1.getY()) * d0;
double d3 = (double)(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);
}
} }
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((double)blockpos1.getX(), (double)blockpos1.getY(), (double)blockpos1.getZ());
Vec3d vec3d1 = new Vec3d((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ());
if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(vec3d1.x, vec3d1.y, vec3d1.z, vec3d.x, vec3d.y, vec3d.z))) @Override
{ public ModelSchalker getMainModel() {
return true; return (ModelSchalker) super.getMainModel();
} }
}
return false; @Override
} public void doRender(EntitySchalker entity, double x, double y, double z, float entityYaw, float partialTicks) {
} int i = entity.getClientTeleportInterp();
protected ResourceLocation getEntityTexture(EntitySchalker entity)
{
return SCHALKER_TEXTURE[entity.getColor().getMetadata()];
}
protected void applyRotations(EntitySchalker entityLiving, float p_77043_2_, float rotationYaw, float partialTicks)
{
super.applyRotations(entityLiving, p_77043_2_, rotationYaw, partialTicks);
switch (entityLiving.getAttachmentFacing()) if (i > 0 && entity.isAttachedToBlock()) {
{ BlockPos blockpos = entity.getAttachmentPos();
case DOWN: BlockPos blockpos1 = entity.getOldAttachPos();
default: double d0 = (i - partialTicks) / 6.0D;
break; d0 = d0 * d0;
case EAST: double d1 = (blockpos.getX() - blockpos1.getX()) * d0;
GlStateManager.translate(0.5F, 0.5F, 0.0F); double d2 = (blockpos.getY() - blockpos1.getY()) * d0;
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); double d3 = (blockpos.getZ() - blockpos1.getZ()) * d0;
GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks);
break; } else {
case WEST: super.doRender(entity, x, y, z, entityYaw, partialTicks);
GlStateManager.translate(-0.5F, 0.5F, 0.0F); }
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
break;
case NORTH:
GlStateManager.translate(0.0F, 0.5F, -0.5F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
break;
case SOUTH:
GlStateManager.translate(0.0F, 0.5F, 0.5F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
break;
case UP:
GlStateManager.translate(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
}
} }
protected void preRenderCallback(EntitySchalker entitylivingbaseIn, float partialTickTime) @Override
{ public boolean shouldRender(EntitySchalker livingEntity, ICamera camera, double camX, double camY, double camZ) {
float f = 0.999F; if (super.shouldRender(livingEntity, camera, camX, camY, camZ)) {
GlStateManager.scale(0.999F, 0.999F, 0.999F); 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());
if (camera.isBoundingBoxInFrustum(
new AxisAlignedBB(vec3d1.x, vec3d1.y, vec3d1.z, vec3d.x, vec3d.y, vec3d.z))) {
return true;
}
}
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) {
super.applyRotations(entityLiving, p_77043_2_, rotationYaw, partialTicks);
switch (entityLiving.getAttachmentFacing()) {
case DOWN:
default:
break;
case EAST:
GlStateManager.translate(0.5F, 0.5F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
break;
case WEST:
GlStateManager.translate(-0.5F, 0.5F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
break;
case NORTH:
GlStateManager.translate(0.0F, 0.5F, -0.5F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
break;
case SOUTH:
GlStateManager.translate(0.0F, 0.5F, 0.5F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
break;
case UP:
GlStateManager.translate(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
}
}
@Override
protected void preRenderCallback(EntitySchalker entitylivingbaseIn, float partialTickTime) {
float f = 0.999F;
GlStateManager.scale(0.999F, 0.999F, 0.999F);
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
class HeadLayer implements LayerRenderer<EntitySchalker> class HeadLayer implements LayerRenderer<EntitySchalker> {
{ private HeadLayer() {
private HeadLayer() }
{
}
public void doRenderLayer(EntitySchalker entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
GlStateManager.pushMatrix();
switch (entitylivingbaseIn.getAttachmentFacing()) @Override
{ public void doRenderLayer(EntitySchalker entitylivingbaseIn, float limbSwing, float limbSwingAmount,
case DOWN: float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
default: GlStateManager.pushMatrix();
break;
case EAST:
GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(1.0F, -1.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
break;
case WEST:
GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(-1.0F, -1.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
break;
case NORTH:
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -1.0F, -1.0F);
break;
case SOUTH:
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -1.0F, 1.0F);
break;
case UP:
GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -2.0F, 0.0F);
}
ModelRenderer modelrenderer = RenderSchalker.this.getMainModel().head; switch (entitylivingbaseIn.getAttachmentFacing()) {
modelrenderer.rotateAngleY = netHeadYaw * 0.017453292F; case DOWN:
modelrenderer.rotateAngleX = headPitch * 0.017453292F; default:
RenderSchalker.this.bindTexture(RenderSchalker.SCHALKER_TEXTURE[entitylivingbaseIn.getColor().getMetadata()]); break;
modelrenderer.render(scale); case EAST:
GlStateManager.popMatrix(); GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
} GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(1.0F, -1.0F, 0.0F);
public boolean shouldCombineTextures() GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
{ break;
return false; case WEST:
} GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(-1.0F, -1.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
break;
case NORTH:
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -1.0F, -1.0F);
break;
case SOUTH:
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -1.0F, 1.0F);
break;
case UP:
GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -2.0F, 0.0F);
}
ModelRenderer modelrenderer = RenderSchalker.this.getMainModel().head;
modelrenderer.rotateAngleY = netHeadYaw * 0.017453292F;
modelrenderer.rotateAngleX = headPitch * 0.017453292F;
RenderSchalker.this
.bindTexture(RenderSchalker.SCHALKER_TEXTURE[entitylivingbaseIn.getColor().getMetadata()]);
modelrenderer.render(scale);
GlStateManager.popMatrix();
}
@Override
public boolean shouldCombineTextures() {
return false;
}
} }
public static class Factory implements IRenderFactory<EntitySchalker> public static class Factory implements IRenderFactory<EntitySchalker> {
{ @Override
@Override public Render<? super EntitySchalker> createRenderFor(RenderManager manager) {
public Render<? super EntitySchalker> createRenderFor(RenderManager manager) return new RenderSchalker(manager);
{ }
return new RenderSchalker(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper; import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderCreeper; import net.minecraft.client.renderer.entity.RenderCreeper;
@ -11,28 +12,25 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderSmavaCreeper extends RenderCreeper public class RenderSmavaCreeper extends RenderCreeper {
{ private static final ResourceLocation SMAVA_TEXTURE = new ResourceLocation(
private static final ResourceLocation SMAVA_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/smava_creeper.png"); "spackenmobs:textures/entities/smava_creeper.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderSmavaCreeper(RenderManager renderManagerIn) public RenderSmavaCreeper(RenderManager renderManagerIn) {
{ super(renderManagerIn);
super(renderManagerIn); this.addLayer(new LayerCreeperCharge(this));
this.addLayer(new LayerCreeperCharge(this));
} }
protected ResourceLocation getEntityTexture(EntityCreeper entity) @Override
{ protected ResourceLocation getEntityTexture(EntityCreeper entity) {
return SMAVA_TEXTURE; return SMAVA_TEXTURE;
} }
public static class Factory implements IRenderFactory<EntitySmavaCreeper> public static class Factory implements IRenderFactory<EntitySmavaCreeper> {
{ @Override
@Override public Render<? super EntitySmavaCreeper> createRenderFor(RenderManager manager) {
public Render<? super EntitySmavaCreeper> createRenderFor(RenderManager manager) return new RenderSmavaCreeper(manager);
{ }
return new RenderSmavaCreeper(manager);
}
} }
} }

View file

@ -1,4 +1,5 @@
package mod.acgaming.spackenmobs.render; package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityWolfMZTE; import mod.acgaming.spackenmobs.entities.EntityWolfMZTE;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
@ -12,53 +13,48 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderWolfMZTE extends RenderWolf public class RenderWolfMZTE extends RenderWolf {
{ private static final ResourceLocation WOLFMZTE_TEXTURE = new ResourceLocation(
private static final ResourceLocation WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte.png"); "spackenmobs:textures/entities/wolfmzte.png");
private static final ResourceLocation TAMED_WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte_tame.png"); private static final ResourceLocation TAMED_WOLFMZTE_TEXTURE = new ResourceLocation(
private static final ResourceLocation ANRGY_WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte_angry.png"); "spackenmobs:textures/entities/wolfmzte_tame.png");
private static final ResourceLocation ANRGY_WOLFMZTE_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/wolfmzte_angry.png");
public static final Factory FACTORY = new Factory(); public static final Factory FACTORY = new Factory();
public RenderWolfMZTE(RenderManager renderManagerIn) public RenderWolfMZTE(RenderManager renderManagerIn) {
{ super(renderManagerIn);
super(renderManagerIn); this.addLayer(new LayerWolfCollar(this));
this.addLayer(new LayerWolfCollar(this));
} }
protected float handleRotationFloat(EntityWolf livingBase, float partialTicks) @Override
{ protected float handleRotationFloat(EntityWolf livingBase, float partialTicks) {
return livingBase.getTailRotation(); return livingBase.getTailRotation();
} }
public void doRender(EntityWolf entity, double x, double y, double z, float entityYaw, float partialTicks) @Override
{ public void doRender(EntityWolf entity, double x, double y, double z, float entityYaw, float partialTicks) {
if (entity.isWolfWet()) if (entity.isWolfWet()) {
{ float f = entity.getBrightness() * entity.getShadingWhileWet(partialTicks);
float f = entity.getBrightness() * entity.getShadingWhileWet(partialTicks); GlStateManager.color(f, f, f);
GlStateManager.color(f, f, f); }
}
super.doRender(entity, x, y, z, entityYaw, partialTicks); super.doRender(entity, x, y, z, entityYaw, partialTicks);
} }
protected ResourceLocation getEntityTexture(EntityWolf entity) @Override
{ protected ResourceLocation getEntityTexture(EntityWolf entity) {
if (entity.isTamed()) if (entity.isTamed()) {
{ return TAMED_WOLFMZTE_TEXTURE;
return TAMED_WOLFMZTE_TEXTURE; } else {
} return entity.isAngry() ? ANRGY_WOLFMZTE_TEXTURE : WOLFMZTE_TEXTURE;
else }
{
return entity.isAngry() ? ANRGY_WOLFMZTE_TEXTURE : WOLFMZTE_TEXTURE;
}
} }
public static class Factory implements IRenderFactory<EntityWolfMZTE> public static class Factory implements IRenderFactory<EntityWolfMZTE> {
{ @Override
@Override public Render<? super EntityWolfMZTE> createRenderFor(RenderManager manager) {
public Render<? super EntityWolfMZTE> createRenderFor(RenderManager manager) return new RenderWolfMZTE(manager);
{ }
return new RenderWolfMZTE(manager);
}
} }
} }