mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
automatic formatting
This commit is contained in:
parent
9ba8f797dc
commit
2b37164ed6
@ -31,9 +31,9 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
public int dirUpper;
|
public int dirUpper;
|
||||||
public int dirRedstone;
|
public int dirRedstone;
|
||||||
public int threshold;
|
public int threshold;
|
||||||
|
|
||||||
public static final long usage = 100_000;
|
public static final long usage = 100_000;
|
||||||
|
|
||||||
public TileEntityPADipole() {
|
public TileEntityPADipole() {
|
||||||
super(2);
|
super(2);
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
@Override
|
@Override
|
||||||
public void onEnter(Particle particle, ForgeDirection dir) {
|
public void onEnter(Particle particle, ForgeDirection dir) {
|
||||||
EnumCoilType type = null;
|
EnumCoilType type = null;
|
||||||
|
|
||||||
int mult = 1;
|
int mult = 1;
|
||||||
if(slots[1] != null && slots[1].getItem() == ModItems.pa_coil) {
|
if(slots[1] != null && slots[1].getItem() == ModItems.pa_coil) {
|
||||||
type = EnumUtil.grabEnumSafely(EnumCoilType.class, slots[1].getItemDamage());
|
type = EnumUtil.grabEnumSafely(EnumCoilType.class, slots[1].getItemDamage());
|
||||||
@ -78,9 +78,9 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
if(this.power < this.usage * mult) particle.crash(PAState.CRASH_NOPOWER);
|
if(this.power < this.usage * mult) particle.crash(PAState.CRASH_NOPOWER);
|
||||||
if(type == null) particle.crash(PAState.CRASH_NOCOIL);
|
if(type == null) particle.crash(PAState.CRASH_NOCOIL);
|
||||||
if(type != null && type.diMax < particle.momentum) particle.crash(PAState.CRASH_OVERSPEED);
|
if(type != null && type.diMax < particle.momentum) particle.crash(PAState.CRASH_OVERSPEED);
|
||||||
|
|
||||||
if(particle.invalid) return;
|
if(particle.invalid) return;
|
||||||
|
|
||||||
particle.resetDistance();
|
particle.resetDistance();
|
||||||
this.power -= this.usage * mult;
|
this.power -= this.usage * mult;
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
particle.dir = dir;
|
particle.dir = dir;
|
||||||
return new BlockPos(xCoord, yCoord, zCoord).offset(dir, 2);
|
return new BlockPos(xCoord, yCoord, zCoord).offset(dir, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkRedstone() {
|
public boolean checkRedstone() {
|
||||||
for(DirPos pos : getConPos()) {
|
for(DirPos pos : getConPos()) {
|
||||||
if(worldObj.isBlockIndirectlyGettingPowered(pos.getX(), pos.getY(), pos.getZ())) return true;
|
if(worldObj.isBlockIndirectlyGettingPowered(pos.getX(), pos.getY(), pos.getZ())) return true;
|
||||||
@ -106,11 +106,11 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
|
|
||||||
if(!worldObj.isRemote) {
|
if(!worldObj.isRemote) {
|
||||||
this.power = Library.chargeTEFromItems(slots, 0, power, this.getMaxPower());
|
this.power = Library.chargeTEFromItems(slots, 0, power, this.getMaxPower());
|
||||||
}
|
}
|
||||||
|
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,12 +151,12 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
nbt.setInteger("dirRedstone", dirRedstone);
|
nbt.setInteger("dirRedstone", dirRedstone);
|
||||||
nbt.setInteger("threshold", threshold);
|
nbt.setInteger("threshold", threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
AxisAlignedBB bb = null;
|
AxisAlignedBB bb = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getRenderBoundingBox() {
|
public AxisAlignedBB getRenderBoundingBox() {
|
||||||
|
|
||||||
if(bb == null) {
|
if(bb == null) {
|
||||||
bb = AxisAlignedBB.getBoundingBox(
|
bb = AxisAlignedBB.getBoundingBox(
|
||||||
xCoord - 1,
|
xCoord - 1,
|
||||||
@ -167,10 +167,10 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
zCoord + 2
|
zCoord + 2
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return bb;
|
return bb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public double getMaxRenderDistanceSquared() {
|
public double getMaxRenderDistanceSquared() {
|
||||||
@ -216,10 +216,10 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
if(this.dirLower > 3) this.dirLower -= 4;
|
if(this.dirLower > 3) this.dirLower -= 4;
|
||||||
if(this.dirUpper > 3) this.dirUpper -= 4;
|
if(this.dirUpper > 3) this.dirUpper -= 4;
|
||||||
if(this.dirRedstone > 3) this.dirRedstone -= 4;
|
if(this.dirRedstone > 3) this.dirRedstone -= 4;
|
||||||
|
|
||||||
this.threshold = MathHelper.clamp_int(threshold, 0, 999_999_999);
|
this.threshold = MathHelper.clamp_int(threshold, 0, 999_999_999);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ForgeDirection ditToForgeDir(int dir) {
|
public static ForgeDirection ditToForgeDir(int dir) {
|
||||||
if(dir == 1) return ForgeDirection.EAST;
|
if(dir == 1) return ForgeDirection.EAST;
|
||||||
if(dir == 2) return ForgeDirection.SOUTH;
|
if(dir == 2) return ForgeDirection.SOUTH;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user