Various code improvements
This commit is contained in:
@@ -38,7 +38,7 @@ public interface IFluidStorageCache {
|
||||
* Removes a fluid from the cache.
|
||||
* <p>
|
||||
* 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
|
||||
*/
|
||||
|
||||
@@ -6,8 +6,8 @@ import com.raoulvdberge.refinedstorage.api.autocrafting.craftingmonitor.ICraftin
|
||||
import java.util.*;
|
||||
|
||||
public class CraftingMonitorElementList implements ICraftingMonitorElementList {
|
||||
public List<ICraftingMonitorElement> elements = new LinkedList<>();
|
||||
public Map<String, Map<Integer, ICraftingMonitorElement>> currentLists = new LinkedHashMap<>();
|
||||
private List<ICraftingMonitorElement> elements = new LinkedList<>();
|
||||
private Map<String, Map<Integer, ICraftingMonitorElement>> currentLists = new LinkedHashMap<>();
|
||||
|
||||
@Override
|
||||
public void directAdd(ICraftingMonitorElement element) {
|
||||
|
||||
@@ -197,7 +197,7 @@ public class NetworkNodeGraph implements INetworkNodeGraph {
|
||||
controller.getDataManager().sendParameterToWatchers(TileController.NODES);
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
protected World getWorld() {
|
||||
return controller.getWorld();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GuiCraftingMonitor extends GuiBase {
|
||||
this.scrollbar = new Scrollbar(157, 20, 12, 89);
|
||||
}
|
||||
|
||||
public List<ICraftingMonitorElement> getElements() {
|
||||
private List<ICraftingMonitorElement> getElements() {
|
||||
return craftingMonitor.isConnected() ? ELEMENTS : Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Set;
|
||||
public class ModGuiFactory implements IModGuiFactory {
|
||||
@Override
|
||||
public void initialize(Minecraft mc) {
|
||||
|
||||
// NO OP
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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<Item, ClientStackItem> ITEMS = Multimaps.synchronizedListMultimap(ArrayListMultimap.create());
|
||||
public static final ListMultimap<Fluid, ClientStackFluid> FLUIDS = Multimaps.synchronizedListMultimap(ArrayListMultimap.create());
|
||||
|
||||
@@ -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<Integer> parameter;
|
||||
|
||||
public SideButtonIOMode(GuiBase gui, TileDataParameter<Integer> 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -15,5 +15,5 @@ public abstract class MessageHandlerPlayerToServer<T extends IMessage> implement
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract void handle(T message, EntityPlayerMP player);
|
||||
protected abstract void handle(T message, EntityPlayerMP player);
|
||||
}
|
||||
|
||||
@@ -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.<ItemOverride>of());
|
||||
super(ImmutableList.of());
|
||||
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@@ -21,12 +21,7 @@ public class PropertyObject<T> implements IUnlistedProperty<T> {
|
||||
}
|
||||
|
||||
public PropertyObject(String name, Class<T> clazz) {
|
||||
this(name, clazz, Predicates.<T>alwaysTrue(), new Function<T, String>() {
|
||||
@Override
|
||||
public String apply(T input) {
|
||||
return Objects.toString(input);
|
||||
}
|
||||
});
|
||||
this(name, clazz, Predicates.alwaysTrue(), input -> Objects.toString(input));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user