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

Compare commits

...

3 commits

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,8 @@
package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.entities.ai.EntityAIBakaMitaiCreeperSwell;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import java.util.Collection;
import javax.annotation.Nullable;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAreaEffectCloud;
import net.minecraft.entity.SharedMonsterAttributes;
@ -29,279 +30,280 @@ import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.Collection;
import mod.acgaming.spackenmobs.entities.ai.EntityAIBakaMitaiCreeperSwell;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
public class EntityBakaMitaiCreeper extends EntityMob
{
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN);
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 100;
private int explosionRadius = 12;
private int droppedSkulls;
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN);
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 100;
private int explosionRadius = 12;
private int droppedSkulls;
public EntityBakaMitaiCreeper(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
}
public EntityBakaMitaiCreeper(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
}
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIBakaMitaiCreeperSwell(this));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
}
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
if (this.hasIgnited())
{
this.setCreeperState(1);
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
int i = this.getCreeperState();
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE, 1.0F, 1.0F);
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
this.timeSinceIgnited += i;
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_CREEPER_HURT;
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_CREEPER_DEATH;
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
if (this.world.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getTrueSource() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
}
else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).ableToCauseSkullDrop())
{
((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (this.hasIgnited())
{
this.setCreeperState(1);
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
int i = this.getCreeperState();
public boolean getPowered()
{
return this.dataManager.get(POWERED);
}
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE, 1.0F, 1.0F);
}
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2);
}
this.timeSinceIgnited += i;
public int getCreeperState()
{
return this.dataManager.get(STATE);
}
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
public void setCreeperState(int state)
{
this.dataManager.set(STATE, state);
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.TRUE);
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_CREEPER_HURT;
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_CREEPER_DEATH;
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
if (this.world.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getTrueSource() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
} else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).ableToCauseSkullDrop())
{
((mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIBakaMitaiCreeperSwell(this));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
}
public boolean getPowered()
{
return this.dataManager.get(POWERED);
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2);
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
public int getCreeperState()
{
return this.dataManager.get(STATE);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
public void setCreeperState(int state)
{
this.dataManager.set(STATE, state);
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.TRUE);
}
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
{
this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
player.swingArm(hand);
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
if (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
return super.processInteract(player, hand);
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
private void explode()
{
if (!this.world.isRemote)
{
boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW, getSoundCategory(), 2.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
{
this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
player.swingArm(hand);
if (!collection.isEmpty())
{
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2);
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
if (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
return super.processInteract(player, hand);
}
this.world.spawnEntity(entityareaeffectcloud);
}
}
private void explode()
{
if (!this.world.isRemote)
{
boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW, getSoundCategory(), 2.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
if (!collection.isEmpty())
{
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2);
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
this.world.spawnEntity(entityareaeffectcloud);
}
}
}

View file

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

View file

@ -1,8 +1,5 @@
package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.misc.ModItems;
import mod.acgaming.spackenmobs.misc.ModLootTableList;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IMerchant;
@ -19,159 +16,167 @@ import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;
import net.minecraft.world.World;
import mod.acgaming.spackenmobs.misc.ModItems;
import mod.acgaming.spackenmobs.misc.ModLootTableList;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
public class EntityFriedrichLiechtenstein extends EntityCreature implements IMerchant
{
public EntityFriedrichLiechtenstein(World worldIn)
{
super(worldIn);
setSize(0.6F, 1.8F);
setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.AHOJ_BRAUSE));
setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK));
}
public EntityFriedrichLiechtenstein(World worldIn)
{
super(worldIn);
setSize(0.6F, 1.8F);
setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.AHOJ_BRAUSE));
setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK));
}
@Override
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
@Override
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT;
}
if (itemstack.getItem() == Items.GLASS_BOTTLE)
{
player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_DEATH, 1.0F, 1.0F);
player.playSound(SoundEvents.ENTITY_COW_MILK, 1.0F, 1.0F);
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
itemstack.shrink(1);
@Override
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_FRIEDRICH;
}
if (itemstack.isEmpty())
{
player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK));
} else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE_DRINK)))
{
player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE_DRINK), false);
}
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
return true;
} else if (itemstack.getItem() == Items.PAPER)
{
player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT, 1.0F, 1.0F);
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
itemstack.shrink(1);
if (itemstack.getItem() == Items.GLASS_BOTTLE)
{
player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_DEATH, 1.0F, 1.0F);
player.playSound(SoundEvents.ENTITY_COW_MILK, 1.0F, 1.0F);
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
itemstack.shrink(1);
if (itemstack.isEmpty())
{
player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE));
} else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE)))
{
player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE), false);
}
if (itemstack.isEmpty())
{
player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE_DRINK));
}
else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE_DRINK)))
{
player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE_DRINK), false);
}
return true;
} else
{
return super.processInteract(player, hand);
}
}
return true;
}
else if (itemstack.getItem() == Items.PAPER)
{
player.playSound(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT, 1.0F, 1.0F);
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
itemstack.shrink(1);
@Override
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_FRIEDRICH;
}
if (itemstack.isEmpty())
{
player.setHeldItem(hand, new ItemStack(ModItems.AHOJ_BRAUSE));
}
else if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.AHOJ_BRAUSE)))
{
player.dropItem(new ItemStack(ModItems.AHOJ_BRAUSE), false);
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT;
}
return true;
}
else
{
return super.processInteract(player, hand);
}
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_FRIEDRICH_HURT;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_FRIEDRICH_HURT;
}
@Override
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_FRIEDRICH_DEATH;
}
@Override
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_FRIEDRICH_DEATH;
}
@Override
public EntityPlayer getCustomer()
{
return null;
}
@Override
public EntityPlayer getCustomer()
{
return null;
}
@Override
public void setCustomer(EntityPlayer player)
{
@Override
public void setCustomer(EntityPlayer player)
{
}
}
@Override
public MerchantRecipeList getRecipes(EntityPlayer player)
{
return null;
}
@Override
public MerchantRecipeList getRecipes(EntityPlayer player)
{
return null;
}
@Override
public void setRecipes(MerchantRecipeList recipeList)
{
@Override
public void setRecipes(MerchantRecipeList recipeList)
{
}
}
@Override
public void useRecipe(MerchantRecipe recipe)
{
@Override
public void useRecipe(MerchantRecipe recipe)
{
}
}
@Override
public void verifySellingItem(ItemStack stack)
{
@Override
public void verifySellingItem(ItemStack stack)
{
}
}
@Override
public World getWorld()
{
return null;
}
@Override
public World getWorld()
{
return null;
}
@Override
public BlockPos getPos()
{
return null;
}
@Override
public BlockPos getPos()
{
return null;
}
}

View file

@ -0,0 +1,71 @@
package mod.acgaming.spackenmobs.entities;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
public class EntityGisela extends EntityAnimal
{
public EntityGisela(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.8F);
}
public EntityGisela createChild(EntityAgeable ageable)
{
return new EntityGisela(this.world);
}
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 2.0D));
this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.SUGAR, false));
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(7, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<>(this, EntityLiving.class, true));
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(1.25D);
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_GISELA_AMBIENT;
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_GISELA_HURT;
}
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_GISELA_HURT;
}
protected void playStepSound(BlockPos pos, Block blockIn)
{
this.playSound(SoundEvents.ENTITY_COW_STEP, 0.15F, 1.0F);
}
}

View file

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

View file

@ -1,64 +0,0 @@
package mod.acgaming.spackenmobs.entities;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import javax.annotation.Nullable;
public class EntityITbyHF extends EntityCreature
{
public EntityITbyHF(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 2.0F);
}
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityLatinTeacher.class, 12.0F, 0.8D, 0.8D));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
protected void entityInit()
{
super.entityInit();
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_VILLAGER_HURT;
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_VILLAGER_DEATH;
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_VILLAGER;
}
}

View file

@ -1,7 +1,8 @@
package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.entities.ai.EntityAIIslamistSwell;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import java.util.Collection;
import javax.annotation.Nullable;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAreaEffectCloud;
import net.minecraft.entity.SharedMonsterAttributes;
@ -29,279 +30,280 @@ import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.Collection;
import mod.acgaming.spackenmobs.entities.ai.EntityAIIslamistSwell;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
public class EntityIslamist extends EntityMob
{
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.BOOLEAN);
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 30;
private int explosionRadius = 6;
private int droppedSkulls;
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(EntityIslamist.class, DataSerializers.BOOLEAN);
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 30;
private int explosionRadius = 6;
private int droppedSkulls;
public EntityIslamist(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
}
public EntityIslamist(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
}
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIIslamistSwell(this));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
}
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
if (this.hasIgnited())
{
this.setCreeperState(1);
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
int i = this.getCreeperState();
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_ISLAMIST_FUSE, 1.0F, 0.5F);
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
this.timeSinceIgnited += i;
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_ISLAMIST_HURT;
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT;
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
if (this.world.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getTrueSource() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
}
else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntityIslamist && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).ableToCauseSkullDrop())
{
((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (this.hasIgnited())
{
this.setCreeperState(1);
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
int i = this.getCreeperState();
public boolean getPowered()
{
return this.dataManager.get(POWERED);
}
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_ISLAMIST_FUSE, 1.0F, 0.5F);
}
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2);
}
this.timeSinceIgnited += i;
public int getCreeperState()
{
return this.dataManager.get(STATE);
}
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
public void setCreeperState(int state)
{
this.dataManager.set(STATE, state);
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.TRUE);
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_ISLAMIST_HURT;
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT;
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
if (this.world.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getTrueSource() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
} else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntityIslamist && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).ableToCauseSkullDrop())
{
((mod.acgaming.spackenmobs.entities.EntityIslamist) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIIslamistSwell(this));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
}
public boolean getPowered()
{
return this.dataManager.get(POWERED);
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2);
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
public int getCreeperState()
{
return this.dataManager.get(STATE);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
public void setCreeperState(int state)
{
this.dataManager.set(STATE, state);
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.TRUE);
}
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
{
this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
player.swingArm(hand);
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
if (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
return super.processInteract(player, hand);
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
private void explode()
{
if (!this.world.isRemote)
{
boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_ISLAMIST_BLOW, getSoundCategory(), 1.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
{
this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
player.swingArm(hand);
if (!collection.isEmpty())
{
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2);
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
if (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
return super.processInteract(player, hand);
}
this.world.spawnEntity(entityareaeffectcloud);
}
}
private void explode()
{
if (!this.world.isRemote)
{
boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_ISLAMIST_BLOW, getSoundCategory(), 1.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
if (!collection.isEmpty())
{
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2);
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
this.world.spawnEntity(entityareaeffectcloud);
}
}
}

View file

@ -1,12 +1,9 @@
package mod.acgaming.spackenmobs.entities;
import java.util.Set;
import javax.annotation.Nullable;
import com.google.common.collect.Sets;
import mod.acgaming.spackenmobs.entities.ai.EntityAIDance;
import mod.acgaming.spackenmobs.entities.ai.EntityAIEatDroppedFish;
import mod.acgaming.spackenmobs.misc.ModConfigs;
import mod.acgaming.spackenmobs.misc.ModItems;
import mod.acgaming.spackenmobs.misc.ModLootTableList;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
@ -29,327 +26,339 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import javax.annotation.Nullable;
import java.util.Set;
import mod.acgaming.spackenmobs.entities.ai.EntityAIDance;
import mod.acgaming.spackenmobs.entities.ai.EntityAIEatDroppedFish;
import mod.acgaming.spackenmobs.misc.ModConfigs;
import mod.acgaming.spackenmobs.misc.ModItems;
import mod.acgaming.spackenmobs.misc.ModLootTableList;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
public class EntityJens extends EntityAnimal
{
private static final DataParameter<Boolean> DIGESTING = EntityDataManager.createKey(EntityJens.class, DataSerializers.BOOLEAN);
private static final DataParameter<Integer> BOOST_TIME = EntityDataManager.createKey(EntityJens.class, DataSerializers.VARINT);
private static final DataParameter<Integer> DIGEST_TIME = EntityDataManager.createKey(EntityJens.class, DataSerializers.VARINT);
private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(ModItems.RAM, Items.FISH);
private static final Set<Item> FISH_ITEMS = Sets.newHashSet(Items.FISH);
public boolean digesting;
public int digestTime;
private boolean boosting;
private int boostTime;
private int totalBoostTime;
private static final DataParameter<Boolean> DIGESTING = EntityDataManager.createKey(EntityJens.class, DataSerializers.BOOLEAN);
private static final DataParameter<Integer> BOOST_TIME = EntityDataManager.createKey(EntityJens.class, DataSerializers.VARINT);
private static final DataParameter<Integer> DIGEST_TIME = EntityDataManager.createKey(EntityJens.class, DataSerializers.VARINT);
private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(ModItems.RAM, Items.FISH);
private static final Set<Item> FISH_ITEMS = Sets.newHashSet(Items.FISH);
public boolean digesting;
public int digestTime;
private boolean boosting;
private int boostTime;
private int totalBoostTime;
public EntityJens(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.8F);
}
public EntityJens(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.8F);
}
@Override
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
this.tasks.addTask(2, new EntityAIDance(this, ModConfigs.Jens_search_distance));
this.tasks.addTask(2, new EntityAIEatDroppedFish(this));
this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, ModItems.RAM, false));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, false, TEMPTATION_ITEMS));
this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 1.0D));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(8, new EntityAILookIdle(this));
}
@Override
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
if (!this.world.isRemote)
{
@Nullable
public Entity getControllingPassenger()
{
return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
}
}
}
@Override
public boolean canBeSteered()
{
Entity entity = this.getControllingPassenger();
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_JENS_HURT;
}
if (!(entity instanceof EntityPlayer))
{
return false;
} else
{
EntityPlayer entityplayer = (EntityPlayer) entity;
return entityplayer.getHeldItemMainhand().getItem() == ModItems.RAM_ON_A_STICK || entityplayer.getHeldItemOffhand().getItem() == ModItems.RAM_ON_A_STICK;
}
}
@Override
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_JENS_DEATH;
}
@Override
public void notifyDataManagerChange(DataParameter<?> key)
{
if (BOOST_TIME.equals(key) && this.world.isRemote)
{
this.boosting = true;
this.boostTime = 0;
this.totalBoostTime = this.dataManager.get(BOOST_TIME);
}
@Override
public void travel(float strafe, float vertical, float forward)
{
Entity entity = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
super.notifyDataManagerChange(key);
}
if (this.isBeingRidden() && this.canBeSteered())
{
this.rotationYaw = entity.rotationYaw;
this.prevRotationYaw = this.rotationYaw;
this.rotationPitch = entity.rotationPitch * 0.5F;
this.setRotation(this.rotationYaw, this.rotationPitch);
this.renderYawOffset = this.rotationYaw;
this.rotationYawHead = this.rotationYaw;
this.stepHeight = 1.0F;
this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F;
@Override
protected void entityInit()
{
super.entityInit();
this.dataManager.register(DIGESTING, Boolean.FALSE);
this.dataManager.register(BOOST_TIME, 0);
this.dataManager.register(DIGEST_TIME, 0);
}
if (this.boosting && this.boostTime++ > this.totalBoostTime)
{
this.boosting = false;
}
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setBoolean("Digesting", this.digesting);
compound.setInteger("DigestTime", this.digestTime);
}
if (this.canPassengerSteer())
{
float f = (float) this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue() * 0.225F;
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.digesting = compound.getBoolean("Digesting");
this.digestTime = compound.getInteger("DigestTime");
}
if (this.boosting)
{
f += f * 1.15F * MathHelper.sin((float) this.boostTime / (float) this.totalBoostTime * (float) Math.PI);
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_JENS_AMBIENT;
}
this.setAIMoveSpeed(f);
super.travel(0.0F, 0.0F, 1.0F);
}
else
{
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_JENS_HURT;
}
this.prevLimbSwingAmount = this.limbSwingAmount;
double d1 = this.posX - this.prevPosX;
double d0 = this.posZ - this.prevPosZ;
float f1 = MathHelper.sqrt(d1 * d1 + d0 * d0) * 4.0F;
@Override
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_JENS_DEATH;
}
if (f1 > 1.0F)
{
f1 = 1.0F;
}
@Override
protected void playStepSound(BlockPos pos, Block blockIn)
{
this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F);
}
this.limbSwingAmount += (f1 - this.limbSwingAmount) * 0.4F;
this.limbSwing += this.limbSwingAmount;
}
else
{
this.stepHeight = 0.5F;
this.jumpMovementFactor = 0.02F;
super.travel(strafe, vertical, forward);
}
}
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
if (!super.processInteract(player, hand))
{
ItemStack itemstack = player.getHeldItem(hand);
if (itemstack.getItem() == Items.FISH && !this.isChild() && !this.digesting)
{
itemstack.shrink(1);
digestFish();
return true;
} else if (itemstack.getItem() == Items.NAME_TAG)
{
itemstack.interactWithEntity(player, this, hand);
return true;
} else if (!this.isBeingRidden())
{
if (!this.world.isRemote)
{
player.startRiding(this);
}
return true;
} else
{
return false;
}
} else
{
return true;
}
}
public boolean boost()
{
if (this.boosting)
{
return false;
}
else
{
this.boosting = true;
this.boostTime = 0;
this.totalBoostTime = this.getRNG().nextInt(841) + 140;
this.getDataManager().set(BOOST_TIME, this.totalBoostTime);
return true;
}
}
@Override
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
@Override
public mod.acgaming.spackenmobs.entities.EntityJens createChild(EntityAgeable ageable)
{
return new mod.acgaming.spackenmobs.entities.EntityJens(this.world);
}
if (!this.world.isRemote)
{
@Override
protected void entityInit()
{
super.entityInit();
this.dataManager.register(DIGESTING, Boolean.FALSE);
this.dataManager.register(BOOST_TIME, 0);
this.dataManager.register(DIGEST_TIME, 0);
}
}
}
@Override
public void notifyDataManagerChange(DataParameter<?> key)
{
if (BOOST_TIME.equals(key) && this.world.isRemote)
{
this.boosting = true;
this.boostTime = 0;
this.totalBoostTime = this.dataManager.get(BOOST_TIME);
}
@Override
@Nullable
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_JENS;
}
super.notifyDataManagerChange(key);
}
@Override
public void travel(float strafe, float vertical, float forward)
{
Entity entity = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
public boolean isFishItem(ItemStack stack)
{
return FISH_ITEMS.contains(stack.getItem());
}
if (this.isBeingRidden() && this.canBeSteered())
{
this.rotationYaw = entity.rotationYaw;
this.prevRotationYaw = this.rotationYaw;
this.rotationPitch = entity.rotationPitch * 0.5F;
this.setRotation(this.rotationYaw, this.rotationPitch);
this.renderYawOffset = this.rotationYaw;
this.rotationYawHead = this.rotationYaw;
this.stepHeight = 1.0F;
this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F;
@Override
public void onLivingUpdate()
{
super.onLivingUpdate();
if (this.boosting && this.boostTime++ > this.totalBoostTime)
{
this.boosting = false;
}
if (!this.world.isRemote && this.digesting && this.digestTime > 0)
{
this.digestTime--;
this.dataManager.set(DIGEST_TIME, this.digestTime);
}
if (this.canPassengerSteer())
{
float f = (float) this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue() * 0.225F;
if (!this.world.isRemote && this.digesting && this.digestTime <= 0)
{
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
this.playSound(ModSoundEvents.ENTITY_JENS_POOP, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
this.dropItem(ModItems.SURSTROEMMING, 1);
this.clearActivePotions();
if (this.boosting)
{
f += f * 1.15F * MathHelper.sin((float) this.boostTime / (float) this.totalBoostTime * (float) Math.PI);
}
this.digesting = false;
this.dataManager.set(DIGESTING, false);
this.setAIMoveSpeed(f);
super.travel(0.0F, 0.0F, 1.0F);
} else
{
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
}
this.digestTime = 0;
this.dataManager.set(DIGEST_TIME, 0);
}
}
this.prevLimbSwingAmount = this.limbSwingAmount;
double d1 = this.posX - this.prevPosX;
double d0 = this.posZ - this.prevPosZ;
float f1 = MathHelper.sqrt(d1 * d1 + d0 * d0) * 4.0F;
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setBoolean("Digesting", this.digesting);
compound.setInteger("DigestTime", this.digestTime);
}
if (f1 > 1.0F)
{
f1 = 1.0F;
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.digesting = compound.getBoolean("Digesting");
this.digestTime = compound.getInteger("DigestTime");
}
this.limbSwingAmount += (f1 - this.limbSwingAmount) * 0.4F;
this.limbSwing += this.limbSwingAmount;
} else
{
this.stepHeight = 0.5F;
this.jumpMovementFactor = 0.02F;
super.travel(strafe, vertical, forward);
}
}
@Override
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
public boolean boost()
{
if (this.boosting)
{
return false;
} else
{
this.boosting = true;
this.boostTime = 0;
this.totalBoostTime = this.getRNG().nextInt(841) + 140;
this.getDataManager().set(BOOST_TIME, this.totalBoostTime);
return true;
}
}
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
if (!super.processInteract(player, hand))
{
ItemStack itemstack = player.getHeldItem(hand);
if (itemstack.getItem() == Items.FISH && !this.isChild() && !this.digesting)
{
itemstack.shrink(1);
digestFish();
return true;
}
else if (itemstack.getItem() == Items.NAME_TAG)
{
itemstack.interactWithEntity(player, this, hand);
return true;
}
else if (!this.isBeingRidden())
{
if (!this.world.isRemote)
{
player.startRiding(this);
}
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}
@Override
public mod.acgaming.spackenmobs.entities.EntityJens createChild(EntityAgeable ageable)
{
return new mod.acgaming.spackenmobs.entities.EntityJens(this.world);
}
public void digestFish()
{
this.playSound(SoundEvents.ENTITY_PLAYER_BURP, 1.0F, 1.0F);
this.playSound(ModSoundEvents.ENTITY_JENS_EAT, 1.0F, 1.0F);
@Override
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
this.digesting = true;
this.dataManager.set(DIGESTING, true);
public boolean isFishItem(ItemStack stack)
{
return FISH_ITEMS.contains(stack.getItem());
}
this.digestTime = (ModConfigs.Jens_digest_time * 20);
this.dataManager.set(DIGEST_TIME, this.digestTime);
@Override
public void onLivingUpdate()
{
super.onLivingUpdate();
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(EnumParticleTypes.HEART, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
if (!this.world.isRemote && this.digesting && this.digestTime > 0)
{
this.digestTime--;
this.dataManager.set(DIGEST_TIME, this.digestTime);
}
this.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, ModConfigs.Jens_digest_time * 20));
}
if (!this.world.isRemote && this.digesting && this.digestTime <= 0)
{
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
this.playSound(ModSoundEvents.ENTITY_JENS_POOP, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
this.dropItem(ModItems.SURSTROEMMING, 1);
this.clearActivePotions();
@Override
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
this.tasks.addTask(2, new EntityAIDance(this, ModConfigs.Jens_search_distance));
this.tasks.addTask(2, new EntityAIEatDroppedFish(this));
this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, ModItems.RAM, false));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, false, TEMPTATION_ITEMS));
this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 1.0D));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(8, new EntityAILookIdle(this));
}
this.digesting = false;
this.dataManager.set(DIGESTING, false);
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
this.digestTime = 0;
this.dataManager.set(DIGEST_TIME, 0);
}
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_JENS_AMBIENT;
}
public void digestFish()
{
this.playSound(SoundEvents.ENTITY_PLAYER_BURP, 1.0F, 1.0F);
this.playSound(ModSoundEvents.ENTITY_JENS_EAT, 1.0F, 1.0F);
@Override
@Nullable
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_JENS;
}
this.digesting = true;
this.dataManager.set(DIGESTING, true);
@Override
public boolean canBeSteered()
{
Entity entity = this.getControllingPassenger();
this.digestTime = (ModConfigs.Jens_digest_time * 20);
this.dataManager.set(DIGEST_TIME, this.digestTime);
if (!(entity instanceof EntityPlayer))
{
return false;
}
else
{
EntityPlayer entityplayer = (EntityPlayer) entity;
return entityplayer.getHeldItemMainhand().getItem() == ModItems.RAM_ON_A_STICK || entityplayer.getHeldItemOffhand().getItem() == ModItems.RAM_ON_A_STICK;
}
}
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
this.world.spawnParticle(EnumParticleTypes.HEART, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
@Override
protected void playStepSound(BlockPos pos, Block blockIn)
{
this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F);
}
this.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, ModConfigs.Jens_digest_time * 20));
}
@Nullable
public Entity getControllingPassenger()
{
return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
}
}

View file

@ -1,247 +0,0 @@
package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.init.Items;
import net.minecraft.init.MobEffects;
import net.minecraft.init.PotionTypes;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.potion.PotionEffect;
import net.minecraft.potion.PotionType;
import net.minecraft.potion.PotionUtils;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.List;
import java.util.UUID;
public class EntityLatinTeacher extends EntityMob implements IRangedAttackMob
{
private static final UUID MODIFIER_UUID = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
private static final AttributeModifier MODIFIER = (new AttributeModifier(MODIFIER_UUID, "Drinking speed penalty", -0.25D, 0)).setSaved(false);
private static final DataParameter<Boolean> IS_DRINKING = EntityDataManager.createKey(EntityLatinTeacher.class, DataSerializers.BOOLEAN);
private int potionUseTimer;
public EntityLatinTeacher(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.95F);
}
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F));
this.tasks.addTask(2, new EntityAIWanderAvoidWater(this, 1.0D));
this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityITbyHF.class, 8.0F));
this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(3, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityITbyHF.class, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
protected void entityInit()
{
super.entityInit();
this.getDataManager().register(IS_DRINKING, Boolean.FALSE);
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_LATINTEACHER_AMBIENT;
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_WITCH_HURT;
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_WITCH_DEATH;
}
public boolean isDrinkingPotion()
{
return this.getDataManager().get(IS_DRINKING);
}
public void setDrinkingPotion(boolean drinkingPotion)
{
this.getDataManager().set(IS_DRINKING, drinkingPotion);
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(26.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
public void onLivingUpdate()
{
if (!this.world.isRemote)
{
if (this.isDrinkingPotion())
{
if (this.potionUseTimer-- <= 0)
{
this.setDrinkingPotion(false);
ItemStack itemstack = this.getHeldItemMainhand();
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, ItemStack.EMPTY);
if (itemstack.getItem() == Items.POTIONITEM)
{
List<PotionEffect> list = PotionUtils.getEffectsFromStack(itemstack);
if (list != null)
{
for (PotionEffect potioneffect : list)
{
this.addPotionEffect(new PotionEffect(potioneffect));
}
}
}
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).removeModifier(MODIFIER);
}
} else
{
PotionType potiontype = null;
if (this.rand.nextFloat() < 0.15F && this.isInsideOfMaterial(Material.WATER) && !this.isPotionActive(MobEffects.WATER_BREATHING))
{
potiontype = PotionTypes.WATER_BREATHING;
} else if (this.rand.nextFloat() < 0.15F && (this.isBurning() || this.getLastDamageSource() != null && this.getLastDamageSource().isFireDamage()) && !this.isPotionActive(MobEffects.FIRE_RESISTANCE))
{
potiontype = PotionTypes.FIRE_RESISTANCE;
} else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth())
{
potiontype = PotionTypes.HEALING;
} else if (this.rand.nextFloat() < 0.5F && this.getAttackTarget() != null && !this.isPotionActive(MobEffects.SPEED) && this.getAttackTarget().getDistanceSq(this) > 121.0D)
{
potiontype = PotionTypes.SWIFTNESS;
}
if (potiontype != null)
{
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), potiontype));
this.potionUseTimer = this.getHeldItemMainhand().getMaxItemUseDuration();
this.setDrinkingPotion(true);
this.world.playSound(null, this.posX, this.posY, this.posZ, SoundEvents.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.rand.nextFloat() * 0.4F);
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);
iattributeinstance.removeModifier(MODIFIER);
iattributeinstance.applyModifier(MODIFIER);
}
}
if (this.rand.nextFloat() < 7.5E-4F)
{
this.world.setEntityState(this, (byte) 15);
}
}
super.onLivingUpdate();
}
@SideOnly(Side.CLIENT)
public void handleStatusUpdate(byte id)
{
if (id == 15)
{
for (int i = 0; i < this.rand.nextInt(35) + 10; ++i)
{
this.world.spawnParticle(EnumParticleTypes.SPELL_WITCH, this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.getEntityBoundingBox().maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D);
}
} else
{
super.handleStatusUpdate(id);
}
}
protected float applyPotionDamageCalculations(DamageSource source, float damage)
{
damage = super.applyPotionDamageCalculations(source, damage);
if (source.getTrueSource() == this)
{
damage = 0.0F;
}
if (source.isMagicDamage())
{
damage = (float) ((double) damage * 0.15D);
}
return damage;
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_WITCH;
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor)
{
if (!this.isDrinkingPotion())
{
double d0 = target.posY + (double) target.getEyeHeight() - 1.100000023841858D;
double d1 = target.posX + target.motionX - this.posX;
double d2 = d0 - this.posY;
double d3 = target.posZ + target.motionZ - this.posZ;
float f = MathHelper.sqrt(d1 * d1 + d3 * d3);
PotionType potiontype = PotionTypes.HARMING;
if (f >= 8.0F && !target.isPotionActive(MobEffects.SLOWNESS))
{
potiontype = PotionTypes.SLOWNESS;
} else if (target.getHealth() >= 8.0F && !target.isPotionActive(MobEffects.POISON))
{
potiontype = PotionTypes.POISON;
} else if (f <= 3.0F && !target.isPotionActive(MobEffects.WEAKNESS) && this.rand.nextFloat() < 0.25F)
{
potiontype = PotionTypes.WEAKNESS;
}
EntityPotion entitypotion = new EntityPotion(this.world, this, PotionUtils.addPotionToItemStack(new ItemStack(Items.SPLASH_POTION), potiontype));
entitypotion.rotationPitch -= -20.0F;
entitypotion.shoot(d1, d2 + (double) (f * 0.2F), d3, 0.75F, 8.0F);
this.world.playSound(null, this.posX, this.posY, this.posZ, SoundEvents.ENTITY_WITCH_THROW, this.getSoundCategory(), 1.0F, 0.8F + this.rand.nextFloat() * 0.4F);
this.world.spawnEntity(entitypotion);
}
}
public float getEyeHeight()
{
return 1.62F;
}
public void setSwingingArms(boolean swingingArms)
{
}
}

View file

@ -1,5 +1,7 @@
package mod.acgaming.spackenmobs.entities;
import java.util.UUID;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityCreeper;
@ -10,87 +12,92 @@ import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import java.util.UUID;
public class EntityMZTEWolf extends EntityWolf
{
public EntityMZTEWolf(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 0.85F);
this.setTamed(false);
}
public EntityMZTEWolf(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 0.85F);
this.setTamed(false);
}
@Override
public EntityMZTEWolf createChild(EntityAgeable ageable)
{
EntityMZTEWolf entitymztewolf = new EntityMZTEWolf(this.world);
UUID uuid = this.getOwnerId();
@Override
public EntityMZTEWolf createChild(EntityAgeable ageable)
{
EntityMZTEWolf entitymztewolf = new EntityMZTEWolf(this.world);
UUID uuid = this.getOwnerId();
if (uuid != null)
{
entitymztewolf.setOwnerId(uuid);
entitymztewolf.setTamed(true);
}
if (uuid != null)
{
entitymztewolf.setOwnerId(uuid);
entitymztewolf.setTamed(true);
}
return entitymztewolf;
}
return entitymztewolf;
}
@Override
public boolean canMateWith(EntityAnimal otherAnimal)
{
if (otherAnimal == this)
{
return false;
} else if (!this.isTamed())
{
return false;
} else if (!(otherAnimal instanceof EntityMZTEWolf))
{
return false;
} else
{
EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) otherAnimal;
@Override
public boolean canMateWith(EntityAnimal otherAnimal)
{
if (otherAnimal == this)
{
return false;
}
else if (!this.isTamed())
{
return false;
}
else if (!(otherAnimal instanceof EntityMZTEWolf))
{
return false;
}
else
{
EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) otherAnimal;
if (!entitymztewolf.isTamed())
{
return false;
} else if (entitymztewolf.isSitting())
{
return false;
} else
{
return this.isInLove() && entitymztewolf.isInLove();
}
}
}
if (!entitymztewolf.isTamed())
{
return false;
}
else if (entitymztewolf.isSitting())
{
return false;
}
else
{
return this.isInLove() && entitymztewolf.isInLove();
}
}
}
@Override
public boolean shouldAttackEntity(EntityLivingBase target, EntityLivingBase owner)
{
if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast))
{
if (target instanceof EntityMZTEWolf)
{
EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) target;
@Override
public boolean shouldAttackEntity(EntityLivingBase target, EntityLivingBase owner)
{
if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast))
{
if (target instanceof EntityMZTEWolf)
{
EntityMZTEWolf entitymztewolf = (EntityMZTEWolf) target;
if (entitymztewolf.isTamed() && entitymztewolf.getOwner() == owner)
{
return false;
}
}
if (entitymztewolf.isTamed() && entitymztewolf.getOwner() == owner)
{
return false;
}
}
if (target instanceof EntityPlayer && owner instanceof EntityPlayer
&& !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target))
{
return false;
} else
{
return !(target instanceof AbstractHorse) || !((AbstractHorse) target).isTame();
}
} else
{
return false;
}
}
if (target instanceof EntityPlayer && owner instanceof EntityPlayer
&& !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target))
{
return false;
}
else
{
return !(target instanceof AbstractHorse) || !((AbstractHorse) target).isTame();
}
}
else
{
return false;
}
}
}

View file

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

View file

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

View file

@ -1,7 +1,8 @@
package mod.acgaming.spackenmobs.entities;
import mod.acgaming.spackenmobs.entities.ai.EntityAISmavaCreeperSwell;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import java.util.Collection;
import javax.annotation.Nullable;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAreaEffectCloud;
import net.minecraft.entity.SharedMonsterAttributes;
@ -29,285 +30,286 @@ import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.Collection;
import mod.acgaming.spackenmobs.entities.ai.EntityAISmavaCreeperSwell;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
public class EntitySmavaCreeper extends EntityMob
{
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN);
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 20;
private int explosionRadius = 6;
private int droppedSkulls;
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN);
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 20;
private int explosionRadius = 6;
private int droppedSkulls;
public EntitySmavaCreeper(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
public EntitySmavaCreeper(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAISmavaCreeperSwell(this));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
}
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
if (this.hasIgnited())
{
this.setCreeperState(1);
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
int i = this.getCreeperState();
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE, 1.0F, 1.0F);
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
this.timeSinceIgnited += i;
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_SMAVACREEPER_HURT;
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_CREEPER_DEATH;
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
if (this.world.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getTrueSource() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
}
else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntitySmavaCreeper && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).ableToCauseSkullDrop())
{
((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
if (this.hasIgnited())
{
this.setCreeperState(1);
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
int i = this.getCreeperState();
public boolean getPowered()
{
return this.dataManager.get(POWERED);
}
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE, 1.0F, 1.0F);
}
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2);
}
this.timeSinceIgnited += i;
public int getCreeperState()
{
return this.dataManager.get(STATE);
}
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
public void setCreeperState(int state)
{
this.dataManager.set(STATE, state);
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.TRUE);
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT;
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_SMAVACREEPER_HURT;
}
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_CREEPER_DEATH;
}
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
if (this.world.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getTrueSource() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
} else if (cause.getTrueSource() instanceof mod.acgaming.spackenmobs.entities.EntitySmavaCreeper && cause.getTrueSource() != this && ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).getPowered() && ((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).ableToCauseSkullDrop())
{
((mod.acgaming.spackenmobs.entities.EntitySmavaCreeper) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAISmavaCreeperSwell(this));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
}
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, Boolean.FALSE);
this.dataManager.register(IGNITED, Boolean.FALSE);
}
public boolean getPowered()
{
return this.dataManager.get(POWERED);
}
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT;
}
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float) (this.fuseTime - 2);
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
if (this.dataManager.get(POWERED))
{
compound.setBoolean("powered", true);
}
public int getCreeperState()
{
return this.dataManager.get(STATE);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
public void setCreeperState(int state)
{
this.dataManager.set(STATE, state);
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.TRUE);
}
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
{
this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
player.swingArm(hand);
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
if (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
return super.processInteract(player, hand);
}
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
private void explode()
{
if (!this.world.isRemote)
{
boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_SMAVACREEPER_BLOW, getSoundCategory(), 5.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
{
this.world.playSound(player, this.posX, this.posY, this.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
player.swingArm(hand);
if (!collection.isEmpty())
{
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2);
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
if (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
return super.processInteract(player, hand);
}
this.world.spawnEntity(entityareaeffectcloud);
}
}
private void explode()
{
if (!this.world.isRemote)
{
boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);
float f = this.getPowered() ? 2.0F : 1.0F;
this.dead = true;
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_SMAVACREEPER_BLOW, getSoundCategory(), 5.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED);
}
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.TRUE);
}
if (!collection.isEmpty())
{
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2);
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
this.world.spawnEntity(entityareaeffectcloud);
}
}
}

View file

@ -1,5 +1,8 @@
package mod.acgaming.spackenmobs.entities;
import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.entity.EntityFlying;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
@ -28,347 +31,350 @@ import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.Random;
public class EntityTileraGhast extends EntityFlying implements IMob
{
private static final DataParameter<Boolean> ATTACKING = EntityDataManager.createKey(EntityTileraGhast.class, DataSerializers.BOOLEAN);
private int explosionStrength = 1;
private static final DataParameter<Boolean> ATTACKING = EntityDataManager.createKey(EntityTileraGhast.class, DataSerializers.BOOLEAN);
private int explosionStrength = 1;
public EntityTileraGhast(World worldIn)
{
super(worldIn);
this.setSize(4.0F, 4.0F);
this.isImmuneToFire = true;
this.experienceValue = 5;
this.moveHelper = new GhastMoveHelper(this);
}
public EntityTileraGhast(World worldIn)
{
super(worldIn);
this.setSize(4.0F, 4.0F);
this.isImmuneToFire = true;
this.experienceValue = 5;
this.moveHelper = new GhastMoveHelper(this);
}
protected void initEntityAI()
{
this.tasks.addTask(5, new AIRandomFly(this));
this.tasks.addTask(7, new AILookAround(this));
this.tasks.addTask(7, new AIFireballAttack(this));
this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
@SideOnly(Side.CLIENT)
public boolean isAttacking()
{
return this.dataManager.get(ATTACKING);
}
@SideOnly(Side.CLIENT)
public boolean isAttacking()
{
return this.dataManager.get(ATTACKING);
}
public void setAttacking(boolean attacking)
{
this.dataManager.set(ATTACKING, attacking);
}
public void setAttacking(boolean attacking)
{
this.dataManager.set(ATTACKING, attacking);
}
public int getFireballStrength()
{
return this.explosionStrength;
}
public int getFireballStrength()
{
return this.explosionStrength;
}
public boolean attackEntityFrom(DamageSource source, float amount)
{
if (this.isEntityInvulnerable(source))
{
return false;
}
else if (source.getImmediateSource() instanceof EntityLargeFireball && source.getTrueSource() instanceof EntityPlayer)
{
super.attackEntityFrom(source, 1000.0F);
return true;
}
else
{
return super.attackEntityFrom(source, amount);
}
}
public void onUpdate()
{
super.onUpdate();
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_GHAST_HURT;
}
if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL)
{
this.setDead();
}
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_GHAST_DEATH;
}
public boolean attackEntityFrom(DamageSource source, float amount)
{
if (this.isEntityInvulnerable(source))
{
return false;
} else if (source.getImmediateSource() instanceof EntityLargeFireball && source.getTrueSource() instanceof EntityPlayer)
{
super.attackEntityFrom(source, 1000.0F);
return true;
} else
{
return super.attackEntityFrom(source, amount);
}
}
protected float getSoundVolume()
{
return 10.0F;
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(ATTACKING, Boolean.FALSE);
}
public float getEyeHeight()
{
return 2.6F;
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(100.0D);
}
public SoundCategory getSoundCategory()
{
return SoundCategory.HOSTILE;
}
public SoundCategory getSoundCategory()
{
return SoundCategory.HOSTILE;
}
protected void initEntityAI()
{
this.tasks.addTask(5, new AIRandomFly(this));
this.tasks.addTask(7, new AILookAround(this));
this.tasks.addTask(7, new AIFireballAttack(this));
this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
protected SoundEvent getAmbientSound()
{
return SoundEvents.ENTITY_GHAST_AMBIENT;
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(100.0D);
}
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_GHAST_HURT;
}
protected void entityInit()
{
super.entityInit();
this.dataManager.register(ATTACKING, Boolean.FALSE);
}
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_GHAST_DEATH;
}
public void onUpdate()
{
super.onUpdate();
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_GHAST;
}
if (!this.world.isRemote && this.world.getDifficulty() == EnumDifficulty.PEACEFUL)
{
this.setDead();
}
}
protected float getSoundVolume()
{
return 10.0F;
}
protected SoundEvent getAmbientSound()
{
return SoundEvents.ENTITY_GHAST_AMBIENT;
}
public boolean getCanSpawnHere()
{
return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.world.getDifficulty() != EnumDifficulty.PEACEFUL;
}
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setInteger("ExplosionPower", this.explosionStrength);
}
public int getMaxSpawnedInChunk()
{
return 1;
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setInteger("ExplosionPower", this.explosionStrength);
}
if (compound.hasKey("ExplosionPower", 99))
{
this.explosionStrength = compound.getInteger("ExplosionPower");
}
}
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_GHAST;
}
if (compound.hasKey("ExplosionPower", 99))
{
this.explosionStrength = compound.getInteger("ExplosionPower");
}
}
public boolean getCanSpawnHere()
{
return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.world.getDifficulty() != EnumDifficulty.PEACEFUL;
}
public float getEyeHeight()
{
return 2.6F;
}
public int getMaxSpawnedInChunk()
{
return 1;
}
static class AIFireballAttack extends EntityAIBase
{
private final EntityTileraGhast parentEntity;
public int attackTimer;
static class AIFireballAttack extends EntityAIBase
{
private final EntityTileraGhast parentEntity;
public int attackTimer;
public AIFireballAttack(EntityTileraGhast ghast)
{
this.parentEntity = ghast;
}
public AIFireballAttack(EntityTileraGhast ghast)
{
this.parentEntity = ghast;
}
public boolean shouldExecute()
{
return this.parentEntity.getAttackTarget() != null;
}
public boolean shouldExecute()
{
return this.parentEntity.getAttackTarget() != null;
}
public void startExecuting()
{
this.attackTimer = 0;
}
public void startExecuting()
{
this.attackTimer = 0;
}
public void resetTask()
{
this.parentEntity.setAttacking(false);
}
public void resetTask()
{
this.parentEntity.setAttacking(false);
}
public void updateTask()
{
EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
double d0 = 64.0D;
public void updateTask()
{
EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
double d0 = 64.0D;
if (entitylivingbase.getDistanceSq(this.parentEntity) < 4096.0D && this.parentEntity.canEntityBeSeen(entitylivingbase))
{
World world = this.parentEntity.world;
++this.attackTimer;
if (entitylivingbase.getDistanceSq(this.parentEntity) < 4096.0D && this.parentEntity.canEntityBeSeen(entitylivingbase))
{
World world = this.parentEntity.world;
++this.attackTimer;
if (this.attackTimer == 10)
{
world.playEvent(null, 1015, new BlockPos(this.parentEntity), 0);
}
if (this.attackTimer == 10)
{
world.playEvent(null, 1015, new BlockPos(this.parentEntity), 0);
}
if (this.attackTimer == 20)
{
double d1 = 4.0D;
Vec3d vec3d = this.parentEntity.getLook(1.0F);
double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3d.x * 4.0D);
double d3 = entitylivingbase.getEntityBoundingBox().minY + (double) (entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F));
double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3d.z * 4.0D);
world.playEvent(null, 1016, new BlockPos(this.parentEntity), 0);
EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4);
entitylargefireball.explosionPower = this.parentEntity.getFireballStrength();
entitylargefireball.posX = this.parentEntity.posX + vec3d.x * 4.0D;
entitylargefireball.posY = this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F) + 0.5D;
entitylargefireball.posZ = this.parentEntity.posZ + vec3d.z * 4.0D;
world.spawnEntity(entitylargefireball);
this.attackTimer = -40;
}
} else if (this.attackTimer > 0)
{
--this.attackTimer;
}
if (this.attackTimer == 20)
{
double d1 = 4.0D;
Vec3d vec3d = this.parentEntity.getLook(1.0F);
double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3d.x * 4.0D);
double d3 = entitylivingbase.getEntityBoundingBox().minY + (double) (entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F));
double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3d.z * 4.0D);
world.playEvent(null, 1016, new BlockPos(this.parentEntity), 0);
EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4);
entitylargefireball.explosionPower = this.parentEntity.getFireballStrength();
entitylargefireball.posX = this.parentEntity.posX + vec3d.x * 4.0D;
entitylargefireball.posY = this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F) + 0.5D;
entitylargefireball.posZ = this.parentEntity.posZ + vec3d.z * 4.0D;
world.spawnEntity(entitylargefireball);
this.attackTimer = -40;
}
}
else if (this.attackTimer > 0)
{
--this.attackTimer;
}
this.parentEntity.setAttacking(this.attackTimer > 10);
}
}
this.parentEntity.setAttacking(this.attackTimer > 10);
}
}
static class AILookAround extends EntityAIBase
{
private final EntityTileraGhast parentEntity;
static class AILookAround extends EntityAIBase
{
private final EntityTileraGhast parentEntity;
public AILookAround(EntityTileraGhast ghast)
{
this.parentEntity = ghast;
this.setMutexBits(2);
}
public AILookAround(EntityTileraGhast ghast)
{
this.parentEntity = ghast;
this.setMutexBits(2);
}
public boolean shouldExecute()
{
return true;
}
public boolean shouldExecute()
{
return true;
}
public void updateTask()
{
if (this.parentEntity.getAttackTarget() == null)
{
this.parentEntity.rotationYaw = -((float) MathHelper.atan2(this.parentEntity.motionX, this.parentEntity.motionZ)) * (180F / (float) Math.PI);
this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw;
} else
{
EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
double d0 = 64.0D;
public void updateTask()
{
if (this.parentEntity.getAttackTarget() == null)
{
this.parentEntity.rotationYaw = -((float) MathHelper.atan2(this.parentEntity.motionX, this.parentEntity.motionZ)) * (180F / (float) Math.PI);
this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw;
}
else
{
EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
double d0 = 64.0D;
if (entitylivingbase.getDistanceSq(this.parentEntity) < 4096.0D)
{
double d1 = entitylivingbase.posX - this.parentEntity.posX;
double d2 = entitylivingbase.posZ - this.parentEntity.posZ;
this.parentEntity.rotationYaw = -((float) MathHelper.atan2(d1, d2)) * (180F / (float) Math.PI);
this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw;
}
}
}
}
if (entitylivingbase.getDistanceSq(this.parentEntity) < 4096.0D)
{
double d1 = entitylivingbase.posX - this.parentEntity.posX;
double d2 = entitylivingbase.posZ - this.parentEntity.posZ;
this.parentEntity.rotationYaw = -((float) MathHelper.atan2(d1, d2)) * (180F / (float) Math.PI);
this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw;
}
}
}
}
static class AIRandomFly extends EntityAIBase
{
private final EntityTileraGhast parentEntity;
static class AIRandomFly extends EntityAIBase
{
private final EntityTileraGhast parentEntity;
public AIRandomFly(EntityTileraGhast ghast)
{
this.parentEntity = ghast;
this.setMutexBits(1);
}
public AIRandomFly(EntityTileraGhast ghast)
{
this.parentEntity = ghast;
this.setMutexBits(1);
}
public boolean shouldExecute()
{
EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper();
public boolean shouldExecute()
{
EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper();
if (!entitymovehelper.isUpdating())
{
return true;
} else
{
double d0 = entitymovehelper.getX() - this.parentEntity.posX;
double d1 = entitymovehelper.getY() - this.parentEntity.posY;
double d2 = entitymovehelper.getZ() - this.parentEntity.posZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
return d3 < 1.0D || d3 > 3600.0D;
}
}
if (!entitymovehelper.isUpdating())
{
return true;
}
else
{
double d0 = entitymovehelper.getX() - this.parentEntity.posX;
double d1 = entitymovehelper.getY() - this.parentEntity.posY;
double d2 = entitymovehelper.getZ() - this.parentEntity.posZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
return d3 < 1.0D || d3 > 3600.0D;
}
}
public boolean shouldContinueExecuting()
{
return false;
}
public boolean shouldContinueExecuting()
{
return false;
}
public void startExecuting()
{
Random random = this.parentEntity.getRNG();
double d0 = this.parentEntity.posX + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
double d1 = this.parentEntity.posY + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
double d2 = this.parentEntity.posZ + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
this.parentEntity.getMoveHelper().setMoveTo(d0, d1, d2, 1.0D);
}
}
public void startExecuting()
{
Random random = this.parentEntity.getRNG();
double d0 = this.parentEntity.posX + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
double d1 = this.parentEntity.posY + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
double d2 = this.parentEntity.posZ + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
this.parentEntity.getMoveHelper().setMoveTo(d0, d1, d2, 1.0D);
}
}
static class GhastMoveHelper extends EntityMoveHelper
{
private final EntityTileraGhast parentEntity;
private int courseChangeCooldown;
static class GhastMoveHelper extends EntityMoveHelper
{
private final EntityTileraGhast parentEntity;
private int courseChangeCooldown;
public GhastMoveHelper(EntityTileraGhast ghast)
{
super(ghast);
this.parentEntity = ghast;
}
public GhastMoveHelper(EntityTileraGhast ghast)
{
super(ghast);
this.parentEntity = ghast;
}
public void onUpdateMoveHelper()
{
if (this.action == EntityMoveHelper.Action.MOVE_TO)
{
double d0 = this.posX - this.parentEntity.posX;
double d1 = this.posY - this.parentEntity.posY;
double d2 = this.posZ - this.parentEntity.posZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
public void onUpdateMoveHelper()
{
if (this.action == EntityMoveHelper.Action.MOVE_TO)
{
double d0 = this.posX - this.parentEntity.posX;
double d1 = this.posY - this.parentEntity.posY;
double d2 = this.posZ - this.parentEntity.posZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
if (this.courseChangeCooldown-- <= 0)
{
this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2;
d3 = MathHelper.sqrt(d3);
if (this.courseChangeCooldown-- <= 0)
{
this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2;
d3 = MathHelper.sqrt(d3);
if (this.isNotColliding(this.posX, this.posY, this.posZ, d3))
{
this.parentEntity.motionX += d0 / d3 * 0.1D;
this.parentEntity.motionY += d1 / d3 * 0.1D;
this.parentEntity.motionZ += d2 / d3 * 0.1D;
} else
{
this.action = EntityMoveHelper.Action.WAIT;
}
}
}
}
if (this.isNotColliding(this.posX, this.posY, this.posZ, d3))
{
this.parentEntity.motionX += d0 / d3 * 0.1D;
this.parentEntity.motionY += d1 / d3 * 0.1D;
this.parentEntity.motionZ += d2 / d3 * 0.1D;
}
else
{
this.action = EntityMoveHelper.Action.WAIT;
}
}
}
}
private boolean isNotColliding(double x, double y, double z, double p_179926_7_)
{
double d0 = (x - this.parentEntity.posX) / p_179926_7_;
double d1 = (y - this.parentEntity.posY) / p_179926_7_;
double d2 = (z - this.parentEntity.posZ) / p_179926_7_;
AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();
private boolean isNotColliding(double x, double y, double z, double p_179926_7_)
{
double d0 = (x - this.parentEntity.posX) / p_179926_7_;
double d1 = (y - this.parentEntity.posY) / p_179926_7_;
double d2 = (z - this.parentEntity.posZ) / p_179926_7_;
AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();
for (int i = 1; (double) i < p_179926_7_; ++i)
{
axisalignedbb = axisalignedbb.offset(d0, d1, d2);
for (int i = 1; (double) i < p_179926_7_; ++i)
{
axisalignedbb = axisalignedbb.offset(d0, d1, d2);
if (!this.parentEntity.world.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
{
return false;
}
}
if (!this.parentEntity.world.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
{
return false;
}
}
return true;
}
}
return true;
}
}
}

View file

@ -1,51 +1,55 @@
package mod.acgaming.spackenmobs.entities.ai;
import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper;
public class EntityAIBakaMitaiCreeperSwell extends EntityAIBase
{
EntityBakaMitaiCreeper swellingCreeper;
EntityLivingBase creeperAttackTarget;
EntityBakaMitaiCreeper swellingCreeper;
EntityLivingBase creeperAttackTarget;
public EntityAIBakaMitaiCreeperSwell(EntityBakaMitaiCreeper entitycreeperIn)
{
this.swellingCreeper = entitycreeperIn;
this.setMutexBits(1);
}
public EntityAIBakaMitaiCreeperSwell(EntityBakaMitaiCreeper entitycreeperIn)
{
this.swellingCreeper = entitycreeperIn;
this.setMutexBits(1);
}
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D;
}
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D;
}
public void startExecuting()
{
this.swellingCreeper.getNavigator().clearPath();
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
}
public void startExecuting()
{
this.swellingCreeper.getNavigator().clearPath();
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
}
public void resetTask()
{
this.creeperAttackTarget = null;
}
public void resetTask()
{
this.creeperAttackTarget = null;
}
public void updateTask()
{
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
} else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
} else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
} else
{
this.swellingCreeper.setCreeperState(1);
}
}
public void updateTask()
{
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
}
else
{
this.swellingCreeper.setCreeperState(1);
}
}
}

View file

@ -1,86 +1,87 @@
package mod.acgaming.spackenmobs.entities.ai;
import mod.acgaming.spackenmobs.entities.EntityJens;
import net.minecraft.block.BlockJukebox;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Blocks;
import mod.acgaming.spackenmobs.entities.EntityJens;
// Thanks to Akrivus!
public class EntityAIDance extends EntityAIBase
{
private final EntityJens jens;
private final EntityJens jens;
private final int searchRadius;
private final int searchRadius;
private int lastDanceMoveTime = 0;
private int lastDanceMoveTime = 0;
private int danceStage = 0;
private int danceStage = 0;
public EntityAIDance(EntityJens jens, int searchRadius)
{
this.jens = jens;
this.searchRadius = searchRadius;
}
public EntityAIDance(EntityJens jens, int searchRadius)
{
this.jens = jens;
this.searchRadius = searchRadius;
}
@Override
public void resetTask()
{
this.lastDanceMoveTime = 0;
this.danceStage = 0;
}
@Override
public boolean shouldExecute()
{
for (int x = -this.searchRadius; x <= this.searchRadius; x++)
{
for (int y = -2; y <= 2; y++)
{
for (int z = -this.searchRadius; z <= this.searchRadius; z++)
{
if (this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getBlock() == Blocks.JUKEBOX && this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getValue(BlockJukebox.HAS_RECORD))
return true;
}
}
}
return false;
}
@Override
public boolean shouldContinueExecuting()
{
return shouldExecute();
}
@Override
public boolean shouldContinueExecuting()
{
return shouldExecute();
}
@Override
public boolean shouldExecute()
{
for (int x = -this.searchRadius; x <= this.searchRadius; x++)
{
for (int y = -2; y <= 2; y++)
{
for (int z = -this.searchRadius; z <= this.searchRadius; z++)
{
if (this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getBlock() == Blocks.JUKEBOX && this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getValue(BlockJukebox.HAS_RECORD))
return true;
}
}
}
return false;
}
@Override
public void startExecuting()
{
this.danceStage = 1;
}
@Override
public void startExecuting()
{
this.danceStage = 1;
}
@Override
public void resetTask()
{
this.lastDanceMoveTime = 0;
this.danceStage = 0;
}
@Override
public void updateTask()
{
if (this.lastDanceMoveTime <= 0)
{
switch (this.danceStage)
{
case 1:
this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2;
this.jens.motionY = 0.42D;
break;
case 2:
this.jens.setSneaking(true);
this.jens.motionY = -3.0D;
this.danceStage = 3;
break;
case 3:
this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2;
this.jens.setSneaking(false);
break;
}
this.lastDanceMoveTime = this.jens.world.rand.nextInt(20) + 10;
}
this.lastDanceMoveTime--;
}
@Override
public void updateTask()
{
if (this.lastDanceMoveTime <= 0)
{
switch (this.danceStage)
{
case 1:
this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2;
this.jens.motionY = 0.42D;
break;
case 2:
this.jens.setSneaking(true);
this.jens.motionY = -3.0D;
this.danceStage = 3;
break;
case 3:
this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2;
this.jens.setSneaking(false);
break;
}
this.lastDanceMoveTime = this.jens.world.rand.nextInt(20) + 10;
}
this.lastDanceMoveTime--;
}
}

View file

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

View file

@ -1,51 +1,55 @@
package mod.acgaming.spackenmobs.entities.ai;
import mod.acgaming.spackenmobs.entities.EntityIslamist;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import mod.acgaming.spackenmobs.entities.EntityIslamist;
public class EntityAIIslamistSwell extends EntityAIBase
{
EntityIslamist swellingCreeper;
EntityLivingBase creeperAttackTarget;
EntityIslamist swellingCreeper;
EntityLivingBase creeperAttackTarget;
public EntityAIIslamistSwell(EntityIslamist entitycreeperIn)
{
this.swellingCreeper = entitycreeperIn;
this.setMutexBits(1);
}
public EntityAIIslamistSwell(EntityIslamist entitycreeperIn)
{
this.swellingCreeper = entitycreeperIn;
this.setMutexBits(1);
}
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D;
}
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D;
}
public void startExecuting()
{
this.swellingCreeper.getNavigator().clearPath();
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
}
public void startExecuting()
{
this.swellingCreeper.getNavigator().clearPath();
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
}
public void resetTask()
{
this.creeperAttackTarget = null;
}
public void resetTask()
{
this.creeperAttackTarget = null;
}
public void updateTask()
{
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
} else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
} else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
} else
{
this.swellingCreeper.setCreeperState(1);
}
}
public void updateTask()
{
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
}
else
{
this.swellingCreeper.setCreeperState(1);
}
}
}

View file

@ -1,51 +1,55 @@
package mod.acgaming.spackenmobs.entities.ai;
import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper;
public class EntityAISmavaCreeperSwell extends EntityAIBase
{
EntitySmavaCreeper swellingCreeper;
EntityLivingBase creeperAttackTarget;
EntitySmavaCreeper swellingCreeper;
EntityLivingBase creeperAttackTarget;
public EntityAISmavaCreeperSwell(EntitySmavaCreeper entitycreeperIn)
{
this.swellingCreeper = entitycreeperIn;
this.setMutexBits(1);
}
public EntityAISmavaCreeperSwell(EntitySmavaCreeper entitycreeperIn)
{
this.swellingCreeper = entitycreeperIn;
this.setMutexBits(1);
}
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D;
}
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSq(entitylivingbase) < 9.0D;
}
public void startExecuting()
{
this.swellingCreeper.getNavigator().clearPath();
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
}
public void startExecuting()
{
this.swellingCreeper.getNavigator().clearPath();
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
}
public void resetTask()
{
this.creeperAttackTarget = null;
}
public void resetTask()
{
this.creeperAttackTarget = null;
}
public void updateTask()
{
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
} else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
} else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
} else
{
this.swellingCreeper.setCreeperState(1);
}
}
public void updateTask()
{
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
}
else
{
this.swellingCreeper.setCreeperState(1);
}
}
}

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.events;
import mod.acgaming.spackenmobs.misc.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemStack;
@ -8,18 +7,20 @@ import net.minecraft.potion.PotionEffect;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent;
import mod.acgaming.spackenmobs.misc.ModItems;
public class SurstroemmingSmellsBadEvent
{
@SubscribeEvent
public void onEvent(PlayerTickEvent event)
{
if (event.player != null)
{
EntityPlayer player = event.player;
if (player.inventory.hasItemStack(new ItemStack(ModItems.SURSTROEMMING)))
{
player.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 100));
}
}
}
@SubscribeEvent
public void onEvent(PlayerTickEvent event)
{
if (event.player != null)
{
EntityPlayer player = event.player;
if (player.inventory.hasItemStack(new ItemStack(ModItems.SURSTROEMMING)))
{
player.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 100));
}
}
}
}

View file

@ -1,27 +1,18 @@
package mod.acgaming.spackenmobs.items;
import net.minecraft.item.Item;
import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.misc.ModItems;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ModItemBase extends Item
{
public ModItemBase(String name)
{
setUnlocalizedName(name);
setRegistryName(name);
setCreativeTab(Spackenmobs.SPACKENMOBS_TAB);
public ModItemBase(String name)
{
setUnlocalizedName(name);
setRegistryName(name);
setCreativeTab(Spackenmobs.SPACKENMOBS_TAB);
ModItems.ITEMS.add(this);
}
@SideOnly(Side.CLIENT)
public void initModel()
{
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
ModItems.ITEMS.add(this);
}
}

View file

@ -1,28 +1,19 @@
package mod.acgaming.spackenmobs.items;
import net.minecraft.item.ItemFood;
import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.misc.ModItems;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.ItemFood;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ModItemFoodBase extends ItemFood
{
public ModItemFoodBase(String name, int amount, float saturation, boolean isAnimalFood)
{
super(amount, saturation, isAnimalFood);
setUnlocalizedName(name);
setRegistryName(name);
setCreativeTab(Spackenmobs.SPACKENMOBS_TAB);
public ModItemFoodBase(String name, int amount, float saturation, boolean isAnimalFood)
{
super(amount, saturation, isAnimalFood);
setUnlocalizedName(name);
setRegistryName(name);
setCreativeTab(Spackenmobs.SPACKENMOBS_TAB);
ModItems.ITEMS.add(this);
}
@SideOnly(Side.CLIENT)
public void initModel()
{
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
ModItems.ITEMS.add(this);
}
}

View file

@ -9,29 +9,29 @@ import net.minecraft.world.World;
public class ModItemFoodDrink extends ModItemFoodBase
{
PotionEffect effect;
PotionEffect effect;
public ModItemFoodDrink(String name, int amount, float saturation, boolean isAnimalFood, PotionEffect effect)
{
super(name, amount, saturation, isAnimalFood);
setAlwaysEdible();
public ModItemFoodDrink(String name, int amount, float saturation, boolean isAnimalFood, PotionEffect effect)
{
super(name, amount, saturation, isAnimalFood);
setAlwaysEdible();
this.effect = effect;
}
this.effect = effect;
}
@Override
protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
{
if (!worldIn.isRemote)
{
player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles()));
player.inventory.addItemStackToInventory(new ItemStack(Items.GLASS_BOTTLE));
}
}
@Override
protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
{
if (!worldIn.isRemote)
{
player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles()));
player.inventory.addItemStackToInventory(new ItemStack(Items.GLASS_BOTTLE));
}
}
@Override
public EnumAction getItemUseAction(ItemStack stack)
{
return EnumAction.DRINK;
}
@Override
public EnumAction getItemUseAction(ItemStack stack)
{
return EnumAction.DRINK;
}
}

View file

@ -7,22 +7,22 @@ import net.minecraft.world.World;
public class ModItemFoodEffect extends ModItemFoodBase
{
PotionEffect effect;
PotionEffect effect;
public ModItemFoodEffect(String name, int amount, float saturation, boolean isAnimalFood, PotionEffect effect)
{
super(name, amount, saturation, isAnimalFood);
setAlwaysEdible();
public ModItemFoodEffect(String name, int amount, float saturation, boolean isAnimalFood, PotionEffect effect)
{
super(name, amount, saturation, isAnimalFood);
setAlwaysEdible();
this.effect = effect;
}
this.effect = effect;
}
@Override
protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
{
if (!worldIn.isRemote)
{
player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles()));
}
}
@Override
protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
{
if (!worldIn.isRemote)
{
player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles()));
}
}
}

View file

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

View file

@ -12,143 +12,135 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@LangKey("spackenmobs.config.title")
public class ModConfigs
{
@Name("Allow ApoRed to spawn?")
public static boolean ApoRed_spawn = true;
@Name("Allow Baka Mitai Creeper to spawn?")
public static boolean BakaMitaiCreeper_spawn = true;
@Name("Allow Drachenlord to spawn?")
public static boolean Drachenlord_spawn = true;
@Name("Allow Friedrich Liechtenstein to spawn?")
public static boolean Friedrich_spawn = true;
@Name("Allow Holzstammhuhn to spawn?")
public static boolean Holzstammhuhn_spawn = true;
@Name("Allow Islamist to spawn?")
public static boolean Islamist_spawn = true;
@Name("Allow Jens to spawn?")
public static boolean Jens_spawn = true;
@Name("Allow Marcell D'Avis to spawn?")
public static boolean MarcellDAvis_spawn = true;
@Name("Allow Mr. Bean to spawn?")
public static boolean MrBean_spawn = true;
@Name("Allow Schalker to spawn?")
public static boolean Schalker_spawn = true;
@Name("Allow Smava Creeper to spawn?")
public static boolean SmavaCreeper_spawn = true;
@Name("Allow MZTEWolf to spawn?")
public static boolean MZTEWolf_spawn = true;
@Name("Allow Latin Teacher to spawn?")
public static boolean LatinTeacher_spawn = true;
@Name("Allow ITbyHF to spawn?")
public static boolean ITbyHF_spawn = true;
@Name("Allow tilera Ghast to spawn?")
public static boolean tileraGhast_spawn = true;
@Name("Allow ApoRed to spawn?")
public static boolean ApoRed_spawn = true;
@Name("Allow Baka Mitai Creeper to spawn?")
public static boolean BakaMitaiCreeper_spawn = true;
@Name("Allow Drachenlord to spawn?")
public static boolean Drachenlord_spawn = true;
@Name("Allow Friedrich Liechtenstein to spawn?")
public static boolean Friedrich_spawn = true;
@Name("Allow Holzstammhuhn to spawn?")
public static boolean Holzstammhuhn_spawn = true;
@Name("Allow Islamist to spawn?")
public static boolean Islamist_spawn = true;
@Name("Allow Jens to spawn?")
public static boolean Jens_spawn = true;
@Name("Allow Marcell D'Avis to spawn?")
public static boolean MarcellDAvis_spawn = true;
@Name("Allow Mr. Bean to spawn?")
public static boolean MrBean_spawn = true;
@Name("Allow Schalker to spawn?")
public static boolean Schalker_spawn = true;
@Name("Allow Smava Creeper to spawn?")
public static boolean SmavaCreeper_spawn = true;
@Name("Allow MZTEWolf to spawn?")
public static boolean MZTEWolf_spawn = true;
@Name("Allow Gisela to spawn?")
public static boolean Gisela_spawn = true;
@Name("Allow tilera Ghast to spawn?")
public static boolean tileraGhast_spawn = true;
@Name("ApoRed spawn probability:")
public static int ApoRed_weight = 15;
@Name("ApoRed min group size:")
public static int ApoRed_min = 1;
@Name("ApoRed max group size:")
public static int ApoRed_max = 2;
@Name("Baka Mitai Creeper spawn probability:")
public static int BakaMitaiCreeper_weight = 10;
@Name("Baka Mitai Creeper min group size:")
public static int BakaMitaiCreeper_min = 1;
@Name("Baka Mitai Creeper max group size:")
public static int BakaMitaiCreeper_max = 2;
@Name("Drachenlord spawn probability:")
public static int Drachenlord_weight = 15;
@Name("Drachenlord min group size:")
public static int Drachenlord_min = 1;
@Name("Drachenlord max group size:")
public static int Drachenlord_max = 2;
@Name("Friedrich Liechtenstein spawn probability:")
public static int Friedrich_weight = 15;
@Name("Friedrich Liechtenstein min group size:")
public static int Friedrich_min = 1;
@Name("Friedrich Liechtenstein max group size:")
public static int Friedrich_max = 2;
@Name("Holzstammhuhn spawn probability:")
public static int Holzstammhuhn_weight = 15;
@Name("Holzstammhuhn min group size:")
public static int Holzstammhuhn_min = 1;
@Name("Holzstammhuhn max group size:")
public static int Holzstammhuhn_max = 2;
@Name("Islamist spawn probability:")
public static int Islamist_weight = 15;
@Name("Islamist min group size:")
public static int Islamist_min = 1;
@Name("Islamist max group size:")
public static int Islamist_max = 2;
@Name("Jens spawn probability:")
public static int Jens_weight = 15;
@Name("Jens min group size:")
public static int Jens_min = 1;
@Name("Jens max group size:")
public static int Jens_max = 2;
@Name("Marcell D'Avis spawn probability:")
public static int MarcellDAvis_weight = 15;
@Name("Marcell D'Avis min group size:")
public static int MarcellDAvis_min = 1;
@Name("Marcell D'Avis max group size:")
public static int MarcellDAvis_max = 2;
@Name("Mr. Bean spawn probability:")
public static int MrBean_weight = 15;
@Name("Mr. Bean min group size:")
public static int MrBean_min = 1;
@Name("Mr. Bean max group size:")
public static int MrBean_max = 2;
@Name("Schalker spawn probability:")
public static int Schalker_weight = 10;
@Name("Schalker min group size:")
public static int Schalker_min = 1;
@Name("Schalker max group size:")
public static int Schalker_max = 2;
@Name("Smava Creeper spawn probability:")
public static int SmavaCreeper_weight = 15;
@Name("Smava Creeper min group size:")
public static int SmavaCreeper_min = 1;
@Name("Smava Creeper max group size:")
public static int SmavaCreeper_max = 2;
@Name("MZTEWolf spawn probability:")
public static int MZTEWolf_weight = 15;
@Name("MZTEWolf min group size:")
public static int MZTEWolf_min = 1;
@Name("MZTEWolf max group size:")
public static int MZTEWolf_max = 2;
@Name("Latin Teacher spawn probability:")
public static int LatinTeacher_weight = 15;
@Name("Latin Teacher min group size:")
public static int LatinTeacher_min = 1;
@Name("Latin Teacher max group size:")
public static int LatinTeacher_max = 2;
@Name("ITbyHF spawn probability:")
public static int ITbyHF_weight = 15;
@Name("ITbyHF min group size:")
public static int ITbyHF_min = 1;
@Name("ITbyHF max group size:")
public static int ITbyHF_max = 2;
@Name("tilera Ghast spawn probability:")
public static int tileraGhast_weight = 15;
@Name("tilera Ghast min group size:")
public static int tileraGhast_min = 1;
@Name("tilera Ghast max group size:")
public static int tileraGhast_max = 2;
@Name("ApoRed spawn weight:")
public static int ApoRed_weight = 10;
@Name("ApoRed min group size:")
public static int ApoRed_min = 1;
@Name("ApoRed max group size:")
public static int ApoRed_max = 1;
@Name("Baka Mitai Creeper spawn weight:")
public static int BakaMitaiCreeper_weight = 10;
@Name("Baka Mitai Creeper min group size:")
public static int BakaMitaiCreeper_min = 1;
@Name("Baka Mitai Creeper max group size:")
public static int BakaMitaiCreeper_max = 1;
@Name("Drachenlord spawn weight:")
public static int Drachenlord_weight = 10;
@Name("Drachenlord min group size:")
public static int Drachenlord_min = 1;
@Name("Drachenlord max group size:")
public static int Drachenlord_max = 1;
@Name("Friedrich Liechtenstein spawn weight:")
public static int Friedrich_weight = 10;
@Name("Friedrich Liechtenstein min group size:")
public static int Friedrich_min = 1;
@Name("Friedrich Liechtenstein max group size:")
public static int Friedrich_max = 1;
@Name("Holzstammhuhn spawn weight:")
public static int Holzstammhuhn_weight = 10;
@Name("Holzstammhuhn min group size:")
public static int Holzstammhuhn_min = 1;
@Name("Holzstammhuhn max group size:")
public static int Holzstammhuhn_max = 1;
@Name("Islamist spawn weight:")
public static int Islamist_weight = 10;
@Name("Islamist min group size:")
public static int Islamist_min = 1;
@Name("Islamist max group size:")
public static int Islamist_max = 1;
@Name("Jens spawn weight:")
public static int Jens_weight = 10;
@Name("Jens min group size:")
public static int Jens_min = 1;
@Name("Jens max group size:")
public static int Jens_max = 1;
@Name("Marcell D'Avis spawn weight:")
public static int MarcellDAvis_weight = 10;
@Name("Marcell D'Avis min group size:")
public static int MarcellDAvis_min = 1;
@Name("Marcell D'Avis max group size:")
public static int MarcellDAvis_max = 1;
@Name("Mr. Bean spawn weight:")
public static int MrBean_weight = 10;
@Name("Mr. Bean min group size:")
public static int MrBean_min = 1;
@Name("Mr. Bean max group size:")
public static int MrBean_max = 1;
@Name("Schalker spawn weight:")
public static int Schalker_weight = 10;
@Name("Schalker min group size:")
public static int Schalker_min = 1;
@Name("Schalker max group size:")
public static int Schalker_max = 1;
@Name("Smava Creeper spawn weight:")
public static int SmavaCreeper_weight = 10;
@Name("Smava Creeper min group size:")
public static int SmavaCreeper_min = 1;
@Name("Smava Creeper max group size:")
public static int SmavaCreeper_max = 1;
@Name("MZTEWolf spawn weight:")
public static int MZTEWolf_weight = 10;
@Name("MZTEWolf min group size:")
public static int MZTEWolf_min = 1;
@Name("MZTEWolf max group size:")
public static int MZTEWolf_max = 1;
@Name("Gisela spawn weight:")
public static int Gisela_weight = 10;
@Name("Gisela min group size:")
public static int Gisela_min = 1;
@Name("Gisela max group size:")
public static int Gisela_max = 1;
@Name("tilera Ghast spawn weight:")
public static int tileraGhast_weight = 10;
@Name("tilera Ghast min group size:")
public static int tileraGhast_min = 1;
@Name("tilera Ghast max group size:")
public static int tileraGhast_max = 1;
@Name("Time in seconds Jens needs to digest:")
public static int Jens_digest_time = 120;
@Name("Maximum distance in blocks Jens can search:")
public static int Jens_search_distance = 16;
@Name("Time in seconds Jens needs to digest:")
public static int Jens_digest_time = 120;
@Name("Maximum distance in blocks Jens can search:")
public static int Jens_search_distance = 16;
@EventBusSubscriber(modid = "spackenmobs")
private static class EventHandler
{
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals("spackenmobs"))
{
ConfigManager.sync("spackenmobs", Config.Type.INSTANCE);
}
}
}
@EventBusSubscriber(modid = "spackenmobs")
private static class EventHandler
{
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals("spackenmobs"))
{
ConfigManager.sync("spackenmobs", Config.Type.INSTANCE);
}
}
}
}

View file

@ -1,27 +1,27 @@
package mod.acgaming.spackenmobs.misc;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import mod.acgaming.spackenmobs.entities.*;
import mod.acgaming.spackenmobs.render.*;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
public class ModEntities
{
public static void initModels()
{
RenderingRegistry.registerEntityRenderingHandler(EntityApoRed.class, RenderApoRed.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityBakaMitaiCreeper.class, RenderBakaMitaiCreeper.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityDrachenlord.class, RenderDrachenlord.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityFriedrichLiechtenstein.class, RenderFriedrichLiechtenstein.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityHolzstammhuhn.class, RenderHolzstammhuhn.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityIslamist.class, RenderIslamist.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityITbyHF.class, RenderITbyHF.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityJens.class, RenderJens.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityLatinTeacher.class, RenderLatinTeacher.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityMZTEWolf.class, RenderMZTEWolf.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityMarcellDAvis.class, RenderMarcellDAvis.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityMrBean.class, RenderMrBean.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntitySchalker.class, RenderSchalker.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntitySmavaCreeper.class, RenderSmavaCreeper.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityTileraGhast.class, RenderTileraGhast.FACTORY);
}
public static void initModels()
{
RenderingRegistry.registerEntityRenderingHandler(EntityApoRed.class, RenderApoRed.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityBakaMitaiCreeper.class, RenderBakaMitaiCreeper.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityDrachenlord.class, RenderDrachenlord.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityFriedrichLiechtenstein.class, RenderFriedrichLiechtenstein.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityGisela.class, RenderGisela.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityHolzstammhuhn.class, RenderHolzstammhuhn.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityIslamist.class, RenderIslamist.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityJens.class, RenderJens.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityMZTEWolf.class, RenderMZTEWolf.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityMarcellDAvis.class, RenderMarcellDAvis.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityMrBean.class, RenderMrBean.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntitySchalker.class, RenderSchalker.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntitySmavaCreeper.class, RenderSmavaCreeper.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityTileraGhast.class, RenderTileraGhast.FACTORY);
}
}

View file

@ -1,22 +1,23 @@
package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.items.ModItemBase;
import mod.acgaming.spackenmobs.items.ModItemFoodDrink;
import mod.acgaming.spackenmobs.items.ModItemFoodEffect;
import net.minecraft.init.MobEffects;
import net.minecraft.item.Item;
import net.minecraft.potion.PotionEffect;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.init.MobEffects;
import net.minecraft.item.Item;
import net.minecraft.potion.PotionEffect;
import mod.acgaming.spackenmobs.items.ModItemBase;
import mod.acgaming.spackenmobs.items.ModItemFoodDrink;
import mod.acgaming.spackenmobs.items.ModItemFoodEffect;
public class ModItems
{
public static final List<Item> ITEMS = new ArrayList<>();
public static final List<Item> ITEMS = new ArrayList<>();
public static final Item RAM = new ModItemBase("ram");
public static final Item RAM_ON_A_STICK = new ModItemBase("ram_on_a_stick");
public static final Item SURSTROEMMING = new ModItemBase("surstroemming");
public static final Item AHOJ_BRAUSE = new ModItemFoodEffect("ahoj_brause", 2, 0.15F, false, new PotionEffect(MobEffects.SPEED, 200, 5, false, true));
public static final Item AHOJ_BRAUSE_DRINK = new ModItemFoodDrink("ahoj_brause_drink", 4, 0.3F, false, new PotionEffect(MobEffects.SPEED, 400, 10, false, true));
public static final Item RAM = new ModItemBase("ram");
public static final Item RAM_ON_A_STICK = new ModItemBase("ram_on_a_stick");
public static final Item SURSTROEMMING = new ModItemBase("surstroemming");
public static final Item AHOJ_BRAUSE = new ModItemFoodEffect("ahoj_brause", 2, 0.15F, false, new PotionEffect(MobEffects.SPEED, 200, 5, false, true));
public static final Item AHOJ_BRAUSE_DRINK = new ModItemFoodDrink("ahoj_brause_drink", 4, 0.3F, false, new PotionEffect(MobEffects.SPEED, 400, 10, false, true));
}

View file

@ -1,54 +1,55 @@
package mod.acgaming.spackenmobs.misc;
import java.util.Collections;
import java.util.Set;
import com.google.common.collect.Sets;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootTable;
import net.minecraft.world.storage.loot.LootTableManager;
import java.util.Collections;
import java.util.Set;
public class ModLootTableList
{
private static final Set<ResourceLocation> LOOT_TABLES = Sets.newHashSet();
public static final ResourceLocation EMPTY = register("empty");
public static final ResourceLocation ENTITIES_JENS = register("entities/jens");
public static final ResourceLocation ENTITIES_FRIEDRICH = register("entities/friedrich");
private static final Set<ResourceLocation> READ_ONLY_LOOT_TABLES = Collections.unmodifiableSet(LOOT_TABLES);
private static final Set<ResourceLocation> LOOT_TABLES = Sets.newHashSet();
public static final ResourceLocation EMPTY = register("empty");
public static final ResourceLocation ENTITIES_JENS = register("entities/jens");
public static final ResourceLocation ENTITIES_FRIEDRICH = register("entities/friedrich");
private static final Set<ResourceLocation> READ_ONLY_LOOT_TABLES = Collections.unmodifiableSet(LOOT_TABLES);
public static Set<ResourceLocation> getAll()
{
return READ_ONLY_LOOT_TABLES;
}
public static Set<ResourceLocation> getAll()
{
return READ_ONLY_LOOT_TABLES;
}
public static ResourceLocation register(ResourceLocation id)
{
if (LOOT_TABLES.add(id))
{
return id;
} else
{
throw new IllegalArgumentException(id + " is already a registered built-in loot table");
}
}
public static ResourceLocation register(ResourceLocation id)
{
if (LOOT_TABLES.add(id))
{
return id;
}
else
{
throw new IllegalArgumentException(id + " is already a registered built-in loot table");
}
}
private static ResourceLocation register(String id)
{
return register(new ResourceLocation("spackenmobs", id));
}
public static boolean test()
{
LootTableManager loottablemanager = new LootTableManager(null);
public static boolean test()
{
LootTableManager loottablemanager = new LootTableManager(null);
for (ResourceLocation resourcelocation : READ_ONLY_LOOT_TABLES)
{
if (loottablemanager.getLootTableFromLocation(resourcelocation) == LootTable.EMPTY_LOOT_TABLE)
{
return false;
}
}
for (ResourceLocation resourcelocation : READ_ONLY_LOOT_TABLES)
{
if (loottablemanager.getLootTableFromLocation(resourcelocation) == LootTable.EMPTY_LOOT_TABLE)
{
return false;
}
}
return true;
}
return true;
}
private static ResourceLocation register(String id)
{
return register(new ResourceLocation("spackenmobs", id));
}
}

View file

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

View file

@ -1,242 +0,0 @@
package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.entities.*;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.EntityRegistry;
@EventBusSubscriber(modid = Spackenmobs.MODID)
public class RegHandler
{
@SubscribeEvent
public static void registerEntities(Register<EntityEntry> event)
{
int id = 1;
// Smava Creeper
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:smava_creeper"), EntitySmavaCreeper.class, "smava_creeper", id++, Spackenmobs.instance, 64, 1, true, 7649828, 11053224);
if (ModConfigs.SmavaCreeper_spawn)
{
EntityRegistry.addSpawn(EntitySmavaCreeper.class, ModConfigs.SmavaCreeper_weight, ModConfigs.SmavaCreeper_min, ModConfigs.SmavaCreeper_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
}
// Marcell D'Avis
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:marcell_davis"), EntityMarcellDAvis.class, "marcell_davis", id++, Spackenmobs.instance, 64, 1, true, 15759, 16777215);
if (ModConfigs.MarcellDAvis_spawn)
{
EntityRegistry.addSpawn(EntityMarcellDAvis.class, ModConfigs.MarcellDAvis_weight, ModConfigs.MarcellDAvis_min, ModConfigs.MarcellDAvis_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
}
// Islamist
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist", id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548);
if (ModConfigs.Islamist_spawn)
{
EntityRegistry.addSpawn(EntityIslamist.class, ModConfigs.Islamist_weight, ModConfigs.Islamist_min, ModConfigs.Islamist_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
}
// ApoRed
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++, Spackenmobs.instance, 64, 1, true, 2039583, 16711680);
if (ModConfigs.ApoRed_spawn)
{
EntityRegistry.addSpawn(EntityApoRed.class, ModConfigs.ApoRed_weight, ModConfigs.ApoRed_min, ModConfigs.ApoRed_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntitySkeleton.class));
}
// Mr. Bean
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mr_bean"), EntityMrBean.class, "mr_bean", id++, Spackenmobs.instance, 64, 1, true, 4802350, 3220238);
if (ModConfigs.MrBean_spawn)
{
EntityRegistry.addSpawn(EntityMrBean.class, ModConfigs.MrBean_weight, ModConfigs.MrBean_min, ModConfigs.MrBean_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
}
// Drachenlord
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class, "drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878);
if (ModConfigs.Drachenlord_spawn)
{
EntityRegistry.addSpawn(EntityDrachenlord.class, ModConfigs.Drachenlord_weight, ModConfigs.Drachenlord_min, ModConfigs.Drachenlord_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityPigZombie.class));
}
// Schalker
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker", id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215);
if (ModConfigs.Schalker_spawn)
{
EntityRegistry.addSpawn(EntitySchalker.class, ModConfigs.Schalker_weight, ModConfigs.Schalker_min, ModConfigs.Schalker_max, EnumCreatureType.MONSTER,
BiomeDictionary.getBiomes(BiomeDictionary.Type.END).toArray(new Biome[0]));
}
// Jens
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++, Spackenmobs.instance, 64, 1, true, 6704526, 6767911);
if (ModConfigs.Jens_spawn)
{
EntityRegistry.addSpawn(EntityJens.class, ModConfigs.Jens_weight, ModConfigs.Jens_min, ModConfigs.Jens_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityPig.class));
}
// MZTEWolf
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mztewolf"), EntityMZTEWolf.class, "mztewolf", id++, Spackenmobs.instance, 64, 1, true, 16711680, 0);
if (ModConfigs.MZTEWolf_spawn)
{
EntityRegistry.addSpawn(EntityMZTEWolf.class, ModConfigs.MZTEWolf_weight, ModConfigs.MZTEWolf_min, ModConfigs.MZTEWolf_max, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityWolf.class));
}
// Holzstammhuhn
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class, "holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899);
if (ModConfigs.Holzstammhuhn_spawn)
{
EntityRegistry.addSpawn(EntityHolzstammhuhn.class, ModConfigs.Holzstammhuhn_weight, ModConfigs.Holzstammhuhn_min, ModConfigs.Holzstammhuhn_max, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityChicken.class));
}
// Baka Mitai Creeper
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:bakamitai_creeper"), EntityBakaMitaiCreeper.class, "bakamitai_creeper", id++, Spackenmobs.instance, 64, 1, true, 826890, 0);
if (ModConfigs.BakaMitaiCreeper_spawn)
{
EntityRegistry.addSpawn(EntityBakaMitaiCreeper.class, ModConfigs.BakaMitaiCreeper_weight, ModConfigs.BakaMitaiCreeper_min, ModConfigs.BakaMitaiCreeper_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
}
// Friedrich Liechtenstein
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:friedrich"), EntityFriedrichLiechtenstein.class, "friedrich", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595);
if (ModConfigs.Friedrich_spawn)
{
EntityRegistry.addSpawn(EntityFriedrichLiechtenstein.class, ModConfigs.Friedrich_weight, ModConfigs.Friedrich_min, ModConfigs.Friedrich_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityCow.class));
}
// Latin Teacher
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:latin_teacher"), EntityLatinTeacher.class, "latin_teacher", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595);
if (ModConfigs.LatinTeacher_spawn)
{
EntityRegistry.addSpawn(EntityLatinTeacher.class, ModConfigs.LatinTeacher_weight, ModConfigs.LatinTeacher_min, ModConfigs.LatinTeacher_max, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityWitch.class));
}
// ITbyHF
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:itbyhf"), EntityITbyHF.class, "itbyhf", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595);
if (ModConfigs.ITbyHF_spawn)
{
EntityRegistry.addSpawn(EntityITbyHF.class, ModConfigs.ITbyHF_weight, ModConfigs.ITbyHF_min, ModConfigs.ITbyHF_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntitySheep.class));
}
// tilera Ghast
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:tilera_ghast"), EntityTileraGhast.class, "tilera_ghast", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595);
if (ModConfigs.tileraGhast_spawn)
{
EntityRegistry.addSpawn(EntityTileraGhast.class, ModConfigs.tileraGhast_weight, ModConfigs.tileraGhast_min, ModConfigs.tileraGhast_max, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityGhast.class));
}
}
@SubscribeEvent
public static void registerItems(Register<Item> event)
{
event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
}
@SubscribeEvent
public static void registerSounds(Register<SoundEvent> event)
{
// Smava Creeper
ModSoundEvents.ENTITY_SMAVACREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.fuse"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE);
ModSoundEvents.ENTITY_SMAVACREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.blow"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_BLOW);
ModSoundEvents.ENTITY_SMAVACREEPER_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_HURT);
ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT);
// Islamist
ModSoundEvents.ENTITY_ISLAMIST_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.fuse"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_FUSE);
ModSoundEvents.ENTITY_ISLAMIST_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.blow"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_BLOW);
ModSoundEvents.ENTITY_ISLAMIST_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_HURT);
ModSoundEvents.ENTITY_ISLAMIST_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_AMBIENT);
// Marcell D'Avis
ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT);
ModSoundEvents.ENTITY_MARCELLDAVIS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_HURT);
ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH);
// Mr. Bean
ModSoundEvents.ENTITY_MRBEAN_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_AMBIENT);
ModSoundEvents.ENTITY_MRBEAN_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_HURT);
ModSoundEvents.ENTITY_MRBEAN_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_DEATH);
// ApoRed
ModSoundEvents.ENTITY_APORED_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_APORED_AMBIENT);
ModSoundEvents.ENTITY_APORED_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_APORED_HURT);
ModSoundEvents.ENTITY_APORED_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_APORED_DEATH);
// Drachenlord
ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT);
ModSoundEvents.ENTITY_DRACHENLORD_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_HURT);
ModSoundEvents.ENTITY_DRACHENLORD_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_DEATH);
ModSoundEvents.ENTITY_DRACHENLORD_ANGRY.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.angry"));
event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_ANGRY);
// Schalker
ModSoundEvents.ENTITY_SCHALKER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_AMBIENT);
ModSoundEvents.ENTITY_SCHALKER_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_DEATH);
ModSoundEvents.ENTITY_SCHALKER_OPEN.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.open"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_OPEN);
ModSoundEvents.ENTITY_SCHALKER_SHOOT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.shoot"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_SHOOT);
// Jens
ModSoundEvents.ENTITY_JENS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_AMBIENT);
ModSoundEvents.ENTITY_JENS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_HURT);
ModSoundEvents.ENTITY_JENS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_DEATH);
ModSoundEvents.ENTITY_JENS_EAT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.eat"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_EAT);
ModSoundEvents.ENTITY_JENS_POOP.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.poop"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_POOP);
// Baka Mitai Creeper
ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.fuse"));
event.getRegistry().register(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE);
ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.blow"));
event.getRegistry().register(ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW);
// Friedrich Liechtenstein
ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT);
ModSoundEvents.ENTITY_FRIEDRICH_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_HURT);
ModSoundEvents.ENTITY_FRIEDRICH_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_DEATH);
}
}

View file

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

View file

@ -0,0 +1,242 @@
package mod.acgaming.spackenmobs.misc;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.entities.*;
@EventBusSubscriber(modid = Spackenmobs.MODID)
public class RegistryHandler
{
@SubscribeEvent
public static void registerEntities(Register<EntityEntry> event)
{
int id = 1;
// Smava Creeper
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:smava_creeper"), EntitySmavaCreeper.class, "smava_creeper", id++, Spackenmobs.instance, 64, 1, true, 7649828, 11053224);
if (ModConfigs.SmavaCreeper_spawn)
{
EntityRegistry.addSpawn(EntitySmavaCreeper.class, ModConfigs.SmavaCreeper_weight, ModConfigs.SmavaCreeper_min, ModConfigs.SmavaCreeper_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
}
// Marcell D'Avis
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:marcell_davis"), EntityMarcellDAvis.class, "marcell_davis", id++, Spackenmobs.instance, 64, 1, true, 15759, 16777215);
if (ModConfigs.MarcellDAvis_spawn)
{
EntityRegistry.addSpawn(EntityMarcellDAvis.class, ModConfigs.MarcellDAvis_weight, ModConfigs.MarcellDAvis_min, ModConfigs.MarcellDAvis_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
}
// Islamist
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist", id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548);
if (ModConfigs.Islamist_spawn)
{
EntityRegistry.addSpawn(EntityIslamist.class, ModConfigs.Islamist_weight, ModConfigs.Islamist_min, ModConfigs.Islamist_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
}
// ApoRed
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++, Spackenmobs.instance, 64, 1, true, 2039583, 16711680);
if (ModConfigs.ApoRed_spawn)
{
EntityRegistry.addSpawn(EntityApoRed.class, ModConfigs.ApoRed_weight, ModConfigs.ApoRed_min, ModConfigs.ApoRed_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntitySkeleton.class));
}
// Mr. Bean
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mr_bean"), EntityMrBean.class, "mr_bean", id++, Spackenmobs.instance, 64, 1, true, 4802350, 3220238);
if (ModConfigs.MrBean_spawn)
{
EntityRegistry.addSpawn(EntityMrBean.class, ModConfigs.MrBean_weight, ModConfigs.MrBean_min, ModConfigs.MrBean_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
}
// Drachenlord
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class, "drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878);
if (ModConfigs.Drachenlord_spawn)
{
EntityRegistry.addSpawn(EntityDrachenlord.class, ModConfigs.Drachenlord_weight, ModConfigs.Drachenlord_min, ModConfigs.Drachenlord_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityPigZombie.class));
}
// Schalker
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker", id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215);
if (ModConfigs.Schalker_spawn)
{
EntityRegistry.addSpawn(EntitySchalker.class, ModConfigs.Schalker_weight, ModConfigs.Schalker_min, ModConfigs.Schalker_max, EnumCreatureType.MONSTER,
BiomeDictionary.getBiomes(BiomeDictionary.Type.END).toArray(new Biome[0]));
}
// Jens
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++, Spackenmobs.instance, 64, 1, true, 6704526, 6767911);
if (ModConfigs.Jens_spawn)
{
EntityRegistry.addSpawn(EntityJens.class, ModConfigs.Jens_weight, ModConfigs.Jens_min, ModConfigs.Jens_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityPig.class));
}
// MZTEWolf
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mztewolf"), EntityMZTEWolf.class, "mztewolf", id++, Spackenmobs.instance, 64, 1, true, 16711680, 0);
if (ModConfigs.MZTEWolf_spawn)
{
EntityRegistry.addSpawn(EntityMZTEWolf.class, ModConfigs.MZTEWolf_weight, ModConfigs.MZTEWolf_min, ModConfigs.MZTEWolf_max, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityWolf.class));
}
// Holzstammhuhn
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class, "holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899);
if (ModConfigs.Holzstammhuhn_spawn)
{
EntityRegistry.addSpawn(EntityHolzstammhuhn.class, ModConfigs.Holzstammhuhn_weight, ModConfigs.Holzstammhuhn_min, ModConfigs.Holzstammhuhn_max, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityChicken.class));
}
// Baka Mitai Creeper
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:bakamitai_creeper"), EntityBakaMitaiCreeper.class, "bakamitai_creeper", id++, Spackenmobs.instance, 64, 1, true, 826890, 0);
if (ModConfigs.BakaMitaiCreeper_spawn)
{
EntityRegistry.addSpawn(EntityBakaMitaiCreeper.class, ModConfigs.BakaMitaiCreeper_weight, ModConfigs.BakaMitaiCreeper_min, ModConfigs.BakaMitaiCreeper_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
}
// Friedrich Liechtenstein
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:friedrich"), EntityFriedrichLiechtenstein.class, "friedrich", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595);
if (ModConfigs.Friedrich_spawn)
{
EntityRegistry.addSpawn(EntityFriedrichLiechtenstein.class, ModConfigs.Friedrich_weight, ModConfigs.Friedrich_min, ModConfigs.Friedrich_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityCow.class));
}
// Gisela
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:gisela"), EntityGisela.class, "gisela", id++, Spackenmobs.instance, 64, 1, true, 39835, 16448250);
if (ModConfigs.Gisela_spawn)
{
EntityRegistry.addSpawn(EntityGisela.class, ModConfigs.Gisela_weight, ModConfigs.Gisela_min, ModConfigs.Gisela_max, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithCreature(EntitySheep.class));
}
// tilera Ghast
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:tilera_ghast"), EntityTileraGhast.class, "tilera_ghast", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595);
if (ModConfigs.tileraGhast_spawn)
{
EntityRegistry.addSpawn(EntityTileraGhast.class, ModConfigs.tileraGhast_weight, ModConfigs.tileraGhast_min, ModConfigs.tileraGhast_max, EnumCreatureType.MONSTER, BiomeHelper.getBiomesWithMonster(EntityGhast.class));
}
}
@SubscribeEvent
public static void registerItems(Register<Item> event)
{
event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
}
@SubscribeEvent
public static void registerSounds(Register<SoundEvent> event)
{
// Smava Creeper
ModSoundEvents.ENTITY_SMAVACREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.fuse"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE);
ModSoundEvents.ENTITY_SMAVACREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.blow"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_BLOW);
ModSoundEvents.ENTITY_SMAVACREEPER_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_HURT);
ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT);
// Islamist
ModSoundEvents.ENTITY_ISLAMIST_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.fuse"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_FUSE);
ModSoundEvents.ENTITY_ISLAMIST_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.blow"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_BLOW);
ModSoundEvents.ENTITY_ISLAMIST_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_HURT);
ModSoundEvents.ENTITY_ISLAMIST_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_AMBIENT);
// Marcell D'Avis
ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT);
ModSoundEvents.ENTITY_MARCELLDAVIS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_HURT);
ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH);
// Mr. Bean
ModSoundEvents.ENTITY_MRBEAN_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_AMBIENT);
ModSoundEvents.ENTITY_MRBEAN_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_HURT);
ModSoundEvents.ENTITY_MRBEAN_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.mr_bean.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_MRBEAN_DEATH);
// ApoRed
ModSoundEvents.ENTITY_APORED_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_APORED_AMBIENT);
ModSoundEvents.ENTITY_APORED_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_APORED_HURT);
ModSoundEvents.ENTITY_APORED_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.apored.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_APORED_DEATH);
// Drachenlord
ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_AMBIENT);
ModSoundEvents.ENTITY_DRACHENLORD_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_HURT);
ModSoundEvents.ENTITY_DRACHENLORD_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_DEATH);
ModSoundEvents.ENTITY_DRACHENLORD_ANGRY.setRegistryName(new ResourceLocation("spackenmobs:entities.drachenlord.angry"));
event.getRegistry().register(ModSoundEvents.ENTITY_DRACHENLORD_ANGRY);
// Schalker
ModSoundEvents.ENTITY_SCHALKER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_AMBIENT);
ModSoundEvents.ENTITY_SCHALKER_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_DEATH);
ModSoundEvents.ENTITY_SCHALKER_OPEN.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.open"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_OPEN);
ModSoundEvents.ENTITY_SCHALKER_SHOOT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.shoot"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_SHOOT);
// Jens
ModSoundEvents.ENTITY_JENS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_AMBIENT);
ModSoundEvents.ENTITY_JENS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_HURT);
ModSoundEvents.ENTITY_JENS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_DEATH);
ModSoundEvents.ENTITY_JENS_EAT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.eat"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_EAT);
ModSoundEvents.ENTITY_JENS_POOP.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.poop"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_POOP);
// Baka Mitai Creeper
ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.fuse"));
event.getRegistry().register(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE);
ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.bakamitai_creeper.blow"));
event.getRegistry().register(ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW);
// Friedrich Liechtenstein
ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_AMBIENT);
ModSoundEvents.ENTITY_FRIEDRICH_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_HURT);
ModSoundEvents.ENTITY_FRIEDRICH_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.friedrich.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_FRIEDRICH_DEATH);
// Gisela
ModSoundEvents.ENTITY_GISELA_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.gisela.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_GISELA_AMBIENT);
ModSoundEvents.ENTITY_GISELA_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.gisela.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_GISELA_HURT);
}
}

View file

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

View file

@ -1,97 +0,0 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityLatinTeacher;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class LayerHeldItemLatinTeacher implements LayerRenderer<EntityLatinTeacher>
{
private final RenderLatinTeacher latinTeacherRenderer;
public LayerHeldItemLatinTeacher(RenderLatinTeacher latinTeacherRendererIn)
{
this.latinTeacherRenderer = latinTeacherRendererIn;
}
public void doRenderLayer(EntityLatinTeacher entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
ItemStack itemstack = entitylivingbaseIn.getHeldItemMainhand();
if (!itemstack.isEmpty())
{
GlStateManager.color(1.0F, 1.0F, 1.0F);
GlStateManager.pushMatrix();
if (this.latinTeacherRenderer.getMainModel().isChild)
{
GlStateManager.translate(0.0F, 0.625F, 0.0F);
GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F);
float f = 0.5F;
GlStateManager.scale(0.5F, 0.5F, 0.5F);
}
this.latinTeacherRenderer.getMainModel().villagerNose.postRender(0.0625F);
GlStateManager.translate(-0.0625F, 0.53125F, 0.21875F);
Item item = itemstack.getItem();
Minecraft minecraft = Minecraft.getMinecraft();
if (Block.getBlockFromItem(item).getDefaultState().getRenderType() == EnumBlockRenderType.ENTITYBLOCK_ANIMATED)
{
GlStateManager.translate(0.0F, 0.0625F, -0.25F);
GlStateManager.rotate(30.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-5.0F, 0.0F, 1.0F, 0.0F);
float f1 = 0.375F;
GlStateManager.scale(0.375F, -0.375F, 0.375F);
} else if (item instanceof net.minecraft.item.ItemBow)
{
GlStateManager.translate(0.0F, 0.125F, -0.125F);
GlStateManager.rotate(-45.0F, 0.0F, 1.0F, 0.0F);
float f2 = 0.625F;
GlStateManager.scale(0.625F, -0.625F, 0.625F);
GlStateManager.rotate(-100.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-20.0F, 0.0F, 1.0F, 0.0F);
} else if (item.isFull3D())
{
if (item.shouldRotateAroundWhenRendering())
{
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(0.0F, -0.0625F, 0.0F);
}
this.latinTeacherRenderer.transformHeldFull3DItemLayer();
GlStateManager.translate(0.0625F, -0.125F, 0.0F);
float f3 = 0.625F;
GlStateManager.scale(0.625F, -0.625F, 0.625F);
GlStateManager.rotate(0.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(0.0F, 0.0F, 1.0F, 0.0F);
} else
{
GlStateManager.translate(0.1875F, 0.1875F, 0.0F);
float f4 = 0.875F;
GlStateManager.scale(0.875F, 0.875F, 0.875F);
GlStateManager.rotate(-20.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(-60.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-30.0F, 0.0F, 0.0F, 1.0F);
}
GlStateManager.rotate(-15.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(40.0F, 0.0F, 0.0F, 1.0F);
minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND);
GlStateManager.popMatrix();
}
}
public boolean shouldCombineTextures()
{
return false;
}
}

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityJensWither;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelWither;
import net.minecraft.client.renderer.GlStateManager;
@ -10,51 +9,53 @@ import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntityJensWither;
@SideOnly(Side.CLIENT)
public class LayerJensWitherAura implements LayerRenderer<EntityJensWither>
{
private static final ResourceLocation WITHER_ARMOR = new ResourceLocation("textures/entity/wither/wither_armor.png");
private final RenderJensWither witherRenderer;
private final ModelWither witherModel = new ModelWither(0.5F);
private static final ResourceLocation WITHER_ARMOR = new ResourceLocation("textures/entity/wither/wither_armor.png");
private final RenderJensWither witherRenderer;
private final ModelWither witherModel = new ModelWither(0.5F);
public LayerJensWitherAura(RenderJensWither witherRendererIn)
{
this.witherRenderer = witherRendererIn;
}
public LayerJensWitherAura(RenderJensWither witherRendererIn)
{
this.witherRenderer = witherRendererIn;
}
public void doRenderLayer(EntityJensWither entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.isArmored())
{
GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
this.witherRenderer.bindTexture(WITHER_ARMOR);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
float f = (float) entitylivingbaseIn.ticksExisted + partialTicks;
float f1 = MathHelper.cos(f * 0.02F) * 3.0F;
float f2 = f * 0.01F;
GlStateManager.translate(f1, f2, 0.0F);
GlStateManager.matrixMode(5888);
GlStateManager.enableBlend();
float f3 = 0.5F;
GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F);
GlStateManager.disableLighting();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
this.witherModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
this.witherModel.setModelAttributes(this.witherRenderer.getMainModel());
Minecraft.getMinecraft().entityRenderer.setupFogColor(true);
this.witherModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
Minecraft.getMinecraft().entityRenderer.setupFogColor(false);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
}
}
public void doRenderLayer(EntityJensWither entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.isArmored())
{
GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
this.witherRenderer.bindTexture(WITHER_ARMOR);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
float f = (float) entitylivingbaseIn.ticksExisted + partialTicks;
float f1 = MathHelper.cos(f * 0.02F) * 3.0F;
float f2 = f * 0.01F;
GlStateManager.translate(f1, f2, 0.0F);
GlStateManager.matrixMode(5888);
GlStateManager.enableBlend();
float f3 = 0.5F;
GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F);
GlStateManager.disableLighting();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
this.witherModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
this.witherModel.setModelAttributes(this.witherRenderer.getMainModel());
Minecraft.getMinecraft().entityRenderer.setupFogColor(true);
this.witherModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
Minecraft.getMinecraft().entityRenderer.setupFogColor(false);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
}
}
public boolean shouldCombineTextures()
{
return false;
}
public boolean shouldCombineTextures()
{
return false;
}
}

View file

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

View file

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

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper;
import net.minecraft.client.model.ModelCreeper;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
@ -12,58 +11,61 @@ import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper;
@SideOnly(Side.CLIENT)
public class RenderBakaMitaiCreeper extends RenderLiving<EntityBakaMitaiCreeper>
{
public static final Factory FACTORY = new Factory();
private static final ResourceLocation CREEPER_TEXTURE = new ResourceLocation("textures/entity/creeper/creeper.png");
public static final Factory FACTORY = new Factory();
private static final ResourceLocation CREEPER_TEXTURE = new ResourceLocation("textures/entity/creeper/creeper.png");
public RenderBakaMitaiCreeper(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelCreeper(), 0.5F);
}
public RenderBakaMitaiCreeper(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelCreeper(), 0.5F);
}
@Override
protected int getColorMultiplier(EntityBakaMitaiCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
@Override
protected int getColorMultiplier(EntityBakaMitaiCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
} else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
return i << 24 | 822083583;
}
}
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
return i << 24 | 822083583;
}
}
@Override
protected ResourceLocation getEntityTexture(EntityBakaMitaiCreeper entity)
{
return CREEPER_TEXTURE;
}
@Override
protected void preRenderCallback(EntityBakaMitaiCreeper entitylivingbaseIn, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
@Override
protected void preRenderCallback(EntityBakaMitaiCreeper entitylivingbaseIn, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
@Override
protected ResourceLocation getEntityTexture(EntityBakaMitaiCreeper entity)
{
return CREEPER_TEXTURE;
}
public static class Factory implements IRenderFactory<EntityBakaMitaiCreeper>
{
@Override
public Render<? super EntityBakaMitaiCreeper> createRenderFor(RenderManager manager)
{
return new RenderBakaMitaiCreeper(manager);
}
}
public static class Factory implements IRenderFactory<EntityBakaMitaiCreeper>
{
@Override
public Render<? super EntityBakaMitaiCreeper> createRenderFor(RenderManager manager)
{
return new RenderBakaMitaiCreeper(manager);
}
}
}

View file

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

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityFriedrichLiechtenstein;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderBiped;
@ -10,29 +9,31 @@ import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntityFriedrichLiechtenstein;
@SideOnly(Side.CLIENT)
public class RenderFriedrichLiechtenstein extends RenderBiped<EntityFriedrichLiechtenstein>
{
public static final Factory FACTORY = new Factory();
private static final ResourceLocation FRIEDRICH_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/friedrich.png");
public static final Factory FACTORY = new Factory();
private static final ResourceLocation FRIEDRICH_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/friedrich.png");
public RenderFriedrichLiechtenstein(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelBiped(), 0.25F);
}
public RenderFriedrichLiechtenstein(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelBiped(), 0.25F);
}
@Override
protected ResourceLocation getEntityTexture(EntityFriedrichLiechtenstein entity)
{
return FRIEDRICH_TEXTURE;
}
@Override
protected ResourceLocation getEntityTexture(EntityFriedrichLiechtenstein entity)
{
return FRIEDRICH_TEXTURE;
}
private static class Factory implements IRenderFactory<EntityFriedrichLiechtenstein>
{
@Override
public Render<? super EntityFriedrichLiechtenstein> createRenderFor(RenderManager manager)
{
return new RenderFriedrichLiechtenstein(manager);
}
}
private static class Factory implements IRenderFactory<EntityFriedrichLiechtenstein>
{
@Override
public Render<? super EntityFriedrichLiechtenstein> createRenderFor(RenderManager manager)
{
return new RenderFriedrichLiechtenstein(manager);
}
}
}

View file

@ -0,0 +1,39 @@
package mod.acgaming.spackenmobs.render;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntityGisela;
@SideOnly(Side.CLIENT)
public class RenderGisela extends RenderBiped<EntityGisela>
{
public static final Factory FACTORY = new Factory();
private static final ResourceLocation GISELA_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/gisela.png");
public RenderGisela(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelBiped(), 0.25F);
}
@Override
protected ResourceLocation getEntityTexture(EntityGisela entity)
{
return GISELA_TEXTURE;
}
private static class Factory implements IRenderFactory<EntityGisela>
{
@Override
public Render<? super EntityGisela> createRenderFor(RenderManager manager)
{
return new RenderGisela(manager);
}
}
}

View file

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

View file

@ -1,38 +0,0 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityITbyHF;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderITbyHF extends RenderBiped<EntityITbyHF>
{
public static final Factory FACTORY = new Factory();
private static final ResourceLocation ITBYHF_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/itbyhf.png");
public RenderITbyHF(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelBiped(), 0.25F);
}
@Override
protected ResourceLocation getEntityTexture(EntityITbyHF entity)
{
return ITBYHF_TEXTURE;
}
private static class Factory implements IRenderFactory<EntityITbyHF>
{
@Override
public Render<? super EntityITbyHF> createRenderFor(RenderManager manager)
{
return new RenderITbyHF(manager);
}
}
}

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityIslamist;
import net.minecraft.client.model.ModelCreeper;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
@ -12,58 +11,61 @@ import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntityIslamist;
@SideOnly(Side.CLIENT)
public class RenderIslamist extends RenderLiving<EntityIslamist>
{
public static final Factory FACTORY = new Factory();
private static final ResourceLocation ISLAMIST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/islamist.png");
public static final Factory FACTORY = new Factory();
private static final ResourceLocation ISLAMIST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/islamist.png");
public RenderIslamist(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelCreeper(), 0.5F);
}
public RenderIslamist(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelCreeper(), 0.5F);
}
@Override
protected int getColorMultiplier(EntityIslamist entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
@Override
protected int getColorMultiplier(EntityIslamist entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
} else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
return i << 24 | 822083583;
}
}
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
return i << 24 | 822083583;
}
}
@Override
protected ResourceLocation getEntityTexture(EntityIslamist entity)
{
return ISLAMIST_TEXTURE;
}
@Override
protected void preRenderCallback(EntityIslamist entitylivingbaseIn, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
@Override
protected void preRenderCallback(EntityIslamist entitylivingbaseIn, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
@Override
protected ResourceLocation getEntityTexture(EntityIslamist entity)
{
return ISLAMIST_TEXTURE;
}
public static class Factory implements IRenderFactory<EntityIslamist>
{
@Override
public Render<? super EntityIslamist> createRenderFor(RenderManager manager)
{
return new RenderIslamist(manager);
}
}
public static class Factory implements IRenderFactory<EntityIslamist>
{
@Override
public Render<? super EntityIslamist> createRenderFor(RenderManager manager)
{
return new RenderIslamist(manager);
}
}
}

View file

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

View file

@ -1,42 +1,58 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityJensWither;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.model.ModelWither;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntityJensWither;
@SideOnly(Side.CLIENT)
public class RenderJensWither extends RenderLiving<EntityJensWither>
{
private static final ResourceLocation INVULNERABLE_JENS_WITHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens_wither_inv.png");
private static final ResourceLocation JENS_WITHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens_wither.png");
private static final ResourceLocation INVULNERABLE_JENS_WITHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens_wither_inv.png");
private static final ResourceLocation JENS_WITHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens_wither.png");
public RenderJensWither(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelWither(0.0F), 1.0F);
this.addLayer(new LayerJensWitherAura(this));
}
public RenderJensWither(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelWither(0.0F), 1.0F);
this.addLayer(new LayerJensWitherAura(this));
}
protected ResourceLocation getEntityTexture(EntityJensWither entity)
{
int i = entity.getInvulTime();
return i > 0 && (i > 80 || i / 5 % 2 != 1) ? INVULNERABLE_JENS_WITHER_TEXTURE : JENS_WITHER_TEXTURE;
}
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
if (!worldIn.isRemote && (double) state.getBlockHardness(worldIn, pos) != 0.0D)
{
stack.damageItem(1, entityLiving);
}
protected void preRenderCallback(EntityJensWither entitylivingbaseIn, float partialTickTime)
{
float f = 2.0F;
int i = entitylivingbaseIn.getInvulTime();
return true;
}
if (i > 0)
{
f -= ((float) i - partialTickTime) / 220.0F * 0.5F;
}
protected ResourceLocation getEntityTexture(EntityJensWither entity)
{
int i = entity.getInvulTime();
return i > 0 && (i > 80 || i / 5 % 2 != 1) ? INVULNERABLE_JENS_WITHER_TEXTURE : JENS_WITHER_TEXTURE;
}
GlStateManager.scale(f, f, f);
}
protected void preRenderCallback(EntityJensWither entitylivingbaseIn, float partialTickTime)
{
float f = 2.0F;
int i = entitylivingbaseIn.getInvulTime();
if (i > 0)
{
f -= ((float) i - partialTickTime) / 220.0F * 0.5F;
}
GlStateManager.scale(f, f, f);
}
}

View file

@ -1,61 +0,0 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityLatinTeacher;
import net.minecraft.client.model.ModelWitch;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderLatinTeacher extends RenderLiving<EntityLatinTeacher>
{
public static final RenderLatinTeacher.Factory FACTORY = new RenderLatinTeacher.Factory();
private static final ResourceLocation LATINTEACHER_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/latin_teacher.png");
public RenderLatinTeacher(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelWitch(0.0F), 0.5F);
this.addLayer(new LayerHeldItemLatinTeacher(this));
}
public ModelWitch getMainModel()
{
return (ModelWitch) super.getMainModel();
}
public void doRender(EntityLatinTeacher entity, double x, double y, double z, float entityYaw, float partialTicks)
{
((ModelWitch) this.mainModel).holdingItem = !entity.getHeldItemMainhand().isEmpty();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
protected ResourceLocation getEntityTexture(EntityLatinTeacher entity)
{
return LATINTEACHER_TEXTURE;
}
public void transformHeldFull3DItemLayer()
{
GlStateManager.translate(0.0F, 0.1875F, 0.0F);
}
protected void preRenderCallback(EntityLatinTeacher entitylivingbaseIn, float partialTickTime)
{
float f = 0.9375F;
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
}
private static class Factory implements IRenderFactory<EntityLatinTeacher>
{
@Override
public Render<? super EntityLatinTeacher> createRenderFor(RenderManager manager)
{
return new RenderLatinTeacher(manager);
}
}
}

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityMZTEWolf;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
@ -12,59 +11,62 @@ import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntityMZTEWolf;
@SideOnly(Side.CLIENT)
public class RenderMZTEWolf extends RenderWolf
{
public static final Factory FACTORY = new Factory();
private static final ResourceLocation MZTEWOLF_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/mztewolf.png");
private static final ResourceLocation TAMED_MZTEWOLF_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/mztewolf_tame.png");
private static final ResourceLocation ANRGY_MZTEWOLF_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/mztewolf_angry.png");
public static final Factory FACTORY = new Factory();
private static final ResourceLocation MZTEWOLF_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/mztewolf.png");
private static final ResourceLocation TAMED_MZTEWOLF_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/mztewolf_tame.png");
private static final ResourceLocation ANRGY_MZTEWOLF_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/mztewolf_angry.png");
public RenderMZTEWolf(RenderManager renderManagerIn)
{
super(renderManagerIn);
this.addLayer(new LayerWolfCollar(this));
}
public RenderMZTEWolf(RenderManager renderManagerIn)
{
super(renderManagerIn);
this.addLayer(new LayerWolfCollar(this));
}
@Override
protected float handleRotationFloat(EntityWolf livingBase, float partialTicks)
{
return livingBase.getTailRotation();
}
@Override
protected float handleRotationFloat(EntityWolf livingBase, float partialTicks)
{
return livingBase.getTailRotation();
}
@Override
public void doRender(EntityWolf entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (entity.isWolfWet())
{
float f = entity.getBrightness() * entity.getShadingWhileWet(partialTicks);
GlStateManager.color(f, f, f);
}
@Override
public void doRender(EntityWolf entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (entity.isWolfWet())
{
float f = entity.getBrightness() * entity.getShadingWhileWet(partialTicks);
GlStateManager.color(f, f, f);
}
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
@Override
protected ResourceLocation getEntityTexture(EntityWolf entity)
{
if (entity.isTamed())
{
return TAMED_MZTEWOLF_TEXTURE;
} else
{
return entity.isAngry() ? ANRGY_MZTEWOLF_TEXTURE : MZTEWOLF_TEXTURE;
}
}
@Override
protected ResourceLocation getEntityTexture(EntityWolf entity)
{
if (entity.isTamed())
{
return TAMED_MZTEWOLF_TEXTURE;
}
else
{
return entity.isAngry() ? ANRGY_MZTEWOLF_TEXTURE : MZTEWOLF_TEXTURE;
}
}
public static class Factory implements IRenderFactory<EntityMZTEWolf>
{
@Override
public Render<? super EntityMZTEWolf> createRenderFor(RenderManager manager)
{
return new RenderMZTEWolf(manager);
}
}
public static class Factory implements IRenderFactory<EntityMZTEWolf>
{
@Override
public Render<? super EntityMZTEWolf> createRenderFor(RenderManager manager)
{
return new RenderMZTEWolf(manager);
}
}
}

View file

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

View file

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

View file

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

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper;
import net.minecraft.client.model.ModelCreeper;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
@ -12,58 +11,61 @@ import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper;
@SideOnly(Side.CLIENT)
public class RenderSmavaCreeper extends RenderLiving<EntitySmavaCreeper>
{
public static final Factory FACTORY = new Factory();
private static final ResourceLocation SMAVA_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/smava_creeper.png");
public static final Factory FACTORY = new Factory();
private static final ResourceLocation SMAVA_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/smava_creeper.png");
public RenderSmavaCreeper(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelCreeper(), 0.5F);
}
public RenderSmavaCreeper(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelCreeper(), 0.5F);
}
@Override
protected int getColorMultiplier(EntitySmavaCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
@Override
protected int getColorMultiplier(EntitySmavaCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
} else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
return i << 24 | 822083583;
}
}
if ((int) (f * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int i = (int) (f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
return i << 24 | 822083583;
}
}
@Override
protected ResourceLocation getEntityTexture(EntitySmavaCreeper entity)
{
return SMAVA_TEXTURE;
}
@Override
protected void preRenderCallback(EntitySmavaCreeper entitylivingbaseIn, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
@Override
protected void preRenderCallback(EntitySmavaCreeper entitylivingbaseIn, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
@Override
protected ResourceLocation getEntityTexture(EntitySmavaCreeper entity)
{
return SMAVA_TEXTURE;
}
public static class Factory implements IRenderFactory<EntitySmavaCreeper>
{
@Override
public Render<? super EntitySmavaCreeper> createRenderFor(RenderManager manager)
{
return new RenderSmavaCreeper(manager);
}
}
public static class Factory implements IRenderFactory<EntitySmavaCreeper>
{
@Override
public Render<? super EntitySmavaCreeper> createRenderFor(RenderManager manager)
{
return new RenderSmavaCreeper(manager);
}
}
}

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityTileraGhast;
import net.minecraft.client.model.ModelGhast;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
@ -11,38 +10,40 @@ import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import mod.acgaming.spackenmobs.entities.EntityTileraGhast;
@SideOnly(Side.CLIENT)
public class RenderTileraGhast extends RenderLiving<EntityTileraGhast>
{
public static final RenderTileraGhast.Factory FACTORY = new RenderTileraGhast.Factory();
private static final ResourceLocation TILERA_GHAST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/tilera_ghast.png");
private static final ResourceLocation TILERA_GHAST_SHOOTING_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/tilera_ghast_shooting.png");
public static final RenderTileraGhast.Factory FACTORY = new RenderTileraGhast.Factory();
private static final ResourceLocation TILERA_GHAST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/tilera_ghast.png");
private static final ResourceLocation TILERA_GHAST_SHOOTING_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/tilera_ghast_shooting.png");
public RenderTileraGhast(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelGhast(), 0.5F);
}
public RenderTileraGhast(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelGhast(), 0.5F);
}
protected ResourceLocation getEntityTexture(EntityTileraGhast entity)
{
return entity.isAttacking() ? TILERA_GHAST_SHOOTING_TEXTURE : TILERA_GHAST_TEXTURE;
}
protected ResourceLocation getEntityTexture(EntityTileraGhast entity)
{
return entity.isAttacking() ? TILERA_GHAST_SHOOTING_TEXTURE : TILERA_GHAST_TEXTURE;
}
protected void preRenderCallback(EntityTileraGhast entitylivingbaseIn, float partialTickTime)
{
float f = 1.0F;
float f1 = 4.5F;
float f2 = 4.5F;
GlStateManager.scale(4.5F, 4.5F, 4.5F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
protected void preRenderCallback(EntityTileraGhast entitylivingbaseIn, float partialTickTime)
{
float f = 1.0F;
float f1 = 4.5F;
float f2 = 4.5F;
GlStateManager.scale(4.5F, 4.5F, 4.5F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
private static class Factory implements IRenderFactory<EntityTileraGhast>
{
@Override
public Render<? super EntityTileraGhast> createRenderFor(RenderManager manager)
{
return new RenderTileraGhast(manager);
}
}
private static class Factory implements IRenderFactory<EntityTileraGhast>
{
@Override
public Render<? super EntityTileraGhast> createRenderFor(RenderManager manager)
{
return new RenderTileraGhast(manager);
}
}
}

View file

@ -14,12 +14,11 @@ entity.apored.name=ApoRed
entity.bakamitai_creeper.name=Baka Mitai-Creeper
entity.drachenlord.name=Drachenlord
entity.friedrich.name=Friedrich Liechtenstein
entity.gisela.name=Gisela
entity.holzstammhuhn.name=Holzstammhuhn
entity.islamist.name=Islamist
entity.itbyhf.name=ITbyHF
entity.jens.name=Jens
entity.jens_wither.name=Jens-Wither
entity.latin_teacher.name=Lateinlehrerin
entity.marcell_davis.name=Marcell D'Avis
entity.mr_bean.name=Mr. Bean
entity.mztewolf.name=MZTEWolf

View file

@ -14,12 +14,11 @@ entity.apored.name=ApoRed
entity.bakamitai_creeper.name=Baka Mitai Creeper
entity.drachenlord.name=Drachenlord
entity.friedrich.name=Friedrich Liechtenstein
entity.gisela.name=Gisela
entity.holzstammhuhn.name=Holzstammhuhn
entity.islamist.name=Islamist
entity.itbyhf.name=ITbyHF
entity.jens.name=Jens
entity.jens_wither.name=Jens Wither
entity.latin_teacher.name=Latin Teacher
entity.marcell_davis.name=Marcell D'Avis
entity.mr_bean.name=Mr. Bean
entity.mztewolf.name=MZTEWolf
@ -32,4 +31,4 @@ item.ram.name=RAM
item.ram_on_a_stick.name=RAM on a Stick
item.surstroemming.name=Surströmming
itemGroup.spackenmobs=Spackenmobs
spackenmobs.config.title=Spackenmobs settings
spackenmobs.config.title=Spackenmobs Settings

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View file

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