diff options
Diffstat (limited to 'src/main/java/kubatech/tileentity')
5 files changed, 13 insertions, 22 deletions
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<MTEExtreme isValid = false; return; } - // noinspection unchecked - attackDamage = ((Multimap<String, AttributeModifier>) stack.getAttributeModifiers()) + attackDamage = stack.getAttributeModifiers() .get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()) .stream() .mapToDouble( @@ -559,7 +556,7 @@ public class MTEExtremeEntityCrusher extends KubaTechGTMultiBlockBase<MTEExtreme double attackDamage = DIAMOND_SPIKES_DAMAGE; // damage from spikes weaponCheck: { - MTEHatchInputBus inputbus = this.mInputBusses.size() == 0 ? null : this.mInputBusses.get(0); + MTEHatchInputBus inputbus = this.mInputBusses.isEmpty() ? null : this.mInputBusses.get(0); if (inputbus != null && !inputbus.isValid()) inputbus = null; ItemStack lootingHolder = inputbus == null ? null : inputbus.getStackInSlot(0); if (lootingHolder == null) break weaponCheck; @@ -592,7 +589,6 @@ public class MTEExtremeEntityCrusher extends KubaTechGTMultiBlockBase<MTEExtreme EECPlayer.currentWeapon = weapon; Item lootingHolderItem = weapon.getItem(); for (int i = 0; i < times + 1; i++) { - // noinspection ConstantConditions if (!lootingHolderItem.hitEntity(weapon, recipe.recipe.entity, EECPlayer)) break; if (weapon.stackSize == 0) { weaponCache.setStackInSlot(0, null); @@ -656,9 +652,8 @@ public class MTEExtremeEntityCrusher extends KubaTechGTMultiBlockBase<MTEExtreme mCasing = 0; if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 6, 0)) return false; if (mCasing < 35 || mMaintenanceHatches.size() != 1 - || mEnergyHatches.size() == 0 - || !(mInputBusses.size() == 0 || (mInputBusses.size() == 1 && mInputBusses.get(0).mTier == 0))) - return false; + || mEnergyHatches.isEmpty() + || !(mInputBusses.isEmpty() || (mInputBusses.size() == 1 && mInputBusses.get(0).mTier == 0))) return false; if (mGlassTier < 8) for (MTEHatchEnergy hatch : mEnergyHatches) if (hatch.mTier > 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<MTE * Summary: * Accelerators in EIG are a bit cheaper than on the crop field (4 amps instead of 6 amps) * There are 4 crops touching the accelerator (1 AMP for 1 accelerated crop) - * + * <p> * 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<MTE ItemStack suppertItem = outputs[i]; if (!player.inventory.addItemStackToInventory(suppertItem)) { player.entityDropItem(suppertItem, 0.f); - } ; + } } if (bucket.getSeedCount() <= 0) this.buckets.remove(bucket); return ret; diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java index 2d3eb590d9..0de075f497 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java @@ -219,7 +219,7 @@ public class MTEMegaIndustrialApiary extends KubaTechGTMultiBlockBase<MTEMegaInd .addElement( 'W', ofChain(ofBlock(Blocks.water, 0), ofBlock(BlocksItems.getFluidBlock(InternalName.fluidDistilledWater), 0))) - .addElement('F', new IStructureElementNoPlacement<MTEMegaIndustrialApiary>() { + .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<MTEMegaInd public void onRemoval() { super.onRemoval(); if (getBaseMetaTileEntity().isServerSide()) - tryOutputAll(mStorage, s -> 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<MTEMegaInd if (mStorage.size() >= 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<MTEMegaInd if (this.mGlassTier < 10 && !this.mEnergyHatches.isEmpty()) for (MTEHatchEnergy hatchEnergy : this.mEnergyHatches) if (this.mGlassTier < hatchEnergy.mTier) return false; - boolean valid = this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() >= 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<Double> P = new LinkedList<Double>(); // 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. - * + * <p> * 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; |