[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-28 18:41:54 -08:00
1 parent c312069d28
commit 6bdb2c0b96
100 files changed
+3171 -3401

No files matched your search

+11 -6
View File
@@ -30,7 +30,8 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.targetTasks.addTask(
3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
3,
new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
}
@@ -84,13 +85,17 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
@Override
public void attackEntityWithRangedAttack(EntityLivingBase entity, float par2) {
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, entity, 1.6F, (float)
(14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
EntityArrow entityarrow = new EntityArrow(
this.worldObj,
this,
entity,
1.6F,
(float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
int punchLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
entityarrow.setDamage((double) (par2 * 2.0F)
+ this.rand.nextGaussian() * 0.25D
+ (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
entityarrow.setDamage(
(double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D
+ (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
if (powerLevel > 0) {
entityarrow.setDamage(entityarrow.getDamage() + (double) powerLevel * 0.5D + 0.5D);
+16 -14
View File
@@ -1,10 +1,7 @@
package emt.entity;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
@@ -16,9 +13,15 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import thaumcraft.common.Thaumcraft;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
public class EntityEnergyBall extends Entity implements IProjectile, IEntityAdditionalSpawnData {
public static final int RADIUS = 8;
public static final int MAX_TICKS_IN_TILE = 60;
@@ -102,8 +105,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
for (int chX = -chunkSize; chX < chunkSize; chX++) {
for (int chZ = -chunkSize; chZ < chunkSize; chZ++) {
Chunk chunk = worldObj.getChunkFromChunkCoords(
chX + (int) (this.posX / 16), chZ + (int) (this.posZ / 16));
Chunk chunk = worldObj
.getChunkFromChunkCoords(chX + (int) (this.posX / 16), chZ + (int) (this.posZ / 16));
if (chunk.isChunkLoaded && chunk.hasEntities) {
for (int i = 0; i < chunk.entityLists.length; i++) {
@@ -112,8 +115,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
double width = entity.posX - this.posX;
double height = entity.posY - this.posY;
double length = entity.posZ - this.posZ;
double hyp =
MathHelper.sqrt_double((width * width) + (length * length) + (height * height));
double hyp = MathHelper
.sqrt_double((width * width) + (length * length) + (height * height));
if (hyp <= RADIUS) {
entities.add(entity);
@@ -135,8 +138,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
else {
/** Collision detection **/
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3next = Vec3.createVectorHelper(
this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
Vec3 vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition mop = this.worldObj.rayTraceBlocks(vec3, vec3next);
this.ticksInAir++;
@@ -151,9 +154,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
for (this.rotationPitch = (float) (Math.atan2((double) f1, this.motionY) * 180.0D / Math.PI) - 90.0F;
this.rotationPitch - this.prevRotationPitch < -180.0F;
this.prevRotationPitch -= 360.0F) {
for (this.rotationPitch = (float) (Math.atan2((double) f1, this.motionY) * 180.0D / Math.PI)
- 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
;
}
@@ -217,7 +219,7 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setByte("inTile", (byte) (this.inTile ? 1 : 0));
nbt.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
nbt.setTag("direction", this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ }));
}
@Override
+34 -26
View File
@@ -1,9 +1,7 @@
package emt.entity;
import cpw.mods.fml.common.registry.IThrowableEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -17,7 +15,12 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.common.registry.IThrowableEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityLaser extends Entity implements IThrowableEntity, IProjectile {
public Entity shootingEntity;
private Block inTile;
private int xTile;
@@ -99,8 +102,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
if (block.getMaterial() != Material.air) {
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb =
block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block
.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null
&& axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
@@ -109,8 +112,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
}
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb =
block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block
.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null
&& axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
@@ -121,7 +124,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(
this, (int) this.posX, (int) this.posY, (int) this.posZ, explosionStrength, true);
this,
(int) this.posX,
(int) this.posY,
(int) this.posZ,
explosionStrength,
true);
this.setDead();
}
@@ -142,12 +150,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
} else {
++this.ticksInAir;
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3next = Vec3.createVectorHelper(
this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
Vec3 vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec3next, false, true, false);
vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
vec3next = Vec3.createVectorHelper(
this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) {
vec3next = Vec3.createVectorHelper(
@@ -159,9 +167,7 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
this,
this.boundingBox
.addCoord(this.motionX, this.motionY, this.motionZ)
.expand(1.0D, 1.0D, 1.0D));
this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
int l;
float down;
@@ -171,8 +177,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
down = 0.3F;
AxisAlignedBB axisalignedbb1 =
entity1.boundingBox.expand((double) down, (double) down, (double) down);
AxisAlignedBB axisalignedbb1 = entity1.boundingBox
.expand((double) down, (double) down, (double) down);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3next, vec3);
if (movingobjectposition1 != null) {
@@ -190,14 +196,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null
&& movingobjectposition.entityHit != null
if (movingobjectposition != null && movingobjectposition.entityHit != null
&& movingobjectposition.entityHit instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage
|| this.shootingEntity instanceof EntityPlayer
&& !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) {
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer
&& !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) {
movingobjectposition = null;
}
}
@@ -211,7 +215,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(
this, (int) this.posX, (int) this.posY, (int) this.posZ, explosionStrength, true);
this,
(int) this.posX,
(int) this.posY,
(int) this.posZ,
explosionStrength,
true);
this.setDead();
}
} else {
@@ -238,9 +247,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D / Math.PI);
this.rotationPitch - this.prevRotationPitch < -180.0F;
this.prevRotationPitch -= 360.0F)
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D
/ Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
;
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
+4 -2
View File
@@ -1,14 +1,16 @@
package emt.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityShield extends Entity {
public EntityPlayer owner;
public boolean needCheck = true;