Run formatter

This commit is contained in:
Nicholas Ignoffo 2017-08-15 21:30:48 -07:00
parent 61c44a831b
commit 08258fd6ef
606 changed files with 13464 additions and 22975 deletions

View file

@ -8,7 +8,8 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.*;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;
@ -16,27 +17,23 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.common.registry.IThrowableEntity;
public class EntityBloodLight extends EntityThrowable implements IThrowableEntity, IEntityAdditionalSpawnData
{
public class EntityBloodLight extends EntityThrowable implements IThrowableEntity, IEntityAdditionalSpawnData {
public EntityLivingBase shootingEntity;
protected int ticksInAir = 0;
protected int maxTicksInAir = 600;
public EntityBloodLight(World world)
{
public EntityBloodLight(World world) {
super(world);
this.setSize(0.5F, 0.5F);
}
public EntityBloodLight(World world, double x, double y, double z)
{
public EntityBloodLight(World world, double x, double y, double z) {
super(world);
this.setSize(0.5F, 0.5F);
this.setPosition(x, y, z);
}
public EntityBloodLight(World world, EntityLivingBase player)
{
public EntityBloodLight(World world, EntityLivingBase player) {
super(world, player);
shootingEntity = player;
float par3 = 0.8F;
@ -53,14 +50,12 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit
}
@Override
protected float getGravityVelocity()
{
protected float getGravityVelocity() {
return 0F;
}
@Override
public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8)
{
public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) {
float var9 = MathHelper.sqrt(var1 * var1 + var3 * var3 + var5 * var5);
var1 /= var9;
var3 /= var9;
@ -80,33 +75,26 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit
}
@Override
public void onUpdate()
{
public void onUpdate() {
super.onUpdate();
if (this.ticksExisted > this.maxTicksInAir)
{
if (this.ticksExisted > this.maxTicksInAir) {
setDead();
}
}
@Override
protected void onImpact(RayTraceResult mop)
{
if (mop.typeOfHit == RayTraceResult.Type.ENTITY && mop.entityHit != null)
{
if (mop.entityHit == shootingEntity)
{
protected void onImpact(RayTraceResult mop) {
if (mop.typeOfHit == RayTraceResult.Type.ENTITY && mop.entityHit != null) {
if (mop.entityHit == shootingEntity) {
return;
}
this.onImpact(mop.entityHit);
} else if (mop.typeOfHit == RayTraceResult.Type.BLOCK)
{
} else if (mop.typeOfHit == RayTraceResult.Type.BLOCK) {
EnumFacing sideHit = mop.sideHit;
BlockPos blockPos = mop.getBlockPos().offset(sideHit);
if (getEntityWorld().isAirBlock(blockPos))
{
if (getEntityWorld().isAirBlock(blockPos)) {
getEntityWorld().setBlockState(blockPos, RegistrarBloodMagicBlocks.BLOOD_LIGHT.getDefaultState());
}
}
@ -114,23 +102,18 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit
this.setDead();
}
protected void onImpact(Entity mop)
{
if (mop == shootingEntity && ticksInAir > 3)
{
protected void onImpact(Entity mop) {
if (mop == shootingEntity && ticksInAir > 3) {
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
} else
{
if (mop instanceof EntityLivingBase)
{
} else {
if (mop instanceof EntityLivingBase) {
((EntityLivingBase) mop).setRevengeTarget(shootingEntity);
doDamage(1, mop);
}
}
if (getEntityWorld().isAirBlock(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ)))
{
if (getEntityWorld().isAirBlock(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ))) {
getEntityWorld().setBlockState(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ), Blocks.FIRE.getDefaultState());
}
@ -138,59 +121,50 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit
this.setDead();
}
protected void doDamage(int i, Entity mop)
{
protected void doDamage(int i, Entity mop) {
mop.attackEntityFrom(this.getDamageSource(), i);
}
public DamageSource getDamageSource()
{
public DamageSource getDamageSource() {
return DamageSource.causeMobDamage(shootingEntity);
}
@Override
public void writeSpawnData(ByteBuf data)
{
public void writeSpawnData(ByteBuf data) {
data.writeByte(this.ticksInAir);
}
@Override
public void readSpawnData(ByteBuf data)
{
public void readSpawnData(ByteBuf data) {
this.ticksInAir = data.readByte();
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt)
{
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setInteger(Constants.NBT.PROJECTILE_TICKS_IN_AIR, ticksInAir);
nbt.setInteger(Constants.NBT.PROJECTILE_MAX_TICKS_IN_AIR, maxTicksInAir);
}
@Override
public void readEntityFromNBT(NBTTagCompound nbt)
{
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
ticksInAir = nbt.getInteger(Constants.NBT.PROJECTILE_TICKS_IN_AIR);
maxTicksInAir = nbt.getInteger(Constants.NBT.PROJECTILE_MAX_TICKS_IN_AIR);
}
@Override
protected boolean canTriggerWalking()
{
protected boolean canTriggerWalking() {
return false;
}
@Override
public boolean canBeCollidedWith()
{
public boolean canBeCollidedWith() {
return false;
}
@Override
public void setThrower(Entity entity)
{
public void setThrower(Entity entity) {
if (entity instanceof EntityLivingBase)
this.shootingEntity = (EntityLivingBase) entity;
}