1.12 conversion
This commit is contained in:
@@ -106,12 +106,12 @@ public class EntityMeteor extends EntityFallingBlock {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getBrightnessForRender(float partialTicks){
|
||||
public int getBrightnessForRender(){
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float partialTicks){
|
||||
public float getBrightness(){
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class EntityBlackHole extends EntityMagicConstruct {
|
||||
((EntityPlayerMP)target).connection.sendPacket(new SPacketEntityVelocity(target));
|
||||
}
|
||||
|
||||
if(this.getDistanceToEntity(target) <= 2){
|
||||
if(this.getDistance(target) <= 2){
|
||||
// Damages the target if it is close enough
|
||||
if(this.getCaster() != null){
|
||||
target.attackEntityFrom(
|
||||
|
||||
@@ -74,7 +74,7 @@ public class EntityEarthquake extends EntityMagicConstruct {
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
// Searches in a 1 wide ring.
|
||||
if(this.getDistanceToEntity(target) > (this.ticksExisted * speed) + 0.5 && target.posY < this.posY + 1
|
||||
if(this.getDistance(target) > (this.ticksExisted * speed) + 0.5 && target.posY < this.posY + 1
|
||||
&& target.posY > this.posY - 1){
|
||||
|
||||
// Knockback must be removed in this instance, or the target will fall into the floor.
|
||||
|
||||
@@ -3,7 +3,8 @@ package electroblob.wizardry.entity.construct;
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardryAchievements;
|
||||
import electroblob.wizardry.advancement.AdvancementHelper;
|
||||
import electroblob.wizardry.advancement.AdvancementHelper.EnumAdvancement;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
import electroblob.wizardry.util.MagicDamage.DamageType;
|
||||
@@ -103,7 +104,7 @@ public class EntityTornado extends EntityMagicConstruct {
|
||||
|
||||
// The 'Not Again...' achievement
|
||||
if(target instanceof EntityPig && WizardryUtilities.getRider(target) instanceof EntityPlayer){
|
||||
((EntityPlayer)WizardryUtilities.getRider(target)).addStat(WizardryAchievements.pig_tornado);
|
||||
AdvancementHelper.grantAdvancement((EntityPlayer)WizardryUtilities.getRider(target), EnumAdvancement.pig_tornado);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class EntityAIAttackSpell extends EntityAIBase {
|
||||
}
|
||||
|
||||
if(distanceSq <= (double)this.maxAttackDistance && this.seeTime >= 20){
|
||||
this.attacker.getNavigator().clearPathEntity();
|
||||
this.attacker.getNavigator().clearPath();
|
||||
}else{
|
||||
this.attacker.getNavigator().tryMoveToEntityLiving(this.target, this.speed);
|
||||
}
|
||||
|
||||
@@ -8,11 +8,12 @@ import java.util.Locale;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.advancement.AdvancementHelper;
|
||||
import electroblob.wizardry.advancement.AdvancementHelper.EnumAdvancement;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.constants.Tier;
|
||||
import electroblob.wizardry.item.ItemSpellBook;
|
||||
import electroblob.wizardry.registry.Spells;
|
||||
import electroblob.wizardry.registry.WizardryAchievements;
|
||||
import electroblob.wizardry.registry.WizardryItems;
|
||||
import electroblob.wizardry.registry.WizardryPotions;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
@@ -285,7 +286,7 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent getHurtSound(){
|
||||
protected SoundEvent getHurtSound(DamageSource source){
|
||||
return SoundEvents.ENTITY_WITCH_HURT;
|
||||
}
|
||||
|
||||
@@ -323,7 +324,7 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
||||
|
||||
super.onDeath(source);
|
||||
if(source.getTrueSource() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getTrueSource()).addStat(WizardryAchievements.defeat_evil_wizard);
|
||||
AdvancementHelper.grantAdvancement((EntityPlayer)source.getTrueSource(), EnumAdvancement.defeat_evil_wizard);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
this.moveStrafing *= 0.98F;
|
||||
this.moveForward *= 0.98F;
|
||||
this.randomYawVelocity *= 0.9F;
|
||||
this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
|
||||
this.moveRelative(moveStrafing, 0f, moveForward, 0f);
|
||||
this.world.profiler.endSection();
|
||||
this.world.profiler.startSection("push");
|
||||
this.collideWithNearbyEntities();
|
||||
@@ -229,7 +229,7 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
public void updateTask(){
|
||||
--this.attackTime;
|
||||
EntityLivingBase entitylivingbase = this.blaze.getAttackTarget();
|
||||
double d0 = this.blaze.getDistanceSqToEntity(entitylivingbase);
|
||||
double d0 = this.blaze.getDistanceSq(entitylivingbase);
|
||||
|
||||
if(d0 < 4.0D){
|
||||
if(this.attackTime <= 0){
|
||||
@@ -264,7 +264,7 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
|
||||
this.blaze.getLookHelper().setLookPositionWithEntity(entitylivingbase, 10.0F, 10.0F);
|
||||
}else{
|
||||
this.blaze.getNavigator().clearPathEntity();
|
||||
this.blaze.getNavigator().clearPath();
|
||||
this.blaze.getMoveHelper().setMoveTo(entitylivingbase.posX, entitylivingbase.posY,
|
||||
entitylivingbase.posZ, 1.0D);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class EntityLightningWraith extends EntityBlazeMinion {
|
||||
public void updateTask(){
|
||||
--this.attackTime;
|
||||
EntityLivingBase entitylivingbase = this.blaze.getAttackTarget();
|
||||
double d0 = this.blaze.getDistanceSqToEntity(entitylivingbase);
|
||||
double d0 = this.blaze.getDistanceSq(entitylivingbase);
|
||||
|
||||
if(d0 < 4.0D){
|
||||
if(this.attackTime <= 0){
|
||||
@@ -162,7 +162,7 @@ public class EntityLightningWraith extends EntityBlazeMinion {
|
||||
|
||||
this.blaze.getLookHelper().setLookPositionWithEntity(entitylivingbase, 10.0F, 10.0F);
|
||||
}else{
|
||||
this.blaze.getNavigator().clearPathEntity();
|
||||
this.blaze.getNavigator().clearPath();
|
||||
this.blaze.getMoveHelper().setMoveTo(entitylivingbase.posX, entitylivingbase.posY,
|
||||
entitylivingbase.posZ, 1.0D);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -103,7 +104,7 @@ public class EntityPhoenix extends EntitySummonedCreature implements ISpellCaste
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent getHurtSound(){
|
||||
protected SoundEvent getHurtSound(DamageSource source){
|
||||
return SoundEvents.ENTITY_BLAZE_HURT;
|
||||
}
|
||||
|
||||
@@ -114,12 +115,12 @@ public class EntityPhoenix extends EntitySummonedCreature implements ISpellCaste
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float par1){
|
||||
public int getBrightnessForRender(){
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float par1){
|
||||
public float getBrightness(){
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.world.World;
|
||||
@@ -102,7 +103,7 @@ public class EntityShadowWraith extends EntitySummonedCreature implements ISpell
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent getHurtSound(){
|
||||
protected SoundEvent getHurtSound(DamageSource source){
|
||||
return SoundEvents.ENTITY_BLAZE_HURT;
|
||||
}
|
||||
|
||||
@@ -113,12 +114,12 @@ public class EntityShadowWraith extends EntitySummonedCreature implements ISpell
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float partialTicks){
|
||||
public int getBrightnessForRender(){
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float partialTicks){
|
||||
public float getBrightness(){
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.world.World;
|
||||
@@ -95,7 +96,7 @@ public class EntityStormElemental extends EntitySummonedCreature implements ISpe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent getHurtSound(){
|
||||
protected SoundEvent getHurtSound(DamageSource source){
|
||||
return SoundEvents.ENTITY_BLAZE_HURT;
|
||||
}
|
||||
|
||||
@@ -106,12 +107,12 @@ public class EntityStormElemental extends EntitySummonedCreature implements ISpe
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float partialTicks){
|
||||
public int getBrightnessForRender(){
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float partialTicks){
|
||||
public float getBrightness(){
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,12 @@ import java.util.Set;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.advancement.AdvancementHelper;
|
||||
import electroblob.wizardry.advancement.AdvancementHelper.EnumAdvancement;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.constants.Tier;
|
||||
import electroblob.wizardry.item.ItemSpellBook;
|
||||
import electroblob.wizardry.registry.Spells;
|
||||
import electroblob.wizardry.registry.WizardryAchievements;
|
||||
import electroblob.wizardry.registry.WizardryItems;
|
||||
import electroblob.wizardry.registry.WizardryPotions;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
@@ -400,11 +401,11 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
|
||||
// Achievements
|
||||
if(this.getCustomer() != null){
|
||||
this.getCustomer().addStat(WizardryAchievements.wizard_trade);
|
||||
AdvancementHelper.grantAdvancement(getCustomer(), EnumAdvancement.wizard_trade);
|
||||
|
||||
if(merchantrecipe.getItemToSell().getItem() instanceof ItemSpellBook
|
||||
&& Spell.get(merchantrecipe.getItemToSell().getItemDamage()).tier == Tier.MASTER){
|
||||
this.getCustomer().addStat(WizardryAchievements.buy_master_spell);
|
||||
AdvancementHelper.grantAdvancement(getCustomer(), EnumAdvancement.buy_master_spell);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -775,7 +776,7 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
public boolean attackEntityFrom(DamageSource source, float damage){
|
||||
|
||||
if(source.getTrueSource() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getTrueSource()).addStat(WizardryAchievements.anger_wizard);
|
||||
AdvancementHelper.grantAdvancement((EntityPlayer)source.getTrueSource(), EnumAdvancement.anger_wizard);
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, damage);
|
||||
@@ -817,7 +818,7 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
for(EntityWizard wizard : wizards){
|
||||
if(wizard.isBlockPartOfTower(event.getPos())){
|
||||
wizard.setRevengeTarget(event.getPlayer());
|
||||
event.getPlayer().addStat(WizardryAchievements.anger_wizard);
|
||||
AdvancementHelper.grantAdvancement(event.getPlayer(), EnumAdvancement.anger_wizard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class EntityForceArrow extends EntityMagicArrow {
|
||||
|
||||
@Override
|
||||
protected void entityInit(){
|
||||
|
||||
// auto generated
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class EntityLightningDisc extends EntityMagicProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
if(!this.isCollided && !world.isRemote){
|
||||
if(!this.collided && !world.isRemote){
|
||||
|
||||
double seekingRange = 5.0d;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class EntityLightningDisc extends EntityMagicProjectile {
|
||||
|
||||
for(Entity possibleTarget : entities){
|
||||
// Decides if current entity should be replaced.
|
||||
if(target == null || this.getDistanceToEntity(target) > this.getDistanceToEntity(possibleTarget)){
|
||||
if(target == null || this.getDistance(target) > this.getDistance(possibleTarget)){
|
||||
// Decides if new entity is a valid target.
|
||||
if(WizardryUtilities.isValidTarget(this.getThrower(), possibleTarget)){
|
||||
target = possibleTarget;
|
||||
|
||||
@@ -122,7 +122,7 @@ public abstract class EntityMagicArrow extends Entity implements IProjectile, IE
|
||||
// f4 depends on the horizontal distance between the two entities and accounts for bullet drop,
|
||||
// but of course if gravity is ignored this should be 0.
|
||||
float bulletDropCompensation = this.doGravity() ? (float)d3 * 0.2F : 0;
|
||||
this.setThrowableHeading(d0, d1 + (double)bulletDropCompensation, d2, speed, aimingError);
|
||||
this.shoot(d0, d1 + (double)bulletDropCompensation, d2, speed, aimingError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public abstract class EntityMagicArrow extends Entity implements IProjectile, IE
|
||||
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI)
|
||||
* MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
|
||||
this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, speed * 1.5F, 1.0F);
|
||||
this.shoot(this.motionX, this.motionY, this.motionZ, speed * 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
/** Subclasses must override this to set their own base damage. */
|
||||
@@ -183,7 +183,8 @@ public abstract class EntityMagicArrow extends Entity implements IProjectile, IE
|
||||
/**
|
||||
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
|
||||
*/
|
||||
public void setThrowableHeading(double x, double y, double z, float speed, float randomness){
|
||||
@Override
|
||||
public void shoot(double x, double y, double z, float speed, float randomness){
|
||||
float f2 = MathHelper.sqrt(x * x + y * y + z * z);
|
||||
x /= (double)f2;
|
||||
y /= (double)f2;
|
||||
@@ -579,4 +580,9 @@ public abstract class EntityMagicArrow extends Entity implements IProjectile, IE
|
||||
public void setShootingEntity(EntityLivingBase entity){
|
||||
shootingEntity = new WeakReference<EntityLivingBase>(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public abstract class EntityMagicProjectile extends EntityThrowable {
|
||||
public EntityMagicProjectile(World world, EntityLivingBase thrower, float damageMultiplier){
|
||||
super(world, thrower);
|
||||
// This is the standard set of parameters for this method, used by snowballs and ender pearls amongst others.
|
||||
this.setHeadingFromThrower(thrower, thrower.rotationPitch, thrower.rotationYaw, 0.0f, this.getSpeed(), 1.0f);
|
||||
this.shoot(thrower, thrower.rotationPitch, thrower.rotationYaw, 0.0f, this.getSpeed(), 1.0f);
|
||||
this.damageMultiplier = damageMultiplier;
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ public abstract class EntityMagicProjectile extends EntityThrowable {
|
||||
- (this.posY + (double)(this.height / 2.0F));
|
||||
double dz = target.posZ - this.posZ;
|
||||
|
||||
this.motionX = dx / this.getDistanceToEntity(target) * velocity;
|
||||
this.motionY = dy / this.getDistanceToEntity(target) * velocity;
|
||||
this.motionZ = dz / this.getDistanceToEntity(target) * velocity;
|
||||
this.motionX = dx / this.getDistance(target) * velocity;
|
||||
this.motionY = dy / this.getDistance(target) * velocity;
|
||||
this.motionZ = dz / this.getDistance(target) * velocity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -68,7 +68,7 @@ public class EntitySpark extends EntityMagicProjectile {
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if(!this.isCollided && !world.isRemote){
|
||||
if(!this.collided && !world.isRemote){
|
||||
|
||||
double seekingRange = 5.0d;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class EntitySpark extends EntityMagicProjectile {
|
||||
|
||||
for(Entity possibleTarget : entities){
|
||||
// Decides if current entity should be replaced.
|
||||
if(target == null || this.getDistanceToEntity(target) > this.getDistanceToEntity(possibleTarget)){
|
||||
if(target == null || this.getDistance(target) > this.getDistance(possibleTarget)){
|
||||
// Decides if new entity is a valid target.
|
||||
if(WizardryUtilities.isValidTarget(this.getThrower(), possibleTarget)){
|
||||
target = possibleTarget;
|
||||
|
||||
Reference in New Issue
Block a user