Use modern java features where we can, optimise imports.

This commit is contained in:
modmuss50 2021-05-29 20:32:05 +01:00
parent 52e4767247
commit 31e7b357dc
135 changed files with 342 additions and 794 deletions

View file

@ -57,6 +57,7 @@ import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.text.WordUtils;
import org.jetbrains.annotations.Nullable;
import reborncore.common.fluid.FluidUtil;
import reborncore.common.fluid.container.ItemFluidInfo;
import reborncore.common.util.ItemNBTHelper;
@ -64,8 +65,6 @@ import techreborn.TechReborn;
import techreborn.init.TRContent;
import techreborn.utils.FluidUtils;
import org.jetbrains.annotations.Nullable;
/**
* Created by modmuss50 on 17/05/2016.
*/

View file

@ -40,12 +40,12 @@ import net.minecraft.util.dynamic.GlobalPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import reborncore.common.chunkloading.ChunkLoaderManager;
import reborncore.common.util.ChatUtils;
import techreborn.TechReborn;
import techreborn.utils.MessageIDs;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Optional;

View file

@ -34,14 +34,14 @@ import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.world.World;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import reborncore.api.blockentity.IUpgrade;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.recipes.IUpgradeHandler;
import techreborn.TechReborn;
import techreborn.init.TRContent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public class UpgradeItem extends Item implements IUpgrade {

View file

@ -32,8 +32,8 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.collection.DefaultedList;
import reborncore.api.items.ArmorRemoveHandler;
import reborncore.api.items.ArmorBlockEntityTicker;
import reborncore.api.items.ArmorRemoveHandler;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.ItemUtils;
import team.reborn.energy.Energy;

View file

@ -40,8 +40,8 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.collection.DefaultedList;
import reborncore.api.items.ArmorRemoveHandler;
import reborncore.api.items.ArmorBlockEntityTicker;
import reborncore.api.items.ArmorRemoveHandler;
import reborncore.api.items.ItemStackModifiers;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.ItemUtils;

View file

@ -41,11 +41,11 @@ import net.minecraft.text.TranslatableText;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Formatting;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import techreborn.TechReborn;
import techreborn.blockentity.cable.CableBlockEntity;
import techreborn.blocks.cable.CableBlock;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public class PaintingToolItem extends Item {

View file

@ -41,6 +41,7 @@ import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import reborncore.common.util.ItemUtils;
import team.reborn.energy.Energy;
import team.reborn.energy.EnergyTier;
@ -50,7 +51,6 @@ import techreborn.utils.MessageIDs;
import techreborn.utils.TagUtils;
import techreborn.utils.ToolsUtil;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;

View file

@ -85,10 +85,9 @@ public class IndustrialDrillItem extends DrillItem {
if (!ItemUtils.isActive(stack)) {
return super.postMine(stack, worldIn, stateIn, pos, entityLiving);
}
if (!(entityLiving instanceof PlayerEntity)) {
if (!(entityLiving instanceof PlayerEntity playerIn)) {
return super.postMine(stack, worldIn, stateIn, pos, entityLiving);
}
PlayerEntity playerIn = (PlayerEntity) entityLiving;
for (BlockPos additionalPos : ToolsUtil.getAOEMiningBlocks(worldIn, pos, entityLiving, 1)) {
if (shouldBreak(playerIn, worldIn, pos, additionalPos)) {
ToolsUtil.breakBlock(stack, worldIn, additionalPos, entityLiving, cost);

View file

@ -43,6 +43,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import reborncore.api.items.ItemStackModifiers;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.ItemDurabilityExtensions;
@ -56,7 +57,6 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.utils.MessageIDs;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public class NanosaberItem extends SwordItem implements EnergyHolder, ItemDurabilityExtensions, ItemStackModifiers {

View file

@ -43,6 +43,7 @@ import net.minecraft.util.Formatting;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.ItemDurabilityExtensions;
import reborncore.common.util.ItemUtils;
@ -57,7 +58,6 @@ import techreborn.init.TRContent;
import techreborn.items.tool.MiningLevel;
import techreborn.utils.InitUtils;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public class OmniToolItem extends PickaxeItem implements EnergyHolder, ItemDurabilityExtensions, DynamicAttributeTool {