diff --git a/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java b/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java index ab45bcefb..e5308f130 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java +++ b/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java @@ -12,12 +12,13 @@ import forestry.api.core.Tabs; import forestry.apiculture.items.ItemBlockCandle; import forestry.core.blocks.BlockBase; import forestry.core.blocks.BlockRegistry; +import forestry.core.blocks.IMachineProperties; import forestry.core.items.ItemBlockForestry; public class BlockRegistryApiculture extends BlockRegistry { public final BlockApiculture apiculture; - public final BlockBase apicultureChest; + public final BlockBase apicultureChest; public final BlockBeehives beehives; public final BlockCandle candle; public final BlockStump stump; @@ -26,7 +27,7 @@ public class BlockRegistryApiculture extends BlockRegistry { public BlockRegistryApiculture() { apiculture = registerBlock(new BlockApiculture(), ItemBlockForestry.class, "apiculture"); - apicultureChest = registerBlock(new BlockBase(true), ItemBlockForestry.class, "apicultureChest"); + apicultureChest = registerBlock(new BlockBase<>(true), ItemBlockForestry.class, "apicultureChest"); apicultureChest.setCreativeTab(Tabs.tabApiculture); apicultureChest.setHarvestLevel("axe", 0); diff --git a/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java b/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java index aed8c659c..239eabe40 100755 --- a/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java +++ b/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java @@ -99,7 +99,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { } } - @SuppressWarnings("rawtypes") + @SuppressWarnings({ "rawtypes", "unchecked" }) public static ComponentVillageBeeHouse buildComponent(StructureVillagePieces.Start startPiece, List par1List, Random random, int par3, int par4, int par5, int par6, int par7) { StructureBoundingBox bbox = StructureBoundingBox diff --git a/src/main/java/forestry/apiculture/worldgen/HiveDecorator.java b/src/main/java/forestry/apiculture/worldgen/HiveDecorator.java index bb62bfd09..3243f90a5 100755 --- a/src/main/java/forestry/apiculture/worldgen/HiveDecorator.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveDecorator.java @@ -28,7 +28,6 @@ import forestry.plugins.PluginApiculture; public abstract class HiveDecorator { - @SuppressWarnings("rawtypes") private static final EventType EVENT_TYPE = EnumHelper .addEnum(EventType.class, "FORESTRY_HIVES", new Class[0], new Object[0]); diff --git a/src/main/java/forestry/core/blocks/BlockStructure.java b/src/main/java/forestry/core/blocks/BlockStructure.java index 5caa8ed1a..c17dd23d5 100644 --- a/src/main/java/forestry/core/blocks/BlockStructure.java +++ b/src/main/java/forestry/core/blocks/BlockStructure.java @@ -16,7 +16,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import com.mojang.authlib.GameProfile; @@ -50,29 +49,22 @@ public abstract class BlockStructure extends BlockForestry { } TileEntity tile = world.getTileEntity(x, y, z); - if (!(tile instanceof MultiblockTileEntityForestry)) { + if (!(tile instanceof MultiblockTileEntityForestrypart)) { return false; } - MultiblockTileEntityForestry part = (MultiblockTileEntityForestry) tile; IMultiblockController controller = part.getMultiblockLogic().getController(); // If the player's hands are empty and they right-click on a multiblock, they get a // multiblock-debugging message if the machine is not assembled. if (player.getCurrentEquippedItem() == null && !controller.isAssembled()) { - if (controller != null) { - String validationError = controller.getLastValidationError(); - if (validationError != null) { - long tick = world.getTotalWorldTime(); - if (tick > previousMessageTick + 20) { - player.addChatMessage(new ChatComponentText(validationError)); - previousMessageTick = tick; - } - return true; + String validationError = controller.getLastValidationError(); + if (validationError != null) { + long tick = world.getTotalWorldTime(); + if (tick > previousMessageTick + 20) { + player.addChatMessage(new ChatComponentText(validationError)); + previousMessageTick = tick; } - } else { - player.addChatMessage( - new ChatComponentText(StatCollector.translateToLocal("for.multiblock.error.notConnected"))); return true; } } @@ -94,13 +86,12 @@ public abstract class BlockStructure extends BlockForestry { return; } - if (entityLiving instanceof EntityPlayer) { + if (entityLiving instanceof EntityPlayer player) { TileEntity tile = world.getTileEntity(i, j, k); - if (tile instanceof MultiblockTileEntityForestry) { - EntityPlayer player = (EntityPlayer) entityLiving; + if (tile instanceof MultiblockTileEntityForestrytileForestry) { GameProfile gameProfile = player.getGameProfile(); - ((MultiblockTileEntityForestry) tile).setOwner(gameProfile); + tileForestry.setOwner(gameProfile); } } } diff --git a/src/main/java/forestry/core/blocks/IItemTyped.java b/src/main/java/forestry/core/blocks/IItemTyped.java index 1ae12cddd..1ac220e0c 100644 --- a/src/main/java/forestry/core/blocks/IItemTyped.java +++ b/src/main/java/forestry/core/blocks/IItemTyped.java @@ -2,5 +2,5 @@ package forestry.core.blocks; public interface IItemTyped { - Enum getTypeFromMeta(int meta); + Enum getTypeFromMeta(int meta); } diff --git a/src/main/java/forestry/core/circuits/CircuitRegistry.java b/src/main/java/forestry/core/circuits/CircuitRegistry.java index 73042746d..663f9194f 100755 --- a/src/main/java/forestry/core/circuits/CircuitRegistry.java +++ b/src/main/java/forestry/core/circuits/CircuitRegistry.java @@ -109,6 +109,6 @@ public class CircuitRegistry implements ICircuitRegistry { return null; } - return new CircuitBoard(nbttagcompound); + return new CircuitBoard<>(nbttagcompound); } } diff --git a/src/main/java/forestry/core/circuits/GuiSolderingIron.java b/src/main/java/forestry/core/circuits/GuiSolderingIron.java index 3f823b6ed..eed5046cf 100755 --- a/src/main/java/forestry/core/circuits/GuiSolderingIron.java +++ b/src/main/java/forestry/core/circuits/GuiSolderingIron.java @@ -79,7 +79,6 @@ public class GuiSolderingIron extends GuiForestry(type, layout, circuits)); return chipset; } diff --git a/src/main/java/forestry/core/commands/CommandHelpers.java b/src/main/java/forestry/core/commands/CommandHelpers.java index a192b0876..5d38aee55 100644 --- a/src/main/java/forestry/core/commands/CommandHelpers.java +++ b/src/main/java/forestry/core/commands/CommandHelpers.java @@ -164,7 +164,6 @@ public class CommandHelpers { return false; } - @SuppressWarnings("unchecked") public static List getListOfStringsMatchingLastWord(String[] strings, String... lastWords) { return CommandBase.getListOfStringsMatchingLastWord(strings, lastWords); } diff --git a/src/main/java/forestry/core/commands/RootCommand.java b/src/main/java/forestry/core/commands/RootCommand.java index 44d8c6308..06ae354ee 100644 --- a/src/main/java/forestry/core/commands/RootCommand.java +++ b/src/main/java/forestry/core/commands/RootCommand.java @@ -74,7 +74,7 @@ public class RootCommand extends CommandBase implements IForestryCommand { } @Override - public List addTabCompletionOptions(ICommandSender sender, String[] incomplete) { + public List addTabCompletionOptions(ICommandSender sender, String[] incomplete) { return CommandHelpers.addStandardTabCompletionOptions(this, sender, incomplete); } diff --git a/src/main/java/forestry/core/config/ForestryGuiConfig.java b/src/main/java/forestry/core/config/ForestryGuiConfig.java index 7e49d7e6d..112223def 100644 --- a/src/main/java/forestry/core/config/ForestryGuiConfig.java +++ b/src/main/java/forestry/core/config/ForestryGuiConfig.java @@ -25,6 +25,7 @@ public class ForestryGuiConfig extends GuiConfig { super(parent, getConfigCategories(), Constants.MOD, true, true, Constants.MOD); } + @SuppressWarnings("rawtypes") private static List getConfigCategories() { List configElements = new ArrayList<>(); @@ -32,13 +33,13 @@ public class ForestryGuiConfig extends GuiConfig { .asList("crafting", "difficulty", "genetics", "performance", "structures", "tweaks", "world"); for (String categoryName : commonCategoryNames) { ConfigCategory category = Config.configCommon.getCategory(categoryName); - configElements.add(new ConfigElement(category)); + configElements.add(new ConfigElement<>(category)); } List fluidCategoryNames = Arrays.asList("enableFluid", "enableFluidBlock"); for (String categoryName : fluidCategoryNames) { ConfigCategory category = Config.configFluid.getCategory(categoryName); - configElements.add(new ConfigElement(category)); + configElements.add(new ConfigElement<>(category)); } return configElements; diff --git a/src/main/java/forestry/core/fluids/FakeTankManager.java b/src/main/java/forestry/core/fluids/FakeTankManager.java index 8ee2a0367..f4892c029 100644 --- a/src/main/java/forestry/core/fluids/FakeTankManager.java +++ b/src/main/java/forestry/core/fluids/FakeTankManager.java @@ -10,7 +10,6 @@ package forestry.core.fluids; import java.util.List; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraftforge.common.util.ForgeDirection; @@ -31,7 +30,7 @@ public class FakeTankManager implements ITankManager { public void containerAdded(Container container, ICrafting player) {} @Override - public void updateGuiData(Container container, List crafters) {} + public void updateGuiData(Container container, List crafters) {} @Override public void containerRemoved(Container container) {} diff --git a/src/main/java/forestry/core/fluids/ITankManager.java b/src/main/java/forestry/core/fluids/ITankManager.java index e2540bc4c..fa90169f3 100644 --- a/src/main/java/forestry/core/fluids/ITankManager.java +++ b/src/main/java/forestry/core/fluids/ITankManager.java @@ -10,7 +10,6 @@ package forestry.core.fluids; import java.util.List; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraftforge.fluids.FluidStack; @@ -21,7 +20,7 @@ public interface ITankManager extends IFluidHandler { void containerAdded(Container container, ICrafting player); - void updateGuiData(Container container, List crafters); + void updateGuiData(Container container, List crafters); void containerRemoved(Container container); diff --git a/src/main/java/forestry/core/fluids/TankManager.java b/src/main/java/forestry/core/fluids/TankManager.java index d8431b9af..cd14ccbb8 100644 --- a/src/main/java/forestry/core/fluids/TankManager.java +++ b/src/main/java/forestry/core/fluids/TankManager.java @@ -17,6 +17,7 @@ import java.util.List; import javax.annotation.Nonnull; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -134,7 +135,7 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl return; } - List crafters = Collections.singletonList((EntityPlayerMP) player); + List crafters = Collections.singletonList(player); for (StandardTank tank : tanks) { sendTankUpdate(container, tank, crafters); @@ -149,13 +150,13 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl } @Override - public void updateGuiData(Container container, List crafters) { + public void updateGuiData(Container container, List crafters) { for (StandardTank tank : tanks) { updateGuiData(container, crafters, tank.getTankIndex()); } } - private void updateGuiData(Container container, List crafters, int tankIndex) { + private void updateGuiData(Container container, List crafters, int tankIndex) { StandardTank tank = tanks.get(tankIndex); if (tank == null) { return; @@ -170,12 +171,12 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl sendTankUpdate(container, tank, crafters); } - private void sendTankUpdate(Container container, StandardTank tank, Iterable crafters) { + private void sendTankUpdate(Container container, StandardTank tank, Iterable crafters) { int tankIndex = tank.getTankIndex(); FluidStack fluid = tank.getFluid(); IForestryPacketClient packet = new PacketTankLevelUpdate(tile, tankIndex, fluid); - for (EntityPlayerMP player : crafters) { - Proxies.net.sendToPlayer(packet, player); + for (ICrafting player : crafters) { + Proxies.net.sendToPlayer(packet, (EntityPlayer) player); } if (fluid == null) { diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java b/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java index 85a115701..ef3ca823b 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java @@ -33,7 +33,7 @@ public class AlleleHelper implements IAlleleHelper { private static final String modId = Constants.ID; public static AlleleHelper instance; - private final Map> alleleMaps = new HashMap<>(); + private final Map, Map> alleleMaps = new HashMap<>(); public void init() { if (PluginManager.Module.APICULTURE.isEnabled()) { diff --git a/src/main/java/forestry/core/gui/ContainerLiquidTanks.java b/src/main/java/forestry/core/gui/ContainerLiquidTanks.java index 1416ccdba..d8b0c37b4 100755 --- a/src/main/java/forestry/core/gui/ContainerLiquidTanks.java +++ b/src/main/java/forestry/core/gui/ContainerLiquidTanks.java @@ -38,7 +38,6 @@ public abstract class ContainerLiquidTanks ext @Optional.Method(modid = "NotEnoughItems") public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) { if (gui instanceof GuiForestry) { - return ((GuiForestry) gui).ledgerManager.ledgerOverlaps(x, y, w, h); + return ((GuiForestry) gui).ledgerManager.ledgerOverlaps(x, y, w, h); } else { return false; } diff --git a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java index 6ca59bbf0..2494279f4 100755 --- a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java +++ b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java @@ -94,7 +94,6 @@ public class GuiNaturalistInventory extends GuiForestry lines = fontRendererObj.listFormattedStringToWidth(text, width); maxLines = lines.size(); diff --git a/src/main/java/forestry/core/gui/GuiUtil.java b/src/main/java/forestry/core/gui/GuiUtil.java index 41bc9993e..1bf9ea84c 100644 --- a/src/main/java/forestry/core/gui/GuiUtil.java +++ b/src/main/java/forestry/core/gui/GuiUtil.java @@ -25,7 +25,7 @@ import forestry.core.gui.tooltips.ToolTipLine; public class GuiUtil { - public static void drawItemStack(GuiForestry gui, ItemStack stack, int xPos, int yPos) { + public static void drawItemStack(GuiForestry gui, ItemStack stack, int xPos, int yPos) { GL11.glPushAttrib(GL11.GL_ENABLE_BIT); RenderHelper.enableGUIStandardItemLighting(); @@ -50,7 +50,7 @@ public class GuiUtil { GL11.glPopAttrib(); } - public static void drawToolTips(GuiForestry gui, ToolTip toolTips, int mouseX, int mouseY) { + public static void drawToolTips(GuiForestry gui, ToolTip toolTips, int mouseX, int mouseY) { if (toolTips == null) { return; } @@ -144,7 +144,7 @@ public class GuiUtil { itemRender.zLevel = 0.0F; } - public static void drawToolTips(GuiForestry gui, Collection objects, int mouseX, int mouseY) { + public static void drawToolTips(GuiForestry gui, Collection objects, int mouseX, int mouseY) { for (Object obj : objects) { if (!(obj instanceof IToolTipProvider)) { continue; diff --git a/src/main/java/forestry/core/gui/TextLayoutHelper.java b/src/main/java/forestry/core/gui/TextLayoutHelper.java index 2ebb3afae..f2c4e0c3d 100644 --- a/src/main/java/forestry/core/gui/TextLayoutHelper.java +++ b/src/main/java/forestry/core/gui/TextLayoutHelper.java @@ -9,6 +9,8 @@ package forestry.core.gui; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; import org.lwjgl.opengl.GL11; @@ -18,7 +20,7 @@ public class TextLayoutHelper { private static final int LINE_HEIGHT = 12; - private final GuiForestry guiForestry; + private final GuiForestry guiForestry; private final int defaultFontColor; private FontRenderer fontRendererObj; @@ -27,7 +29,7 @@ public class TextLayoutHelper { public int column2; public int line; - public TextLayoutHelper(GuiForestry guiForestry, FontColour fontColour) { + public TextLayoutHelper(GuiForestry guiForestry, FontColour fontColour) { this.guiForestry = guiForestry; this.defaultFontColor = fontColour.get("gui.screen"); } diff --git a/src/main/java/forestry/core/gui/ledgers/Ledger.java b/src/main/java/forestry/core/gui/ledgers/Ledger.java index b426f9322..8697eb590 100644 --- a/src/main/java/forestry/core/gui/ledgers/Ledger.java +++ b/src/main/java/forestry/core/gui/ledgers/Ledger.java @@ -227,12 +227,10 @@ public abstract class Ledger { protected int drawSplitText(String string, int x, int y, int width, int color, boolean shadow) { int originalY = y; Minecraft minecraft = Proxies.common.getClientInstance(); - List strings = minecraft.fontRenderer.listFormattedStringToWidth(string, width); - for (Object obj : strings) { - if (obj instanceof String) { - minecraft.fontRenderer.drawString((String) obj, x, y, color, shadow); - y += minecraft.fontRenderer.FONT_HEIGHT; - } + List strings = minecraft.fontRenderer.listFormattedStringToWidth(string, width); + for (String obj : strings) { + minecraft.fontRenderer.drawString(obj, x, y, color, shadow); + y += minecraft.fontRenderer.FONT_HEIGHT; } return y - originalY; } diff --git a/src/main/java/forestry/core/gui/ledgers/LedgerManager.java b/src/main/java/forestry/core/gui/ledgers/LedgerManager.java index 93d61cf05..af592cdd0 100644 --- a/src/main/java/forestry/core/gui/ledgers/LedgerManager.java +++ b/src/main/java/forestry/core/gui/ledgers/LedgerManager.java @@ -11,6 +11,9 @@ package forestry.core.gui.ledgers; import java.util.ArrayList; import java.util.List; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; + import org.lwjgl.opengl.GL11; import forestry.api.core.IErrorSource; @@ -29,9 +32,9 @@ public class LedgerManager { private IErrorSource errorSource; private final int maxWidth; - public final GuiForestry gui; + public final GuiForestry gui; - public LedgerManager(GuiForestry gui, int maxWidth) { + public LedgerManager(GuiForestry gui, int maxWidth) { this.gui = gui; this.errorSource = FakeErrorSource.instance; this.maxWidth = maxWidth; diff --git a/src/main/java/forestry/core/gui/tooltips/ToolTip.java b/src/main/java/forestry/core/gui/tooltips/ToolTip.java index 3fc51e14d..613cd2b99 100755 --- a/src/main/java/forestry/core/gui/tooltips/ToolTip.java +++ b/src/main/java/forestry/core/gui/tooltips/ToolTip.java @@ -39,7 +39,7 @@ public class ToolTip extends ForwardingList { return add(new ToolTipLine(line)); } - public boolean add(List lines) { + public boolean add(List lines) { boolean changed = false; for (Object line : lines) { if (line instanceof String) { diff --git a/src/main/java/forestry/core/gui/widgets/SocketWidget.java b/src/main/java/forestry/core/gui/widgets/SocketWidget.java index a375fa9d9..556d8144e 100755 --- a/src/main/java/forestry/core/gui/widgets/SocketWidget.java +++ b/src/main/java/forestry/core/gui/widgets/SocketWidget.java @@ -54,7 +54,6 @@ public class SocketWidget extends Widget { private final ToolTip toolTip = new ToolTip(250) { - @SuppressWarnings("unchecked") @Override public void refresh() { toolTip.clear(); diff --git a/src/main/java/forestry/core/gui/widgets/WidgetManager.java b/src/main/java/forestry/core/gui/widgets/WidgetManager.java index e7a26e43d..48a8046e7 100644 --- a/src/main/java/forestry/core/gui/widgets/WidgetManager.java +++ b/src/main/java/forestry/core/gui/widgets/WidgetManager.java @@ -12,6 +12,8 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.client.Minecraft; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; import org.lwjgl.opengl.GL11; @@ -20,11 +22,11 @@ import forestry.core.proxy.Proxies; public class WidgetManager { - public final GuiForestry gui; + public final GuiForestry gui; public final Minecraft minecraft; protected final List widgets = new ArrayList<>(); - public WidgetManager(GuiForestry gui) { + public WidgetManager(GuiForestry gui) { this.gui = gui; this.minecraft = Proxies.common.getClientInstance(); } diff --git a/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java b/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java index 5ee4e8066..b89f006b7 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java +++ b/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java @@ -120,7 +120,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI coord); } - MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); logic.setController(this); this.onBlockAdded(part); @@ -138,7 +138,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI TileEntity te = this.worldObj.getTileEntity(referenceCoord.posX, referenceCoord.posY, referenceCoord.posZ); if (te instanceof IMultiblockComponent) { IMultiblockComponent tePart = (IMultiblockComponent) te; - MultiblockLogic teLogic = (MultiblockLogic) tePart.getMultiblockLogic(); + MultiblockLogic teLogic = (MultiblockLogic) tePart.getMultiblockLogic(); teLogic.forfeitMultiblockSaveDelegate(); } @@ -219,7 +219,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI */ private void onDetachBlock(IMultiblockComponent part) { // Strip out this part - MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); logic.setController(null); this.onBlockRemoved(part); logic.forfeitMultiblockSaveDelegate(); @@ -361,7 +361,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } connectedParts.add(acquiredPart); - MultiblockLogic logic = (MultiblockLogic) acquiredPart.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) acquiredPart.getMultiblockLogic(); logic.setController(this); this.onBlockAdded(acquiredPart); } @@ -383,7 +383,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI .getTileEntity(referenceCoord.posX, referenceCoord.posY, referenceCoord.posZ); if (te instanceof IMultiblockComponent) { IMultiblockComponent part = (IMultiblockComponent) te; - MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); logic.forfeitMultiblockSaveDelegate(); } } @@ -745,7 +745,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI continue; } - MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); logic.setUnvisited(); logic.forfeitMultiblockSaveDelegate(); @@ -769,7 +769,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI MultiblockRegistry.addDeadController(worldObj, this); return Collections.emptySet(); } else { - MultiblockLogic logic = (MultiblockLogic) referencePart.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) referencePart.getMultiblockLogic(); logic.becomeMultiblockSaveDelegate(); } @@ -781,7 +781,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI while (!partsToCheck.isEmpty()) { part = partsToCheck.removeFirst(); - MultiblockLogic partLogic = (MultiblockLogic) part.getMultiblockLogic(); + MultiblockLogic partLogic = (MultiblockLogic) part.getMultiblockLogic(); partLogic.setVisited(); List nearbyParts = MultiblockUtil.getNeighboringParts(worldObj, part); // Chunk-safe @@ -790,7 +790,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI // client for (IMultiblockComponent nearbyPart : nearbyParts) { // Ignore different machines - MultiblockLogic nearbyPartLogic = (MultiblockLogic) nearbyPart.getMultiblockLogic(); + MultiblockLogic nearbyPartLogic = (MultiblockLogic) nearbyPart.getMultiblockLogic(); if (nearbyPartLogic.getController() != this) { continue; } @@ -805,7 +805,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI // Finally, remove all parts that remain disconnected. Set removedParts = new HashSet<>(); for (IMultiblockComponent orphanCandidate : connectedParts) { - MultiblockLogic logic = (MultiblockLogic) orphanCandidate.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) orphanCandidate.getMultiblockLogic(); if (!logic.isVisited()) { deadParts.add(orphanCandidate); onDetachBlock(orphanCandidate); @@ -877,7 +877,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } if (theChosenOne != null) { - MultiblockLogic logic = (MultiblockLogic) theChosenOne.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) theChosenOne.getMultiblockLogic(); logic.becomeMultiblockSaveDelegate(); } } diff --git a/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java b/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java index b29111fcf..d6db93fd8 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java @@ -135,7 +135,7 @@ public class MultiblockWorldRegistry { if (compatibleControllers.size() == 0) { // FOREVER ALONE! Create and register a new controller. // THIS IS THE ONLY PLACE WHERE NEW CONTROLLERS ARE CREATED. - MultiblockLogic logic = (MultiblockLogic) orphan.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) orphan.getMultiblockLogic(); IMultiblockControllerInternal newController = logic.createNewController(worldObj); newController.attachBlock(orphan); this.controllers.add(newController); @@ -263,7 +263,7 @@ public class MultiblockWorldRegistry { // list, and will be checked next tick to see if their chunk is still loaded. for (IMultiblockComponent part : detachedParts) { // Ensure parts know they're detached - MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); logic.assertDetached(part); } @@ -276,7 +276,7 @@ public class MultiblockWorldRegistry { Set controllers = new HashSet<>(); IMultiblockControllerInternal bestController = null; - MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); Class controllerClass = logic.getControllerClass(); // Look for a compatible controller in our neighboring parts. List partsToCheck = MultiblockUtil.getNeighboringParts(worldObj, part); @@ -367,7 +367,7 @@ public class MultiblockWorldRegistry { } } - MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); + MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); logic.assertDetached(part); } diff --git a/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java b/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java index 4022bffb2..5902f986f 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java @@ -46,7 +46,7 @@ public class PacketGuiEnergy extends ForestryPacket implements IForestryPacketCl @Override public void onPacketData(DataInputStreamForestry data, EntityPlayer player) throws IOException { if (player.openContainer instanceof ContainerTile && player.openContainer.windowId == windowId) { - ((ContainerTile) player.openContainer).onGuiEnergy(value); + ((ContainerTile) player.openContainer).onGuiEnergy(value); } } diff --git a/src/main/java/forestry/core/recipes/RecipeUtil.java b/src/main/java/forestry/core/recipes/RecipeUtil.java index 19cd08a4b..7cf5a60af 100644 --- a/src/main/java/forestry/core/recipes/RecipeUtil.java +++ b/src/main/java/forestry/core/recipes/RecipeUtil.java @@ -34,7 +34,7 @@ import forestry.factory.inventory.InventoryCraftingForestry; public abstract class RecipeUtil { - static List cachedRecipes = new ArrayList(); + static List cachedRecipes = new ArrayList<>(); public static void addFermenterRecipes(ItemStack resource, int fermentationValue, Fluids output) { if (RecipeManagers.fermenterManager == null) { @@ -183,15 +183,14 @@ public abstract class RecipeUtil { } List matchingRecipes = new ArrayList<>(); - List matchingIndex = new ArrayList(); - List matchingRecipeMap = new ArrayList(); + List matchingIndex = new ArrayList<>(); + List matchingRecipeMap = new ArrayList<>(); int index = 0; if (Config.cacheWorktableRecipes) { // Check across the whole cached recipe map // Add each recipe to the matchingRecipes list - for (Object recipe : cachedRecipes) { - IRecipe irecipe = (IRecipe) recipe; + for (IRecipe irecipe : cachedRecipes) { if (irecipe.matches(inventory, world)) { ItemStack result = irecipe.getCraftingResult(inventory); @@ -206,8 +205,7 @@ public abstract class RecipeUtil { } } // Only do this if there were no cached recipes hit - for (Object recipe : CraftingManager.getInstance().getRecipeList()) { - IRecipe irecipe = (IRecipe) recipe; + for (IRecipe irecipe : CraftingManager.getInstance().getRecipeList()) { if (irecipe.matches(inventory, world)) { ItemStack result = irecipe.getCraftingResult(inventory); @@ -216,8 +214,8 @@ public abstract class RecipeUtil { if (Config.promoteWorktableRecipesToFrontOfGlobalRecipemap || Config.cacheWorktableRecipes) { // Add to the back of the list. That way when we cycle through the list // moving items to the front, the index locations for the following items doesn't change - matchingRecipeMap.add(recipe); - matchingIndex.add(new Integer(index)); + matchingRecipeMap.add(irecipe); + matchingIndex.add(index); } } } @@ -227,7 +225,7 @@ public abstract class RecipeUtil { if (Config.promoteWorktableRecipesToFrontOfGlobalRecipemap) { // Only move the recipes if the last one was beyond 500 in the recipeMap (in GTNH about 57k recipes) if (matchingIndex.get(matchingIndex.size() - 1) > 500) { - List recipeMap = CraftingManager.getInstance().getRecipeList(); + List recipeMap = CraftingManager.getInstance().getRecipeList(); // System.out.println( "Highest recipe found at " + matchingIndex.get(matchingIndex.size()-1) + ", // moving " + matchingIndex.size() + " to front" ); // System.out.println( "Size of recipe map " + recipeMap.size() ); @@ -295,12 +293,10 @@ public abstract class RecipeUtil { addRecipe(new ItemStack(item), obj); } - @SuppressWarnings("unchecked") public static void addRecipe(ItemStack itemstack, Object... obj) { CraftingManager.getInstance().getRecipeList().add(new ShapedRecipeCustom(itemstack, obj)); } - @SuppressWarnings("unchecked") public static void addPriorityRecipe(ItemStack itemStack, Object... obj) { CraftingManager.getInstance().getRecipeList().add(0, new ShapedRecipeCustom(itemStack, obj)); } @@ -309,7 +305,6 @@ public abstract class RecipeUtil { addShapelessRecipe(new ItemStack(item), obj); } - @SuppressWarnings("unchecked") public static void addShapelessRecipe(ItemStack itemstack, Object... obj) { CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(itemstack, obj)); } @@ -400,7 +395,7 @@ public abstract class RecipeUtil { } else if (recipeIngredient instanceof ItemStack) { return ItemStackUtil.isCraftingEquivalent((ItemStack) recipeIngredient, resource); } else if (recipeIngredient instanceof Iterable) { - for (Object item : (Iterable) recipeIngredient) { + for (Object item : (Iterable) recipeIngredient) { if (checkIngredientMatch(item, resource)) { return true; } diff --git a/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java b/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java index a16cf3f5a..8314cfb5b 100644 --- a/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java +++ b/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java @@ -35,7 +35,7 @@ public class PositionedStackAdv extends PositionedStack { return new Rectangle(this.relx - 1, this.rely - 1, 18, 18); } - public List handleTooltip(GuiRecipe guiRecipe, List currenttip) { + public List handleTooltip(GuiRecipe guiRecipe, List currenttip) { if (!this.tooltip.isEmpty()) { for (String tip : this.tooltip) { currenttip.add(tip); diff --git a/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java b/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java index c95df1d1a..5374c1f10 100644 --- a/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java +++ b/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java @@ -139,7 +139,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements return currenttip; } - public List provideTooltip(GuiRecipe guiRecipe, List currenttip, CachedBaseRecipe crecipe, + public List provideTooltip(GuiRecipe guiRecipe, List currenttip, CachedBaseRecipe crecipe, Point relMouse) { if (crecipe.getFluidTanks() != null) { for (PositionedFluidTank tank : crecipe.getFluidTanks()) { @@ -151,7 +151,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements return currenttip; } - public List provideItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List currenttip, + public List provideItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List currenttip, CachedBaseRecipe crecipe, Point relMouse) { for (PositionedStack stack : crecipe.getIngredients()) { if (stack instanceof PositionedStackAdv && ((PositionedStackAdv) stack).getRect().contains(relMouse)) { @@ -171,7 +171,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements } @Override - public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe) { + public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe) { if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe")) { if (this.transferFluidTank(gui, recipe, false)) { return true; @@ -185,7 +185,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements } @Override - public boolean mouseClicked(GuiRecipe gui, int button, int recipe) { + public boolean mouseClicked(GuiRecipe gui, int button, int recipe) { if (button == 0) { if (this.transferFluidTank(gui, recipe, false)) { return true; @@ -198,7 +198,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements return super.mouseClicked(gui, button, recipe); } - protected boolean transferFluidTank(GuiRecipe guiRecipe, int recipe, boolean usage) { + protected boolean transferFluidTank(GuiRecipe guiRecipe, int recipe, boolean usage) { CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe); Point mousepos = GuiDraw.getMousePosition(); Point offset = guiRecipe.getRecipePosition(recipe); diff --git a/src/main/java/forestry/core/utils/BlockUtil.java b/src/main/java/forestry/core/utils/BlockUtil.java index e0024a067..093333998 100644 --- a/src/main/java/forestry/core/utils/BlockUtil.java +++ b/src/main/java/forestry/core/utils/BlockUtil.java @@ -31,6 +31,7 @@ import forestry.core.config.Constants; import forestry.core.tiles.TileEngine; import forestry.core.utils.vect.Vect; +@SuppressWarnings("unchecked") public abstract class BlockUtil { private static final int slabWoodId = OreDictionary.getOreID("slabWood"); diff --git a/src/main/java/forestry/core/utils/EntityUtil.java b/src/main/java/forestry/core/utils/EntityUtil.java index aefa40ec3..cd1dd7291 100644 --- a/src/main/java/forestry/core/utils/EntityUtil.java +++ b/src/main/java/forestry/core/utils/EntityUtil.java @@ -59,13 +59,11 @@ public abstract class EntityUtil { Log.finer("Registered entity %s (%s) with id %s.", ident, entityClass.toString(), id); } - @SuppressWarnings("unchecked") public static List getEntitiesWithinAABB(World world, Class entityClass, AxisAlignedBB boundingBox) { return world.getEntitiesWithinAABB(entityClass, boundingBox); } - @SuppressWarnings("unchecked") public static List selectEntitiesWithinAABB(World world, EntitySelector entitySelector, AxisAlignedBB boundingBox) { return world.selectEntitiesWithinAABB(entitySelector.getEntityClass(), boundingBox, entitySelector); diff --git a/src/main/java/forestry/core/utils/Log.java b/src/main/java/forestry/core/utils/Log.java index b2bb52803..0368e90a6 100644 --- a/src/main/java/forestry/core/utils/Log.java +++ b/src/main/java/forestry/core/utils/Log.java @@ -123,7 +123,7 @@ public abstract class Log { LogManager.getLogger(Constants.MOD).log(level, new MessageFormatMessage(msg, args), error); } - public static void logErrorAPI(String mod, Throwable error, Class classFile) { + public static void logErrorAPI(String mod, Throwable error, Class classFile) { StringBuilder msg = new StringBuilder(mod); msg.append(" API error, please update your mods. Error: ").append(error); logThrowable(Level.ERROR, msg.toString(), 2, error); diff --git a/src/main/java/forestry/core/utils/SlotUtil.java b/src/main/java/forestry/core/utils/SlotUtil.java index 8c5a2aa90..a05b1bac3 100644 --- a/src/main/java/forestry/core/utils/SlotUtil.java +++ b/src/main/java/forestry/core/utils/SlotUtil.java @@ -62,8 +62,8 @@ public abstract class SlotUtil { return stack; } - public static ItemStack transferStackInSlot(List inventorySlots, EntityPlayer player, int slotIndex) { - Slot slot = (Slot) inventorySlots.get(slotIndex); + public static ItemStack transferStackInSlot(List inventorySlots, EntityPlayer player, int slotIndex) { + Slot slot = inventorySlots.get(slotIndex); if (slot == null || !slot.getHasStack()) { return null; } @@ -93,7 +93,7 @@ public abstract class SlotUtil { return originalStack; } - private static boolean shiftItemStack(List inventorySlots, ItemStack stackInSlot, int slotIndex, int numSlots, + private static boolean shiftItemStack(List inventorySlots, ItemStack stackInSlot, int slotIndex, int numSlots, boolean fromCraftingSlot) { if (isInPlayerInventory(slotIndex)) { if (shiftToMachineInventory(inventorySlots, stackInSlot, numSlots)) { @@ -160,13 +160,14 @@ public abstract class SlotUtil { slot.putStack(phantomStack); } - private static boolean shiftItemStackToRange(List inventorySlots, ItemStack stackToShift, int start, int count) { + private static boolean shiftItemStackToRange(List inventorySlots, ItemStack stackToShift, int start, + int count) { boolean changed = shiftItemStackToRangeMerge(inventorySlots, stackToShift, start, count); changed |= shiftItemStackToRangeOpenSlots(inventorySlots, stackToShift, start, count); return changed; } - private static boolean shiftItemStackToRangeMerge(List inventorySlots, ItemStack stackToShift, int start, + private static boolean shiftItemStackToRangeMerge(List inventorySlots, ItemStack stackToShift, int start, int count) { if (stackToShift == null || !stackToShift.isStackable() || stackToShift.stackSize <= 0) { return false; @@ -174,7 +175,7 @@ public abstract class SlotUtil { boolean changed = false; for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < start + count; slotIndex++) { - Slot slot = (Slot) inventorySlots.get(slotIndex); + Slot slot = inventorySlots.get(slotIndex); ItemStack stackInSlot = slot.getStack(); if (stackInSlot != null && ItemStackUtil.isIdenticalItem(stackInSlot, stackToShift)) { int resultingStackSize = stackInSlot.stackSize + stackToShift.stackSize; @@ -195,7 +196,7 @@ public abstract class SlotUtil { return changed; } - private static boolean shiftItemStackToRangeOpenSlots(List inventorySlots, ItemStack stackToShift, int start, + private static boolean shiftItemStackToRangeOpenSlots(List inventorySlots, ItemStack stackToShift, int start, int count) { if (stackToShift == null || stackToShift.stackSize <= 0) { return false; @@ -203,7 +204,7 @@ public abstract class SlotUtil { boolean changed = false; for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < start + count; slotIndex++) { - Slot slot = (Slot) inventorySlots.get(slotIndex); + Slot slot = inventorySlots.get(slotIndex); ItemStack stackInSlot = slot.getStack(); if (stackInSlot == null) { int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit()); @@ -229,7 +230,7 @@ public abstract class SlotUtil { return SlotUtil.isSlotInRange(slotIndex, playerInventorySize - playerHotbarSize, playerInventorySize); } - private static boolean shiftToPlayerInventory(List inventorySlots, ItemStack stackInSlot) { + private static boolean shiftToPlayerInventory(List inventorySlots, ItemStack stackInSlot) { int playerHotbarStart = playerInventorySize - playerHotbarSize; // try to merge with existing stacks, hotbar first @@ -242,17 +243,17 @@ public abstract class SlotUtil { return shifted; } - private static boolean shiftToPlayerInventoryNoHotbar(List inventorySlots, ItemStack stackInSlot) { + private static boolean shiftToPlayerInventoryNoHotbar(List inventorySlots, ItemStack stackInSlot) { int playerHotbarStart = playerInventorySize - playerHotbarSize; return shiftItemStackToRange(inventorySlots, stackInSlot, 0, playerHotbarStart); } - private static boolean shiftToHotbar(List inventorySlots, ItemStack stackInSlot) { + private static boolean shiftToHotbar(List inventorySlots, ItemStack stackInSlot) { int playerHotbarStart = playerInventorySize - playerHotbarSize; return shiftItemStackToRange(inventorySlots, stackInSlot, playerHotbarStart, playerHotbarSize); } - private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots) { + private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots) { boolean success = false; if (stackToShift.isStackable()) { success = shiftToMachineInventory(inventorySlots, stackToShift, numSlots, true); @@ -264,7 +265,7 @@ public abstract class SlotUtil { } // if mergeOnly = true, don't shift into empty slots. - private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots, + private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots, boolean mergeOnly) { for (int machineIndex = playerInventorySize; machineIndex < numSlots; machineIndex++) { // System.out.println("SlotUtil::shiftToMachineinventory"); diff --git a/src/main/java/forestry/energy/blocks/BlockEngine.java b/src/main/java/forestry/energy/blocks/BlockEngine.java index edff6e51e..1148737ef 100644 --- a/src/main/java/forestry/energy/blocks/BlockEngine.java +++ b/src/main/java/forestry/energy/blocks/BlockEngine.java @@ -67,8 +67,7 @@ public class BlockEngine extends BlockBase { } @Override - @SuppressWarnings("unchecked") - public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, + public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity colliding) { TileEngine tile = TileUtil.getTile(world, x, y, z, TileEngine.class); if (tile == null) { diff --git a/src/main/java/forestry/energy/gui/ContainerEngineBiogas.java b/src/main/java/forestry/energy/gui/ContainerEngineBiogas.java index 21b474204..abc93b693 100644 --- a/src/main/java/forestry/energy/gui/ContainerEngineBiogas.java +++ b/src/main/java/forestry/energy/gui/ContainerEngineBiogas.java @@ -32,7 +32,6 @@ public class ContainerEngineBiogas extends ContainerLiquidTanks { } @Override - @SuppressWarnings("unchecked") public void detectAndSendChanges() { super.detectAndSendChanges(); diff --git a/src/main/java/forestry/factory/gui/ContainerFabricator.java b/src/main/java/forestry/factory/gui/ContainerFabricator.java index 2987c16f1..421ef466e 100755 --- a/src/main/java/forestry/factory/gui/ContainerFabricator.java +++ b/src/main/java/forestry/factory/gui/ContainerFabricator.java @@ -69,7 +69,6 @@ public class ContainerFabricator extends ContainerLiquidTanks im } @Override - @SuppressWarnings("unchecked") public void detectAndSendChanges() { super.detectAndSendChanges(); diff --git a/src/main/java/forestry/factory/gui/ContainerFermenter.java b/src/main/java/forestry/factory/gui/ContainerFermenter.java index 907a8160d..7ec3251cf 100755 --- a/src/main/java/forestry/factory/gui/ContainerFermenter.java +++ b/src/main/java/forestry/factory/gui/ContainerFermenter.java @@ -37,7 +37,6 @@ public class ContainerFermenter extends ContainerLiquidTanks { } @Override - @SuppressWarnings("unchecked") public void detectAndSendChanges() { super.detectAndSendChanges(); diff --git a/src/main/java/forestry/factory/gui/ContainerMoistener.java b/src/main/java/forestry/factory/gui/ContainerMoistener.java index 80a2e2044..8fa67e1be 100755 --- a/src/main/java/forestry/factory/gui/ContainerMoistener.java +++ b/src/main/java/forestry/factory/gui/ContainerMoistener.java @@ -58,7 +58,6 @@ public class ContainerMoistener extends ContainerLiquidTanks impl } @Override - @SuppressWarnings("unchecked") public void detectAndSendChanges() { super.detectAndSendChanges(); diff --git a/src/main/java/forestry/factory/gui/ContainerRaintank.java b/src/main/java/forestry/factory/gui/ContainerRaintank.java index 71996308f..6aaa2d08e 100755 --- a/src/main/java/forestry/factory/gui/ContainerRaintank.java +++ b/src/main/java/forestry/factory/gui/ContainerRaintank.java @@ -34,7 +34,6 @@ public class ContainerRaintank extends ContainerLiquidTanks { } @Override - @SuppressWarnings("unchecked") public void detectAndSendChanges() { super.detectAndSendChanges(); diff --git a/src/main/java/forestry/factory/gui/GuiWorktable.java b/src/main/java/forestry/factory/gui/GuiWorktable.java index b06eae6f4..2fc9b9ae8 100755 --- a/src/main/java/forestry/factory/gui/GuiWorktable.java +++ b/src/main/java/forestry/factory/gui/GuiWorktable.java @@ -111,7 +111,6 @@ public class GuiWorktable extends GuiForestryTitled) item).size() == 0) { continue; } diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java index 1d107b774..0c3258edd 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java @@ -85,7 +85,7 @@ public class NEIHandlerFabricator extends RecipeHandlerBase { continue; } else if (item instanceof ItemStack[] && ((ItemStack[]) item).length == 0) { continue; - } else if (item instanceof List && ((List) item).size() == 0) { + } else if (item instanceof List && ((List) item).size() == 0) { continue; } @@ -199,7 +199,7 @@ public class NEIHandlerFabricator extends RecipeHandlerBase { } @Override - public List provideItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List currenttip, + public List provideItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List currenttip, CachedBaseRecipe crecipe, Point relMouse) { super.provideItemTooltip(guiRecipe, itemStack, currenttip, crecipe, relMouse); diff --git a/src/main/java/forestry/factory/tiles/TileCarpenter.java b/src/main/java/forestry/factory/tiles/TileCarpenter.java index e42d12968..001e238ca 100644 --- a/src/main/java/forestry/factory/tiles/TileCarpenter.java +++ b/src/main/java/forestry/factory/tiles/TileCarpenter.java @@ -56,7 +56,7 @@ public class TileCarpenter extends TilePowered private final FilteredTank resourceTank; private final TankManager tankManager; - private final InventoryAdapterTile craftingInventory; + private final InventoryAdapterTile craftingInventory; private final InventoryCraftResult craftPreviewInventory; @Nullable diff --git a/src/main/java/forestry/factory/tiles/TileFabricator.java b/src/main/java/forestry/factory/tiles/TileFabricator.java index 8b427f3b9..513a7d545 100644 --- a/src/main/java/forestry/factory/tiles/TileFabricator.java +++ b/src/main/java/forestry/factory/tiles/TileFabricator.java @@ -56,7 +56,7 @@ public class TileFabricator extends TilePowered private static final int MAX_HEAT = 5000; - private final InventoryAdapterTile craftingInventory; + private final InventoryAdapterTile craftingInventory; private final TankManager tankManager; private final FilteredTank moltenTank; private int heat = 0; diff --git a/src/main/java/forestry/factory/tiles/TileWorktable.java b/src/main/java/forestry/factory/tiles/TileWorktable.java index a87134593..205cce5e8 100644 --- a/src/main/java/forestry/factory/tiles/TileWorktable.java +++ b/src/main/java/forestry/factory/tiles/TileWorktable.java @@ -38,7 +38,7 @@ import forestry.factory.recipes.RecipeMemory; public class TileWorktable extends TileBase implements ICrafterWorktable { private final RecipeMemory recipeMemory; - private final InventoryAdapterTile craftingDisplay; + private final InventoryAdapterTile craftingDisplay; private MemorizedRecipe currentRecipe; private long savedTick = 0; private long savedSystemTimeExpiration = 0; diff --git a/src/main/java/forestry/farming/circuits/CircuitFarmLogic.java b/src/main/java/forestry/farming/circuits/CircuitFarmLogic.java index 542b71cce..98e83bc15 100755 --- a/src/main/java/forestry/farming/circuits/CircuitFarmLogic.java +++ b/src/main/java/forestry/farming/circuits/CircuitFarmLogic.java @@ -42,7 +42,6 @@ public class CircuitFarmLogic extends Circuit { } @Override - @SuppressWarnings("rawtypes") public void onInsertion(int slot, Object tile) { IFarmHousing housing = getCircuitable(tile); if (housing == null) { diff --git a/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java b/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java index 54ceb9e49..92c5b16c6 100755 --- a/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java +++ b/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java @@ -89,6 +89,7 @@ public class ItemButterflyGE extends ItemGE { return butterfly.getDisplayName(); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { super.addInformation(itemstack, player, list, flag); diff --git a/src/main/java/forestry/mail/LetterProperties.java b/src/main/java/forestry/mail/LetterProperties.java index f46bba68b..7fe658a59 100644 --- a/src/main/java/forestry/mail/LetterProperties.java +++ b/src/main/java/forestry/mail/LetterProperties.java @@ -97,7 +97,7 @@ public class LetterProperties { } @SuppressWarnings("unchecked") - public static void getSubItems(Item item, CreativeTabs tab, List list) { + public static void getSubItems(Item item, CreativeTabs tab, @SuppressWarnings("rawtypes") List list) { for (State state : State.values()) { for (Size size : Size.values()) { int meta = encodeMeta(state, size); diff --git a/src/main/java/forestry/mail/gui/GuiCatalogue.java b/src/main/java/forestry/mail/gui/GuiCatalogue.java index 272d75a22..cd8594b89 100755 --- a/src/main/java/forestry/mail/gui/GuiCatalogue.java +++ b/src/main/java/forestry/mail/gui/GuiCatalogue.java @@ -43,7 +43,6 @@ public class GuiCatalogue extends GuiForestry { this.ySize = 192; } - @SuppressWarnings("unchecked") @Override public void initGui() { super.initGui(); diff --git a/src/main/java/forestry/mail/items/ItemLetter.java b/src/main/java/forestry/mail/items/ItemLetter.java index d2b35d192..13a65a3f7 100755 --- a/src/main/java/forestry/mail/items/ItemLetter.java +++ b/src/main/java/forestry/mail/items/ItemLetter.java @@ -82,7 +82,7 @@ public class ItemLetter extends ItemWithGui { } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + public void getSubItems(Item item, CreativeTabs tab, @SuppressWarnings("rawtypes") List list) { LetterProperties.getSubItems(item, tab, list); } diff --git a/src/main/java/forestry/plugins/PluginFactory.java b/src/main/java/forestry/plugins/PluginFactory.java index cb5d4b52e..3c66e21bb 100644 --- a/src/main/java/forestry/plugins/PluginFactory.java +++ b/src/main/java/forestry/plugins/PluginFactory.java @@ -26,7 +26,6 @@ import forestry.api.fuels.FermenterFuel; import forestry.api.fuels.FuelManager; import forestry.api.fuels.MoistenerFuel; import forestry.api.fuels.RainSubstrate; -import forestry.api.recipes.ICraftingProvider; import forestry.api.recipes.RecipeManagers; import forestry.apiculture.items.ItemRegistryApiculture; import forestry.core.blocks.BlockCoreType; @@ -78,7 +77,7 @@ public class PluginFactory extends ForestryPlugin { protected void setupAPI() { super.setupAPI(); - RecipeManagers.craftingProviders = ImmutableList.of( + RecipeManagers.craftingProviders = ImmutableList.of( RecipeManagers.carpenterManager = new CarpenterRecipeManager(), RecipeManagers.centrifugeManager = new CentrifugeRecipeManager(), RecipeManagers.fabricatorManager = new FabricatorRecipeManager(), @@ -95,7 +94,7 @@ public class PluginFactory extends ForestryPlugin { protected void disabledSetupAPI() { super.disabledSetupAPI(); - RecipeManagers.craftingProviders = ImmutableList.of( + RecipeManagers.craftingProviders = ImmutableList.of( RecipeManagers.carpenterManager = new DummyManagers.DummyCarpenterManager(), RecipeManagers.centrifugeManager = new DummyManagers.DummyCentrifugeManager(), RecipeManagers.fabricatorManager = new DummyManagers.DummyFabricatorManager(), diff --git a/src/main/java/forestry/plugins/PluginLepidopterology.java b/src/main/java/forestry/plugins/PluginLepidopterology.java index 081a9fac7..74a508d9b 100755 --- a/src/main/java/forestry/plugins/PluginLepidopterology.java +++ b/src/main/java/forestry/plugins/PluginLepidopterology.java @@ -131,7 +131,6 @@ public class PluginLepidopterology extends ForestryPlugin { config.save(); } - @SuppressWarnings("unchecked") @Override protected void registerRecipes() { CraftingManager.getInstance().getRecipeList().add(new MatingRecipe()); diff --git a/src/main/java/forestry/plugins/PluginStorage.java b/src/main/java/forestry/plugins/PluginStorage.java index 148e87f84..5c065292b 100755 --- a/src/main/java/forestry/plugins/PluginStorage.java +++ b/src/main/java/forestry/plugins/PluginStorage.java @@ -100,7 +100,7 @@ public class PluginStorage extends ForestryPlugin { public static ItemRegistryStorage items; @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({ "unchecked" }) protected void setupAPI() { super.setupAPI(); @@ -149,7 +149,7 @@ public class PluginStorage extends ForestryPlugin { } @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({ "unchecked" }) protected void disabledSetupAPI() { BackpackManager.backpackItems = new ArrayList[6]; BackpackManager.backpackItems[0] = minerItems; @@ -186,12 +186,12 @@ public class PluginStorage extends ForestryPlugin { config.save(); BackpackDefinition forester = (BackpackDefinition) BackpackManager.definitions.get("forester"); - forester.addValidBlockClasses(Arrays.asList(IPlantable.class, IGrowable.class, IShearable.class)); - forester.addValidItemClasses(Arrays.asList(IPlantable.class, IGrowable.class)); + forester.addValidBlockClasses(Arrays.asList(IPlantable.class, IGrowable.class, IShearable.class)); + forester.addValidItemClasses(Arrays.asList(IPlantable.class, IGrowable.class)); BackpackDefinition builder = (BackpackDefinition) BackpackManager.definitions.get("builder"); builder.addValidBlockClasses( - Arrays.asList( + Arrays.asList( BlockStairs.class, BlockFence.class, BlockFenceGate.class, diff --git a/src/main/java/forestry/storage/BackpackDefinition.java b/src/main/java/forestry/storage/BackpackDefinition.java index 04937a539..d38d5177e 100755 --- a/src/main/java/forestry/storage/BackpackDefinition.java +++ b/src/main/java/forestry/storage/BackpackDefinition.java @@ -33,8 +33,8 @@ public class BackpackDefinition implements IBackpackDefinition { private final Set validItemStacks = new HashSet<>(); private final Set validOreIds = new HashSet<>(); - private final Set validItemClasses = new HashSet<>(); - private final Set validBlockClasses = new HashSet<>(); + private final Set> validItemClasses = new HashSet<>(); + private final Set> validBlockClasses = new HashSet<>(); public BackpackDefinition(String name, int primaryColor) { this(name, primaryColor, 0xffffff); @@ -125,26 +125,26 @@ public class BackpackDefinition implements IBackpackDefinition { } } - public void addValidItemClass(Class itemClass) { + public void addValidItemClass(Class itemClass) { if (itemClass != null) { validItemClasses.add(itemClass); } } - public void addValidItemClasses(List itemClasses) { - for (Class itemClass : itemClasses) { + public void addValidItemClasses(List> itemClasses) { + for (Class itemClass : itemClasses) { addValidItemClass(itemClass); } } - public void addValidBlockClass(Class blockClass) { + public void addValidBlockClass(Class blockClass) { if (blockClass != null) { validBlockClasses.add(blockClass); } } - public void addValidBlockClasses(List blockClasses) { - for (Class blockClass : blockClasses) { + public void addValidBlockClasses(List> blockClasses) { + for (Class blockClass : blockClasses) { addValidBlockClass(blockClass); } } @@ -157,11 +157,11 @@ public class BackpackDefinition implements IBackpackDefinition { return validOreIds; } - public Set getValidBlockClasses() { + public Set> getValidBlockClasses() { return validBlockClasses; } - public Set getValidItemClasses() { + public Set> getValidItemClasses() { return validItemClasses; } @@ -197,7 +197,7 @@ public class BackpackDefinition implements IBackpackDefinition { } } - for (Class itemClass : validItemClasses) { + for (Class itemClass : validItemClasses) { if (itemClass.isInstance(item)) { validItemStacks.add(itemStackStringWild); return true; @@ -206,7 +206,7 @@ public class BackpackDefinition implements IBackpackDefinition { Block block = Block.getBlockFromItem(item); if (block != null) { - for (Class blockClass : validBlockClasses) { + for (Class blockClass : validBlockClasses) { if (blockClass.isInstance(block)) { validItemStacks.add(itemStackStringWild); return true;