1.12 conversion

This commit is contained in:
Corail31
2018-03-09 11:56:31 +01:00
parent edff82acca
commit 489fb82fbd
126 changed files with 1044 additions and 563 deletions
@@ -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;