massive cleanup

damn this code was shit
This commit is contained in:
LordMZTE 2020-08-29 17:36:56 +02:00
parent 373ab78823
commit 484236b477
41 changed files with 2517 additions and 3851 deletions

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip

View file

@ -1,9 +1,7 @@
package mod.acgaming.spackenmobs;
import mod.acgaming.spackenmobs.events.SurstroemmingSmellsBadEvent;
import mod.acgaming.spackenmobs.misc.ModEntities;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
@ -13,39 +11,34 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@Mod(modid = "spackenmobs", version = "RC3", acceptedMinecraftVersions = "[1.12.2]")
public class Spackenmobs
{
public static final String MODID = "spackenmobs";
public static final String VERSION = "RC3";
@Mod(modid = "spackenmobs", version = "RC1", acceptedMinecraftVersions = "[1.12.2]")
public class Spackenmobs {
public static final String MODID = "spackenmobs";
public static final String VERSION = "RC1";
public static final CreativeTabs SPACKENMOBS_TAB = new SpackenmobsTab("tabSpackenmobs");
public static final CreativeTabs SPACKENMOBS_TAB = new SpackenmobsTab();
@Instance
public static Spackenmobs instance;
@Instance
public static Spackenmobs instance;
@EventHandler
public void init(FMLInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(new SurstroemmingSmellsBadEvent());
}
@SideOnly(Side.CLIENT)
@EventHandler
public void preInitClient(FMLPreInitializationEvent event) {
ModEntities.initModels();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
}
}
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
@EventHandler
public void init(FMLInitializationEvent event) {
}
}
@SideOnly(Side.CLIENT)
@EventHandler
public void preInitClient(FMLPreInitializationEvent event)
{
ModEntities.initModels();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
}

View file

@ -6,17 +6,14 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class SpackenmobsTab extends CreativeTabs
{
public SpackenmobsTab(String name)
{
super(Spackenmobs.MODID + "." + name);
}
public class SpackenmobsTab extends CreativeTabs {
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,87 +1,74 @@
package mod.acgaming.spackenmobs.entities;
import net.minecraft.block.BlockJukebox;
import net.minecraft.block.properties.IProperty;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Blocks;
// Thanks to Akrivus!
public class EntityAIDance extends EntityAIBase
{
private final EntityJens jens;
public class EntityAIDance extends EntityAIBase {
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 void resetTask() {
this.lastDanceMoveTime = 0;
this.danceStage = 0;
}
@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
&& ((Boolean) this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getValue((IProperty) BlockJukebox.HAS_RECORD)).booleanValue())
return true;
}
}
}
return false;
}
@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 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(10) + 5;
}
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(10) + 5;
}
this.lastDanceMoveTime--;
}
}

View file

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

View file

@ -1,99 +1,28 @@
package mod.acgaming.spackenmobs.entities;
import javax.annotation.Nullable;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntitySpectralArrow;
import net.minecraft.entity.projectile.EntityTippedArrow;
import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
public class EntityApoRed extends EntitySkeleton
{
public static void registerFixesApoRed(DataFixer fixer)
{
EntityLiving.registerFixesMob(fixer, EntityApoRed.class);
}
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 EntityArrow getArrow(float p_190726_1_)
{
ItemStack itemstack = this.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND);
if (itemstack.getItem() == Items.SPECTRAL_ARROW)
{
EntitySpectralArrow entityspectralarrow = new EntitySpectralArrow(this.world, this);
entityspectralarrow.setEnchantmentEffectsFromEntity(this, p_190726_1_);
return entityspectralarrow;
}
else
{
EntityArrow entityarrow = super.getArrow(p_190726_1_);
if (itemstack.getItem() == Items.TIPPED_ARROW && entityarrow instanceof EntityTippedArrow)
{
((EntityTippedArrow) entityarrow).setPotionEffect(itemstack);
}
return entityarrow;
}
}
@Override
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_APORED_DEATH;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_APORED_HURT;
}
@Override
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_SKELETON;
}
@Override
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
if (cause.getTrueSource() instanceof EntityCreeper)
{
EntityCreeper entitycreeper = (EntityCreeper) cause.getTrueSource();
if (entitycreeper.getPowered() && entitycreeper.ableToCauseSkullDrop())
{
entitycreeper.incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 0), 0.0F);
}
}
}
@Override
protected SoundEvent getDeathSound() {
return ModSoundEvents.ENTITY_APORED_DEATH;
}
}

View file

@ -1,23 +1,10 @@
package mod.acgaming.spackenmobs.entities;
import java.util.Collection;
import javax.annotation.Nullable;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAreaEffectCloud;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.EntityAIAvoidEntity;
import net.minecraft.entity.ai.EntityAICreeperSwell;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySkeleton;
@ -36,315 +23,264 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntityBakaMitaiCreeper extends EntityCreeper
{
private static final DataParameter<Integer> STATE = EntityDataManager.<Integer>createKey(EntityBakaMitaiCreeper.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.<Boolean>createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.<Boolean>createKey(EntityBakaMitaiCreeper.class, DataSerializers.BOOLEAN);
import javax.annotation.Nullable;
import java.util.Collection;
public static void registerFixesCreeper(DataFixer fixer)
{
EntityLiving.registerFixesMob(fixer, EntityBakaMitaiCreeper.class);
}
public class EntityBakaMitaiCreeper extends EntityCreeper {
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 int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 100;
private int explosionRadius = 12;
public EntityBakaMitaiCreeper(World worldIn) {
super(worldIn);
this.setSize(0.6F, 1.7F);
}
private int droppedSkulls;
@Override
public boolean ableToCauseSkullDrop() {
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
public EntityBakaMitaiCreeper(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Override
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
@Override
public boolean attackEntityAsMob(Entity entityIn) {
return true;
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Override
protected void entityInit() {
super.entityInit();
this.dataManager.register(STATE, -1);
this.dataManager.register(POWERED, false);
this.dataManager.register(IGNITED, false);
}
@Override
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
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 /*TODO sound missing?*/, getSoundCategory(), 1.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
@Override
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, Integer.valueOf(-1));
this.dataManager.register(POWERED, Boolean.valueOf(false));
this.dataManager.register(IGNITED, Boolean.valueOf(false));
}
@Override
public void fall(float distance, float damageMultiplier) {
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int)(this.timeSinceIgnited + distance * 1.5F);
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(), 1.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
if(this.timeSinceIgnited > this.fuseTime - 5) {
this.timeSinceIgnited = this.fuseTime - 5;
}
}
@Override
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) (this.timeSinceIgnited + distance * 1.5F);
@Override
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_) {
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
@Override
public int getCreeperState() {
return this.dataManager.get(STATE);
}
@Override
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
}
@Override
public void setCreeperState(int state) {
this.dataManager.set(STATE, state);
}
@Override
public int getCreeperState()
{
return this.dataManager.get(STATE).intValue();
}
@Override
protected SoundEvent getDeathSound() {
return SoundEvents.ENTITY_CREEPER_DEATH;
}
@Override
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_CREEPER_DEATH;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return SoundEvents.ENTITY_CREEPER_HURT;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_CREEPER_HURT;
}
@Override
@Nullable
protected ResourceLocation getLootTable() {
return LootTableList.ENTITIES_CREEPER;
}
@Override
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
@Override
public int getMaxFallHeight() {
return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F);
}
@Override
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
@Override
public boolean getPowered() {
return this.dataManager.get(POWERED);
}
@Override
public boolean getPowered()
{
return this.dataManager.get(POWERED).booleanValue();
}
@Override
public boolean hasIgnited() {
return this.dataManager.get(IGNITED);
}
@Override
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED).booleanValue();
}
@Override
public void ignite() {
this.dataManager.set(IGNITED, true);
}
@Override
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.valueOf(true));
}
@Override
public void incrementDroppedSkulls() {
++this.droppedSkulls;
}
@Override
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
@Override
protected void initEntityAI() {
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAICreeperSwell(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));
}
@Override
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAICreeperSwell(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, new Class[0]));
}
@Override
public void onDeath(DamageSource cause) {
super.onDeath(cause);
@Override
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
if(this.world.getGameRules().getBoolean("doMobLoot")) {
if(cause.getTrueSource() instanceof EntitySkeleton) {
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
}else if(cause.getTrueSource() instanceof EntityBakaMitaiCreeper && cause.getTrueSource() != this && ((EntityBakaMitaiCreeper)cause.getTrueSource()).getPowered()
&& ((EntityBakaMitaiCreeper)cause.getTrueSource()).ableToCauseSkullDrop()) {
((EntityBakaMitaiCreeper)cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
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 EntityBakaMitaiCreeper && cause.getTrueSource() != this && ((EntityBakaMitaiCreeper) cause.getTrueSource()).getPowered()
&& ((EntityBakaMitaiCreeper) cause.getTrueSource()).ableToCauseSkullDrop())
{
((EntityBakaMitaiCreeper) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
@Override
public void onStruckByLightning(EntityLightningBolt lightningBolt) {
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, true);
}
@Override
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.valueOf(true));
}
@Override
public void onUpdate() {
if(this.isEntityAlive()) {
this.lastActiveTime = this.timeSinceIgnited;
@Override
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
if(this.hasIgnited()) {
this.setCreeperState(1);
}
if (this.hasIgnited())
{
this.setCreeperState(1);
}
int i = this.getCreeperState();
int i = this.getCreeperState();
if(i > 0 && this.timeSinceIgnited == 0) {
this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE /*TODO sound missing?*/, 1.0F, 1.0F);
}
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE, 1.0F, 1.0F);
}
this.timeSinceIgnited += i;
this.timeSinceIgnited += i;
if(this.timeSinceIgnited < 0) {
this.timeSinceIgnited = 0;
}
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
if(this.timeSinceIgnited >= this.fuseTime) {
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
super.onUpdate();
}
@Override
protected boolean processInteract(EntityPlayer player, EnumHand hand) {
ItemStack itemstack = player.getHeldItem(hand);
@Override
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
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 (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(!this.world.isRemote) {
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
if (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
return super.processInteract(player, hand);
}
return super.processInteract(player, hand);
}
@Override
public void readEntityFromNBT(NBTTagCompound compound) {
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, compound.getBoolean("powered"));
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, Boolean.valueOf(compound.getBoolean("powered")));
if(compound.hasKey("Fuse", 99)) {
this.fuseTime = compound.getShort("Fuse");
}
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
if(compound.hasKey("ExplosionRadius", 99)) {
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if(compound.getBoolean("ignited")) {
this.ignite();
}
}
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
private void spawnLingeringCloud() {
Collection<PotionEffect> collection = this.getActivePotionEffects();
@Override
public void setCreeperState(int state)
{
this.dataManager.set(STATE, Integer.valueOf(state));
}
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() / entityareaeffectcloud.getDuration());
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
for(PotionEffect potioneffect : collection) {
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
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() / entityareaeffectcloud.getDuration());
this.world.spawnEntity(entityareaeffectcloud);
}
}
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
@Override
public void writeEntityToNBT(NBTTagCompound compound) {
super.writeEntityToNBT(compound);
this.world.spawnEntity(entityareaeffectcloud);
}
}
if(this.dataManager.get(POWERED)) {
compound.setBoolean("powered", true);
}
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.dataManager.get(POWERED).booleanValue())
{
compound.setBoolean("powered", true);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
compound.setShort("Fuse", (short)this.fuseTime);
compound.setByte("ExplosionRadius", (byte)this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
}

View file

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

View file

@ -1,19 +1,9 @@
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;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@ -26,64 +16,57 @@ import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class EntityHolzstammhuhn extends EntityChicken
{
private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(Items.STICK);
import java.util.Set;
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 class EntityHolzstammhuhn extends EntityChicken {
private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(Items.STICK);
@Override
public EntityHolzstammhuhn createChild(EntityAgeable ageable)
{
return new EntityHolzstammhuhn(this.world);
}
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 SoundEvent getAmbientSound()
{
return SoundEvents.BLOCK_WOOD_PLACE;
}
@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 SoundEvent getDeathSound()
{
return SoundEvents.BLOCK_WOOD_BREAK;
}
@Override
public boolean isBreedingItem(ItemStack stack) {
return TEMPTATION_ITEMS.contains(stack.getItem());
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.BLOCK_WOOD_HIT;
}
@Override
protected SoundEvent getAmbientSound() {
return SoundEvents.BLOCK_WOOD_PLACE;
}
@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 SoundEvent getHurtSound(DamageSource damageSourceIn) {
return SoundEvents.BLOCK_WOOD_HIT;
}
@Override
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
@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);
}
}

View file

@ -1,350 +1,71 @@
package mod.acgaming.spackenmobs.entities;
import java.util.Collection;
import javax.annotation.Nullable;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAreaEffectCloud;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.EntityAIAvoidEntity;
import net.minecraft.entity.ai.EntityAICreeperSwell;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
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.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntityIslamist extends EntityCreeper
{
private static final DataParameter<Integer> STATE = EntityDataManager.<Integer>createKey(EntityIslamist.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.<Boolean>createKey(EntityIslamist.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.<Boolean>createKey(EntityIslamist.class, DataSerializers.BOOLEAN);
public class EntityIslamist extends EntityCreeper {
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 30;
private int explosionRadius = 6;
public static void registerFixesIslamist(DataFixer fixer)
{
EntityLiving.registerFixesMob(fixer, EntityIslamist.class);
}
public EntityIslamist(World worldIn) {
super(worldIn);
this.setSize(0.6F, 1.7F);
}
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 30;
private int explosionRadius = 6;
@Override
public void onUpdate() {
if(this.isEntityAlive()) {
this.lastActiveTime = this.timeSinceIgnited;
private int droppedSkulls;
if(this.hasIgnited()) {
this.setCreeperState(1);
}
public EntityIslamist(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
}
int i = this.getCreeperState();
@Override
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
if(i > 0 && this.timeSinceIgnited == 0) {
this.playSound(ModSoundEvents.ENTITY_ISLAMIST_FUSE, 1.0F, 0.5F);
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
this.timeSinceIgnited += i;
@Override
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
if(this.timeSinceIgnited < 0) {
this.timeSinceIgnited = 0;
}
@Override
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, Integer.valueOf(-1));
this.dataManager.register(POWERED, Boolean.valueOf(false));
this.dataManager.register(IGNITED, Boolean.valueOf(false));
}
if(this.timeSinceIgnited >= this.fuseTime) {
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
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(), 2.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
super.onUpdate();
}
@Override
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) (this.timeSinceIgnited + distance * 1.5F);
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, this.explosionRadius * f, flag);
this.setDead();
}
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_ISLAMIST_HURT;
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT;
}
@Override
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
}
@Override
public int getCreeperState()
{
return this.dataManager.get(STATE).intValue();
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_ISLAMIST_HURT;
}
@Override
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
@Override
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
@Override
public boolean getPowered()
{
return this.dataManager.get(POWERED).booleanValue();
}
@Override
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED).booleanValue();
}
@Override
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.valueOf(true));
}
@Override
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
@Override
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAICreeperSwell(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, new Class[0]));
}
@Override
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
if (this.world.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getTrueSource() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
}
else if (cause.getTrueSource() instanceof EntityIslamist && cause.getTrueSource() != this && ((EntityIslamist) cause.getTrueSource()).getPowered()
&& ((EntityIslamist) cause.getTrueSource()).ableToCauseSkullDrop())
{
((EntityIslamist) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
@Override
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.valueOf(true));
}
@Override
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
if (this.hasIgnited())
{
this.setCreeperState(1);
}
int i = this.getCreeperState();
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_ISLAMIST_FUSE, 1.0F, 0.5F);
}
this.timeSinceIgnited += i;
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
@Override
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
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 (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
return super.processInteract(player, hand);
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, Boolean.valueOf(compound.getBoolean("powered")));
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
@Override
public void setCreeperState(int state)
{
this.dataManager.set(STATE, Integer.valueOf(state));
}
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
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() / entityareaeffectcloud.getDuration());
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
this.world.spawnEntity(entityareaeffectcloud);
}
}
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.dataManager.get(POWERED).booleanValue())
{
compound.setBoolean("powered", true);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
@Override
protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_ISLAMIST_AMBIENT;
}
}

View file

@ -1,9 +1,6 @@
package mod.acgaming.spackenmobs.entities;
import java.util.Set;
import com.google.common.collect.Sets;
import mod.acgaming.spackenmobs.misc.ModConfigs;
import mod.acgaming.spackenmobs.misc.ModItems;
import mod.acgaming.spackenmobs.misc.ModLootTableList;
@ -11,16 +8,8 @@ import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@ -32,252 +21,200 @@ 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.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.util.*;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntityJens extends EntityPig
{
private static final DataParameter<Boolean> SADDLED = EntityDataManager.<Boolean>createKey(EntityJens.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> DIGESTING = EntityDataManager.<Boolean>createKey(EntityJens.class, DataSerializers.BOOLEAN);
import java.util.Set;
private static final DataParameter<Integer> BOOST_TIME = EntityDataManager.<Integer>createKey(EntityJens.class, DataSerializers.VARINT);
private static final DataParameter<Integer> DIGEST_TIME = EntityDataManager.<Integer>createKey(EntityJens.class, DataSerializers.VARINT);
public class EntityJens extends EntityPig {
private static final DataParameter<Boolean> SADDLED = EntityDataManager.createKey(EntityJens.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> DIGESTING = EntityDataManager.createKey(EntityJens.class, DataSerializers.BOOLEAN);
private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(ModItems.RAM);
private static final Set<Item> FISH_ITEMS = Sets.newHashSet(Items.FISH);
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);
public static void registerFixesJens(DataFixer fixer)
{
EntityLiving.registerFixesMob(fixer, EntityJens.class);
}
private static final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(ModItems.RAM);
private static final Set<Item> FISH_ITEMS = Sets.newHashSet(Items.FISH);
public boolean digesting;
public int digestTime;
@SideOnly(Side.CLIENT)
Minecraft MINECRAFT = Minecraft.getMinecraft();
private boolean boosting;
public boolean digesting;
public EntityJens(World worldIn) {
super(worldIn);
setSize(0.6F, 2.2F);
}
private int boostTime;
private int totalBoostTime;
public int digestTime;
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@SideOnly(Side.CLIENT)
Minecraft MINECRAFT = Minecraft.getMinecraft();
@Override
public boolean canBeSteered() {
Entity entity = this.getControllingPassenger();
public EntityJens(World worldIn)
{
super(worldIn);
setSize(0.6F, 2.2F);
}
if(!(entity instanceof EntityPlayer)) {
return false;
}else {
EntityPlayer entityplayer = (EntityPlayer)entity;
return entityplayer.getHeldItemMainhand().getItem() == ModItems.RAM_ON_A_STICK || entityplayer.getHeldItemOffhand().getItem() == ModItems.RAM_ON_A_STICK;
}
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
}
@Override
public EntityJens createChild(EntityAgeable ageable) {
return new EntityJens(this.world);
}
@Override
public boolean canBeSteered()
{
Entity entity = this.getControllingPassenger();
public void digestFish() {
this.playSound(ModSoundEvents.ENTITY_JENS_EAT, 1.0F, 1.0F);
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;
}
}
this.digesting = true;
this.dataManager.set(DIGESTING, true);
@Override
public EntityJens createChild(EntityAgeable ageable)
{
return new EntityJens(this.world);
}
this.digestTime = (ModConfigs.Jens_digest_time * 20);
this.dataManager.set(DIGEST_TIME, this.digestTime);
public void digestFish()
{
this.playSound(ModSoundEvents.ENTITY_JENS_EAT, 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;
MINECRAFT.world.spawnParticle(EnumParticleTypes.HEART, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height,
this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
this.digesting = true;
this.dataManager.set(DIGESTING, Boolean.valueOf(true));
this.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, ModConfigs.Jens_digest_time * 20));
}
this.digestTime = (ModConfigs.Jens_digest_time * 20);
this.dataManager.set(DIGEST_TIME, Integer.valueOf(this.digestTime));
@Override
protected void entityInit() {
super.entityInit();
this.dataManager.register(SADDLED, false);
this.dataManager.register(DIGESTING, false);
this.dataManager.register(BOOST_TIME, 0);
this.dataManager.register(DIGEST_TIME, 0);
}
for (int i = 0; i < 7; ++i)
{
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
double d2 = this.rand.nextGaussian() * 0.02D;
MINECRAFT.world.spawnParticle(EnumParticleTypes.HEART, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height,
this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
@Override
protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_JENS_AMBIENT;
}
this.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, ModConfigs.Jens_digest_time * 20));
}
@Override
protected SoundEvent getDeathSound() {
return ModSoundEvents.ENTITY_JENS_DEATH;
}
@Override
protected void entityInit()
{
super.entityInit();
this.dataManager.register(SADDLED, Boolean.valueOf(false));
this.dataManager.register(DIGESTING, Boolean.valueOf(false));
this.dataManager.register(BOOST_TIME, Integer.valueOf(0));
this.dataManager.register(DIGEST_TIME, Integer.valueOf(0));
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_JENS_HURT;
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_JENS_AMBIENT;
}
@Override
protected ResourceLocation getLootTable() {
return ModLootTableList.ENTITIES_JENS;
}
@Override
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_JENS_DEATH;
}
@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, false, TEMPTATION_ITEMS));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, ModItems.RAM_ON_A_STICK, false));
this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 1.0D));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(8, new EntityAILookIdle(this));
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_JENS_HURT;
}
@Override
public boolean isBreedingItem(ItemStack stack) {
return TEMPTATION_ITEMS.contains(stack.getItem());
}
@Override
protected ResourceLocation getLootTable()
{
return ModLootTableList.ENTITIES_JENS;
}
public boolean isFishItem(ItemStack stack) {
return FISH_ITEMS.contains(stack.getItem());
}
@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, false, TEMPTATION_ITEMS));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, ModItems.RAM_ON_A_STICK, false));
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 onLivingUpdate() {
super.onLivingUpdate();
@Override
public boolean isBreedingItem(ItemStack stack)
{
return TEMPTATION_ITEMS.contains(stack.getItem());
}
if(!this.world.isRemote && this.digesting && this.digestTime > 0) {
this.digestTime--;
this.dataManager.set(DIGEST_TIME, this.digestTime);
}
public boolean isFishItem(ItemStack stack)
{
return FISH_ITEMS.contains(stack.getItem());
}
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;
MINECRAFT.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height,
this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
this.playSound(ModSoundEvents.ENTITY_JENS_POOP, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
this.dropItem(ModItems.SURSTROEMMING, 1);
this.clearActivePotions();
@Override
public void onLivingUpdate()
{
super.onLivingUpdate();
this.digesting = false;
this.dataManager.set(DIGESTING, false);
if (!this.world.isRemote && this.digesting == true && this.digestTime > 0)
{
this.digestTime--;
this.dataManager.set(DIGEST_TIME, Integer.valueOf(this.digestTime));
}
this.digestTime = 0;
this.dataManager.set(DIGEST_TIME, 0);
}
}
if (!this.world.isRemote && this.digesting == true && 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;
MINECRAFT.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, this.posY + 0.5D + this.rand.nextFloat() * this.height,
this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, d0, d1, d2);
}
this.playSound(ModSoundEvents.ENTITY_JENS_POOP, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
this.dropItem(ModItems.SURSTROEMMING, 1);
this.clearActivePotions();
@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.getSaddled() && !this.isBeingRidden()) {
if(!this.world.isRemote) {
player.startRiding(this);
}
return true;
}else if(itemstack.getItem() == Items.SADDLE) {
itemstack.interactWithEntity(player, this, hand);
this.setCustomNameTag("Reitbarer Jens");
this.setAlwaysRenderNameTag(true);
return true;
}else {
return false;
}
}else {
return true;
}
}
this.digesting = false;
this.dataManager.set(DIGESTING, Boolean.valueOf(false));
@Override
public void readEntityFromNBT(NBTTagCompound compound) {
super.readEntityFromNBT(compound);
this.setSaddled(compound.getBoolean("Saddle"));
this.digesting = compound.getBoolean("Digesting");
this.digestTime = compound.getInteger("DigestTime");
}
this.digestTime = 0;
this.dataManager.set(DIGEST_TIME, Integer.valueOf(0));
}
}
@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 == false)
{
itemstack.shrink(1);
digestFish();
return true;
}
else if (itemstack.getItem() == Items.NAME_TAG)
{
itemstack.interactWithEntity(player, this, hand);
return true;
}
else if (this.getSaddled() && !this.isBeingRidden())
{
if (!this.world.isRemote)
{
player.startRiding(this);
}
return true;
}
else if (itemstack.getItem() == Items.SADDLE)
{
itemstack.interactWithEntity(player, this, hand);
this.setCustomNameTag("Reitbarer Jens");
this.setAlwaysRenderNameTag(true);
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.setSaddled(compound.getBoolean("Saddle"));
this.digesting = compound.getBoolean("Digesting");
this.digestTime = compound.getInteger("DigestTime");
}
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setBoolean("Saddle", this.getSaddled());
compound.setBoolean("Digesting", this.digesting);
compound.setInteger("DigestTime", this.digestTime);
}
@Override
public void writeEntityToNBT(NBTTagCompound compound) {
super.writeEntityToNBT(compound);
compound.setBoolean("Saddle", this.getSaddled());
compound.setBoolean("Digesting", this.digesting);
compound.setInteger("DigestTime", this.digestTime);
}
}

View file

@ -6,29 +6,24 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;
public class EntityMarcellDAvis extends EntityZombie
{
public EntityMarcellDAvis(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.95F);
}
public class EntityMarcellDAvis extends EntityZombie {
public EntityMarcellDAvis(World worldIn) {
super(worldIn);
this.setSize(0.6F, 1.95F);
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT;
}
@Override
protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT;
}
@Override
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH;
}
@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;
}
}

View file

@ -6,29 +6,24 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;
public class EntityMrBean extends EntityZombie
{
public EntityMrBean(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.95F);
}
public class EntityMrBean extends EntityZombie {
public EntityMrBean(World worldIn) {
super(worldIn);
this.setSize(0.6F, 1.95F);
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_MRBEAN_AMBIENT;
}
@Override
protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_MRBEAN_AMBIENT;
}
@Override
protected SoundEvent getDeathSound()
{
return ModSoundEvents.ENTITY_MRBEAN_DEATH;
}
@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;
}
}

View file

@ -1,350 +1,73 @@
package mod.acgaming.spackenmobs.entities;
import java.util.Collection;
import javax.annotation.Nullable;
import mod.acgaming.spackenmobs.misc.ModSoundEvents;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAreaEffectCloud;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.EntityAIAvoidEntity;
import net.minecraft.entity.ai.EntityAICreeperSwell;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
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.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntitySmavaCreeper extends EntityCreeper
{
private static final DataParameter<Integer> STATE = EntityDataManager.<Integer>createKey(EntitySmavaCreeper.class, DataSerializers.VARINT);
private static final DataParameter<Boolean> POWERED = EntityDataManager.<Boolean>createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> IGNITED = EntityDataManager.<Boolean>createKey(EntitySmavaCreeper.class, DataSerializers.BOOLEAN);
public class EntitySmavaCreeper extends EntityCreeper {
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 20;
private int explosionRadius = 6;
public static void registerFixesSmavaCreeper(DataFixer fixer)
{
EntityLiving.registerFixesMob(fixer, EntitySmavaCreeper.class);
}
public EntitySmavaCreeper(World worldIn) {
super(worldIn);
setSize(0.6F, 1.7F);
getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 20;
private int explosionRadius = 6;
@Override
public void onUpdate() {
if(this.isEntityAlive()) {
this.lastActiveTime = this.timeSinceIgnited;
private int droppedSkulls;
if(this.hasIgnited()) {
this.setCreeperState(1);
}
public EntitySmavaCreeper(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 1.7F);
}
int i = this.getCreeperState();
@Override
public boolean ableToCauseSkullDrop()
{
return this.droppedSkulls < 1 && this.world.getGameRules().getBoolean("doMobLoot");
}
if(i > 0 && this.timeSinceIgnited == 0) {
this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE, 1.0F, 1.0F);
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
this.timeSinceIgnited += i;
@Override
public boolean attackEntityAsMob(Entity entityIn)
{
return true;
}
if(this.timeSinceIgnited < 0) {
this.timeSinceIgnited = 0;
}
@Override
protected void entityInit()
{
super.entityInit();
this.dataManager.register(STATE, Integer.valueOf(-1));
this.dataManager.register(POWERED, Boolean.valueOf(false));
this.dataManager.register(IGNITED, Boolean.valueOf(false));
}
if(this.timeSinceIgnited >= this.fuseTime) {
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
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, this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
super.onUpdate();
}
@Override
public void fall(float distance, float damageMultiplier)
{
super.fall(distance, damageMultiplier);
this.timeSinceIgnited = (int) (this.timeSinceIgnited + distance * 1.5F);
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, this.explosionRadius * f, flag);
this.setDead();
}
}
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return ModSoundEvents.ENTITY_SMAVACREEPER_HURT;
}
@Override
protected SoundEvent getAmbientSound()
{
return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT;
}
@Override
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_)
{
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
}
@Override
public int getCreeperState()
{
return this.dataManager.get(STATE).intValue();
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return ModSoundEvents.ENTITY_SMAVACREEPER_HURT;
}
@Override
@Nullable
protected ResourceLocation getLootTable()
{
return LootTableList.ENTITIES_CREEPER;
}
@Override
public int getMaxFallHeight()
{
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
@Override
public boolean getPowered()
{
return this.dataManager.get(POWERED).booleanValue();
}
@Override
public boolean hasIgnited()
{
return this.dataManager.get(IGNITED).booleanValue();
}
@Override
public void ignite()
{
this.dataManager.set(IGNITED, Boolean.valueOf(true));
}
@Override
public void incrementDroppedSkulls()
{
++this.droppedSkulls;
}
@Override
protected void initEntityAI()
{
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAICreeperSwell(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, new Class[0]));
}
@Override
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
if (this.world.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getTrueSource() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.RECORD_13);
int j = Item.getIdFromItem(Items.RECORD_WAIT);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
}
else if (cause.getTrueSource() instanceof EntitySmavaCreeper && cause.getTrueSource() != this && ((EntitySmavaCreeper) cause.getTrueSource()).getPowered()
&& ((EntitySmavaCreeper) cause.getTrueSource()).ableToCauseSkullDrop())
{
((EntitySmavaCreeper) cause.getTrueSource()).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
}
@Override
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
super.onStruckByLightning(lightningBolt);
this.dataManager.set(POWERED, Boolean.valueOf(true));
}
@Override
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
if (this.hasIgnited())
{
this.setCreeperState(1);
}
int i = this.getCreeperState();
if (i > 0 && this.timeSinceIgnited == 0)
{
this.playSound(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE, 1.0F, 1.0F);
}
this.timeSinceIgnited += i;
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
this.explode();
}
}
super.onUpdate();
}
@Override
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
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 (!this.world.isRemote)
{
this.ignite();
itemstack.damageItem(1, player);
return true;
}
}
return super.processInteract(player, hand);
}
@Override
public void readEntityFromNBT(NBTTagCompound compound)
{
super.readEntityFromNBT(compound);
this.dataManager.set(POWERED, Boolean.valueOf(compound.getBoolean("powered")));
if (compound.hasKey("Fuse", 99))
{
this.fuseTime = compound.getShort("Fuse");
}
if (compound.hasKey("ExplosionRadius", 99))
{
this.explosionRadius = compound.getByte("ExplosionRadius");
}
if (compound.getBoolean("ignited"))
{
this.ignite();
}
}
@Override
public void setCreeperState(int state)
{
this.dataManager.set(STATE, Integer.valueOf(state));
}
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
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() / entityareaeffectcloud.getDuration());
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
this.world.spawnEntity(entityareaeffectcloud);
}
}
@Override
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
if (this.dataManager.get(POWERED).booleanValue())
{
compound.setBoolean("powered", true);
}
compound.setShort("Fuse", (short) this.fuseTime);
compound.setByte("ExplosionRadius", (byte) this.explosionRadius);
compound.setBoolean("ignited", this.hasIgnited());
}
@Override
protected SoundEvent getAmbientSound() {
return ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT;
}
}

View file

@ -1,7 +1,5 @@
package mod.acgaming.spackenmobs.entities;
import java.util.UUID;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLivingBase;
@ -18,145 +16,68 @@ import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.world.World;
public class EntityWolfMZTE extends EntityWolf
{
class AIAvoidEntity<T extends Entity> extends EntityAIAvoidEntity<T>
{
private final EntityWolfMZTE wolf;
import java.util.UUID;
public AIAvoidEntity(EntityWolfMZTE wolfIn, Class<T> p_i47251_3_, float p_i47251_4_, double p_i47251_5_, double p_i47251_7_)
{
super(wolfIn, p_i47251_3_, p_i47251_4_, p_i47251_5_, p_i47251_7_);
this.wolf = wolfIn;
}
public class EntityWolfMZTE extends EntityWolf {
public EntityWolfMZTE(World worldIn) {
super(worldIn);
this.setSize(0.6F, 0.85F);
this.setTamed(false);
}
private boolean avoidLlama(EntityLlama p_190854_1_)
{
return p_190854_1_.getStrength() >= EntityWolfMZTE.this.rand.nextInt(5);
}
@Override
public EntityWolfMZTE createChild(EntityAgeable ageable) {
EntityWolfMZTE entitywolfmzte = new EntityWolfMZTE(this.world);
UUID uuid = this.getOwnerId();
@Override
public boolean shouldExecute()
{
if (super.shouldExecute() && this.closestLivingEntity instanceof EntityLlama)
{
return !this.wolf.isTamed() && this.avoidLlama((EntityLlama) this.closestLivingEntity);
}
else
{
return false;
}
}
if(uuid != null) {
entitywolfmzte.setOwnerId(uuid);
entitywolfmzte.setTamed(true);
}
@Override
public void startExecuting()
{
EntityWolfMZTE.this.setAttackTarget((EntityLivingBase) null);
super.startExecuting();
}
return entitywolfmzte;
}
@Override
public void updateTask()
{
EntityWolfMZTE.this.setAttackTarget((EntityLivingBase) null);
super.updateTask();
}
}
@Override
public boolean canMateWith(EntityAnimal otherAnimal) {
if(otherAnimal == this) {
return false;
}else if(!this.isTamed()) {
return false;
}else if(!(otherAnimal instanceof EntityWolfMZTE)) {
return false;
}else {
EntityWolfMZTE entitywolfmzte = (EntityWolfMZTE)otherAnimal;
private static final DataParameter<Float> DATA_HEALTH_ID = EntityDataManager.<Float>createKey(EntityWolfMZTE.class, DataSerializers.FLOAT);
private static final DataParameter<Boolean> BEGGING = EntityDataManager.<Boolean>createKey(EntityWolfMZTE.class, DataSerializers.BOOLEAN);
private static final DataParameter<Integer> COLLAR_COLOR = EntityDataManager.<Integer>createKey(EntityWolfMZTE.class, DataSerializers.VARINT);
private float headRotationCourse;
private float headRotationCourseOld;
private boolean isWet;
private boolean isShaking;
private float timeWolfIsShaking;
if(!entitywolfmzte.isTamed()) {
return false;
}else if(entitywolfmzte.isSitting()) {
return false;
}else {
return this.isInLove() && entitywolfmzte.isInLove();
}
}
}
private float prevTimeWolfIsShaking;
@Override
public boolean shouldAttackEntity(EntityLivingBase target, EntityLivingBase owner) {
if(!(target instanceof EntityCreeper) && !(target instanceof EntityGhast)) {
if(target instanceof EntityWolfMZTE) {
EntityWolfMZTE entitywolfmzte = (EntityWolfMZTE)target;
public EntityWolfMZTE(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 0.85F);
this.setTamed(false);
}
if(entitywolfmzte.isTamed() && entitywolfmzte.getOwner() == owner) {
return false;
}
}
@Override
public boolean canMateWith(EntityAnimal otherAnimal)
{
if (otherAnimal == this)
{
return false;
}
else if (!this.isTamed())
{
return false;
}
else if (!(otherAnimal instanceof EntityWolfMZTE))
{
return false;
}
else
{
EntityWolfMZTE entitywolfmzte = (EntityWolfMZTE) otherAnimal;
if (!entitywolfmzte.isTamed())
{
return false;
}
else if (entitywolfmzte.isSitting())
{
return false;
}
else
{
return this.isInLove() && entitywolfmzte.isInLove();
}
}
}
@Override
public EntityWolfMZTE createChild(EntityAgeable ageable)
{
EntityWolfMZTE entitywolfmzte = new EntityWolfMZTE(this.world);
UUID uuid = this.getOwnerId();
if (uuid != null)
{
entitywolfmzte.setOwnerId(uuid);
entitywolfmzte.setTamed(true);
}
return entitywolfmzte;
}
@Override
public boolean shouldAttackEntity(EntityLivingBase target, EntityLivingBase owner)
{
if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast))
{
if (target instanceof EntityWolfMZTE)
{
EntityWolfMZTE entitywolfmzte = (EntityWolfMZTE) target;
if (entitywolfmzte.isTamed() && entitywolfmzte.getOwner() == owner)
{
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

@ -8,18 +8,14 @@ import net.minecraft.potion.PotionEffect;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent;
public class SurstroemmingSmellsBadEvent
{
@SubscribeEvent
public void onEvent(PlayerTickEvent event)
{
if (event.player instanceof EntityPlayer)
{
EntityPlayer player = event.player;
if (player.inventory.hasItemStack(new ItemStack(ModItems.SURSTROEMMING)))
{
player.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 100));
}
}
}
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));
}
}
}
}

View file

@ -1,33 +1,27 @@
package mod.acgaming.spackenmobs.events;
import org.lwjgl.input.Keyboard;
import mod.acgaming.spackenmobs.entities.EntityDrachenlord;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent;
import org.lwjgl.input.Keyboard;
public class TauntDrachenlordEvent
{
public static AxisAlignedBB getBoundingBox(double x, double y, double z, int hRadius, int vRadius)
{
return new AxisAlignedBB(x - hRadius, y - vRadius, z - hRadius, x + hRadius, y + vRadius, z + hRadius);
}
public class TauntDrachenlordEvent {
public static AxisAlignedBB getBoundingBox(double x, double y, double z, int hRadius, int vRadius) {
return new AxisAlignedBB(x - hRadius, y - vRadius, z - hRadius, x + hRadius, y + vRadius, z + hRadius);
}
public static void makeAngry(EntityPlayer player, EntityDrachenlord drache)
{
drache.attackEntityFrom(DamageSource.causePlayerDamage(player), 0);
}
public static void makeAngry(EntityPlayer player, EntityDrachenlord drache) {
drache.attackEntityFrom(DamageSource.causePlayerDamage(player), 0);
}
@SubscribeEvent
public void onKeyPress(KeyInputEvent event, EntityDrachenlord drache, EntityPlayer player)
{
final int aggroRange = 64;
if (Keyboard.isKeyDown(Keyboard.KEY_J))
{
@SubscribeEvent
public void onKeyPress(KeyInputEvent event, EntityDrachenlord drache, EntityPlayer player) {
final int aggroRange = 64;
if(Keyboard.isKeyDown(Keyboard.KEY_J)) {
}
}
}
}
}

View file

@ -8,18 +8,15 @@ import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemBase extends Item
{
public ItemBase(String name, CreativeTabs tab)
{
setRegistryName(name);
setUnlocalizedName(Spackenmobs.MODID + "." + name);
setCreativeTab(tab);
}
public class ItemBase extends Item {
public ItemBase(String name, CreativeTabs tab) {
setRegistryName(name);
setUnlocalizedName(Spackenmobs.MODID + "." + name);
setCreativeTab(tab);
}
@SideOnly(Side.CLIENT)
public void initModel()
{
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
@SideOnly(Side.CLIENT)
public void initModel() {
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
}

View file

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

View file

@ -1,46 +1,39 @@
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 class BiomeHelper {
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[] 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]);
}
}

View file

@ -10,111 +10,107 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Config(modid = "spackenmobs")
@LangKey("spackenmobs.config.title")
public class ModConfigs
{
@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);
}
}
}
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 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 WolfMZTE to spawn?")
public static boolean WolfMZTE_spawn = true;
@Name("ApoRed spawn probability:")
public static int ApoRed_weight = 50;
@Name("ApoRed min group size:")
public static int ApoRed_min = 1;
@Name("ApoRed max group size:")
public static int ApoRed_max = 4;
@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 = 50;
@Name("Drachenlord min group size:")
public static int Drachenlord_min = 1;
@Name("Drachenlord max group size:")
public static int Drachenlord_max = 4;
@Name("Holzstammhuhn spawn probability:")
public static int Holzstammhuhn_weight = 50;
@Name("Holzstammhuhn min group size:")
public static int Holzstammhuhn_min = 1;
@Name("Holzstammhuhn max group size:")
public static int Holzstammhuhn_max = 4;
@Name("Islamist spawn probability:")
public static int Islamist_weight = 50;
@Name("Islamist min group size:")
public static int Islamist_min = 1;
@Name("Islamist max group size:")
public static int Islamist_max = 4;
@Name("Jens spawn probability:")
public static int Jens_weight = 25;
@Name("Jens min group size:")
public static int Jens_min = 1;
@Name("Jens max group size:")
public static int Jens_max = 4;
@Name("Marcell D'Avis spawn probability:")
public static int MarcellDAvis_weight = 50;
@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 = 4;
@Name("Mr. Bean spawn probability:")
public static int MrBean_weight = 50;
@Name("Mr. Bean min group size:")
public static int MrBean_min = 1;
@Name("Mr. Bean max group size:")
public static int MrBean_max = 4;
@Name("Schalker spawn probability:")
public static int Schalker_weight = 50;
@Name("Schalker min group size:")
public static int Schalker_min = 1;
@Name("Schalker max group size:")
public static int Schalker_max = 4;
@Name("Smava Creeper spawn probability:")
public static int SmavaCreeper_weight = 25;
@Name("Smava Creeper min group size:")
public static int SmavaCreeper_min = 1;
@Name("Smava Creeper max group size:")
public static int SmavaCreeper_max = 4;
@Name("WolfMZTE spawn probability:")
public static int WolfMZTE_weight = 50;
@Name("WolfMZTE min group size:")
public static int WolfMZTE_min = 1;
@Name("WolfMZTE max group size:")
public static int WolfMZTE_max = 4;
@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 = 10;
@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 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 WolfMZTE to spawn?")
public static boolean WolfMZTE_spawn = true;
@Name("ApoRed spawn probability:")
public static int ApoRed_weight = 50;
@Name("ApoRed min group size:")
public static int ApoRed_min = 1;
@Name("ApoRed max group size:")
public static int ApoRed_max = 4;
@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 = 50;
@Name("Drachenlord min group size:")
public static int Drachenlord_min = 1;
@Name("Drachenlord max group size:")
public static int Drachenlord_max = 4;
@Name("Holzstammhuhn spawn probability:")
public static int Holzstammhuhn_weight = 50;
@Name("Holzstammhuhn min group size:")
public static int Holzstammhuhn_min = 1;
@Name("Holzstammhuhn max group size:")
public static int Holzstammhuhn_max = 4;
@Name("Islamist spawn probability:")
public static int Islamist_weight = 50;
@Name("Islamist min group size:")
public static int Islamist_min = 1;
@Name("Islamist max group size:")
public static int Islamist_max = 4;
@Name("Jens spawn probability:")
public static int Jens_weight = 25;
@Name("Jens min group size:")
public static int Jens_min = 1;
@Name("Jens max group size:")
public static int Jens_max = 4;
@Name("Marcell D'Avis spawn probability:")
public static int MarcellDAvis_weight = 50;
@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 = 4;
@Name("Mr. Bean spawn probability:")
public static int MrBean_weight = 50;
@Name("Mr. Bean min group size:")
public static int MrBean_min = 1;
@Name("Mr. Bean max group size:")
public static int MrBean_max = 4;
@Name("Schalker spawn probability:")
public static int Schalker_weight = 50;
@Name("Schalker min group size:")
public static int Schalker_min = 1;
@Name("Schalker max group size:")
public static int Schalker_max = 4;
@Name("Smava Creeper spawn probability:")
public static int SmavaCreeper_weight = 25;
@Name("Smava Creeper min group size:")
public static int SmavaCreeper_min = 1;
@Name("Smava Creeper max group size:")
public static int SmavaCreeper_max = 4;
@Name("WolfMZTE spawn probability:")
public static int WolfMZTE_weight = 50;
@Name("WolfMZTE min group size:")
public static int WolfMZTE_min = 1;
@Name("WolfMZTE max group size:")
public static int WolfMZTE_max = 4;
@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 = 10;
@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,43 +1,20 @@
package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.entities.EntityApoRed;
import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper;
import mod.acgaming.spackenmobs.entities.EntityDrachenlord;
import mod.acgaming.spackenmobs.entities.EntityHolzstammhuhn;
import mod.acgaming.spackenmobs.entities.EntityIslamist;
import mod.acgaming.spackenmobs.entities.EntityJens;
import mod.acgaming.spackenmobs.entities.EntityMarcellDAvis;
import mod.acgaming.spackenmobs.entities.EntityMrBean;
import mod.acgaming.spackenmobs.entities.EntitySchalker;
import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper;
import mod.acgaming.spackenmobs.entities.EntityWolfMZTE;
import mod.acgaming.spackenmobs.render.RenderApoRed;
import mod.acgaming.spackenmobs.render.RenderBakaMitaiCreeper;
import mod.acgaming.spackenmobs.render.RenderDrachenlord;
import mod.acgaming.spackenmobs.render.RenderHolzstammhuhn;
import mod.acgaming.spackenmobs.render.RenderIslamist;
import mod.acgaming.spackenmobs.render.RenderJens;
import mod.acgaming.spackenmobs.render.RenderMarcellDAvis;
import mod.acgaming.spackenmobs.render.RenderMrBean;
import mod.acgaming.spackenmobs.render.RenderSchalker;
import mod.acgaming.spackenmobs.render.RenderSmavaCreeper;
import mod.acgaming.spackenmobs.render.RenderWolfMZTE;
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(EntityDrachenlord.class, RenderDrachenlord.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityIslamist.class, RenderIslamist.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityJens.class, RenderJens.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(EntityWolfMZTE.class, RenderWolfMZTE.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityHolzstammhuhn.class, RenderHolzstammhuhn.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityBakaMitaiCreeper.class, RenderBakaMitaiCreeper.FACTORY);
}
public class ModEntities {
public static void initModels() {
RenderingRegistry.registerEntityRenderingHandler(EntityApoRed.class, RenderApoRed.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityDrachenlord.class, RenderDrachenlord.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityIslamist.class, RenderIslamist.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityJens.class, RenderJens.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(EntityWolfMZTE.class, RenderWolfMZTE.FACTORY);
RenderingRegistry.registerEntityRenderingHandler(EntityHolzstammhuhn.class, RenderHolzstammhuhn.FACTORY);
}
}

View file

@ -6,9 +6,8 @@ import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
@ObjectHolder(Spackenmobs.MODID)
public class ModItems
{
public static final Item RAM = new ItemBase("ram", Spackenmobs.SPACKENMOBS_TAB);
public static final Item RAM_ON_A_STICK = new ItemBase("ram_on_a_stick", Spackenmobs.SPACKENMOBS_TAB);
public static final Item SURSTROEMMING = new ItemBase("surstroemming", Spackenmobs.SPACKENMOBS_TAB);
public class ModItems {
public static final Item RAM = new ItemBase("ram", Spackenmobs.SPACKENMOBS_TAB);
public static final Item RAM_ON_A_STICK = new ItemBase("ram_on_a_stick", Spackenmobs.SPACKENMOBS_TAB);
public static final Item SURSTROEMMING = new ItemBase("surstroemming", Spackenmobs.SPACKENMOBS_TAB);
}

View file

@ -1,56 +1,45 @@
package mod.acgaming.spackenmobs.misc;
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.io.File;
import java.util.Collections;
import java.util.Set;
import com.google.common.collect.Sets;
public class ModLootTableList {
private static final Set<ResourceLocation> LOOT_TABLES = Sets.<ResourceLocation>newHashSet();
public static final ResourceLocation EMPTY = register("empty");
public static final ResourceLocation ENTITIES_JENS = register("entities/jens");
private static final Set<ResourceLocation> READ_ONLY_LOOT_TABLES = Collections.<ResourceLocation>unmodifiableSet(LOOT_TABLES);
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootTable;
import net.minecraft.world.storage.loot.LootTableManager;
public static Set<ResourceLocation> getAll() {
return READ_ONLY_LOOT_TABLES;
}
public class ModLootTableList
{
private static final Set<ResourceLocation> LOOT_TABLES = Sets.<ResourceLocation>newHashSet();
private static final Set<ResourceLocation> READ_ONLY_LOOT_TABLES = Collections.<ResourceLocation>unmodifiableSet(LOOT_TABLES);
public static final ResourceLocation EMPTY = register("empty");
public static final ResourceLocation ENTITIES_JENS = register("entities/jens");
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 Set<ResourceLocation> getAll()
{
return READ_ONLY_LOOT_TABLES;
}
private static ResourceLocation register(String id) {
return register(new ResourceLocation("spackenmobs", id));
}
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 boolean test() {
LootTableManager loottablemanager = new LootTableManager((File)null);
private static ResourceLocation register(String id)
{
return register(new ResourceLocation("spackenmobs", id));
}
for(ResourceLocation resourcelocation : READ_ONLY_LOOT_TABLES) {
if(loottablemanager.getLootTableFromLocation(resourcelocation) == LootTable.EMPTY_LOOT_TABLE) {
return false;
}
}
public static boolean test()
{
LootTableManager loottablemanager = new LootTableManager((File) null);
for (ResourceLocation resourcelocation : READ_ONLY_LOOT_TABLES)
{
if (loottablemanager.getLootTableFromLocation(resourcelocation) == LootTable.EMPTY_LOOT_TABLE)
{
return false;
}
}
return true;
}
return true;
}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.potion.Potion;
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
@ObjectHolder(Spackenmobs.MODID)
public class ModPotions
{
public static final Potion SURSTROEMMING_DRINK = new ItemPotion("surstroemming_drink", true, 42, 0, 0);
public class ModPotions {
public static final Potion SURSTROEMMING_DRINK = new ItemPotion("surstroemming_drink", true, 42, 0, 0);
}

View file

@ -6,46 +6,74 @@ import net.minecraft.util.SoundEvent;
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
@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 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_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_HURT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.hurt"));
public static final SoundEvent ENTITY_SCHALKER_DEATH = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.death"));
public static final SoundEvent ENTITY_SCHALKER_OPEN = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.open"));
public static final SoundEvent ENTITY_SCHALKER_SHOOT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.schalker.shoot"));
public static final SoundEvent ENTITY_JENS_AMBIENT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.ambient"));
public static final SoundEvent ENTITY_JENS_HURT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.hurt"));
public static final SoundEvent ENTITY_JENS_DEATH = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.death"));
public static final SoundEvent ENTITY_JENS_EAT = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.eat"));
public static final SoundEvent ENTITY_JENS_POOP = new SoundEvent(new ResourceLocation("spackenmobs:entities.jens.poop"));
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_JENS_AMBIENT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.ambient"));
public static final SoundEvent ENTITY_JENS_HURT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.hurt"));
public static final SoundEvent ENTITY_JENS_DEATH = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.death"));
public static final SoundEvent ENTITY_JENS_EAT = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.eat"));
public static final SoundEvent ENTITY_JENS_POOP = new SoundEvent(
new ResourceLocation("spackenmobs:entities.jens.poop"));
}

View file

@ -1,23 +1,10 @@
package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.entities.EntityApoRed;
import mod.acgaming.spackenmobs.entities.EntityBakaMitaiCreeper;
import mod.acgaming.spackenmobs.entities.EntityDrachenlord;
import mod.acgaming.spackenmobs.entities.EntityHolzstammhuhn;
import mod.acgaming.spackenmobs.entities.EntityIslamist;
import mod.acgaming.spackenmobs.entities.EntityJens;
import mod.acgaming.spackenmobs.entities.EntityMarcellDAvis;
import mod.acgaming.spackenmobs.entities.EntityMrBean;
import mod.acgaming.spackenmobs.entities.EntitySchalker;
import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper;
import mod.acgaming.spackenmobs.entities.EntityWolfMZTE;
import mod.acgaming.spackenmobs.entities.*;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntityShulker;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntityWolf;
@ -31,196 +18,178 @@ 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;
public class RegHandler {
@SubscribeEvent
public static void registerItems(Register<Item> event) {
final Item[] items = {
new Item().setRegistryName(Spackenmobs.MODID, "ram").setUnlocalizedName(Spackenmobs.MODID + "." + "ram")
.setCreativeTab(CreativeTabs.MISC),
new Item().setRegistryName(Spackenmobs.MODID, "ram_on_a_stick")
.setUnlocalizedName(Spackenmobs.MODID + "." + "ram_on_a_stick")
.setCreativeTab(CreativeTabs.MISC),
new Item().setRegistryName(Spackenmobs.MODID, "surstroemming")
.setUnlocalizedName(Spackenmobs.MODID + "." + "surstroemming")
.setCreativeTab(CreativeTabs.MISC)};
event.getRegistry().registerAll(items);
}
// 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 == true)
{
EntityRegistry.addSpawn(EntitySmavaCreeper.class, ModConfigs.SmavaCreeper_weight, ModConfigs.SmavaCreeper_min, ModConfigs.SmavaCreeper_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
}
@SubscribeEvent
public static void registerEntities(Register<EntityEntry> event) {
int id = 1;
// 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 == true)
{
EntityRegistry.addSpawn(EntityMarcellDAvis.class, ModConfigs.MarcellDAvis_weight, ModConfigs.MarcellDAvis_min, ModConfigs.MarcellDAvis_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
}
// Smava Creeper
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:smava_creeper"), EntitySmavaCreeper.class,
"smava_creeper", id++, Spackenmobs.instance, 64, 1, true, 7649828, 11053224);
EntityRegistry.addSpawn(EntitySmavaCreeper.class, 25, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
// Islamist
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist", id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548);
if (ModConfigs.Islamist_spawn == true)
{
EntityRegistry.addSpawn(EntityIslamist.class, ModConfigs.Islamist_weight, ModConfigs.Islamist_min, ModConfigs.Islamist_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);
EntityRegistry.addSpawn(EntityMarcellDAvis.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
// ApoRed
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++, Spackenmobs.instance, 64, 1, true, 2039583, 16711680);
if (ModConfigs.ApoRed_spawn == true)
{
EntityRegistry.addSpawn(EntityApoRed.class, ModConfigs.ApoRed_weight, ModConfigs.ApoRed_min, ModConfigs.ApoRed_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntitySkeleton.class));
}
// Islamist
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist",
id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548);
EntityRegistry.addSpawn(EntityIslamist.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
// 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 == true)
{
EntityRegistry.addSpawn(EntityMrBean.class, ModConfigs.MrBean_weight, ModConfigs.MrBean_min, ModConfigs.MrBean_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
}
// ApoRed
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++,
Spackenmobs.instance, 64, 1, true, 2039583, 16711680);
EntityRegistry.addSpawn(EntityApoRed.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntitySkeleton.class));
// Drachenlord
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class, "drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878);
if (ModConfigs.Drachenlord_spawn == true)
{
EntityRegistry.addSpawn(EntityDrachenlord.class, ModConfigs.Drachenlord_weight, ModConfigs.Drachenlord_min, ModConfigs.Drachenlord_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityPigZombie.class));
}
// Mr. Bean
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mr_bean"), EntityMrBean.class, "mr_bean",
id++, Spackenmobs.instance, 64, 1, true, 4802350, 3220238);
EntityRegistry.addSpawn(EntityMrBean.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityZombie.class));
// Schalker
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker", id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215);
if (ModConfigs.Schalker_spawn == true)
{
EntityRegistry.addSpawn(EntitySchalker.class, ModConfigs.Schalker_weight, ModConfigs.Schalker_min, ModConfigs.Schalker_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityShulker.class));
}
// Drachenlord
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class,
"drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878);
EntityRegistry.addSpawn(EntityDrachenlord.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityPigZombie.class));
// Jens
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++, Spackenmobs.instance, 64, 1, true, 6704526, 6767911);
if (ModConfigs.Jens_spawn == true)
{
EntityRegistry.addSpawn(EntityJens.class, ModConfigs.Jens_weight, ModConfigs.Jens_min, ModConfigs.Jens_max, EnumCreatureType.CREATURE, BiomeHelper.getBiomesWithCreature(EntityPig.class));
}
// Schalker
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker",
id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215);
EntityRegistry.addSpawn(EntitySchalker.class, 50, 1, 4, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityShulker.class));
// WolfMZTE
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:wolfmzte"), EntityWolfMZTE.class, "wolfmzte", id++, Spackenmobs.instance, 64, 1, true, 16711680, 0);
if (ModConfigs.WolfMZTE_spawn == true)
{
EntityRegistry.addSpawn(EntityJens.class, ModConfigs.WolfMZTE_weight, ModConfigs.WolfMZTE_min, ModConfigs.WolfMZTE_max, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityWolf.class));
}
// Jens
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++,
Spackenmobs.instance, 64, 1, true, 6704526, 6767911);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityPig.class));
// Holzstammhuhn
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class, "holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899);
if (ModConfigs.Holzstammhuhn_spawn == true)
{
EntityRegistry.addSpawn(EntityJens.class, ModConfigs.Holzstammhuhn_weight, ModConfigs.Holzstammhuhn_min, ModConfigs.Holzstammhuhn_max, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityChicken.class));
}
// WolfMZTE
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:wolfmzte"), EntityWolfMZTE.class, "wolfmzte",
id++, Spackenmobs.instance, 64, 1, true, 16711680, 0);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityWolf.class));
// 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 == true)
{
EntityRegistry.addSpawn(EntityBakaMitaiCreeper.class, ModConfigs.BakaMitaiCreeper_weight, ModConfigs.BakaMitaiCreeper_min, ModConfigs.BakaMitaiCreeper_max, EnumCreatureType.MONSTER,
BiomeHelper.getBiomesWithMonster(EntityCreeper.class));
}
}
// Holzstammhuhn
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class,
"holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899);
EntityRegistry.addSpawn(EntityJens.class, 50, 1, 4, EnumCreatureType.CREATURE,
BiomeHelper.getBiomesWithCreature(EntityChicken.class));
@SubscribeEvent
public static void registerItems(Register<Item> event)
{
final Item[] items =
{
new Item().setRegistryName(Spackenmobs.MODID, "ram").setUnlocalizedName(Spackenmobs.MODID + "." + "ram").setCreativeTab(Spackenmobs.SPACKENMOBS_TAB),
new Item().setRegistryName(Spackenmobs.MODID, "ram_on_a_stick").setUnlocalizedName(Spackenmobs.MODID + "." + "ram_on_a_stick").setCreativeTab(Spackenmobs.SPACKENMOBS_TAB),
new Item().setRegistryName(Spackenmobs.MODID, "surstroemming").setUnlocalizedName(Spackenmobs.MODID + "." + "surstroemming").setCreativeTab(Spackenmobs.SPACKENMOBS_TAB)
};
event.getRegistry().registerAll(items);
}
// LootTableList.register(EntityJens.LOOT);
}
@SubscribeEvent
public static void registerSounds(Register<SoundEvent> event)
{
// Smava Creeper
ModSoundEvents.ENTITY_SMAVACREEPER_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.fuse"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_FUSE);
ModSoundEvents.ENTITY_SMAVACREEPER_BLOW.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.blow"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_BLOW);
ModSoundEvents.ENTITY_SMAVACREEPER_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_HURT);
ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.smava_creeper.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_SMAVACREEPER_AMBIENT);
@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);
// Islamist
ModSoundEvents.ENTITY_ISLAMIST_FUSE.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.fuse"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_FUSE);
ModSoundEvents.ENTITY_ISLAMIST_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.islamist.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_ISLAMIST_HURT);
// Marcell D'Avis
ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_AMBIENT);
ModSoundEvents.ENTITY_MARCELLDAVIS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_HURT);
ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.marcell_davis.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_MARCELLDAVIS_DEATH);
// 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);
// 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);
// 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);
// 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);
// Schalker
ModSoundEvents.ENTITY_SCHALKER_AMBIENT
.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_AMBIENT);
ModSoundEvents.ENTITY_SCHALKER_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_HURT);
ModSoundEvents.ENTITY_SCHALKER_DEATH
.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_DEATH);
ModSoundEvents.ENTITY_SCHALKER_OPEN.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.open"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_OPEN);
ModSoundEvents.ENTITY_SCHALKER_SHOOT
.setRegistryName(new ResourceLocation("spackenmobs:entities.schalker.shoot"));
event.getRegistry().register(ModSoundEvents.ENTITY_SCHALKER_SHOOT);
// Jens
ModSoundEvents.ENTITY_JENS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_AMBIENT);
ModSoundEvents.ENTITY_JENS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_HURT);
ModSoundEvents.ENTITY_JENS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_DEATH);
ModSoundEvents.ENTITY_JENS_EAT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.eat"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_EAT);
ModSoundEvents.ENTITY_JENS_POOP.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.poop"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_POOP);
// 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);
}
// Jens
ModSoundEvents.ENTITY_JENS_AMBIENT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.ambient"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_AMBIENT);
ModSoundEvents.ENTITY_JENS_HURT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.hurt"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_HURT);
ModSoundEvents.ENTITY_JENS_DEATH.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.death"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_DEATH);
ModSoundEvents.ENTITY_JENS_EAT.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.eat"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_EAT);
ModSoundEvents.ENTITY_JENS_POOP.setRegistryName(new ResourceLocation("spackenmobs:entities.jens.poop"));
event.getRegistry().register(ModSoundEvents.ENTITY_JENS_POOP);
}
}

View file

@ -10,18 +10,16 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
@EventBusSubscriber(value = Side.CLIENT, modid = Spackenmobs.MODID)
public class RegHandlerModels
{
private static void registerModel(Item item, int meta)
{
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
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);
}
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event)
{
registerModel(ModItems.RAM, 0);
registerModel(ModItems.RAM_ON_A_STICK, 0);
registerModel(ModItems.SURSTROEMMING, 0);
}
private static void registerModel(Item item, int meta) {
ModelLoader.setCustomModelResourceLocation(item, meta,
new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
}

View file

@ -9,60 +9,54 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSchalker extends ModelBase
{
public final ModelRenderer base;
public final ModelRenderer lid;
public ModelRenderer head;
public class ModelSchalker extends ModelBase {
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 render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.base.render(scale);
this.lid.render(scale);
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw,
float headPitch, float scaleFactor, Entity entityIn) {
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 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;
if(f1 > (float)Math.PI) {
f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F;
}
if (f1 > (float) Math.PI)
{
f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F;
}
this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);
this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);
if(EntitySchalker.getClientPeekAmount(f) > 0.3F) {
this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F;
}else {
this.lid.rotateAngleY = 0.0F;
}
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.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
}
this.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
}
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw,
float headPitch, float scale) {
this.base.render(scale);
this.lid.render(scale);
}
}

View file

@ -15,45 +15,37 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderApoRed extends RenderSkeleton
{
public static class Factory implements IRenderFactory<EntityApoRed>
{
@Override
public Render<? super EntityApoRed> createRenderFor(RenderManager manager)
{
return new RenderApoRed(manager);
}
}
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");
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 static final Factory FACTORY = new Factory();
@Override
public void transformHeldFull3DItemLayer() {
GlStateManager.translate(0.09375F, 0.1875F, 0.0F);
}
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
protected ResourceLocation getEntityTexture(AbstractSkeleton entity) {
return APORED_TEXTURE;
}
@Override
protected ResourceLocation getEntityTexture(AbstractSkeleton entity)
{
return APORED_TEXTURE;
}
@Override
public void transformHeldFull3DItemLayer()
{
GlStateManager.translate(0.09375F, 0.1875F, 0.0F);
}
public static class Factory implements IRenderFactory<EntityApoRed> {
@Override
public Render<? super EntityApoRed> createRenderFor(RenderManager manager) {
return new RenderApoRed(manager);
}
}
}

View file

@ -14,58 +14,47 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderBakaMitaiCreeper extends RenderCreeper
{
public static class Factory implements IRenderFactory<EntityBakaMitaiCreeper>
{
@Override
public Render<? super EntityBakaMitaiCreeper> createRenderFor(RenderManager manager)
{
return new RenderBakaMitaiCreeper(manager);
}
}
public class RenderBakaMitaiCreeper extends RenderCreeper {
public static final Factory FACTORY = new Factory();
private static final ResourceLocation CREEPER_TEXTURE = new ResourceLocation("textures/entity/creeper/creeper.png");
private static final ResourceLocation CREEPER_TEXTURE = new ResourceLocation("textures/entity/creeper/creeper.png");
public RenderBakaMitaiCreeper(RenderManager renderManagerIn) {
super(renderManagerIn);
this.addLayer(new LayerCreeperCharge(this));
}
public static final Factory FACTORY = new Factory();
protected int getColorMultiplier(EntityBakaMitaiCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) {
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
public RenderBakaMitaiCreeper(RenderManager renderManagerIn)
{
super(renderManagerIn);
this.addLayer(new LayerCreeperCharge(this));
}
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;
}
}
protected int getColorMultiplier(EntityBakaMitaiCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
@Override
protected ResourceLocation getEntityTexture(EntityCreeper entity) {
return CREEPER_TEXTURE;
}
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;
}
}
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(EntityCreeper entity)
{
return CREEPER_TEXTURE;
}
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);
}
public static class Factory implements IRenderFactory<EntityBakaMitaiCreeper> {
@Override
public Render<? super EntityBakaMitaiCreeper> createRenderFor(RenderManager manager) {
return new RenderBakaMitaiCreeper(manager);
}
}
}

View file

@ -13,38 +13,31 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderDrachenlord extends RenderZombie
{
public static class Factory implements IRenderFactory<EntityDrachenlord>
{
@Override
public Render<? super EntityDrachenlord> createRenderFor(RenderManager manager)
{
return new RenderDrachenlord(manager);
}
}
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");
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 static final Factory FACTORY = new Factory();
@Override
protected ResourceLocation getEntityTexture(EntityZombie entity) {
return DRACHENLORD_TEXTURE;
}
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;
}
public static class Factory implements IRenderFactory<EntityDrachenlord> {
@Override
public Render<? super EntityDrachenlord> createRenderFor(RenderManager manager) {
return new RenderDrachenlord(manager);
}
}
}

View file

@ -11,29 +11,24 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderHolzstammhuhn extends RenderChicken
{
public static class Factory implements IRenderFactory<EntityHolzstammhuhn>
{
@Override
public Render<? super EntityHolzstammhuhn> createRenderFor(RenderManager manager)
{
return new RenderHolzstammhuhn(manager);
}
}
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");
private static final ResourceLocation HOLZSTAMMHUHN_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/holzstammhuhn.png");
public RenderHolzstammhuhn(RenderManager renderManagerIn) {
super(renderManagerIn);
}
public static final Factory FACTORY = new Factory();
@Override
protected ResourceLocation getEntityTexture(EntityChicken entity) {
return HOLZSTAMMHUHN_TEXTURE;
}
public RenderHolzstammhuhn(RenderManager renderManagerIn)
{
super(renderManagerIn);
}
@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);
}
}
}

View file

@ -1,71 +1,36 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntityIslamist;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderCreeper;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.layers.LayerCreeperCharge;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderIslamist extends RenderCreeper
{
public static class Factory implements IRenderFactory<EntityIslamist>
{
@Override
public Render<? super EntityIslamist> createRenderFor(RenderManager manager)
{
return new RenderIslamist(manager);
}
}
public class RenderIslamist extends RenderCreeper {
public static final Factory FACTORY = new Factory();
private static final ResourceLocation ISLAMIST_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/islamist.png");
private static final ResourceLocation ISLAMIST_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/islamist.png");
public RenderIslamist(RenderManager renderManagerIn) {
super(renderManagerIn);
this.addLayer(new LayerCreeperCharge(this));
}
public static final Factory FACTORY = new Factory();
@Override
protected ResourceLocation getEntityTexture(EntityCreeper entity) {
return ISLAMIST_TEXTURE;
}
public RenderIslamist(RenderManager renderManagerIn)
{
super(renderManagerIn);
this.addLayer(new LayerCreeperCharge(this));
}
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;
}
}
@Override
protected ResourceLocation getEntityTexture(EntityCreeper entity)
{
return ISLAMIST_TEXTURE;
}
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);
}
public static class Factory implements IRenderFactory<EntityIslamist> {
@Override
public Render<? super EntityIslamist> createRenderFor(RenderManager manager) {
return new RenderIslamist(manager);
}
}
}

View file

@ -11,29 +11,23 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderJens extends RenderBiped<EntityJens>
{
private static class Factory implements IRenderFactory<EntityJens>
{
@Override
public Render<? super EntityJens> createRenderFor(RenderManager manager)
{
return new RenderJens(manager);
}
}
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");
private static final ResourceLocation JENS_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/jens.png");
public RenderJens(RenderManager renderManagerIn) {
super(renderManagerIn, new ModelBiped(), 0.25F);
}
public static final Factory FACTORY = new Factory();
@Override
protected ResourceLocation getEntityTexture(EntityJens entity) {
return JENS_TEXTURE;
}
public RenderJens(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelBiped(), 0.25F);
}
@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);
}
}
}

View file

@ -13,39 +13,32 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderMarcellDAvis extends RenderZombie
{
public static class Factory implements IRenderFactory<EntityMarcellDAvis>
{
@Override
public Render<? super EntityMarcellDAvis> createRenderFor(RenderManager manager)
{
return new RenderMarcellDAvis(manager);
}
}
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");
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 static final Factory FACTORY = new Factory();
@Override
protected ResourceLocation getEntityTexture(EntityZombie entity) {
return MARCELLDAVIS_TEXTURE;
}
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;
}
public static class Factory implements IRenderFactory<EntityMarcellDAvis> {
@Override
public Render<? super EntityMarcellDAvis> createRenderFor(RenderManager manager) {
return new RenderMarcellDAvis(manager);
}
}
}

View file

@ -13,39 +13,32 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderMrBean extends RenderZombie
{
public static class Factory implements IRenderFactory<EntityMrBean>
{
@Override
public Render<? super EntityMrBean> createRenderFor(RenderManager manager)
{
return new RenderMrBean(manager);
}
}
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");
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 static final Factory FACTORY = new Factory();
@Override
protected ResourceLocation getEntityTexture(EntityZombie entity) {
return MRBEAN_TEXTURE;
}
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;
}
public static class Factory implements IRenderFactory<EntityMrBean> {
@Override
public Render<? super EntityMrBean> createRenderFor(RenderManager manager) {
return new RenderMrBean(manager);
}
}
}

View file

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

View file

@ -1,71 +1,36 @@
package mod.acgaming.spackenmobs.render;
import mod.acgaming.spackenmobs.entities.EntitySmavaCreeper;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderCreeper;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.layers.LayerCreeperCharge;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderSmavaCreeper extends RenderCreeper
{
public static class Factory implements IRenderFactory<EntitySmavaCreeper>
{
@Override
public Render<? super EntitySmavaCreeper> createRenderFor(RenderManager manager)
{
return new RenderSmavaCreeper(manager);
}
}
public class RenderSmavaCreeper extends RenderCreeper {
public static final Factory FACTORY = new Factory();
private static final ResourceLocation SMAVA_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/smava_creeper.png");
private static final ResourceLocation SMAVA_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/smava_creeper.png");
public RenderSmavaCreeper(RenderManager renderManagerIn) {
super(renderManagerIn);
this.addLayer(new LayerCreeperCharge(this));
}
public static final Factory FACTORY = new Factory();
@Override
protected ResourceLocation getEntityTexture(EntityCreeper entity) {
return SMAVA_TEXTURE;
}
public RenderSmavaCreeper(RenderManager renderManagerIn)
{
super(renderManagerIn);
this.addLayer(new LayerCreeperCharge(this));
}
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;
}
}
@Override
protected ResourceLocation getEntityTexture(EntityCreeper entity)
{
return SMAVA_TEXTURE;
}
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);
}
public static class Factory implements IRenderFactory<EntitySmavaCreeper> {
@Override
public Render<? super EntitySmavaCreeper> createRenderFor(RenderManager manager) {
return new RenderSmavaCreeper(manager);
}
}
}

View file

@ -13,57 +13,48 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderWolfMZTE extends RenderWolf
{
public static class Factory implements IRenderFactory<EntityWolfMZTE>
{
@Override
public Render<? super EntityWolfMZTE> createRenderFor(RenderManager manager)
{
return new RenderWolfMZTE(manager);
}
}
public class RenderWolfMZTE extends RenderWolf {
public static final Factory FACTORY = new Factory();
private static final ResourceLocation WOLFMZTE_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/wolfmzte.png");
private static final ResourceLocation TAMED_WOLFMZTE_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/wolfmzte_tame.png");
private static final ResourceLocation ANRGY_WOLFMZTE_TEXTURE = new ResourceLocation(
"spackenmobs:textures/entities/wolfmzte_angry.png");
private static final ResourceLocation WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte.png");
private static final ResourceLocation TAMED_WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte_tame.png");
private static final ResourceLocation ANRGY_WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte_angry.png");
public RenderWolfMZTE(RenderManager renderManagerIn) {
super(renderManagerIn);
this.addLayer(new LayerWolfCollar(this));
}
public static final Factory FACTORY = new Factory();
@Override
protected float handleRotationFloat(EntityWolf livingBase, float partialTicks) {
return livingBase.getTailRotation();
}
public RenderWolfMZTE(RenderManager renderManagerIn)
{
super(renderManagerIn);
this.addLayer(new LayerWolfCollar(this));
}
@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_WOLFMZTE_TEXTURE;
}else {
return entity.isAngry() ? ANRGY_WOLFMZTE_TEXTURE : WOLFMZTE_TEXTURE;
}
}
@Override
protected ResourceLocation getEntityTexture(EntityWolf entity)
{
if (entity.isTamed())
{
return TAMED_WOLFMZTE_TEXTURE;
}
else
{
return entity.isAngry() ? ANRGY_WOLFMZTE_TEXTURE : WOLFMZTE_TEXTURE;
}
}
@Override
protected float handleRotationFloat(EntityWolf livingBase, float partialTicks)
{
return livingBase.getTailRotation();
}
public static class Factory implements IRenderFactory<EntityWolfMZTE> {
@Override
public Render<? super EntityWolfMZTE> createRenderFor(RenderManager manager) {
return new RenderWolfMZTE(manager);
}
}
}