First Checkup
This commit is contained in:
@@ -98,7 +98,7 @@ public class EntityAIAttackSpell extends EntityAIBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean continueExecuting(){
|
||||
public boolean shouldContinueExecuting(){
|
||||
return this.shouldExecute() || !this.attacker.getNavigator().noPath();
|
||||
}
|
||||
|
||||
|
||||
@@ -322,8 +322,8 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
||||
public void onDeath(DamageSource source){
|
||||
|
||||
super.onDeath(source);
|
||||
if(source.getEntity() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getEntity()).addStat(WizardryAchievements.defeat_evil_wizard);
|
||||
if(source.getTrueSource() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getTrueSource()).addStat(WizardryAchievements.defeat_evil_wizard);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,8 +168,8 @@ public class EntityIceGiant extends EntityIronGolem implements ISummonedCreature
|
||||
public void onSuccessfulAttack(EntityLivingBase target){
|
||||
|
||||
target.motionY += 0.2;
|
||||
target.motionX += this.getLookVec().xCoord * 0.2;
|
||||
target.motionZ += this.getLookVec().xCoord * 0.2;
|
||||
target.motionX += this.getLookVec().x * 0.2;
|
||||
target.motionZ += this.getLookVec().x * 0.2;
|
||||
|
||||
target.addPotionEffect(new PotionEffect(WizardryPotions.frost, 300, 0));
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
this.motionZ = 0.0D;
|
||||
}
|
||||
|
||||
this.world.theProfiler.startSection("ai");
|
||||
this.world.profiler.startSection("ai");
|
||||
|
||||
if(this.isMovementBlocked()){
|
||||
this.isJumping = false;
|
||||
@@ -133,13 +133,13 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
this.moveForward = 0.0F;
|
||||
this.randomYawVelocity = 0.0F;
|
||||
}else if(this.isServerWorld()){
|
||||
this.world.theProfiler.startSection("newAi");
|
||||
this.world.profiler.startSection("newAi");
|
||||
this.updateEntityActionState();
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.profiler.endSection();
|
||||
}
|
||||
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.theProfiler.startSection("jump");
|
||||
this.world.profiler.endSection();
|
||||
this.world.profiler.startSection("jump");
|
||||
|
||||
if(this.isJumping){
|
||||
if(this.isInWater()){
|
||||
@@ -154,16 +154,16 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
this.jumpTicks = 0;
|
||||
}
|
||||
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.theProfiler.startSection("travel");
|
||||
this.world.profiler.endSection();
|
||||
this.world.profiler.startSection("travel");
|
||||
this.moveStrafing *= 0.98F;
|
||||
this.moveForward *= 0.98F;
|
||||
this.randomYawVelocity *= 0.9F;
|
||||
this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.theProfiler.startSection("push");
|
||||
this.world.profiler.endSection();
|
||||
this.world.profiler.startSection("push");
|
||||
this.collideWithNearbyEntities();
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.profiler.endSection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -123,7 +123,7 @@ public class EntitySkeletonMinion extends EntitySkeleton implements ISummonedCre
|
||||
}
|
||||
|
||||
// Halloween pumpkin heads! Why not?
|
||||
if(this.getItemStackFromSlot(EntityEquipmentSlot.HEAD) == null){
|
||||
if(this.getItemStackFromSlot(EntityEquipmentSlot.HEAD).isEmpty()){
|
||||
Calendar calendar = this.world.getCurrentDate();
|
||||
|
||||
if(calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F){
|
||||
|
||||
@@ -125,7 +125,7 @@ public class EntityWitherSkeletonMinion extends EntityWitherSkeleton implements
|
||||
}
|
||||
|
||||
// Halloween pumpkin heads! Why not?
|
||||
if(this.getItemStackFromSlot(EntityEquipmentSlot.HEAD) == null){
|
||||
if(this.getItemStackFromSlot(EntityEquipmentSlot.HEAD).isEmpty()){
|
||||
Calendar calendar = this.world.getCurrentDate();
|
||||
|
||||
if(calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F){
|
||||
|
||||
@@ -774,8 +774,8 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float damage){
|
||||
|
||||
if(source.getEntity() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getEntity()).addStat(WizardryAchievements.anger_wizard);
|
||||
if(source.getTrueSource() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getTrueSource()).addStat(WizardryAchievements.anger_wizard);
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, damage);
|
||||
|
||||
@@ -330,9 +330,9 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
|
||||
|
||||
// Rather than bother overriding entire attack methods in ISummonedCreature implementations, it's easier (and
|
||||
// more robust) to use LivingAttackEvent to modify the damage source.
|
||||
if(event.getSource().getEntity() instanceof ISummonedCreature){
|
||||
if(event.getSource().getTrueSource() instanceof ISummonedCreature){
|
||||
|
||||
EntityLivingBase summoner = ((ISummonedCreature)event.getSource().getEntity()).getCaster();
|
||||
EntityLivingBase summoner = ((ISummonedCreature)event.getSource().getTrueSource()).getCaster();
|
||||
|
||||
if(summoner != null){
|
||||
|
||||
@@ -349,11 +349,11 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
|
||||
// All summoned creatures are classified as magic, so it makes sense to do it this way.
|
||||
if(event.getSource() instanceof EntityDamageSourceIndirect){
|
||||
newSource = new IndirectMinionDamage(event.getSource().damageType,
|
||||
event.getSource().getSourceOfDamage(), event.getSource().getEntity(), summoner, type,
|
||||
event.getSource().getImmediateSource(), event.getSource().getTrueSource(), summoner, type,
|
||||
isRetaliatory);
|
||||
}else if(event.getSource() instanceof EntityDamageSource){
|
||||
// Name is copied over so it uses the appropriate vanilla death message
|
||||
newSource = new MinionDamage(event.getSource().damageType, event.getSource().getEntity(), summoner,
|
||||
newSource = new MinionDamage(event.getSource().damageType, event.getSource().getTrueSource(), summoner,
|
||||
type, isRetaliatory);
|
||||
}
|
||||
|
||||
@@ -365,8 +365,8 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
|
||||
// For some reason Minecraft calculates knockback relative to DamageSource#getEntity. In vanilla this
|
||||
// is unnoticeable, but it looks a bit weird with summoned creatures involved - so this fixes that.
|
||||
if(WizardryUtilities.attackEntityWithoutKnockback(event.getEntity(), newSource, event.getAmount())){
|
||||
WizardryUtilities.applyStandardKnockback(event.getSource().getEntity(), event.getEntityLiving());
|
||||
((ISummonedCreature)event.getSource().getEntity()).onSuccessfulAttack(event.getEntityLiving());
|
||||
WizardryUtilities.applyStandardKnockback(event.getSource().getTrueSource(), event.getEntityLiving());
|
||||
((ISummonedCreature)event.getSource().getTrueSource()).onSuccessfulAttack(event.getEntityLiving());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user