From 74519fb75bb87dd4fc6ef9aa2f3e69ec5b0640b2 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Sat, 26 Nov 2016 10:00:00 +0100 Subject: [PATCH] Various code improvements --- .../api/storage/fluid/IFluidStorageCache.java | 2 +- .../CraftingMonitorElementList.java | 4 +- .../apiimpl/network/NetworkNodeGraph.java | 2 +- .../storage/fluid/FluidStorageNBT.java | 2 +- .../apiimpl/storage/item/ItemStorageNBT.java | 2 +- .../refinedstorage/block/BlockCable.java | 5 ++- .../block/BlockConstructor.java | 6 +-- .../refinedstorage/block/BlockDestructor.java | 6 +-- .../refinedstorage/block/BlockExporter.java | 36 ++++++++-------- .../block/BlockExternalStorage.java | 12 +++--- .../refinedstorage/block/BlockImporter.java | 42 +++++++++---------- .../container/ContainerGrid.java | 2 +- .../container/slot/SlotSpecimenLegacy.java | 2 +- .../gui/GuiCraftingMonitor.java | 2 +- .../gui/GuiDiskManipulator.java | 2 +- .../gui/config/ModGuiConfig.java | 7 ++-- .../gui/config/ModGuiFactory.java | 2 +- .../refinedstorage/gui/grid/GuiGrid.java | 4 +- .../gui/sidebutton/SideButtonIOMode.java | 13 ++---- .../jei/RecipeTransferHandlerPattern.java | 1 - .../network/MessageHandlerPlayerToServer.java | 2 +- .../refinedstorage/render/BakedModelTRSR.java | 7 +++- .../refinedstorage/render/PropertyObject.java | 7 +--- .../refinedstorage/tile/TileController.java | 7 +--- .../refinedstorage/tile/TileDetector.java | 2 +- .../tile/TileNetworkTransmitter.java | 4 +- .../tile/TileProcessingPatternEncoder.java | 1 - .../refinedstorage/tile/TileSolderer.java | 4 +- .../externalstorage/FluidStorageExternal.java | 4 +- 29 files changed, 86 insertions(+), 106 deletions(-) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/api/storage/fluid/IFluidStorageCache.java b/src/main/java/com/raoulvdberge/refinedstorage/api/storage/fluid/IFluidStorageCache.java index 458c3499f..2ca4ef979 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/api/storage/fluid/IFluidStorageCache.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/api/storage/fluid/IFluidStorageCache.java @@ -38,7 +38,7 @@ public interface IFluidStorageCache { * Removes a fluid from the cache. *

* Note that this doesn't modify any of the connected storages, but just modifies the cache. - * Use {@link INetworkMaster#extractFluid(FluidStack, int, int)} to remove an fluid from an actual storage. + * Use {@link INetworkMaster#extractFluid(FluidStack, int, int, boolean)} to remove an fluid from an actual storage. * * @param stack the fluid to remove, do NOT modify */ diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/craftingmonitor/CraftingMonitorElementList.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/craftingmonitor/CraftingMonitorElementList.java index d3a3188cc..89bbb6417 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/craftingmonitor/CraftingMonitorElementList.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/craftingmonitor/CraftingMonitorElementList.java @@ -6,8 +6,8 @@ import com.raoulvdberge.refinedstorage.api.autocrafting.craftingmonitor.ICraftin import java.util.*; public class CraftingMonitorElementList implements ICraftingMonitorElementList { - public List elements = new LinkedList<>(); - public Map> currentLists = new LinkedHashMap<>(); + private List elements = new LinkedList<>(); + private Map> currentLists = new LinkedHashMap<>(); @Override public void directAdd(ICraftingMonitorElement element) { diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/NetworkNodeGraph.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/NetworkNodeGraph.java index 1bd5943e6..91faf32cd 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/NetworkNodeGraph.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/NetworkNodeGraph.java @@ -197,7 +197,7 @@ public class NetworkNodeGraph implements INetworkNodeGraph { controller.getDataManager().sendParameterToWatchers(TileController.NODES); } - public World getWorld() { + protected World getWorld() { return controller.getWorld(); } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/fluid/FluidStorageNBT.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/fluid/FluidStorageNBT.java index b8942c656..b99c16b37 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/fluid/FluidStorageNBT.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/fluid/FluidStorageNBT.java @@ -47,7 +47,7 @@ public abstract class FluidStorageNBT implements IFluidStorage { readFromNBT(); } - public void readFromNBT() { + private void readFromNBT() { NBTTagList list = (NBTTagList) tag.getTag(NBT_FLUIDS); for (int i = 0; i < list.tagCount(); ++i) { diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/item/ItemStorageNBT.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/item/ItemStorageNBT.java index 4cdf83bc0..9f0eda42a 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/item/ItemStorageNBT.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/item/ItemStorageNBT.java @@ -53,7 +53,7 @@ public abstract class ItemStorageNBT implements IItemStorage { readFromNBT(); } - public void readFromNBT() { + private void readFromNBT() { NBTTagList list = (NBTTagList) tag.getTag(NBT_ITEMS); for (int i = 0; i < list.tagCount(); ++i) { diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockCable.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockCable.java index bf9181492..e69f0b3fd 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockCable.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockCable.java @@ -30,7 +30,9 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.items.IItemHandler; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class BlockCable extends BlockCoverable { protected static final PropertyDirection DIRECTION = PropertyDirection.create("direction"); @@ -254,6 +256,7 @@ public class BlockCable extends BlockCoverable { } @Override + @SuppressWarnings("deprecation") public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase entity) { IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, entity); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockConstructor.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockConstructor.java index 93a45f6d8..882fc5faf 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockConstructor.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockConstructor.java @@ -31,12 +31,8 @@ public class BlockConstructor extends BlockCable { public static final AxisAlignedBB HEAD_DOWN_AABB = createAABB(0, 0, 0, 16, 2, 16); public static final AxisAlignedBB HEAD_UP_AABB = createAABB(0, 14, 0, 16, 16, 16); - public BlockConstructor(String name) { - super(name); - } - public BlockConstructor() { - this("constructor"); + super("constructor"); } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockDestructor.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockDestructor.java index f333996d7..f2ad5c822 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockDestructor.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockDestructor.java @@ -17,12 +17,8 @@ import net.minecraft.world.World; import java.util.List; public class BlockDestructor extends BlockCable { - public BlockDestructor(String name) { - super(name); - } - public BlockDestructor() { - this("destructor"); + super("destructor"); } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockExporter.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockExporter.java index 41a61c44d..db179a31d 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockExporter.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockExporter.java @@ -17,24 +17,24 @@ import java.util.ArrayList; import java.util.List; public class BlockExporter extends BlockCable { - public static final AxisAlignedBB LINE_NORTH_1_AABB = createAABB(6, 6, 0, 10, 10, 2); - public static final AxisAlignedBB LINE_NORTH_2_AABB = createAABB(5, 5, 2, 11, 11, 4); - public static final AxisAlignedBB LINE_NORTH_3_AABB = createAABB(3, 3, 4, 13, 13, 6); - public static final AxisAlignedBB LINE_EAST_1_AABB = createAABB(14, 6, 6, 16, 10, 10); - public static final AxisAlignedBB LINE_EAST_2_AABB = createAABB(12, 5, 5, 14, 11, 11); - public static final AxisAlignedBB LINE_EAST_3_AABB = createAABB(10, 3, 3, 12, 13, 13); - public static final AxisAlignedBB LINE_SOUTH_1_AABB = createAABB(6, 6, 14, 10, 10, 16); - public static final AxisAlignedBB LINE_SOUTH_2_AABB = createAABB(5, 5, 12, 11, 11, 14); - public static final AxisAlignedBB LINE_SOUTH_3_AABB = createAABB(3, 3, 10, 13, 13, 12); - public static final AxisAlignedBB LINE_WEST_1_AABB = createAABB(0, 6, 6, 2, 10, 10); - public static final AxisAlignedBB LINE_WEST_2_AABB = createAABB(2, 5, 5, 4, 11, 11); - public static final AxisAlignedBB LINE_WEST_3_AABB = createAABB(4, 3, 3, 6, 13, 13); - public static final AxisAlignedBB LINE_UP_1_AABB = createAABB(6, 14, 6, 10, 16, 10); - public static final AxisAlignedBB LINE_UP_2_AABB = createAABB(5, 12, 5, 11, 14, 11); - public static final AxisAlignedBB LINE_UP_3_AABB = createAABB(3, 10, 3, 13, 12, 13); - public static final AxisAlignedBB LINE_DOWN_1_AABB = createAABB(6, 0, 6, 10, 2, 10); - public static final AxisAlignedBB LINE_DOWN_2_AABB = createAABB(5, 2, 5, 11, 4, 11); - public static final AxisAlignedBB LINE_DOWN_3_AABB = createAABB(3, 4, 3, 13, 6, 13); + private static final AxisAlignedBB LINE_NORTH_1_AABB = createAABB(6, 6, 0, 10, 10, 2); + private static final AxisAlignedBB LINE_NORTH_2_AABB = createAABB(5, 5, 2, 11, 11, 4); + private static final AxisAlignedBB LINE_NORTH_3_AABB = createAABB(3, 3, 4, 13, 13, 6); + private static final AxisAlignedBB LINE_EAST_1_AABB = createAABB(14, 6, 6, 16, 10, 10); + private static final AxisAlignedBB LINE_EAST_2_AABB = createAABB(12, 5, 5, 14, 11, 11); + private static final AxisAlignedBB LINE_EAST_3_AABB = createAABB(10, 3, 3, 12, 13, 13); + private static final AxisAlignedBB LINE_SOUTH_1_AABB = createAABB(6, 6, 14, 10, 10, 16); + private static final AxisAlignedBB LINE_SOUTH_2_AABB = createAABB(5, 5, 12, 11, 11, 14); + private static final AxisAlignedBB LINE_SOUTH_3_AABB = createAABB(3, 3, 10, 13, 13, 12); + private static final AxisAlignedBB LINE_WEST_1_AABB = createAABB(0, 6, 6, 2, 10, 10); + private static final AxisAlignedBB LINE_WEST_2_AABB = createAABB(2, 5, 5, 4, 11, 11); + private static final AxisAlignedBB LINE_WEST_3_AABB = createAABB(4, 3, 3, 6, 13, 13); + private static final AxisAlignedBB LINE_UP_1_AABB = createAABB(6, 14, 6, 10, 16, 10); + private static final AxisAlignedBB LINE_UP_2_AABB = createAABB(5, 12, 5, 11, 14, 11); + private static final AxisAlignedBB LINE_UP_3_AABB = createAABB(3, 10, 3, 13, 12, 13); + private static final AxisAlignedBB LINE_DOWN_1_AABB = createAABB(6, 0, 6, 10, 2, 10); + private static final AxisAlignedBB LINE_DOWN_2_AABB = createAABB(5, 2, 5, 11, 4, 11); + private static final AxisAlignedBB LINE_DOWN_3_AABB = createAABB(3, 4, 3, 13, 6, 13); public BlockExporter() { super("exporter"); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockExternalStorage.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockExternalStorage.java index e63accaf6..7665dcda2 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockExternalStorage.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockExternalStorage.java @@ -18,12 +18,12 @@ import java.util.ArrayList; import java.util.List; public class BlockExternalStorage extends BlockCable { - public static final AxisAlignedBB HEAD_NORTH_AABB = createAABB(3, 3, 0, 13, 13, 2); - public static final AxisAlignedBB HEAD_EAST_AABB = createAABB(14, 3, 3, 16, 13, 13); - public static final AxisAlignedBB HEAD_SOUTH_AABB = createAABB(3, 3, 14, 13, 13, 16); - public static final AxisAlignedBB HEAD_WEST_AABB = createAABB(0, 3, 3, 2, 13, 13); - public static final AxisAlignedBB HEAD_UP_AABB = createAABB(3, 14, 3, 13, 16, 13); - public static final AxisAlignedBB HEAD_DOWN_AABB = createAABB(3, 0, 3, 13, 2, 13); + private static final AxisAlignedBB HEAD_NORTH_AABB = createAABB(3, 3, 0, 13, 13, 2); + private static final AxisAlignedBB HEAD_EAST_AABB = createAABB(14, 3, 3, 16, 13, 13); + private static final AxisAlignedBB HEAD_SOUTH_AABB = createAABB(3, 3, 14, 13, 13, 16); + private static final AxisAlignedBB HEAD_WEST_AABB = createAABB(0, 3, 3, 2, 13, 13); + private static final AxisAlignedBB HEAD_UP_AABB = createAABB(3, 14, 3, 13, 16, 13); + private static final AxisAlignedBB HEAD_DOWN_AABB = createAABB(3, 0, 3, 13, 2, 13); public BlockExternalStorage() { super("external_storage"); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockImporter.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockImporter.java index c39e1d39d..d81c6add5 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockImporter.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockImporter.java @@ -17,31 +17,27 @@ import java.util.ArrayList; import java.util.List; public class BlockImporter extends BlockCable { - public static final AxisAlignedBB LINE_NORTH_1_AABB = createAABB(6, 6, 4, 10, 10, 6); - public static final AxisAlignedBB LINE_NORTH_2_AABB = createAABB(5, 5, 2, 11, 11, 4); - public static final AxisAlignedBB LINE_NORTH_3_AABB = createAABB(3, 3, 0, 13, 13, 2); - public static final AxisAlignedBB LINE_EAST_1_AABB = createAABB(10, 6, 6, 12, 10, 10); - public static final AxisAlignedBB LINE_EAST_2_AABB = createAABB(12, 5, 5, 14, 11, 11); - public static final AxisAlignedBB LINE_EAST_3_AABB = createAABB(14, 3, 3, 16, 13, 13); - public static final AxisAlignedBB LINE_SOUTH_1_AABB = createAABB(6, 6, 10, 10, 10, 12); - public static final AxisAlignedBB LINE_SOUTH_2_AABB = createAABB(5, 5, 12, 11, 11, 14); - public static final AxisAlignedBB LINE_SOUTH_3_AABB = createAABB(3, 3, 14, 13, 13, 16); - public static final AxisAlignedBB LINE_WEST_1_AABB = createAABB(4, 6, 6, 6, 10, 10); - public static final AxisAlignedBB LINE_WEST_2_AABB = createAABB(2, 5, 5, 4, 11, 11); - public static final AxisAlignedBB LINE_WEST_3_AABB = createAABB(0, 3, 3, 2, 13, 13); - public static final AxisAlignedBB LINE_UP_1_AABB = createAABB(6, 10, 6, 10, 12, 10); - public static final AxisAlignedBB LINE_UP_2_AABB = createAABB(5, 12, 5, 11, 14, 11); - public static final AxisAlignedBB LINE_UP_3_AABB = createAABB(3, 14, 3, 13, 16, 13); - public static final AxisAlignedBB LINE_DOWN_1_AABB = createAABB(6, 4, 6, 10, 6, 10); - public static final AxisAlignedBB LINE_DOWN_2_AABB = createAABB(5, 2, 5, 11, 4, 11); - public static final AxisAlignedBB LINE_DOWN_3_AABB = createAABB(3, 0, 3, 13, 2, 13); - - public BlockImporter(String name) { - super(name); - } + private static final AxisAlignedBB LINE_NORTH_1_AABB = createAABB(6, 6, 4, 10, 10, 6); + private static final AxisAlignedBB LINE_NORTH_2_AABB = createAABB(5, 5, 2, 11, 11, 4); + private static final AxisAlignedBB LINE_NORTH_3_AABB = createAABB(3, 3, 0, 13, 13, 2); + private static final AxisAlignedBB LINE_EAST_1_AABB = createAABB(10, 6, 6, 12, 10, 10); + private static final AxisAlignedBB LINE_EAST_2_AABB = createAABB(12, 5, 5, 14, 11, 11); + private static final AxisAlignedBB LINE_EAST_3_AABB = createAABB(14, 3, 3, 16, 13, 13); + private static final AxisAlignedBB LINE_SOUTH_1_AABB = createAABB(6, 6, 10, 10, 10, 12); + private static final AxisAlignedBB LINE_SOUTH_2_AABB = createAABB(5, 5, 12, 11, 11, 14); + private static final AxisAlignedBB LINE_SOUTH_3_AABB = createAABB(3, 3, 14, 13, 13, 16); + private static final AxisAlignedBB LINE_WEST_1_AABB = createAABB(4, 6, 6, 6, 10, 10); + private static final AxisAlignedBB LINE_WEST_2_AABB = createAABB(2, 5, 5, 4, 11, 11); + private static final AxisAlignedBB LINE_WEST_3_AABB = createAABB(0, 3, 3, 2, 13, 13); + private static final AxisAlignedBB LINE_UP_1_AABB = createAABB(6, 10, 6, 10, 12, 10); + private static final AxisAlignedBB LINE_UP_2_AABB = createAABB(5, 12, 5, 11, 14, 11); + private static final AxisAlignedBB LINE_UP_3_AABB = createAABB(3, 14, 3, 13, 16, 13); + private static final AxisAlignedBB LINE_DOWN_1_AABB = createAABB(6, 4, 6, 10, 6, 10); + private static final AxisAlignedBB LINE_DOWN_2_AABB = createAABB(5, 2, 5, 11, 4, 11); + private static final AxisAlignedBB LINE_DOWN_3_AABB = createAABB(3, 0, 3, 13, 2, 13); public BlockImporter() { - this("importer"); + super("importer"); } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerGrid.java index f68962546..11b26d6e5 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerGrid.java @@ -46,7 +46,7 @@ public class ContainerGrid extends ContainerBase { int y = 96; for (int i = 0; i < 9; ++i) { - addSlotToContainer(new SlotSpecimenLegacy(((TileGrid) grid).getMatrix(), i, x, y, false)); + addSlotToContainer(new SlotSpecimenLegacy(((TileGrid) grid).getMatrix(), i, x, y)); x += 18; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/container/slot/SlotSpecimenLegacy.java b/src/main/java/com/raoulvdberge/refinedstorage/container/slot/SlotSpecimenLegacy.java index b29cb9784..9d649da70 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/container/slot/SlotSpecimenLegacy.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/container/slot/SlotSpecimenLegacy.java @@ -7,7 +7,7 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class SlotSpecimenLegacy extends Slot { - public SlotSpecimenLegacy(IInventory inventory, int id, int x, int y, boolean allowSize) { + public SlotSpecimenLegacy(IInventory inventory, int id, int x, int y) { super(inventory, id, x, y); } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiCraftingMonitor.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiCraftingMonitor.java index 16d610745..bdd91ff5e 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiCraftingMonitor.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiCraftingMonitor.java @@ -57,7 +57,7 @@ public class GuiCraftingMonitor extends GuiBase { this.scrollbar = new Scrollbar(157, 20, 12, 89); } - public List getElements() { + private List getElements() { return craftingMonitor.isConnected() ? ELEMENTS : Collections.emptyList(); } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiDiskManipulator.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiDiskManipulator.java index 7f909fc99..0de0320ad 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiDiskManipulator.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiDiskManipulator.java @@ -13,7 +13,7 @@ public class GuiDiskManipulator extends GuiBase { @Override public void init(int x, int y) { addSideButton(new SideButtonRedstoneMode(this, TileDiskManipulator.REDSTONE_MODE)); - addSideButton(new SideButtonIOMode(this, TileDiskManipulator.IO_MODE)); + addSideButton(new SideButtonIOMode(this)); addSideButton(new SideButtonType(this, TileDiskManipulator.TYPE)); addSideButton(new SideButtonMode(this, TileDiskManipulator.MODE)); addSideButton(new SideButtonCompare(this, TileDiskManipulator.COMPARE, IComparer.COMPARE_DAMAGE)); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/config/ModGuiConfig.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/config/ModGuiConfig.java index 5505b704d..cdcc1e2e6 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/config/ModGuiConfig.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/config/ModGuiConfig.java @@ -5,13 +5,14 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.fml.client.config.GuiConfig; public class ModGuiConfig extends GuiConfig { - public ModGuiConfig(GuiScreen guiScreen) { - super(guiScreen, + super( + guiScreen, RS.INSTANCE.config.getConfigElements(), RS.ID, false, false, - GuiConfig.getAbridgedConfigPath(RS.INSTANCE.config.getConfig().toString())); + GuiConfig.getAbridgedConfigPath(RS.INSTANCE.config.getConfig().toString()) + ); } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/config/ModGuiFactory.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/config/ModGuiFactory.java index 0db9c2d74..ce077401b 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/config/ModGuiFactory.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/config/ModGuiFactory.java @@ -9,7 +9,7 @@ import java.util.Set; public class ModGuiFactory implements IModGuiFactory { @Override public void initialize(Minecraft mc) { - + // NO OP } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java index b29335c8f..b957761e1 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java @@ -43,8 +43,8 @@ import java.util.*; import java.util.concurrent.ThreadLocalRandom; public class GuiGrid extends GuiBase { - public static final GridSortingQuantity SORTING_QUANTITY = new GridSortingQuantity(); - public static final GridSortingName SORTING_NAME = new GridSortingName(); + private static final GridSortingQuantity SORTING_QUANTITY = new GridSortingQuantity(); + private static final GridSortingName SORTING_NAME = new GridSortingName(); public static final ListMultimap ITEMS = Multimaps.synchronizedListMultimap(ArrayListMultimap.create()); public static final ListMultimap FLUIDS = Multimaps.synchronizedListMultimap(ArrayListMultimap.create()); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/sidebutton/SideButtonIOMode.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/sidebutton/SideButtonIOMode.java index 9b0900495..199db81ce 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/sidebutton/SideButtonIOMode.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/sidebutton/SideButtonIOMode.java @@ -3,30 +3,25 @@ package com.raoulvdberge.refinedstorage.gui.sidebutton; import com.raoulvdberge.refinedstorage.gui.GuiBase; import com.raoulvdberge.refinedstorage.tile.TileDiskManipulator; import com.raoulvdberge.refinedstorage.tile.data.TileDataManager; -import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter; import net.minecraft.util.text.TextFormatting; public class SideButtonIOMode extends SideButton { - private TileDataParameter parameter; - - public SideButtonIOMode(GuiBase gui, TileDataParameter parameter) { + public SideButtonIOMode(GuiBase gui) { super(gui); - - this.parameter = parameter; } @Override public String getTooltip() { - return TextFormatting.GREEN + GuiBase.t("sidebutton.refinedstorage:iomode") + TextFormatting.RESET + "\n" + GuiBase.t("sidebutton.refinedstorage:iomode." + (parameter.getValue() == TileDiskManipulator.IO_MODE_INSERT ? "insert" : "extract")); + return TextFormatting.GREEN + GuiBase.t("sidebutton.refinedstorage:iomode") + TextFormatting.RESET + "\n" + GuiBase.t("sidebutton.refinedstorage:iomode." + (TileDiskManipulator.IO_MODE.getValue() == TileDiskManipulator.IO_MODE_INSERT ? "insert" : "extract")); } @Override protected void drawButtonIcon(int x, int y) { - gui.drawTexture(x, y, parameter.getValue() == TileDiskManipulator.IO_MODE_EXTRACT ? 0 : 16, 160, 16, 16); + gui.drawTexture(x, y, TileDiskManipulator.IO_MODE.getValue() == TileDiskManipulator.IO_MODE_EXTRACT ? 0 : 16, 160, 16, 16); } @Override public void actionPerformed() { - TileDataManager.setParameter(parameter, parameter.getValue() == TileDiskManipulator.IO_MODE_INSERT ? TileDiskManipulator.IO_MODE_EXTRACT : TileDiskManipulator.IO_MODE_INSERT); + TileDataManager.setParameter(TileDiskManipulator.IO_MODE, TileDiskManipulator.IO_MODE.getValue() == TileDiskManipulator.IO_MODE_INSERT ? TileDiskManipulator.IO_MODE_EXTRACT : TileDiskManipulator.IO_MODE_INSERT); } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java index a0884db84..2603c509c 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java @@ -12,7 +12,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import javax.annotation.Nullable; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/network/MessageHandlerPlayerToServer.java b/src/main/java/com/raoulvdberge/refinedstorage/network/MessageHandlerPlayerToServer.java index bd8849ba8..15858857c 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/network/MessageHandlerPlayerToServer.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/network/MessageHandlerPlayerToServer.java @@ -15,5 +15,5 @@ public abstract class MessageHandlerPlayerToServer implement return null; } - public abstract void handle(T message, EntityPlayerMP player); + protected abstract void handle(T message, EntityPlayerMP player); } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/render/BakedModelTRSR.java b/src/main/java/com/raoulvdberge/refinedstorage/render/BakedModelTRSR.java index 7c19847b0..43cce8ef1 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/render/BakedModelTRSR.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/render/BakedModelTRSR.java @@ -2,7 +2,10 @@ package com.raoulvdberge.refinedstorage.render; import com.google.common.collect.ImmutableList; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.*; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormatElement; @@ -131,7 +134,7 @@ public class BakedModelTRSR implements IBakedModel { private final BakedModelTRSR model; public TRSROverride(BakedModelTRSR model) { - super(ImmutableList.of()); + super(ImmutableList.of()); this.model = model; } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/render/PropertyObject.java b/src/main/java/com/raoulvdberge/refinedstorage/render/PropertyObject.java index 4e9d44a82..659c99cdd 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/render/PropertyObject.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/render/PropertyObject.java @@ -21,12 +21,7 @@ public class PropertyObject implements IUnlistedProperty { } public PropertyObject(String name, Class clazz) { - this(name, clazz, Predicates.alwaysTrue(), new Function() { - @Override - public String apply(T input) { - return Objects.toString(input); - } - }); + this(name, clazz, Predicates.alwaysTrue(), input -> Objects.toString(input)); } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileController.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileController.java index cb871b75b..190b63569 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileController.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileController.java @@ -256,10 +256,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR boolean craftingTasksChanged = !craftingTasksToAdd.isEmpty() || !craftingTasksToCancel.isEmpty(); - for (ICraftingTask taskToCancel : craftingTasksToCancel) { - taskToCancel.onCancelled(); - } - + craftingTasksToCancel.forEach(ICraftingTask::onCancelled); craftingTasks.removeAll(craftingTasksToCancel); craftingTasksToCancel.clear(); @@ -816,7 +813,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR return getWorld(); } - public static ICraftingTask readCraftingTask(World world, INetworkMaster network, NBTTagCompound tag) { + private static ICraftingTask readCraftingTask(World world, INetworkMaster network, NBTTagCompound tag) { ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTag(ICraftingTask.NBT_PATTERN_STACK)); if (stack != null && stack.getItem() instanceof ICraftingPatternProvider) { diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileDetector.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileDetector.java index b309272a7..767759142 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileDetector.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileDetector.java @@ -177,7 +177,7 @@ public class TileDetector extends TileNode implements IComparable, IType { return powered; } - public boolean isPowered(Integer size) { + private boolean isPowered(Integer size) { if (size != null) { switch (mode) { case MODE_UNDER: diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileNetworkTransmitter.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileNetworkTransmitter.java index 5c297ccd9..5ef7f4e36 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileNetworkTransmitter.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileNetworkTransmitter.java @@ -136,7 +136,7 @@ public class TileNetworkTransmitter extends TileNode { return receiverDimension; } - public int getDistance() { + private int getDistance() { if (receiver == null) { return 0; } @@ -148,7 +148,7 @@ public class TileNetworkTransmitter extends TileNode { return getWorld().provider.getDimension() == receiverDimension; } - public boolean isDimensionSupported() { + private boolean isDimensionSupported() { return isSameDimension() || upgrades.hasUpgrade(ItemUpgrade.TYPE_INTERDIMENSIONAL); } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileProcessingPatternEncoder.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileProcessingPatternEncoder.java index 340c05741..62fc0d812 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileProcessingPatternEncoder.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileProcessingPatternEncoder.java @@ -17,7 +17,6 @@ import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; public class TileProcessingPatternEncoder extends TileBase { private static final String NBT_OREDICT_PATTERN = "OredictPattern"; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileSolderer.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileSolderer.java index e8b8e7c79..8a55028f9 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileSolderer.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileSolderer.java @@ -90,7 +90,7 @@ public class TileSolderer extends TileNode { if (newRecipe == null) { stop(); } else if (newRecipe != recipe) { - boolean sameItem = result.getStackInSlot(0) != null ? API.instance().getComparer().isEqualNoQuantity(result.getStackInSlot(0), newRecipe.getResult()) : false; + boolean sameItem = result.getStackInSlot(0) != null && API.instance().getComparer().isEqualNoQuantity(result.getStackInSlot(0), newRecipe.getResult()); if (result.getStackInSlot(0) == null || (sameItem && ((result.getStackInSlot(0).stackSize + newRecipe.getResult().stackSize) <= result.getStackInSlot(0).getMaxStackSize()))) { recipe = newRecipe; @@ -134,7 +134,7 @@ public class TileSolderer extends TileNode { } } - public void stop() { + private void stop() { progress = 0; working = false; recipe = null; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/externalstorage/FluidStorageExternal.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/externalstorage/FluidStorageExternal.java index 6d615b29d..caea5f5a7 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/externalstorage/FluidStorageExternal.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/externalstorage/FluidStorageExternal.java @@ -26,11 +26,11 @@ public class FluidStorageExternal implements IFluidStorage { this.handler = handler; } - public IFluidTankProperties getProperties() { + private IFluidTankProperties getProperties() { return handler.getTankProperties().length != 0 ? handler.getTankProperties()[0] : null; } - public FluidStack getContents() { + private FluidStack getContents() { return getProperties() == null ? null : getProperties().getContents(); }