diff options
| author | Jason Mitchell <mitchej@gmail.com> | 2023-01-28 19:32:44 -0800 |
|---|---|---|
| committer | Jason Mitchell <mitchej@gmail.com> | 2023-01-28 19:32:44 -0800 |
| commit | 55f64675b42ac8d3c557cc850f78664bee006f6f (patch) | |
| tree | 2afd26dd3d5e6f763119bc192b57c66a1a075922 /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity | |
| parent | 0f5dfd01b877b6a1019e0671b88d07974aae68c0 (diff) | |
| download | GT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.tar.gz GT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.tar.bz2 GT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.zip | |
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity')
50 files changed, 2598 insertions, 3283 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java index a88105f7f6..aae4494f88 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -12,12 +20,6 @@ import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.interfaces.IBaseCustomMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import ic2.api.Direction; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Random; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCustomMetaTileEntity { @@ -76,16 +78,13 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCus } if (this.getUniversalEnergyCapacity() > 0L && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) { - this.doExplosion(this.getOutput() - * (long) - (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() - ? 4 - : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L - ? 2 - : 1))); + this.doExplosion( + this.getOutput() * (long) (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() ? 4 + : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L ? 2 : 1))); GT_Mod arg9999 = GT_Mod.instance; GT_Mod.achievements.issueAchievement( - this.getWorldObj().getPlayerEntityByName(this.getOwnerName()), "electricproblems"); + this.getWorldObj().getPlayerEntityByName(this.getOwnerName()), + "electricproblems"); } } @@ -147,8 +146,7 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCus (double) ((float) this.zCoord + tRandom.nextFloat() * 0.8F + 0.1F), new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); if (tItem.hasTagCompound()) { - tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) - tItem.getTagCompound().copy()); + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); } tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java index b3d8b8aa8c..ba67ba6466 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java @@ -1,10 +1,11 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.metatileentity.BaseCustomTileEntity; import ic2.api.Direction; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class BaseCustomPower_MTE extends BaseCustomTileEntity { @@ -21,8 +22,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { if (mMetaTileEntity == null) { Logger.INFO("Bad Tile"); } - if (this.canAccessData() - && this.mMetaTileEntity.isElectric() + if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.inputEnergyFrom(aSide) && aAmperage > 0L && aVoltage > 0L @@ -37,8 +37,9 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { Logger.INFO("aAmperage: " + aAmperage); Logger.INFO("aVoltage: " + aVoltage); Logger.INFO("this.getStoredEU() < this.getEUCapacity(): " + (this.getStoredEU() < this.getEUCapacity())); - Logger.INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: " - + (this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage())); + Logger.INFO( + "this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: " + + (this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage())); Logger.INFO("this.mMetaTileEntity.maxAmperesIn(): " + (this.mMetaTileEntity.maxAmperesIn())); Logger.INFO("this.mAcceptedAmperes: " + (this.getInputAmperage())); return 0L; @@ -47,13 +48,12 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { Logger.INFO("Draining Energy Units 4"); - if (this.canAccessData() - && this.mMetaTileEntity.isElectric() + if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.outputsEnergyTo(aSide) && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) { if (this.decreaseStoredEU(aVoltage * aAmperage, false)) { - this.mAverageEUOutput[this.mAverageEUOutputIndex] = - (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex] + aVoltage * aAmperage); + this.mAverageEUOutput[this.mAverageEUOutputIndex] = (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex] + + aVoltage * aAmperage); return true; } else { return false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java index 841359c0b2..0060cba12c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; +import java.util.Collection; +import java.util.Iterator; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.modularui.GT_UIInfos; @@ -10,21 +18,16 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; -import java.util.Collection; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank { - public GTPP_MTE_BasicLosslessGenerator( - int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + + public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } - public GTPP_MTE_BasicLosslessGenerator( - int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier, + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } @@ -55,21 +58,11 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank return rTextures; } - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : (aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : (aSide == 0 ? 2 : (aSide == 1 ? 3 : 4))))][ - aColorIndex + 1]; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : (aSide == GT_Utility.getOppositeSide(aFacing) ? 1 + : (aSide == 0 ? 2 : (aSide == 1 ? 3 : 4))))][aColorIndex + 1]; } public String[] getDescription() { @@ -86,23 +79,23 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank } public ITexture[] getFront(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBack(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBottom(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getTop(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getSides(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getFrontActive(byte aColor) { @@ -198,8 +191,10 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); } - this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: " - + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU"); + this.mInventory[this.getStackDisplaySlot()].setStackDisplayName( + "Generating: " + + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + + " EU"); } } else { tFuelValue = this.getFuelValue(this.mFluid); @@ -208,9 +203,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank long tFluidAmountToUse = Math.min( (long) (this.mFluid.amount / tConsumed), (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue); - if (tFluidAmountToUse > 0L - && aBaseMetaTileEntity.increaseStoredEnergyUnits( - tFluidAmountToUse * (long) tFuelValue, true)) { + if (tFluidAmountToUse > 0L && aBaseMetaTileEntity + .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) { PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution()); this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed); } @@ -235,8 +229,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank if (aBaseMetaTileEntity.isServerSide()) { Logger.WARNING("Ticking Servside"); - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() - && aBaseMetaTileEntity.getUniversalEnergyStored() + aBaseMetaTileEntity.setActive( + aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU()); } } @@ -264,15 +258,13 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null && aLiquid.isFluidEqual(tLiquid)) { Logger.WARNING("Fuel Ok"); - return (int) ((long) tFuel.mSpecialValue - * (long) this.getEfficiency() + return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency() * (long) this.consumedFluidPerOperation(tLiquid) / 100L); } if ((tLiquid = tFuel.getRepresentativeFluidInput(0)) != null && aLiquid.isFluidEqual(tLiquid)) { Logger.WARNING("Fuel Ok"); - return (int) ((long) tFuel.mSpecialValue - * (long) this.getEfficiency() + return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency() * (long) this.consumedFluidPerOperation(tLiquid) / 100L); } @@ -288,11 +280,12 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank public int getFuelValue(ItemStack aStack) { if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) { Logger.WARNING("Fuel Item OK"); - GT_Recipe tFuel = this.getRecipes() - .findRecipe( - this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] { - aStack - }); + GT_Recipe tFuel = this.getRecipes().findRecipe( + this.getBaseMetaTileEntity(), + false, + Long.MAX_VALUE, + (FluidStack[]) null, + new ItemStack[] { aStack }); return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.getEfficiency() / 100L) : 0; } else { return 0; @@ -301,13 +294,13 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank public ItemStack getEmptyContainer(ItemStack aStack) { if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) { - GT_Recipe tFuel = this.getRecipes() - .findRecipe( - this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] { - aStack - }); - return tFuel != null - ? GT_Utility.copy(new Object[] {tFuel.getOutput(0)}) + GT_Recipe tFuel = this.getRecipes().findRecipe( + this.getBaseMetaTileEntity(), + false, + Long.MAX_VALUE, + (FluidStack[]) null, + new ItemStack[] { aStack }); + return tFuel != null ? GT_Utility.copy(new Object[] { tFuel.getOutput(0) }) : GT_Utility.getContainerItem(aStack, true); } else { return null; @@ -315,9 +308,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) - && (this.getFuelValue(aStack) > 0 - || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0); + return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (this.getFuelValue(aStack) > 0 + || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0); } public int getCapacity() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java index cb3f42b6f6..2721dc437e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java @@ -2,6 +2,17 @@ package g |
