diff options
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/MetaTileEntity.java')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/MetaTileEntity.java | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index a017fca2e0..c929bd5677 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -1,7 +1,5 @@ package gregtech.api.metatileentity; -import static gregtech.api.enums.GT_Values.V; - import java.io.File; import java.util.ArrayList; import java.util.List; @@ -45,6 +43,7 @@ import gnu.trove.list.TIntList; import gnu.trove.list.array.TIntArrayList; import gregtech.api.GregTech_API; import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.SoundResource; import gregtech.api.enums.SteamVariant; import gregtech.api.gui.GT_GUIColorOverride; @@ -846,8 +845,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public void setInventorySlotContents(int aIndex, ItemStack aStack) { markDirty(); - if (this instanceof IConfigurationCircuitSupport) { - IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport) this; + if (this instanceof IConfigurationCircuitSupport ccs) { if (ccs.allowSelectCircuit() && aIndex == ccs.getCircuitSlot() && aStack != null) { mInventory[aIndex] = GT_Utility.copyAmount(0, aStack); return; @@ -1090,28 +1088,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public void doExplosion(long aExplosionPower) { - // spotless:off - float tStrength = - aExplosionPower < V[0] ? 1.0F : - aExplosionPower < V[1] ? 2.0F : - aExplosionPower < V[2] ? 3.0F : - aExplosionPower < V[3] ? 4.0F : - aExplosionPower < V[4] ? 5.0F : - aExplosionPower < V[4] * 2 ? 6.0F : - aExplosionPower < V[5] ? 7.0F : - aExplosionPower < V[6] ? 8.0F : - aExplosionPower < V[7] ? 9.0F : - aExplosionPower < V[8] ? 10.0F : - aExplosionPower < V[8] * 2 ? 11.0F : - aExplosionPower < V[9] ? 12.0F : - aExplosionPower < V[10] ? 13.0F : - aExplosionPower < V[11] ? 14.0F : - aExplosionPower < V[12] ? 15.0F : - aExplosionPower < V[12] * 2 ? 16.0F : - aExplosionPower < V[13] ? 17.0F : - aExplosionPower < V[14] ? 18.0F : - aExplosionPower < V[15] ? 19.0F : 20.0F; - // spotless:on + float tStrength = GT_Values.getExplosionPowerForVoltage(aExplosionPower); final int tX = getBaseMetaTileEntity().getXCoord(); final int tY = getBaseMetaTileEntity().getYCoord(); final int tZ = getBaseMetaTileEntity().getZCoord(); @@ -1201,9 +1178,8 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac ForgeDirection.getOrientation(mBaseMetaTileEntity.getFrontFacing()) .name())); - if (this instanceof IPowerChannelState) { + if (this instanceof IPowerChannelState state) { // adapted from PowerStateWailaDataProvider - final IPowerChannelState state = (IPowerChannelState) this; NBTTagCompound tag = accessor.getNBTData(); final boolean isActive = tag.getBoolean("isActive"); final boolean isPowered = tag.getBoolean("isPowered"); @@ -1224,9 +1200,8 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { - if (this instanceof IPowerChannelState) { + if (this instanceof IPowerChannelState state) { // adapted from PowerStateWailaDataProvider - final IPowerChannelState state = (IPowerChannelState) this; final boolean isActive = state.isActive(); final boolean isPowered = state.isPowered(); final boolean isBooting = state.isBooting(); |