diff options
author | Raven Szewczyk <git@eigenraven.me> | 2023-04-10 17:49:16 +0100 |
---|---|---|
committer | Raven Szewczyk <git@eigenraven.me> | 2023-04-10 17:49:16 +0100 |
commit | 8ac58626bd4caa9e49f58acc6b97ac031f6c2107 (patch) | |
tree | 0a8c7b737f1f2607fa6875309f4c6a5c2b8b3331 /src/main/java/gregtech/api/util/GT_BaseCrop.java | |
parent | d795cf740c3b48b602d3bfb708ed9e6c492ad37d (diff) | |
download | GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.tar.gz GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.tar.bz2 GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.zip |
Update spotless config to 0.2.2
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_BaseCrop.java')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_BaseCrop.java | 95 |
1 files changed, 40 insertions, 55 deletions
diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GT_BaseCrop.java index 12e6b86019..f3337a8c0a 100644 --- a/src/main/java/gregtech/api/util/GT_BaseCrop.java +++ b/src/main/java/gregtech/api/util/GT_BaseCrop.java @@ -57,28 +57,27 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size */ public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, - int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, - int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, ItemStack aDrop, - ItemStack[] aSpecialDrops) { + int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, + int aStatColor, int aStatWeed, String[] aAttributes, ItemStack aDrop, ItemStack[] aSpecialDrops) { new GT_BaseCrop( - aID, - aCropName, - aDiscoveredBy, - aBaseSeed, - aTier, - aMaxSize, - aGrowthSpeed, - aAfterHarvestSize, - aHarvestSize, - aStatChemical, - aStatFood, - aStatDefensive, - aStatColor, - aStatWeed, - aAttributes, - null, - aDrop, - aSpecialDrops); + aID, + aCropName, + aDiscoveredBy, + aBaseSeed, + aTier, + aMaxSize, + aGrowthSpeed, + aAfterHarvestSize, + aHarvestSize, + aStatChemical, + aStatFood, + aStatDefensive, + aStatColor, + aStatWeed, + aAttributes, + null, + aDrop, + aSpecialDrops); } /** @@ -96,9 +95,9 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @param aBlock the block below needed for crop to grow. If null no block needed */ public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, - int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, - int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop, - ItemStack[] aSpecialDrops) { + int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, + int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop, + ItemStack[] aSpecialDrops) { mName = aCropName; aID = GT_Config.addIDConfig(ConfigCategories.IDs.crops, mName.replaceAll(" ", "_"), aID); if (aDiscoveredBy != null && !aDiscoveredBy.equals(E)) mDiscoveredBy = aDiscoveredBy; @@ -126,13 +125,13 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { if (bIc2NeiLoaded) { try { Class.forName("speiger.src.crops.api.CropPluginAPI") - .getMethod("registerCropInfo", Class.forName("speiger.src.crops.api.ICropCardInfo")) - .invoke( - Class.forName("speiger.src.crops.api.CropPluginAPI") - .getField("instance"), - this); + .getMethod("registerCropInfo", Class.forName("speiger.src.crops.api.ICropCardInfo")) + .invoke( + Class.forName("speiger.src.crops.api.CropPluginAPI") + .getField("instance"), + this); } catch (IllegalAccessException | ClassNotFoundException | SecurityException | NoSuchMethodException - | NoSuchFieldException | InvocationTargetException | IllegalArgumentException ex) { + | NoSuchFieldException | InvocationTargetException | IllegalArgumentException ex) { bIc2NeiLoaded = false; } } @@ -207,11 +206,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { public ItemStack getGain(ICropTile aCrop) { int tDrop = 0; if (mSpecialDrops != null && (tDrop = java.util.concurrent.ThreadLocalRandom.current() - .nextInt( - 0, - (mSpecialDrops.length * 2) - + 2)) - < mSpecialDrops.length && mSpecialDrops[tDrop] != null) { + .nextInt(0, (mSpecialDrops.length * 2) + 2)) < mSpecialDrops.length && mSpecialDrops[tDrop] != null) { return GT_Utility.copyOrNull(mSpecialDrops[tDrop]); } return GT_Utility.copyOrNull(mDrop); @@ -234,19 +229,13 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { } for (int i = 1; i < this.getrootslength(aCrop); i++) { Block tBlock = aCrop.getWorld() - .getBlock( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getBlock(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); if ((tBlock instanceof GT_Block_Ores_Abstract)) { TileEntity tTileEntity = aCrop.getWorld() - .getTileEntity( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getTileEntity(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData - % 1000)]; + % 1000)]; if ((tMaterial != null) && (tMaterial != Materials._NULL)) { if (tMaterial == mBlock) { return true; @@ -257,18 +246,14 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { } } else { int tMetaID = aCrop.getWorld() - .getBlockMetadata( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getBlockMetadata(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); if ((tAssotiation != null) && (tAssotiation.mPrefix.toString() - .startsWith("ore")) - && (tAssotiation.mMaterial.mMaterial == mBlock)) { + .startsWith("ore")) && (tAssotiation.mMaterial.mMaterial == mBlock)) { return true; } if ((tAssotiation != null) && (tAssotiation.mPrefix == OrePrefixes.block) - && (tAssotiation.mMaterial.mMaterial == mBlock)) { + && (tAssotiation.mMaterial.mMaterial == mBlock)) { return true; } } @@ -293,10 +278,10 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { if (mBlock != null) { ArrayList<String> result = new ArrayList<>(1); result.add( - String.format( - "Requires %s Ore or Block of %s as soil block to reach full growth.", - mBlock.mName, - mBlock.mName)); + String.format( + "Requires %s Ore or Block of %s as soil block to reach full growth.", + mBlock.mName, + mBlock.mName)); return result; } return null; |