From 8ac58626bd4caa9e49f58acc6b97ac031f6c2107 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Mon, 10 Apr 2023 17:49:16 +0100 Subject: Update spotless config to 0.2.2 --- .../common/items/behaviors/Behaviour_Arrow.java | 48 +++++----- .../items/behaviors/Behaviour_Arrow_Potion.java | 16 ++-- .../items/behaviors/Behaviour_Cover_Tool.java | 65 +++++++------ .../common/items/behaviors/Behaviour_Crowbar.java | 2 +- .../items/behaviors/Behaviour_DataStick.java | 4 +- .../common/items/behaviors/Behaviour_Hoe.java | 19 ++-- .../common/items/behaviors/Behaviour_Lighter.java | 39 ++++---- .../common/items/behaviors/Behaviour_None.java | 10 +- .../behaviors/Behaviour_Plunger_Essentia.java | 15 ++- .../items/behaviors/Behaviour_Plunger_Fluid.java | 33 +++---- .../items/behaviors/Behaviour_Plunger_Item.java | 46 +++++---- .../items/behaviors/Behaviour_Prospecting.java | 75 +++++++-------- .../common/items/behaviors/Behaviour_Scanner.java | 13 ++- .../common/items/behaviors/Behaviour_Scoop.java | 33 ++++--- .../items/behaviors/Behaviour_Screwdriver.java | 2 +- .../common/items/behaviors/Behaviour_Sense.java | 13 ++- .../items/behaviors/Behaviour_SensorKit.java | 8 +- .../items/behaviors/Behaviour_SoftHammer.java | 105 ++++++--------------- .../items/behaviors/Behaviour_Sonictron.java | 14 +-- .../items/behaviors/Behaviour_Spray_Color.java | 48 +++++----- .../items/behaviors/Behaviour_Switch_Metadata.java | 2 +- .../common/items/behaviors/Behaviour_Wrench.java | 77 ++++++++------- .../items/behaviors/Behaviour_WrittenBook.java | 6 +- 23 files changed, 310 insertions(+), 383 deletions(-) (limited to 'src/main/java/gregtech/common/items/behaviors') diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java index 7c03965cc0..8005009d14 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java @@ -33,7 +33,7 @@ public class Behaviour_Arrow extends Behaviour_None { } public Behaviour_Arrow(Class aArrow, float aSpeed, float aPrecision, - Enchantment aEnchantment, int aLevel) { + Enchantment aEnchantment, int aLevel) { this.mArrow = aArrow; this.mSpeedMultiplier = aSpeed; this.mPrecision = aPrecision; @@ -81,20 +81,20 @@ public class Behaviour_Arrow extends Behaviour_None { IPosition tPosition = BlockDispenser.func_149939_a(aSource); EnumFacing tFacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); GT_Entity_Arrow tEntityArrow = (GT_Entity_Arrow) getProjectile( - aItem, - SubTag.PROJECTILE_ARROW, - aStack, - aWorld, - tPosition.getX(), - tPosition.getY(), - tPosition.getZ()); + aItem, + SubTag.PROJECTILE_ARROW, + aStack, + aWorld, + tPosition.getX(), + tPosition.getY(), + tPosition.getZ()); if (tEntityArrow != null) { tEntityArrow.setThrowableHeading( - tFacing.getFrontOffsetX(), - tFacing.getFrontOffsetY() + 0.1F, - tFacing.getFrontOffsetZ(), - this.mSpeedMultiplier * 1.1F, - this.mPrecision); + tFacing.getFrontOffsetX(), + tFacing.getFrontOffsetY() + 0.1F, + tFacing.getFrontOffsetZ(), + this.mSpeedMultiplier * 1.1F, + this.mPrecision); tEntityArrow.setArrowItem(aStack); tEntityArrow.canBePickedUp = 1; aWorld.spawnEntityInWorld(tEntityArrow); @@ -113,32 +113,28 @@ public class Behaviour_Arrow extends Behaviour_None { @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, - double aX, double aY, double aZ) { + double aX, double aY, double aZ) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; } - GT_Entity_Arrow rArrow = (GT_Entity_Arrow) GT_Utility.callConstructor( - this.mArrow.getName(), - -1, - null, - true, - new Object[] { aWorld, aX, aY, aZ }); + GT_Entity_Arrow rArrow = (GT_Entity_Arrow) GT_Utility + .callConstructor(this.mArrow.getName(), -1, null, true, new Object[] { aWorld, aX, aY, aZ }); rArrow.setArrowItem(aStack); return rArrow; } @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, - EntityLivingBase aEntity, float aSpeed) { + EntityLivingBase aEntity, float aSpeed) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; } GT_Entity_Arrow rArrow = (GT_Entity_Arrow) GT_Utility.callConstructor( - this.mArrow.getName(), - -1, - null, - true, - new Object[] { aWorld, aEntity, this.mSpeedMultiplier * aSpeed }); + this.mArrow.getName(), + -1, + null, + true, + new Object[] { aWorld, aEntity, this.mSpeedMultiplier * aSpeed }); rArrow.setArrowItem(aStack); return rArrow; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java index 4397429018..3643de7b77 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java @@ -23,7 +23,7 @@ public class Behaviour_Arrow_Potion extends Behaviour_Arrow { } public Behaviour_Arrow_Potion(float aSpeed, float aPrecision, Enchantment aEnchantment, int aLevel, - int... aPotions) { + int... aPotions) { super(GT_Entity_Arrow_Potion.class, aSpeed, aPrecision, aEnchantment, aLevel); this.mPotions = aPotions; } @@ -34,11 +34,11 @@ public class Behaviour_Arrow_Potion extends Behaviour_Arrow { for (int i = 3; i < this.mPotions.length; i += 4) { if (aEntity.worldObj.rand.nextInt(100) < this.mPotions[i]) { ((EntityLivingBase) aEntity).addPotionEffect( - new PotionEffect( - this.mPotions[(i - 3)], - this.mPotions[(i - 2)], - this.mPotions[(i - 1)], - false)); + new PotionEffect( + this.mPotions[(i - 3)], + this.mPotions[(i - 2)], + this.mPotions[(i - 1)], + false)); } } } @@ -47,7 +47,7 @@ public class Behaviour_Arrow_Potion extends Behaviour_Arrow { @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, - double aX, double aY, double aZ) { + double aX, double aY, double aZ) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; } @@ -59,7 +59,7 @@ public class Behaviour_Arrow_Potion extends Behaviour_Arrow { @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, - EntityLivingBase aEntity, float aSpeed) { + EntityLivingBase aEntity, float aSpeed) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java index d0c589c09f..d0f5582549 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java @@ -23,16 +23,15 @@ import gregtech.api.util.*; public class Behaviour_Cover_Tool extends Behaviour_None { public static final IItemBehaviour INSTANCE = new Behaviour_Cover_Tool(); - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.cover_copy_paste", - "Can copy/paste cover data."); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.cover_copy_paste", "Can copy/paste cover data."); private ISerializableObject mStoredData = GregTech_API.sNoBehavior.createDataObject(); private int mCoverType; @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } @@ -86,41 +85,41 @@ public class Behaviour_Cover_Tool extends Behaviour_None { @SuppressWarnings({ "unchecked", "rawtypes" }) private void doCopy(TileEntity aTileEntity, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, - float hitZ, List aList) { + float hitZ, List aList) { aList.add( - "----- X: " + EnumChatFormatting.AQUA - + GT_Utility.formatNumbers(aX) - + EnumChatFormatting.RESET - + " Y: " - + EnumChatFormatting.AQUA - + GT_Utility.formatNumbers(aY) - + EnumChatFormatting.RESET - + " Z: " - + EnumChatFormatting.AQUA - + GT_Utility.formatNumbers(aZ) - + EnumChatFormatting.RESET - + " D: " - + EnumChatFormatting.AQUA - + aWorld.provider.dimensionId - + EnumChatFormatting.RESET - + " -----"); + "----- X: " + EnumChatFormatting.AQUA + + GT_Utility.formatNumbers(aX) + + EnumChatFormatting.RESET + + " Y: " + + EnumChatFormatting.AQUA + + GT_Utility.formatNumbers(aY) + + EnumChatFormatting.RESET + + " Z: " + + EnumChatFormatting.AQUA + + GT_Utility.formatNumbers(aZ) + + EnumChatFormatting.RESET + + " D: " + + EnumChatFormatting.AQUA + + aWorld.provider.dimensionId + + EnumChatFormatting.RESET + + " -----"); if (aTileEntity instanceof ICoverable tCoverable) { int tSide = tCoverable.getCoverItemAtSide((byte) aSide) != null ? aSide - : tCoverable.getCoverItemAtSide(GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ)) - != null ? GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ) : -1; + : tCoverable.getCoverItemAtSide(GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ)) + != null ? GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ) : -1; if (tSide != -1) { mStoredData = tCoverable.getComplexCoverDataAtSide((byte) tSide); mCoverType = tCoverable.getCoverIDAtSide((byte) tSide); aList.add( - "Block Side: " + EnumChatFormatting.AQUA - + ForgeDirection.getOrientation(tSide) - .name() - + EnumChatFormatting.RESET); + "Block Side: " + EnumChatFormatting.AQUA + + ForgeDirection.getOrientation(tSide) + .name() + + EnumChatFormatting.RESET); aList.add( - "Cover Type: " + EnumChatFormatting.GREEN - + tCoverable.getCoverItemAtSide((byte) tSide) - .getDisplayName() - + EnumChatFormatting.RESET); + "Cover Type: " + EnumChatFormatting.GREEN + + tCoverable.getCoverItemAtSide((byte) tSide) + .getDisplayName() + + EnumChatFormatting.RESET); } else { mStoredData = GregTech_API.sNoBehavior.createDataObject(); mCoverType = 0; @@ -140,8 +139,8 @@ public class Behaviour_Cover_Tool extends Behaviour_None { return; } int tSide = tCoverable.getCoverItemAtSide((byte) aSide) != null ? aSide - : tCoverable.getCoverItemAtSide(GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ)) - != null ? GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ) : -1; + : tCoverable.getCoverItemAtSide(GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ)) + != null ? GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ) : -1; if (tSide != -1) { int tCoverID = tCoverable.getCoverIDAtSide((byte) tSide); if (tCoverID == mCoverType) { diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java index 4d8ecb2f41..76bc0615c1 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java @@ -25,7 +25,7 @@ public class Behaviour_Crowbar extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java index 8b876a5b44..13e6622b47 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java @@ -33,7 +33,7 @@ public class Behaviour_DataStick extends Behaviour_None { } } short sTier = GT_Utility.ItemNBT.getNBT(aStack) - .getShort("rocket_tier"); + .getShort("rocket_tier"); if (sTier > 0 && sTier < 100) { aList.add("Rocket Schematic Tier: " + sTier); } else if (sTier >= 100) { @@ -50,7 +50,7 @@ public class Behaviour_DataStick extends Behaviour_None { } } long lastUpdate = GT_Utility.ItemNBT.getNBT(aStack) - .getLong("lastUpdate"); + .getLong("lastUpdate"); if (lastUpdate != 0) aList.add(String.format("Last update at: %tc", lastUpdate)); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java index a66cba699d..0d8e26ac66 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java @@ -28,7 +28,7 @@ public class Behaviour_Hoe extends Behaviour_None { @Override public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (!aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) { return false; } @@ -44,15 +44,14 @@ public class Behaviour_Hoe extends Behaviour_None { } Block aBlock = aWorld.getBlock(aX, aY, aZ); if ((aSide != 0) && (GT_Utility.isBlockAir(aWorld, aX, aY + 1, aZ)) - && ((aBlock == Blocks.grass) || (aBlock == Blocks.dirt))) { - new WorldSpawnedEventBuilder.SoundEventBuilder().setVolume( - (Blocks.farmland.stepSound.getVolume() + 1.0F) / 2.0F) - .setPitch(Blocks.farmland.stepSound.getPitch() * 0.8F) - .setIdentifier( - Blocks.farmland.stepSound.getStepResourcePath()) - .setPosition(aX + 0.5F, aY + 0.5F, aZ + 0.5F) - .setWorld(aWorld) - .run(); + && ((aBlock == Blocks.grass) || (aBlock == Blocks.dirt))) { + new WorldSpawnedEventBuilder.SoundEventBuilder() + .setVolume((Blocks.farmland.stepSound.getVolume() + 1.0F) / 2.0F) + .setPitch(Blocks.farmland.stepSound.getPitch() * 0.8F) + .setIdentifier(Blocks.farmland.stepSound.getStepResourcePath()) + .setPosition(aX + 0.5F, aY + 0.5F, aZ + 0.5F) + .setWorld(aWorld) + .run(); if (aWorld.isRemote) { return true; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java index 1e232d4988..d348f3eed4 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java @@ -24,18 +24,15 @@ public class Behaviour_Lighter extends Behaviour_None { private final ItemStack mUsedLighter; private final ItemStack mFullLighter; private final long mFuelAmount; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.lighter.tooltip", - "Can light things on Fire"); - private final String mTooltipUses = GT_LanguageManager.addStringLocalization( - "gt.behaviour.lighter.uses", - "Remaining Uses:"); - private final String mTooltipUnstackable = GT_LanguageManager.addStringLocalization( - "gt.behaviour.unstackable", - "Not usable when stacked!"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); + private final String mTooltipUses = GT_LanguageManager + .addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); + private final String mTooltipUnstackable = GT_LanguageManager + .addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); public Behaviour_Lighter(ItemStack aEmptyLighter, ItemStack aUsedLighter, ItemStack aFullLighter, - long aFuelAmount) { + long aFuelAmount) { this.mFullLighter = aFullLighter; this.mUsedLighter = aUsedLighter; this.mEmptyLighter = aEmptyLighter; @@ -53,13 +50,13 @@ public class Behaviour_Lighter extends Behaviour_None { long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack); if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) { GT_Utility.sendSoundToPlayers( - aPlayer.worldObj, - SoundResource.FIRE_IGNITE, - 1.0F, - 1.0F, - MathHelper.floor_double(aEntity.posX), - MathHelper.floor_double(aEntity.posY), - MathHelper.floor_double(aEntity.posZ)); + aPlayer.worldObj, + SoundResource.FIRE_IGNITE, + 1.0F, + 1.0F, + MathHelper.floor_double(aEntity.posX), + MathHelper.floor_double(aEntity.posY), + MathHelper.floor_double(aEntity.posZ)); ((EntityCreeper) aEntity).func_146079_cb(); if (!aPlayer.capabilities.isCreativeMode) { tFuelAmount -= 1L; @@ -76,13 +73,13 @@ public class Behaviour_Lighter extends Behaviour_None { @Override public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { return false; } @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if ((aWorld.isRemote) || (aStack.stackSize != 1)) { return false; } @@ -134,8 +131,8 @@ public class Behaviour_Lighter extends Behaviour_None { aList.add(this.mTooltip); NBTTagCompound tNBT = aStack.getTagCompound(); long tFuelAmount = tNBT == null ? this.mFuelAmount - : GT_Utility.areStacksEqual(aStack, this.mFullLighter, true) ? this.mFuelAmount - : tNBT.getLong("GT.LighterFuel"); + : GT_Utility.areStacksEqual(aStack, this.mFullLighter, true) ? this.mFuelAmount + : tNBT.getLong("GT.LighterFuel"); aList.add(this.mTooltipUses + " " + tFuelAmount); aList.add(this.mTooltipUnstackable); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java index ca6a1e8466..6928222af1 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java @@ -28,13 +28,13 @@ public class Behaviour_None implements IItemBehaviour { @Override public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { return false; } @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { return false; } @@ -50,7 +50,7 @@ public class Behaviour_None implements IItemBehaviour { @Override public void onUpdate(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, - boolean aIsInHand) {} + boolean aIsInHand) {} @Override public boolean isItemStackUsable(GT_MetaBase_Item aItem, ItemStack aStack) { @@ -78,13 +78,13 @@ public class Behaviour_None implements IItemBehaviour { @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, - double aX, double aY, double aZ) { + double aX, double aY, double aZ) { return null; } @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, - EntityLivingBase aEntity, float aSpeed) { + EntityLivingBase aEntity, float aSpeed) { return null; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java index 0023511846..16c1f1dec1 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java @@ -18,9 +18,8 @@ import gregtech.api.util.GT_Utility; public class Behaviour_Plunger_Essentia extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.plunger.essentia", - "Clears Essentia from Containers and Tubes"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.plunger.essentia", "Clears Essentia from Containers and Tubes"); public Behaviour_Plunger_Essentia(int aCosts) { this.mCosts = aCosts; @@ -28,19 +27,19 @@ public class Behaviour_Plunger_Essentia extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (((aTileEntity instanceof IEssentiaTransport)) && ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); for (ForgeDirection tDirection : ForgeDirection.VALID_DIRECTIONS) { ((IEssentiaTransport) aTileEntity).takeEssentia( - ((IEssentiaTransport) aTileEntity).getEssentiaType(tDirection), - ((IEssentiaTransport) aTileEntity).getEssentiaAmount(tDirection), - tDirection); + ((IEssentiaTransport) aTileEntity).getEssentiaType(tDirection), + ((IEssentiaTransport) aTileEntity).getEssentiaAmount(tDirection), + tDirection); } return true; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java index cf5b782200..95e895ba91 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java @@ -21,9 +21,8 @@ import gregtech.api.util.GT_Utility; public class Behaviour_Plunger_Fluid extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.plunger.fluid", - "Clears 1000 Liters of Fluid from Tanks"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.plunger.fluid", "Clears 1000 Liters of Fluid from Tanks"); public Behaviour_Plunger_Fluid(int aCosts) { this.mCosts = aCosts; @@ -31,7 +30,7 @@ public class Behaviour_Plunger_Fluid extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } @@ -40,16 +39,16 @@ public class Behaviour_Plunger_Fluid extends Behaviour_None { for (ForgeDirection tDirection : ForgeDirection.VALID_DIRECTIONS) { if (((IFluidHandler) aTileEntity).drain(tDirection, 1000, false) != null) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { ((IFluidHandler) aTileEntity).drain(tDirection, 1000, true); GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + aWorld, + SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, + 1.0F, + -1.0F, + aX, + aY, + aZ); return true; } } @@ -60,14 +59,8 @@ public class Behaviour_Plunger_Fluid extends Behaviour_None { if (mTileEntity instanceof GT_MetaTileEntity_BasicTank machine) { if (machine.mFluid != null && machine.mFluid.amount > 0) machine.mFluid.amount = machine.mFluid.amount - Math.min(machine.mFluid.amount, 1000); - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); return true; } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java index e4f0c3012d..41df9d6e95 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java @@ -21,9 +21,8 @@ import gregtech.api.util.GT_Utility; public class Behaviour_Plunger_Item extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.plunger.item", - "Clears Items from Pipes"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.plunger.item", "Clears Items from Pipes"); public Behaviour_Plunger_Item(int aCosts) { this.mCosts = aCosts; @@ -31,7 +30,7 @@ public class Behaviour_Plunger_Item extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } @@ -39,39 +38,36 @@ public class Behaviour_Plunger_Item extends Behaviour_None { if ((aTileEntity instanceof IGregTechTileEntity)) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aTileEntity).getMetaTileEntity(); if ((tMetaTileEntity instanceof IMetaTileEntityItemPipe)) { - for (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending( - IMetaTileEntityItemPipe.Util.scanPipes( - (IMetaTileEntityItemPipe) tMetaTileEntity, - new HashMap<>(), - 0L, - false, - true)) - .keySet()) { + for (IMetaTileEntityItemPipe tTileEntity : GT_Utility + .sortMapByValuesAcending( + IMetaTileEntityItemPipe.Util + .scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, new HashMap<>(), 0L, false, true)) + .keySet()) { int i = 0; for (int j = tTileEntity.getSizeInventory(); i < j; i++) { if (tTileEntity.isValidSlot(i)) { if ((tTileEntity.getStackInSlot(i) != null) && ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { ItemStack tStack = tTileEntity.decrStackSize(i, 64); if (tStack != null) { EntityItem tEntity = new EntityItem( - aWorld, - ((IGregTechTileEntity) aTileEntity).getOffsetX((byte) aSide, 1) + 0.5D, - ((IGregTechTileEntity) aTileEntity).getOffsetY((byte) aSide, 1) + 0.5D, - ((IGregTechTileEntity) aTileEntity).getOffsetZ((byte) aSide, 1) + 0.5D, - tStack); + aWorld, + ((IGregTechTileEntity) aTileEntity).getOffsetX((byte) aSide, 1) + 0.5D, + ((IGregTechTileEntity) aTileEntity).getOffsetY((byte) aSide, 1) + 0.5D, + ((IGregTechTileEntity) aTileEntity).getOffsetZ((byte) aSide, 1) + 0.5D, + tStack); tEntity.motionX = 0.0D; tEntity.motionY = 0.0D; tEntity.motionZ = 0.0D; aWorld.spawnEntityInWorld(tEntity); GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + aWorld, + SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java index c007473df1..43a35cff05 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java @@ -31,9 +31,8 @@ public class Behaviour_Prospecting extends Behaviour_None { private final int mVanillaCosts; private final int mEUCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.prospecting", - "Usable for Prospecting"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting"); public Behaviour_Prospecting(int aVanillaCosts, int aEUCosts) { this.mVanillaCosts = aVanillaCosts; @@ -42,7 +41,7 @@ public class Behaviour_Prospecting extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } @@ -54,26 +53,26 @@ public class Behaviour_Prospecting extends Behaviour_None { ItemData tAssociation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta)); if (tAssociation != null && tAssociation.mPrefix != null - && tAssociation.mMaterial != null - && tAssociation.mPrefix.toString() - .startsWith("ore")) { + && tAssociation.mMaterial != null + && tAssociation.mPrefix.toString() + .startsWith("ore")) { GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("100", "This is ") + tAssociation.mMaterial.mMaterial.mDefaultLocalName - + GT_Utility.trans("101", " Ore.")); + aPlayer, + GT_Utility.trans("100", "This is ") + tAssociation.mMaterial.mMaterial.mDefaultLocalName + + GT_Utility.trans("101", " Ore.")); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ); return true; } if (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) - || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack) - || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone) - || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockStones) - || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) - || aBlock == GregTech_API.sBlockOresUb1 - || aBlock == GregTech_API.sBlockOresUb2 - || aBlock == GregTech_API.sBlockOresUb3 - || aBlock == GregTech_API.sBlockOres1) { + || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack) + || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone) + || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockStones) + || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) + || aBlock == GregTech_API.sBlockOresUb1 + || aBlock == GregTech_API.sBlockOresUb2 + || aBlock == GregTech_API.sBlockOresUb3 + || aBlock == GregTech_API.sBlockOres1) { if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ); int tMetaID; @@ -87,27 +86,25 @@ public class Behaviour_Prospecting extends Behaviour_None { tBlock = aWorld.getBlock(tX, tY, tZ); if (tBlock == Blocks.lava || tBlock == Blocks.flowing_lava) { - GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("102", "There is Lava behind this Rock.")); + GT_Utility + .sendChatToPlayer(aPlayer, GT_Utility.trans("102", "There is Lava behind this Rock.")); break; } if (tBlock instanceof BlockLiquid || tBlock instanceof IFluidBlock) { - GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("103", "There is a Liquid behind this Rock.")); + GT_Utility + .sendChatToPlayer(aPlayer, GT_Utility.trans("103", "There is a Liquid behind this Rock.")); break; } if (tBlock == Blocks.monster_egg || !GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ)) { GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("104", "There is an Air Pocket behind this Rock.")); + aPlayer, + GT_Utility.trans("104", "There is an Air Pocket behind this Rock.")); break; } if (tBlock != aBlock) { if (i < 4) GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("105", "Material is changing behind this Rock.")); + aPlayer, + GT_Utility.trans("105", "Material is changing behind this Rock.")); break; } } @@ -122,12 +119,12 @@ public class Behaviour_Prospecting extends Behaviour_None { TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ); if (tTileEntity instanceof GT_TileEntity_Ores) { Materials tMaterial = GregTech_API.sGeneratedMaterials[((GT_TileEntity_Ores) tTileEntity).mMetaData - % 1000]; + % 1000]; if (tMaterial != null && tMaterial != Materials._NULL) { GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("106", "Found traces of ") + tMaterial.mDefaultLocalName - + GT_Utility.trans("101", " Ore.")); + aPlayer, + GT_Utility.trans("106", "Found traces of ") + tMaterial.mDefaultLocalName + + GT_Utility.trans("101", " Ore.")); return true; } } @@ -135,14 +132,14 @@ public class Behaviour_Prospecting extends Behaviour_None { tMetaID = aWorld.getBlockMetadata(tX, tY, tZ); tAssociation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); if (tAssociation != null && tAssociation.mPrefix != null - && tAssociation.mMaterial != null - && tAssociation.mPrefix.toString() - .startsWith("ore")) { + && tAssociation.mMaterial != null + && tAssociation.mPrefix.toString() + .startsWith("ore")) { GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("106", "Found traces of ") - + tAssociation.mMaterial.mMaterial.mDefaultLocalName - + GT_Utility.trans("101", " Ore.")); + aPlayer, + GT_Utility.trans("106", "Found traces of ") + + tAssociation.mMaterial.mMaterial.mDefaultLocalName + + GT_Utility.trans("101", " Ore.")); return true; } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java index d82585184d..c041e02881 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java @@ -19,20 +19,19 @@ import gregtech.api.util.GT_Utility; public class Behaviour_Scanner extends Behaviour_None { public static final IItemBehaviour INSTANCE = new Behaviour_Scanner(); - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.scanning", - "Can scan Blocks in World"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.scanning", "Can scan Blocks in World"); @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { NBTTagCompound tNBT = aStack.getTagCompound(); if (((aPlayer instanceof EntityPlayerMP)) && (aItem.canUse(aStack, 20000.0D))) { ArrayList tList = new ArrayList<>(); if (aItem.use( - aStack, - GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ), - aPlayer)) { + aStack, + GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ), + aPlayer)) { int tList_sS = tList.size(); tNBT.setInteger("dataLinesCount", tList_sS); for (int i = 0; i < tList_sS; i++) { diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java index 6bb687a5a8..65be65a96d 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java @@ -17,9 +17,8 @@ import gregtech.api.util.GT_LanguageManager; public class Behaviour_Scoop extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.scoop", - "Catches Butterflies on Leftclick"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.scoop", "Catches Butterflies on Leftclick"); public Behaviour_Scoop(int aCosts) { this.mCosts = aCosts; @@ -32,23 +31,23 @@ public class Behaviour_Scoop extends Behaviour_None { return true; } if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { IButterfly tButterfly = ((IEntityButterfly) aEntity).getButterfly(); tButterfly.getGenome() - .getPrimary() - .getRoot() - .getBreedingTracker(aEntity.worldObj, aPlayer.getGameProfile()) - .registerCatch(tButterfly); + .getPrimary() + .getRoot() + .getBreedingTracker(aEntity.worldObj, aPlayer.getGameProfile()) + .registerCatch(tButterfly); aPlayer.worldObj.spawnEntityInWorld( - new EntityItem( - aPlayer.worldObj, - aEntity.posX, - aEntity.posY, - aEntity.posZ, - tButterfly.getGenome() - .getPrimary() - .getRoot() - .getMemberStack(tButterfly.copy(), EnumFlutterType.BUTTERFLY.ordinal()))); + new EntityItem( + aPlayer.worldObj, + aEntity.posX, + aEntity.posY, + aEntity.posZ, + tButterfly.getGenome() + .getPrimary() + .getRoot() + .getMemberStack(tButterfly.copy(), EnumFlutterType.BUTTERFLY.ordinal()))); aEntity.setDead(); } return true; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java index e2fa9d8f71..3e15849e3f 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java @@ -23,7 +23,7 @@ public class Behaviour_Screwdriver extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java index 949b57e581..8adcc8a59d 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java @@ -15,9 +15,8 @@ import ic2.api.crops.ICropTile; public class Behaviour_Sense extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.sense", - "Rightclick to harvest Crop Sticks"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.sense", "Rightclick to harvest Crop Sticks"); public Behaviour_Sense(int aCosts) { this.mCosts = aCosts; @@ -25,7 +24,7 @@ public class Behaviour_Sense extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } @@ -35,9 +34,9 @@ public class Behaviour_Sense extends Behaviour_None { for (int j = -2; j < 3; j++) { for (int k = -2; k < 3; k++) { if ((aStack.stackSize > 0) - && (((tTileEntity = aWorld.getTileEntity(aX + i, aY + j, aZ + k)) instanceof ICropTile)) - && (((ICropTile) tTileEntity).harvest(true)) - && (!aPlayer.capabilities.isCreativeMode)) { + && (((tTileEntity = aWorld.getTileEntity(aX + i, aY + j, aZ + k)) instanceof ICropTile)) + && (((ICropTile) tTileEntity).harvest(true)) + && (!aPlayer.capabilities.isCreativeMode)) { ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts / 20); } } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java index 62ceebd365..7362621df9 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java @@ -19,19 +19,19 @@ import gregtech.api.util.GT_Utility; public class Behaviour_SensorKit extends Behaviour_None { private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.sensorkit.tooltip", - "Used to display Information using the Mod Nuclear Control"); + "gt.behaviour.sensorkit.tooltip", + "Used to display Information using the Mod Nuclear Control"); @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if ((aPlayer instanceof EntityPlayerMP)) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (((tTileEntity instanceof IInventory)) && (!((IInventory) tTileEntity).isUseableByPlayer(aPlayer))) { return false; } if (((tTileEntity instanceof IGregTechDeviceInformation)) - && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { + && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { GT_Utility.setStack(aStack, ItemList.NC_SensorCard.get(aStack.stackSize)); NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT == null) { diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java index 75f3afb4fc..7f529282dd 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java @@ -17,9 +17,8 @@ import gregtech.api.util.GT_Utility; public class Behaviour_SoftHammer extends Behaviour_None { private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.softhammer", - "Activates and Deactivates Machines"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.softhammer", "Activates and Deactivates Machines"); public Behaviour_SoftHammer(int aCosts) { this.mCosts = aCosts; @@ -27,7 +26,7 @@ public class Behaviour_SoftHammer extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; } @@ -38,127 +37,85 @@ public class Behaviour_SoftHammer extends Behaviour_None { byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ); if (aBlock == Blocks.lit_redstone_lamp) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, Blocks.redstone_lamp, 0, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.redstone_lamp) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.golden_rail) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 8) % 16, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.activator_rail) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 8) % 16, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3); } return true; } if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) - || (aBlock == Blocks.dispenser) - || (aBlock == Blocks.dropper)) { + || (aBlock == Blocks.dispenser) + || (aBlock == Blocks.dropper)) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6, 3); - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) - || (aBlock == Blocks.furnace) - || (aBlock == Blocks.lit_furnace) - || (aBlock == Blocks.chest) - || (aBlock == Blocks.trapped_chest)) { + || (aBlock == Blocks.furnace) + || (aBlock == Blocks.lit_furnace) + || (aBlock == Blocks.chest) + || (aBlock == Blocks.trapped_chest)) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta - 1) % 4 + 2, 3); - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.hopper) { if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6 != 1 ? (aMeta + 1) % 6 : 2, 3); - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ); } return true; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java index a191d97209..02413bf143 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java @@ -99,7 +99,7 @@ public class Behaviour_Sonictron extends Behaviour_None { @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { setCurrentIndex(aStack, -1); return false; } @@ -112,17 +112,17 @@ public class Behaviour_Sonictron extends Behaviour_None { @Override public void onUpdate(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, - boolean aIsInHand) { + boolean aIsInHand) { int tTickTimer = getTickTimer(aStack); int tCurrentIndex = getCurrentIndex(aStack); if ((tTickTimer++ % 2 == 0) && (tCurrentIndex > -1)) { ItemStack[] tInventory = getNBTInventory(aStack); GT_Values.GT.doSonictronSound( - tInventory[tCurrentIndex], - aPlayer.worldObj, - aPlayer.posX, - aPlayer.posY, - aPlayer.posZ); + tInventory[tCurrentIndex], + aPlayer.worldObj, + aPlayer.posX, + aPlayer.posY, + aPlayer.posZ); tCurrentIndex++; if (tCurrentIndex > 63) { tCurrentIndex = -1; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java index 36c81b2