From 3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Wed, 2 Oct 2024 07:31:08 +0200 Subject: Cleanup the codebase (#3311) Co-authored-by: boubou19 --- .../gregtech/multiblock/MTEExtremeEntityCrusher.java | 13 ++++--------- .../gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java | 4 ++-- .../gregtech/multiblock/MTEMegaIndustrialApiary.java | 11 +++++------ .../gregtech/multiblock/eigbuckets/EIGIC2Bucket.java | 5 +---- .../gregtech/multiblock/eigbuckets/EIGSeedBucket.java | 2 +- 5 files changed, 13 insertions(+), 22 deletions(-) (limited to 'src/main/java/kubatech/tileentity/gregtech/multiblock') diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java index 4e90c2634c..eb5b80176a 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java @@ -54,7 +54,6 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -75,7 +74,6 @@ import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; -import com.google.common.collect.Multimap; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -497,8 +495,7 @@ public class MTEExtremeEntityCrusher extends KubaTechGTMultiBlockBase) stack.getAttributeModifiers()) + attackDamage = stack.getAttributeModifiers() .get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()) .stream() .mapToDouble( @@ -559,7 +556,7 @@ public class MTEExtremeEntityCrusher extends KubaTechGTMultiBlockBase mGlassTier) return false; if (isInRitualMode) connectToRitual(); return true; diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java index d0831a17ee..0f0c03484d 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java @@ -142,7 +142,7 @@ public class MTEExtremeIndustrialGreenhouse extends KubaTechGTMultiBlockBase * Changing T one number down will buff the EIG twice, as well as changing it up will nerf the EIG twice * (That is because accelerators are imperfectly scaled in game LV = 2x, MV = 4x, ...) */ @@ -986,7 +986,7 @@ public class MTEExtremeIndustrialGreenhouse extends KubaTechGTMultiBlockBase() { + .addElement('F', new IStructureElementNoPlacement<>() { @Override public boolean check(MTEMegaIndustrialApiary mte, World world, int x, int y, int z) { @@ -248,7 +248,7 @@ public class MTEMegaIndustrialApiary extends KubaTechGTMultiBlockBase Collections.singletonList(((BeeSimulator) s).queenStack)); + tryOutputAll(mStorage, s -> Collections.singletonList(s.queenStack)); } private boolean isCacheDirty = true; @@ -467,9 +467,8 @@ public class MTEMegaIndustrialApiary extends KubaTechGTMultiBlockBase= mMaxSlots) break; } updateSlots(); - } else if (mPrimaryMode == 1 && mStorage.size() > 0) { - if (tryOutputAll(mStorage, s -> Collections.singletonList(((BeeSimulator) s).queenStack))) - isCacheDirty = true; + } else if (mPrimaryMode == 1 && !mStorage.isEmpty()) { + if (tryOutputAll(mStorage, s -> Collections.singletonList(s.queenStack))) isCacheDirty = true; } else return CheckRecipeResultRegistry.NO_RECIPE; mMaxProgresstime = 10; mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); @@ -594,7 +593,7 @@ public class MTEMegaIndustrialApiary extends KubaTechGTMultiBlockBase= 1 && this.mCasing >= 190; + boolean valid = this.mMaintenanceHatches.size() == 1 && !this.mEnergyHatches.isEmpty() && this.mCasing >= 190; flowersError = valid && !this.flowersCheck.isEmpty(); if (valid) updateMaxSlots(); return valid; diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/eigbuckets/EIGIC2Bucket.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/eigbuckets/EIGIC2Bucket.java index 8c58f911c5..3314e89356 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/eigbuckets/EIGIC2Bucket.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/eigbuckets/EIGIC2Bucket.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; -import java.util.LinkedList; import java.util.Set; import net.minecraft.block.Block; @@ -316,7 +315,6 @@ public class EIGIC2Bucket extends EIGBucket { ItemStack newSupport = potentialBlockStack.copy(); newSupport.stackSize = 1; this.supportItems = new ItemStack[] { newSupport }; - keepLooking = false; crop.updateNutrientsForBlockUnder(); break blockLoop; } @@ -602,7 +600,6 @@ public class EIGIC2Bucket extends EIGBucket { // Create kernel out of our growth speeds double[] kernel = tabulate(speeds, 1.0d / speeds.length); double[] convolutionTarget = new double[signal.length]; - LinkedList P = new LinkedList(); // Perform convolutions on the signal until it's too weak to be recognised. double p, avgRolls = 1; @@ -620,7 +617,7 @@ public class EIGIC2Bucket extends EIGBucket { /** * Creates an array that corresponds to the amount of times a number appears in a list. - * + *

* Ex: {1,2,3,4} -> {0,1,1,1,1}, {0,2,2,4} -> {1,0,2,0,1} * * @param bin The number list to tabulate diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/eigbuckets/EIGSeedBucket.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/eigbuckets/EIGSeedBucket.java index 831569a4ae..6563bb68da 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/eigbuckets/EIGSeedBucket.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/eigbuckets/EIGSeedBucket.java @@ -203,7 +203,7 @@ public class EIGSeedBucket extends EIGBucket { return false; } - class EIGCraftingSeedFinder extends InventoryCrafting { + static class EIGCraftingSeedFinder extends InventoryCrafting { public ItemStack recipeInput; -- cgit