Fixed TileEntity ritual stones
This commit is contained in:
parent
ce4b571010
commit
1ac6fdda98
|
@ -70,6 +70,7 @@ import WayofTime.alchemicalWizardry.common.compress.AdvancedCompressionHandler;
|
|||
import WayofTime.alchemicalWizardry.common.compress.BaseCompressionHandler;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonPacketAngel;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonPacketRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist;
|
||||
|
@ -382,6 +383,7 @@ public class AlchemicalWizardry
|
|||
public static String entityFireElementalID = "AW012";
|
||||
public static String entityShadeElementalID = "AW013";
|
||||
public static String entityHolyElementalID = "AW014";
|
||||
public static String entityMinorDemonGruntID = "AW015";
|
||||
|
||||
|
||||
public static Fluid lifeEssenceFluid;
|
||||
|
@ -818,7 +820,8 @@ public class AlchemicalWizardry
|
|||
SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityFireElementalID), new ItemStack[]{incendiumStack, incendiumStack, incendiumStack, incendiumStack, incendiumStack, incendiumStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4);
|
||||
SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityShadeElementalID), new ItemStack[]{tennebraeStack, tennebraeStack, tennebraeStack, tennebraeStack, tennebraeStack, tennebraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4);
|
||||
SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityHolyElementalID), new ItemStack[]{sanctusStack, sanctusStack, sanctusStack, sanctusStack, sanctusStack, sanctusStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4);
|
||||
|
||||
SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityMinorDemonGruntID), new ItemStack[]{incendiumStack, sanctusStack, sanctusStack, sanctusStack, sanctusStack, sanctusStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4);
|
||||
|
||||
//Custom mobs
|
||||
EntityRegistry.registerModEntity(EntityFallenAngel.class, "FallenAngel", 20, this, 80, 3, true);
|
||||
EntityRegistry.registerModEntity(EntityLowerGuardian.class, "LowerGuardian", 21, this, 80, 3, true);
|
||||
|
@ -834,6 +837,7 @@ public class AlchemicalWizardry
|
|||
EntityRegistry.registerModEntity(EntityFireElemental.class, "FireElemental", 31, this, 120, 3, true);
|
||||
EntityRegistry.registerModEntity(EntityShadeElemental.class, "ShadeElemental", 32, this, 120, 3, true);
|
||||
EntityRegistry.registerModEntity(EntityHolyElemental.class, "HolyElemental", 33, this, 120, 3, true);
|
||||
EntityRegistry.registerModEntity(EntityMinorDemonGrunt.class, "MinorDemonGrunt", 34, this, 80, 3, true);
|
||||
|
||||
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.standardBindingAgent), 1, 3, this.standardBindingAgentDungeonChance));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.mundanePowerCatalyst), 1, 1, this.mundanePowerCatalystDungeonChance));
|
||||
|
|
|
@ -158,7 +158,7 @@ public class Rituals
|
|||
te = world.getTileEntity(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
|
||||
if (!(test instanceof IRitualStone && ((IRitualStone)test).isRuneType(world, x + rc.getX(direction), y, z+ rc.getZ(direction), world.getBlockMetadata(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)), rc.getStoneType()))
|
||||
&& !(test instanceof ITileRitualStone && ((ITileRitualStone)te).isRuneType(rc.getStoneType())))
|
||||
&& !(te instanceof ITileRitualStone && ((ITileRitualStone)te).isRuneType(rc.getStoneType())))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,29 +1,91 @@
|
|||
package WayofTime.alchemicalWizardry.client;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.CommonProxy;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAirElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.*;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityEarthElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityFireElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityHolyElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityShadeElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityWaterElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.*;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.*;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.*;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.*;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderAlchemicCalcinator;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderConduit;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderCrystalBelljar;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderMasterStone;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderPlinth;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderReagentConduit;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEffectBlock;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEnhancementBlock;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellModifierBlock;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellParadigmBlock;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderWritingTable;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.ShaderHelper;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.TEAltarRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAlchemicalCalcinatorItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAltarItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEBellJarItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEConduitItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellEffectBlockItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellEnhancementBlockItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellModifierBlockItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellParadigmBlockItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderBileDemon;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderBoulderFist;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderElemental;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderFallenAngel;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderGrunt;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderIceDemon;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderLowerGuardian;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderShade;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderSmallEarthGolem;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.mob.RenderWingedFireDemon;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelBileDemon;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelBoulderFist;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelElemental;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelFallenAngel;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelIceDemon;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelLowerGuardian;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelShade;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSmallEarthGolem;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelWingedFireDemon;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBazookaMainProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBlastProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.*;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
|
@ -52,6 +114,7 @@ public class ClientProxy extends CommonProxy
|
|||
RenderingRegistry.registerEntityRenderingHandler(EntityFireElemental.class, new RenderElemental(new ModelElemental(), 0.5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityShadeElemental.class, new RenderElemental(new ModelElemental(), 0.5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHolyElemental.class, new RenderElemental(new ModelElemental(), 0.5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMinorDemonGrunt.class, new RenderGrunt(new ModelShade(), 0.5F));
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEAltar.class, new TEAltarRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEPedestal.class, new RenderPedestal());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEPlinth.class, new RenderPlinth());
|
||||
|
|
|
@ -0,0 +1,166 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage.ai;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class EntityAIOccasionalRangedAttack extends EntityAIBase
|
||||
{
|
||||
/** The entity the AI instance has been applied to */
|
||||
private final EntityLiving entityHost;
|
||||
/** The entity (as a RangedAttackMob) the AI instance has been applied to. */
|
||||
private final IOccasionalRangedAttackMob rangedAttackEntityHost;
|
||||
private EntityLivingBase attackTarget;
|
||||
/**
|
||||
* A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the
|
||||
* maxRangedAttackTime.
|
||||
*/
|
||||
private int rangedAttackTime;
|
||||
private double entityMoveSpeed;
|
||||
private int field_75318_f;
|
||||
private int field_96561_g;
|
||||
/** The maximum time the AI has to wait before peforming another ranged attack. */
|
||||
private int maxRangedAttackTime;
|
||||
private float field_96562_i;
|
||||
private float field_82642_h;
|
||||
private static final String __OBFID = "CL_00001609";
|
||||
private double range;
|
||||
|
||||
public EntityAIOccasionalRangedAttack(IOccasionalRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_, double range)
|
||||
{
|
||||
this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_, range);
|
||||
}
|
||||
|
||||
public EntityAIOccasionalRangedAttack(IOccasionalRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_, double range)
|
||||
{
|
||||
this.rangedAttackTime = -1;
|
||||
|
||||
if (!(p_i1650_1_ instanceof EntityLivingBase))
|
||||
{
|
||||
throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.rangedAttackEntityHost = p_i1650_1_;
|
||||
this.entityHost = (EntityLiving)p_i1650_1_;
|
||||
this.entityMoveSpeed = p_i1650_2_;
|
||||
this.field_96561_g = p_i1650_4_;
|
||||
this.maxRangedAttackTime = p_i1650_5_;
|
||||
this.field_96562_i = p_i1650_6_;
|
||||
this.field_82642_h = p_i1650_6_ * p_i1650_6_;
|
||||
this.setMutexBits(3);
|
||||
this.range = range;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the EntityAIBase should begin execution.
|
||||
*/
|
||||
public boolean shouldExecute()
|
||||
{
|
||||
EntityLivingBase entitylivingbase = this.entityHost.getAttackTarget();
|
||||
|
||||
if (entitylivingbase == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if(this.rangedAttackEntityHost.shouldUseRangedAttack() && this.isInRange(entitylivingbase))
|
||||
{
|
||||
this.attackTarget = entitylivingbase;
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether an in-progress EntityAIBase should continue executing
|
||||
*/
|
||||
public boolean continueExecuting()
|
||||
{
|
||||
return this.shouldExecute() || !this.entityHost.getNavigator().noPath() && this.rangedAttackEntityHost.shouldUseRangedAttack();
|
||||
}
|
||||
|
||||
public boolean isInRange(EntityLivingBase target)
|
||||
{
|
||||
double xf = target.posX;
|
||||
double yf = target.posY;
|
||||
double zf = target.posZ;
|
||||
|
||||
double xi = this.entityHost.posX;
|
||||
double yi = this.entityHost.posY;
|
||||
double zi = this.entityHost.posZ;
|
||||
return (xi-xf)*(xi-xf) + (yi-yf)*(yi-yf) + (zi-zf)*(zi-zf) >= range*range;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the task
|
||||
*/
|
||||
public void resetTask()
|
||||
{
|
||||
this.attackTarget = null;
|
||||
this.field_75318_f = 0;
|
||||
this.rangedAttackTime = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the task
|
||||
*/
|
||||
public void updateTask()
|
||||
{
|
||||
double d0 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.boundingBox.minY, this.attackTarget.posZ);
|
||||
boolean flag = this.entityHost.getEntitySenses().canSee(this.attackTarget);
|
||||
|
||||
if (flag)
|
||||
{
|
||||
++this.field_75318_f;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.field_75318_f = 0;
|
||||
}
|
||||
|
||||
if (d0 <= (double)this.field_82642_h && this.field_75318_f >= 20)
|
||||
{
|
||||
this.entityHost.getNavigator().clearPathEntity();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.entityHost.getNavigator().tryMoveToEntityLiving(this.attackTarget, this.entityMoveSpeed);
|
||||
}
|
||||
|
||||
this.entityHost.getLookHelper().setLookPositionWithEntity(this.attackTarget, 30.0F, 30.0F);
|
||||
float f;
|
||||
|
||||
if (--this.rangedAttackTime == 0)
|
||||
{
|
||||
if (d0 > (double)this.field_82642_h || !flag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
f = MathHelper.sqrt_double(d0) / this.field_96562_i;
|
||||
float f1 = f;
|
||||
|
||||
if (f < 0.1F)
|
||||
{
|
||||
f1 = 0.1F;
|
||||
}
|
||||
|
||||
if (f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
|
||||
this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, f1);
|
||||
this.rangedAttackTime = MathHelper.floor_float(f * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g);
|
||||
}
|
||||
else if (this.rangedAttackTime < 0)
|
||||
{
|
||||
f = MathHelper.sqrt_double(d0) / this.field_96562_i;
|
||||
this.rangedAttackTime = MathHelper.floor_float(f * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage.ai;
|
||||
|
||||
import net.minecraft.entity.IRangedAttackMob;
|
||||
|
||||
public interface IOccasionalRangedAttackMob extends IRangedAttackMob
|
||||
{
|
||||
public boolean shouldUseRangedAttack();
|
||||
}
|
|
@ -2,9 +2,7 @@ package WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon;
|
|||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IRangedAttackMob;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIArrowAttack;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIFollowOwner;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
|
@ -23,17 +21,20 @@ import net.minecraft.item.ItemFood;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.ai.EntityAIOccasionalRangedAttack;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.ai.IOccasionalRangedAttackMob;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class EntityMinorDemonGrunt extends EntityDemon implements IRangedAttackMob, IHoardDemon
|
||||
public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRangedAttackMob, IHoardDemon
|
||||
{
|
||||
private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F);
|
||||
private EntityAIOccasionalRangedAttack aiArrowAttack = new EntityAIOccasionalRangedAttack(this, 1.0D, 40, 40, 15.0F, 5);
|
||||
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
|
||||
|
||||
private boolean isAngry = false;
|
||||
|
@ -130,11 +131,11 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IRangedAttackM
|
|||
/**
|
||||
* main AI tick function, replaces updateEntityActionState
|
||||
*/
|
||||
@Override
|
||||
protected void updateAITick()
|
||||
{
|
||||
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
|
||||
}
|
||||
// @Override
|
||||
// protected void updateAITick()
|
||||
// {
|
||||
// this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
|
||||
// }
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
|
@ -400,6 +401,13 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IRangedAttackM
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity par1Entity)
|
||||
{
|
||||
int i = this.isTamed() ? 6 : 7;
|
||||
return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attack the specified entity using a ranged attack.
|
||||
*/
|
||||
|
@ -421,5 +429,12 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IRangedAttackM
|
|||
this.tasks.removeTask(this.aiAttackOnCollide);
|
||||
this.tasks.removeTask(this.aiArrowAttack);
|
||||
this.tasks.addTask(4, this.aiArrowAttack);
|
||||
this.tasks.addTask(5, this.aiAttackOnCollide);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRangedAttack()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.mob;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt;
|
||||
|
||||
public class RenderGrunt extends RenderLiving
|
||||
{
|
||||
private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/ShadeMob.png");
|
||||
|
||||
public RenderGrunt(ModelBase par1ModelBase, float par2)
|
||||
{
|
||||
super(par1ModelBase, par2);
|
||||
}
|
||||
|
||||
public ResourceLocation func_110832_a(EntityMinorDemonGrunt par1EntityShade)
|
||||
{
|
||||
return field_110833_a;
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(Entity par1Entity)
|
||||
{
|
||||
return this.func_110832_a((EntityMinorDemonGrunt) par1Entity);
|
||||
}
|
||||
}
|
|
@ -1,12 +1,25 @@
|
|||
package WayofTime.alchemicalWizardry.common.summoning;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningHelper;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAirElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.*;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityPig;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningHelper;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAirElemental;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityEarthElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityFireElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityHolyElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityShadeElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityWaterElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon;
|
||||
|
||||
public class SummoningHelperAW extends SummoningHelper
|
||||
{
|
||||
|
@ -87,6 +100,11 @@ public class SummoningHelperAW extends SummoningHelper
|
|||
return new EntityHolyElemental(worldObj);
|
||||
}
|
||||
|
||||
if(this.id.equals(AlchemicalWizardry.entityMinorDemonGruntID))
|
||||
{
|
||||
return new EntityMinorDemonGrunt(worldObj);
|
||||
}
|
||||
|
||||
return new EntityPig(worldObj);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue