Cleanup
This commit is contained in:
@@ -347,6 +347,14 @@ public final class RSUtils {
|
||||
return String.valueOf(qty);
|
||||
}
|
||||
|
||||
public static AxisAlignedBB getAABB(int fromX, int fromY, int fromZ, int toX, int toY, int toZ) {
|
||||
return new AxisAlignedBB((float) fromX / 16F, (float) fromY / 16F, (float) fromZ / 16F, (float) toX / 16F, (float) toY / 16F, (float) toZ / 16F);
|
||||
}
|
||||
|
||||
public static boolean isInAABB(AxisAlignedBB aabb, float hitX, float hitY, float hitZ) {
|
||||
return hitX >= aabb.minX && hitX <= aabb.maxX && hitY >= aabb.minY && hitY <= aabb.maxY && hitZ >= aabb.minZ && hitZ <= aabb.maxZ;
|
||||
}
|
||||
|
||||
private static class AdvancedRayTraceResultBase<T extends RayTraceResult> {
|
||||
public final AxisAlignedBB bounds;
|
||||
public final T hit;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.apiimpl.autocrafting;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.api.autocrafting.ICraftingPatternChain;
|
||||
import com.raoulvdberge.refinedstorage.api.autocrafting.ICraftingPattern;
|
||||
import com.raoulvdberge.refinedstorage.api.autocrafting.ICraftingPatternChain;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
@@ -90,8 +90,8 @@ public class CraftingPatternChainList implements Iterable<CraftingPatternChainLi
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(ICraftingPattern iCraftingPattern) {
|
||||
return isValidForChain(iCraftingPattern) && innerList.add(iCraftingPattern);
|
||||
public boolean add(ICraftingPattern pattern) {
|
||||
return isValidForChain(pattern) && innerList.add(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,6 +107,7 @@ public class CraftingPatternChainList implements Iterable<CraftingPatternChainLi
|
||||
@Override
|
||||
public boolean addAll(Collection<? extends ICraftingPattern> c) {
|
||||
c.removeIf(p -> !isValidForChain(p));
|
||||
|
||||
return innerList.addAll(c);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ public class NetworkNodeCable extends NetworkNode {
|
||||
@Override
|
||||
public boolean canConduct(@Nullable EnumFacing direction) {
|
||||
if (IntegrationMCMP.isLoaded() && direction != null) {
|
||||
return RSMCMPAddon.hasConnectionWith(holder.world().getTileEntity(holder.pos()), Collections.singletonList(BlockCable.directionToAABB(direction)))
|
||||
&& RSMCMPAddon.hasConnectionWith(holder.world().getTileEntity(holder.pos().offset(direction)), Collections.singletonList(BlockCable.directionToAABB(direction.getOpposite())));
|
||||
return RSMCMPAddon.hasConnectionWith(holder.world().getTileEntity(holder.pos()), Collections.singletonList(BlockCable.getCableExtensionAABB(direction)))
|
||||
&& RSMCMPAddon.hasConnectionWith(holder.world().getTileEntity(holder.pos().offset(direction)), Collections.singletonList(BlockCable.getCableExtensionAABB(direction.getOpposite())));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.raoulvdberge.refinedstorage.api.storage.IStorageProvider;
|
||||
import com.raoulvdberge.refinedstorage.api.util.IComparer;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid;
|
||||
import com.raoulvdberge.refinedstorage.block.BlockFluidStorage;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumFluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.FluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFluid;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerNetworkNode;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileFluidStorage;
|
||||
@@ -72,7 +72,7 @@ public class NetworkNodeFluidStorage extends NetworkNode implements IGuiStorage,
|
||||
private StorageFluid storage = new StorageFluid(StorageDiskFluid.getTag());
|
||||
private NBTTagCompound storageTagToRead;
|
||||
|
||||
private EnumFluidStorageType type;
|
||||
private FluidStorageType type;
|
||||
|
||||
private AccessType accessType = AccessType.INSERT_EXTRACT;
|
||||
private int priority = 0;
|
||||
@@ -201,12 +201,12 @@ public class NetworkNodeFluidStorage extends NetworkNode implements IGuiStorage,
|
||||
accessType = RSUtils.readAccessType(tag);
|
||||
}
|
||||
|
||||
public EnumFluidStorageType getType() {
|
||||
public FluidStorageType getType() {
|
||||
if (type == null && holder.world() != null && holder.world().getBlockState(holder.pos()).getBlock() == RSBlocks.FLUID_STORAGE) {
|
||||
type = (EnumFluidStorageType) holder.world().getBlockState(holder.pos()).getValue(BlockFluidStorage.TYPE);
|
||||
type = (FluidStorageType) holder.world().getBlockState(holder.pos()).getValue(BlockFluidStorage.TYPE);
|
||||
}
|
||||
|
||||
return type == null ? EnumFluidStorageType.TYPE_64K : type;
|
||||
return type == null ? FluidStorageType.TYPE_64K : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.raoulvdberge.refinedstorage.api.network.security.Permission;
|
||||
import com.raoulvdberge.refinedstorage.api.util.IComparer;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
import com.raoulvdberge.refinedstorage.block.BlockGrid;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFilter;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerNetworkNode;
|
||||
@@ -86,7 +86,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
|
||||
private List<FilterTab> tabs = new ArrayList<>();
|
||||
private ItemHandlerFilter filter = new ItemHandlerFilter(filters, tabs, new ItemHandlerListenerNetworkNode(this));
|
||||
|
||||
private EnumGridType type;
|
||||
private GridType type;
|
||||
|
||||
private int viewType = VIEW_TYPE_NORMAL;
|
||||
private int sortingDirection = SORTING_DIRECTION_DESCENDING;
|
||||
@@ -150,17 +150,17 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
|
||||
this.oredictPattern = oredictPattern;
|
||||
}
|
||||
|
||||
public EnumGridType getType() {
|
||||
public GridType getType() {
|
||||
if (type == null && holder.world().getBlockState(holder.pos()).getBlock() == RSBlocks.GRID) {
|
||||
type = (EnumGridType) holder.world().getBlockState(holder.pos()).getValue(BlockGrid.TYPE);
|
||||
type = (GridType) holder.world().getBlockState(holder.pos()).getValue(BlockGrid.TYPE);
|
||||
}
|
||||
|
||||
return type == null ? EnumGridType.NORMAL : type;
|
||||
return type == null ? GridType.NORMAL : type;
|
||||
}
|
||||
|
||||
public void onOpened(EntityPlayer player) {
|
||||
if (network != null) {
|
||||
if (getType() == EnumGridType.FLUID) {
|
||||
if (getType() == GridType.FLUID) {
|
||||
network.sendFluidStorageToClient((EntityPlayerMP) player);
|
||||
} else {
|
||||
network.sendItemStorageToClient((EntityPlayerMP) player);
|
||||
@@ -170,7 +170,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
|
||||
|
||||
@Override
|
||||
public String getGuiTitle() {
|
||||
return getType() == EnumGridType.FLUID ? "gui.refinedstorage:fluid_grid" : "gui.refinedstorage:grid";
|
||||
return getType() == GridType.FLUID ? "gui.refinedstorage:fluid_grid" : "gui.refinedstorage:grid";
|
||||
}
|
||||
|
||||
public IItemHandler getPatterns() {
|
||||
@@ -211,7 +211,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
|
||||
|
||||
@Override
|
||||
public void onRecipeTransfer(EntityPlayer player, ItemStack[][] recipe) {
|
||||
if (network != null && getType() == EnumGridType.CRAFTING && !network.getSecurityManager().hasPermission(Permission.EXTRACT, player)) {
|
||||
if (network != null && getType() == GridType.CRAFTING && !network.getSecurityManager().hasPermission(Permission.EXTRACT, player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
|
||||
|
||||
if (!slot.isEmpty()) {
|
||||
// Only if we are a crafting grid. Pattern grids can just be emptied.
|
||||
if (getType() == EnumGridType.CRAFTING) {
|
||||
if (getType() == GridType.CRAFTING) {
|
||||
// If we are connected, try to insert into network. If it fails, stop.
|
||||
if (network != null) {
|
||||
if (network.insertItem(slot, slot.getCount(), true) != null) {
|
||||
@@ -247,7 +247,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
|
||||
ItemStack[] possibilities = recipe[i];
|
||||
|
||||
// If we are a crafting grid
|
||||
if (getType() == EnumGridType.CRAFTING) {
|
||||
if (getType() == GridType.CRAFTING) {
|
||||
boolean found = false;
|
||||
|
||||
// If we are connected, first try to get the possibilities from the network
|
||||
@@ -285,7 +285,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (getType() == EnumGridType.PATTERN) {
|
||||
} else if (getType() == GridType.PATTERN) {
|
||||
// If we are a pattern grid we can just set the slot
|
||||
matrix.setInventorySlotContents(i, possibilities[0]);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.raoulvdberge.refinedstorage.api.storage.IStorageProvider;
|
||||
import com.raoulvdberge.refinedstorage.api.util.IComparer;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem;
|
||||
import com.raoulvdberge.refinedstorage.block.BlockStorage;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.ItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerNetworkNode;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileStorage;
|
||||
@@ -71,7 +71,7 @@ public class NetworkNodeStorage extends NetworkNode implements IGuiStorage, ISto
|
||||
private StorageItem storage = new StorageItem(StorageDiskItem.getTag());
|
||||
private NBTTagCompound storageTagToRead = null;
|
||||
|
||||
private EnumItemStorageType type;
|
||||
private ItemStorageType type;
|
||||
|
||||
private AccessType accessType = AccessType.INSERT_EXTRACT;
|
||||
private int priority = 0;
|
||||
@@ -196,12 +196,12 @@ public class NetworkNodeStorage extends NetworkNode implements IGuiStorage, ISto
|
||||
accessType = RSUtils.readAccessType(tag);
|
||||
}
|
||||
|
||||
public EnumItemStorageType getType() {
|
||||
public ItemStorageType getType() {
|
||||
if (type == null && holder.world() != null && holder.world().getBlockState(holder.pos()).getBlock() == RSBlocks.STORAGE) {
|
||||
type = (EnumItemStorageType) holder.world().getBlockState(holder.pos()).getValue(BlockStorage.TYPE);
|
||||
type = (ItemStorageType) holder.world().getBlockState(holder.pos()).getValue(BlockStorage.TYPE);
|
||||
}
|
||||
|
||||
return type == null ? EnumItemStorageType.TYPE_1K : type;
|
||||
return type == null ? ItemStorageType.TYPE_1K : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,8 +14,8 @@ import com.raoulvdberge.refinedstorage.apiimpl.network.node.INetworkNodeHolder;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNode;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumFluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.FluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.ItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.inventory.IItemValidator;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFluid;
|
||||
@@ -330,7 +330,7 @@ public class NetworkNodeDiskDrive extends NetworkNode implements IGuiStorage, IS
|
||||
ItemStack disk = disks.getStackInSlot(i);
|
||||
|
||||
if (!disk.isEmpty()) {
|
||||
int diskCapacity = disk.getItem() == RSItems.STORAGE_DISK ? EnumItemStorageType.getById(disk.getItemDamage()).getCapacity() : EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity();
|
||||
int diskCapacity = disk.getItem() == RSItems.STORAGE_DISK ? ItemStorageType.getById(disk.getItemDamage()).getCapacity() : FluidStorageType.getById(disk.getItemDamage()).getCapacity();
|
||||
|
||||
if (diskCapacity == -1) {
|
||||
return -1;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.solderer;
|
||||
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.RSItems;
|
||||
import com.raoulvdberge.refinedstorage.api.solderer.ISoldererRecipe;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumFluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.FluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemBlockFluidStorage;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemProcessor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -12,10 +12,10 @@ import net.minecraft.util.NonNullList;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SoldererRecipeFluidStorage implements ISoldererRecipe {
|
||||
private EnumFluidStorageType type;
|
||||
private FluidStorageType type;
|
||||
private NonNullList<ItemStack> rows = NonNullList.create();
|
||||
|
||||
public SoldererRecipeFluidStorage(EnumFluidStorageType type, int storagePart) {
|
||||
public SoldererRecipeFluidStorage(FluidStorageType type, int storagePart) {
|
||||
this.type = type;
|
||||
|
||||
this.rows.add(new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC));
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.solderer;
|
||||
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.RSItems;
|
||||
import com.raoulvdberge.refinedstorage.api.solderer.ISoldererRecipe;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.ItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemBlockStorage;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemProcessor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -12,10 +12,10 @@ import net.minecraft.util.NonNullList;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SoldererRecipeStorage implements ISoldererRecipe {
|
||||
private EnumItemStorageType type;
|
||||
private ItemStorageType type;
|
||||
private NonNullList<ItemStack> rows = NonNullList.create();
|
||||
|
||||
public SoldererRecipeStorage(EnumItemStorageType type, int storagePart) {
|
||||
public SoldererRecipeStorage(ItemStorageType type, int storagePart) {
|
||||
this.type = type;
|
||||
|
||||
this.rows.add(new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC));
|
||||
|
||||
@@ -193,7 +193,7 @@ public abstract class BlockBase extends Block {
|
||||
return super.canEntityDestroy(state, world, pos, entity);
|
||||
}
|
||||
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.HORIZONTAL;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.HORIZONTAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,17 +26,13 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCable extends BlockNode {
|
||||
protected static AxisAlignedBB createAABB(int fromX, int fromY, int fromZ, int toX, int toY, int toZ) {
|
||||
return new AxisAlignedBB((float) fromX / 16F, (float) fromY / 16F, (float) fromZ / 16F, (float) toX / 16F, (float) toY / 16F, (float) toZ / 16F);
|
||||
}
|
||||
|
||||
public static final AxisAlignedBB CORE_AABB = createAABB(6, 6, 6, 10, 10, 10);
|
||||
protected static final AxisAlignedBB NORTH_AABB = createAABB(6, 6, 0, 10, 10, 6);
|
||||
protected static final AxisAlignedBB EAST_AABB = createAABB(10, 6, 6, 16, 10, 10);
|
||||
protected static final AxisAlignedBB SOUTH_AABB = createAABB(6, 6, 10, 10, 10, 16);
|
||||
protected static final AxisAlignedBB WEST_AABB = createAABB(0, 6, 6, 6, 10, 10);
|
||||
protected static final AxisAlignedBB UP_AABB = createAABB(6, 10, 6, 10, 16, 10);
|
||||
protected static final AxisAlignedBB DOWN_AABB = createAABB(6, 0, 6, 10, 6, 10);
|
||||
public static final AxisAlignedBB CORE_AABB = RSUtils.getAABB(6, 6, 6, 10, 10, 10);
|
||||
private static final AxisAlignedBB NORTH_AABB = RSUtils.getAABB(6, 6, 0, 10, 10, 6);
|
||||
private static final AxisAlignedBB EAST_AABB = RSUtils.getAABB(10, 6, 6, 16, 10, 10);
|
||||
private static final AxisAlignedBB SOUTH_AABB = RSUtils.getAABB(6, 6, 10, 10, 10, 16);
|
||||
private static final AxisAlignedBB WEST_AABB = RSUtils.getAABB(0, 6, 6, 6, 10, 10);
|
||||
private static final AxisAlignedBB UP_AABB = RSUtils.getAABB(6, 10, 6, 10, 16, 10);
|
||||
private static final AxisAlignedBB DOWN_AABB = RSUtils.getAABB(6, 0, 6, 10, 6, 10);
|
||||
|
||||
protected static final PropertyBool NORTH = PropertyBool.create("north");
|
||||
protected static final PropertyBool EAST = PropertyBool.create("east");
|
||||
@@ -123,8 +119,8 @@ public class BlockCable extends BlockNode {
|
||||
}
|
||||
|
||||
if (IntegrationMCMP.isLoaded()) {
|
||||
return RSMCMPAddon.hasConnectionWith(tile, Collections.singletonList(BlockCable.directionToAABB(direction)))
|
||||
&& RSMCMPAddon.hasConnectionWith(otherTile, Collections.singletonList(BlockCable.directionToAABB(direction.getOpposite())));
|
||||
return RSMCMPAddon.hasConnectionWith(tile, Collections.singletonList(BlockCable.getCableExtensionAABB(direction)))
|
||||
&& RSMCMPAddon.hasConnectionWith(otherTile, Collections.singletonList(BlockCable.getCableExtensionAABB(direction.getOpposite())));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -133,38 +129,16 @@ public class BlockCable extends BlockNode {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static AxisAlignedBB directionToAABB(EnumFacing facing) {
|
||||
if (facing == EnumFacing.NORTH) {
|
||||
return NORTH_AABB;
|
||||
} else if (facing == EnumFacing.EAST) {
|
||||
return EAST_AABB;
|
||||
} else if (facing == EnumFacing.SOUTH) {
|
||||
return SOUTH_AABB;
|
||||
} else if (facing == EnumFacing.WEST) {
|
||||
return WEST_AABB;
|
||||
} else if (facing == EnumFacing.UP) {
|
||||
return UP_AABB;
|
||||
} else if (facing == EnumFacing.DOWN) {
|
||||
return DOWN_AABB;
|
||||
}
|
||||
|
||||
return NORTH_AABB;
|
||||
}
|
||||
|
||||
private boolean isInAABB(AxisAlignedBB aabb, float hitX, float hitY, float hitZ) {
|
||||
return hitX >= aabb.minX && hitX <= aabb.maxX && hitY >= aabb.minY && hitY <= aabb.maxY && hitZ >= aabb.minZ && hitZ <= aabb.maxZ;
|
||||
}
|
||||
|
||||
protected boolean hitCablePart(IBlockState state, World world, BlockPos pos, float hitX, float hitY, float hitZ) {
|
||||
state = getActualState(state, world, pos);
|
||||
|
||||
return isInAABB(CORE_AABB, hitX, hitY, hitZ) ||
|
||||
(state.getValue(NORTH) && isInAABB(NORTH_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(EAST) && isInAABB(EAST_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(SOUTH) && isInAABB(SOUTH_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(WEST) && isInAABB(WEST_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(UP) && isInAABB(UP_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(DOWN) && isInAABB(DOWN_AABB, hitX, hitY, hitZ));
|
||||
return RSUtils.isInAABB(CORE_AABB, hitX, hitY, hitZ) ||
|
||||
(state.getValue(NORTH) && RSUtils.isInAABB(NORTH_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(EAST) && RSUtils.isInAABB(EAST_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(SOUTH) && RSUtils.isInAABB(SOUTH_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(WEST) && RSUtils.isInAABB(WEST_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(UP) && RSUtils.isInAABB(UP_AABB, hitX, hitY, hitZ)) ||
|
||||
(state.getValue(DOWN) && RSUtils.isInAABB(DOWN_AABB, hitX, hitY, hitZ));
|
||||
}
|
||||
|
||||
public List<AxisAlignedBB> getUnionizedCollisionBoxes(IBlockState state) {
|
||||
@@ -258,7 +232,25 @@ public class BlockCable extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AxisAlignedBB getCableExtensionAABB(EnumFacing facing) {
|
||||
if (facing == EnumFacing.NORTH) {
|
||||
return NORTH_AABB;
|
||||
} else if (facing == EnumFacing.EAST) {
|
||||
return EAST_AABB;
|
||||
} else if (facing == EnumFacing.SOUTH) {
|
||||
return SOUTH_AABB;
|
||||
} else if (facing == EnumFacing.WEST) {
|
||||
return WEST_AABB;
|
||||
} else if (facing == EnumFacing.UP) {
|
||||
return UP_AABB;
|
||||
} else if (facing == EnumFacing.DOWN) {
|
||||
return DOWN_AABB;
|
||||
}
|
||||
|
||||
return NORTH_AABB;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSGui;
|
||||
import com.raoulvdberge.refinedstorage.RSUtils;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileConstructor;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,19 +16,19 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockConstructor extends BlockCable {
|
||||
public static final AxisAlignedBB HOLDER_NORTH_AABB = createAABB(7, 7, 2, 9, 9, 6);
|
||||
public static final AxisAlignedBB HOLDER_EAST_AABB = createAABB(10, 7, 7, 14, 9, 9);
|
||||
public static final AxisAlignedBB HOLDER_SOUTH_AABB = createAABB(7, 7, 10, 9, 9, 14);
|
||||
public static final AxisAlignedBB HOLDER_WEST_AABB = createAABB(2, 7, 7, 6, 9, 9);
|
||||
public static final AxisAlignedBB HOLDER_UP_AABB = createAABB(7, 10, 7, 9, 14, 9);
|
||||
public static final AxisAlignedBB HOLDER_DOWN_AABB = createAABB(7, 2, 7, 9, 6, 9);
|
||||
public static final AxisAlignedBB HOLDER_NORTH_AABB = RSUtils.getAABB(7, 7, 2, 9, 9, 6);
|
||||
public static final AxisAlignedBB HOLDER_EAST_AABB = RSUtils.getAABB(10, 7, 7, 14, 9, 9);
|
||||
public static final AxisAlignedBB HOLDER_SOUTH_AABB = RSUtils.getAABB(7, 7, 10, 9, 9, 14);
|
||||
public static final AxisAlignedBB HOLDER_WEST_AABB = RSUtils.getAABB(2, 7, 7, 6, 9, 9);
|
||||
public static final AxisAlignedBB HOLDER_UP_AABB = RSUtils.getAABB(7, 10, 7, 9, 14, 9);
|
||||
public static final AxisAlignedBB HOLDER_DOWN_AABB = RSUtils.getAABB(7, 2, 7, 9, 6, 9);
|
||||
|
||||
public static final AxisAlignedBB HEAD_NORTH_AABB = createAABB(0, 0, 0, 16, 16, 2);
|
||||
public static final AxisAlignedBB HEAD_EAST_AABB = createAABB(14, 0, 0, 16, 16, 16);
|
||||
public static final AxisAlignedBB HEAD_SOUTH_AABB = createAABB(0, 0, 14, 16, 16, 16);
|
||||
public static final AxisAlignedBB HEAD_WEST_AABB = createAABB(0, 0, 0, 2, 16, 16);
|
||||
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 static final AxisAlignedBB HEAD_NORTH_AABB = RSUtils.getAABB(0, 0, 0, 16, 16, 2);
|
||||
public static final AxisAlignedBB HEAD_EAST_AABB = RSUtils.getAABB(14, 0, 0, 16, 16, 16);
|
||||
public static final AxisAlignedBB HEAD_SOUTH_AABB = RSUtils.getAABB(0, 0, 14, 16, 16, 16);
|
||||
public static final AxisAlignedBB HEAD_WEST_AABB = RSUtils.getAABB(0, 0, 0, 2, 16, 16);
|
||||
public static final AxisAlignedBB HEAD_DOWN_AABB = RSUtils.getAABB(0, 0, 0, 16, 2, 16);
|
||||
public static final AxisAlignedBB HEAD_UP_AABB = RSUtils.getAABB(0, 14, 0, 16, 16, 16);
|
||||
|
||||
public BlockConstructor() {
|
||||
super("constructor");
|
||||
@@ -91,7 +92,7 @@ public class BlockConstructor extends BlockCable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.ANY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockController extends BlockBase {
|
||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumControllerType.class);
|
||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", ControllerType.class);
|
||||
|
||||
private static final PropertyInteger ENERGY = PropertyInteger.create("energy", 0, 7);
|
||||
|
||||
@@ -51,12 +51,12 @@ public class BlockController extends BlockBase {
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(TYPE, meta == 0 ? EnumControllerType.NORMAL : EnumControllerType.CREATIVE);
|
||||
return getDefaultState().withProperty(TYPE, meta == 0 ? ControllerType.NORMAL : ControllerType.CREATIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(TYPE) == EnumControllerType.NORMAL ? 0 : 1;
|
||||
return state.getValue(TYPE) == ControllerType.NORMAL ? 0 : 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,8 +30,8 @@ public class BlockCrafter extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY_FACE_PLAYER;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.ANY_FACE_PLAYER;
|
||||
}
|
||||
|
||||
public boolean hasConnectivityState() {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class BlockDestructor extends BlockCable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.ANY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class BlockDetector extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class BlockDiskManipulator extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.HORIZONTAL;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.HORIZONTAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSGui;
|
||||
import com.raoulvdberge.refinedstorage.RSUtils;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileExporter;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,24 +16,24 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockExporter extends BlockCable {
|
||||
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);
|
||||
private static final AxisAlignedBB LINE_NORTH_1_AABB = RSUtils.getAABB(6, 6, 0, 10, 10, 2);
|
||||
private static final AxisAlignedBB LINE_NORTH_2_AABB = RSUtils.getAABB(5, 5, 2, 11, 11, 4);
|
||||
private static final AxisAlignedBB LINE_NORTH_3_AABB = RSUtils.getAABB(3, 3, 4, 13, 13, 6);
|
||||
private static final AxisAlignedBB LINE_EAST_1_AABB = RSUtils.getAABB(14, 6, 6, 16, 10, 10);
|
||||
private static final AxisAlignedBB LINE_EAST_2_AABB = RSUtils.getAABB(12, 5, 5, 14, 11, 11);
|
||||
private static final AxisAlignedBB LINE_EAST_3_AABB = RSUtils.getAABB(10, 3, 3, 12, 13, 13);
|
||||
private static final AxisAlignedBB LINE_SOUTH_1_AABB = RSUtils.getAABB(6, 6, 14, 10, 10, 16);
|
||||
private static final AxisAlignedBB LINE_SOUTH_2_AABB = RSUtils.getAABB(5, 5, 12, 11, 11, 14);
|
||||
private static final AxisAlignedBB LINE_SOUTH_3_AABB = RSUtils.getAABB(3, 3, 10, 13, 13, 12);
|
||||
private static final AxisAlignedBB LINE_WEST_1_AABB = RSUtils.getAABB(0, 6, 6, 2, 10, 10);
|
||||
private static final AxisAlignedBB LINE_WEST_2_AABB = RSUtils.getAABB(2, 5, 5, 4, 11, 11);
|
||||
private static final AxisAlignedBB LINE_WEST_3_AABB = RSUtils.getAABB(4, 3, 3, 6, 13, 13);
|
||||
private static final AxisAlignedBB LINE_UP_1_AABB = RSUtils.getAABB(6, 14, 6, 10, 16, 10);
|
||||
private static final AxisAlignedBB LINE_UP_2_AABB = RSUtils.getAABB(5, 12, 5, 11, 14, 11);
|
||||
private static final AxisAlignedBB LINE_UP_3_AABB = RSUtils.getAABB(3, 10, 3, 13, 12, 13);
|
||||
private static final AxisAlignedBB LINE_DOWN_1_AABB = RSUtils.getAABB(6, 0, 6, 10, 2, 10);
|
||||
private static final AxisAlignedBB LINE_DOWN_2_AABB = RSUtils.getAABB(5, 2, 5, 11, 4, 11);
|
||||
private static final AxisAlignedBB LINE_DOWN_3_AABB = RSUtils.getAABB(3, 4, 3, 13, 6, 13);
|
||||
|
||||
public BlockExporter() {
|
||||
super("exporter");
|
||||
@@ -97,7 +98,7 @@ public class BlockExporter extends BlockCable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.ANY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSGui;
|
||||
import com.raoulvdberge.refinedstorage.RSUtils;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.externalstorage.NetworkNodeExternalStorage;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileExternalStorage;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -17,12 +18,12 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockExternalStorage extends BlockCable {
|
||||
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);
|
||||
private static final AxisAlignedBB HEAD_NORTH_AABB = RSUtils.getAABB(3, 3, 0, 13, 13, 2);
|
||||
private static final AxisAlignedBB HEAD_EAST_AABB = RSUtils.getAABB(14, 3, 3, 16, 13, 13);
|
||||
private static final AxisAlignedBB HEAD_SOUTH_AABB = RSUtils.getAABB(3, 3, 14, 13, 13, 16);
|
||||
private static final AxisAlignedBB HEAD_WEST_AABB = RSUtils.getAABB(0, 3, 3, 2, 13, 13);
|
||||
private static final AxisAlignedBB HEAD_UP_AABB = RSUtils.getAABB(3, 14, 3, 13, 16, 13);
|
||||
private static final AxisAlignedBB HEAD_DOWN_AABB = RSUtils.getAABB(3, 0, 3, 13, 2, 13);
|
||||
|
||||
public BlockExternalStorage() {
|
||||
super("external_storage");
|
||||
@@ -95,7 +96,7 @@ public class BlockExternalStorage extends BlockCable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.ANY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BlockFluidInterface extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockFluidStorage extends BlockNode {
|
||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumFluidStorageType.class);
|
||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", FluidStorageType.class);
|
||||
|
||||
public BlockFluidStorage() {
|
||||
super("fluid_storage");
|
||||
@@ -50,12 +50,12 @@ public class BlockFluidStorage extends BlockNode {
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(TYPE, EnumFluidStorageType.getById(meta));
|
||||
return getDefaultState().withProperty(TYPE, FluidStorageType.getById(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumFluidStorageType) state.getValue(TYPE)).getId();
|
||||
return ((FluidStorageType) state.getValue(TYPE)).getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,7 +112,7 @@ public class BlockFluidStorage extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockGrid extends BlockNode {
|
||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumGridType.class);
|
||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", GridType.class);
|
||||
|
||||
public BlockGrid() {
|
||||
super("grid");
|
||||
@@ -45,12 +45,12 @@ public class BlockGrid extends BlockNode {
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(TYPE, meta == 0 ? EnumGridType.NORMAL : (meta == 1 ? EnumGridType.CRAFTING : (meta == 2 ? EnumGridType.PATTERN : EnumGridType.FLUID)));
|
||||
return getDefaultState().withProperty(TYPE, meta == 0 ? GridType.NORMAL : (meta == 1 ? GridType.CRAFTING : (meta == 2 ? GridType.PATTERN : GridType.FLUID)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(TYPE) == EnumGridType.NORMAL ? 0 : (state.getValue(TYPE) == EnumGridType.CRAFTING ? 1 : (state.getValue(TYPE) == EnumGridType.PATTERN ? 2 : 3));
|
||||
return state.getValue(TYPE) == GridType.NORMAL ? 0 : (state.getValue(TYPE) == GridType.CRAFTING ? 1 : (state.getValue(TYPE) == GridType.PATTERN ? 2 : 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSGui;
|
||||
import com.raoulvdberge.refinedstorage.RSUtils;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileImporter;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,24 +16,24 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockImporter extends BlockCable {
|
||||
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);
|
||||
private static final AxisAlignedBB LINE_NORTH_1_AABB = RSUtils.getAABB(6, 6, 4, 10, 10, 6);
|
||||
private static final AxisAlignedBB LINE_NORTH_2_AABB = RSUtils.getAABB(5, 5, 2, 11, 11, 4);
|
||||
private static final AxisAlignedBB LINE_NORTH_3_AABB = RSUtils.getAABB(3, 3, 0, 13, 13, 2);
|
||||
private static final AxisAlignedBB LINE_EAST_1_AABB = RSUtils.getAABB(10, 6, 6, 12, 10, 10);
|
||||
private static final AxisAlignedBB LINE_EAST_2_AABB = RSUtils.getAABB(12, 5, 5, 14, 11, 11);
|
||||
private static final AxisAlignedBB LINE_EAST_3_AABB = RSUtils.getAABB(14, 3, 3, 16, 13, 13);
|
||||
private static final AxisAlignedBB LINE_SOUTH_1_AABB = RSUtils.getAABB(6, 6, 10, 10, 10, 12);
|
||||
private static final AxisAlignedBB LINE_SOUTH_2_AABB = RSUtils.getAABB(5, 5, 12, 11, 11, 14);
|
||||
private static final AxisAlignedBB LINE_SOUTH_3_AABB = RSUtils.getAABB(3, 3, 14, 13, 13, 16);
|
||||
private static final AxisAlignedBB LINE_WEST_1_AABB = RSUtils.getAABB(4, 6, 6, 6, 10, 10);
|
||||
private static final AxisAlignedBB LINE_WEST_2_AABB = RSUtils.getAABB(2, 5, 5, 4, 11, 11);
|
||||
private static final AxisAlignedBB LINE_WEST_3_AABB = RSUtils.getAABB(0, 3, 3, 2, 13, 13);
|
||||
private static final AxisAlignedBB LINE_UP_1_AABB = RSUtils.getAABB(6, 10, 6, 10, 12, 10);
|
||||
private static final AxisAlignedBB LINE_UP_2_AABB = RSUtils.getAABB(5, 12, 5, 11, 14, 11);
|
||||
private static final AxisAlignedBB LINE_UP_3_AABB = RSUtils.getAABB(3, 14, 3, 13, 16, 13);
|
||||
private static final AxisAlignedBB LINE_DOWN_1_AABB = RSUtils.getAABB(6, 4, 6, 10, 6, 10);
|
||||
private static final AxisAlignedBB LINE_DOWN_2_AABB = RSUtils.getAABB(5, 2, 5, 11, 4, 11);
|
||||
private static final AxisAlignedBB LINE_DOWN_3_AABB = RSUtils.getAABB(3, 0, 3, 13, 2, 13);
|
||||
|
||||
public BlockImporter() {
|
||||
super("importer");
|
||||
@@ -97,7 +98,7 @@ public class BlockImporter extends BlockCable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.ANY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BlockInterface extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ public class BlockMachineCasing extends BlockBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BlockNetworkReceiver extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BlockNetworkTransmitter extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BlockProcessingPatternEncoder extends BlockBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ public class BlockQuartzEnrichedIron extends BlockBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class BlockReader extends BlockCable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY_FACE_PLAYER;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.ANY_FACE_PLAYER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BlockRelay extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public class BlockSolderer extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.HORIZONTAL;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.HORIZONTAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockStorage extends BlockNode {
|
||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumItemStorageType.class);
|
||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", ItemStorageType.class);
|
||||
|
||||
public BlockStorage() {
|
||||
super("storage");
|
||||
@@ -50,12 +50,12 @@ public class BlockStorage extends BlockNode {
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(TYPE, EnumItemStorageType.getById(meta));
|
||||
return getDefaultState().withProperty(TYPE, ItemStorageType.getById(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumItemStorageType) state.getValue(TYPE)).getId();
|
||||
return ((ItemStorageType) state.getValue(TYPE)).getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,7 +112,7 @@ public class BlockStorage extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class BlockWirelessTransmitter extends BlockNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
public PlacementType getPlacementType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public class BlockWriter extends BlockCable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY_FACE_PLAYER;
|
||||
public PlacementType getPlacementType() {
|
||||
return PlacementType.ANY_FACE_PLAYER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@ package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public enum EnumControllerType implements IStringSerializable {
|
||||
public enum ControllerType implements IStringSerializable {
|
||||
NORMAL(0, "normal"),
|
||||
CREATIVE(1, "creative");
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
EnumControllerType(int id, String name) {
|
||||
ControllerType(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public enum EnumFluidStorageType implements IStringSerializable {
|
||||
public enum FluidStorageType implements IStringSerializable {
|
||||
TYPE_64K(0, 64000, "64k"),
|
||||
TYPE_128K(1, 128000, "128k"),
|
||||
TYPE_256K(2, 256000, "256k"),
|
||||
@@ -13,7 +13,7 @@ public enum EnumFluidStorageType implements IStringSerializable {
|
||||
private int capacity;
|
||||
private String name;
|
||||
|
||||
EnumFluidStorageType(int id, int capacity, String name) {
|
||||
FluidStorageType(int id, int capacity, String name) {
|
||||
this.id = id;
|
||||
this.capacity = capacity;
|
||||
this.name = name;
|
||||
@@ -37,8 +37,8 @@ public enum EnumFluidStorageType implements IStringSerializable {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static EnumFluidStorageType getById(int id) {
|
||||
for (EnumFluidStorageType type : EnumFluidStorageType.values()) {
|
||||
public static FluidStorageType getById(int id) {
|
||||
for (FluidStorageType type : FluidStorageType.values()) {
|
||||
if (type.getId() == id) {
|
||||
return type;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public enum EnumGridType implements IStringSerializable {
|
||||
public enum GridType implements IStringSerializable {
|
||||
NORMAL(0, "normal"),
|
||||
CRAFTING(1, "crafting"),
|
||||
PATTERN(2, "pattern"),
|
||||
@@ -11,7 +11,7 @@ public enum EnumGridType implements IStringSerializable {
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
EnumGridType(int id, String name) {
|
||||
GridType(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public enum EnumItemStorageType implements IStringSerializable {
|
||||
public enum ItemStorageType implements IStringSerializable {
|
||||
TYPE_1K(0, 1000, "1k"),
|
||||
TYPE_4K(1, 4000, "4k"),
|
||||
TYPE_16K(2, 16000, "16k"),
|
||||
@@ -13,7 +13,7 @@ public enum EnumItemStorageType implements IStringSerializable {
|
||||
private int capacity;
|
||||
private String name;
|
||||
|
||||
EnumItemStorageType(int id, int capacity, String name) {
|
||||
ItemStorageType(int id, int capacity, String name) {
|
||||
this.id = id;
|
||||
this.capacity = capacity;
|
||||
this.name = name;
|
||||
@@ -37,8 +37,8 @@ public enum EnumItemStorageType implements IStringSerializable {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static EnumItemStorageType getById(int id) {
|
||||
for (EnumItemStorageType type : EnumItemStorageType.values()) {
|
||||
public static ItemStorageType getById(int id) {
|
||||
for (ItemStorageType type : ItemStorageType.values()) {
|
||||
if (type.getId() == id) {
|
||||
return type;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public enum EnumPlacementType {
|
||||
public enum PlacementType {
|
||||
ANY(
|
||||
EnumFacing.VALUES
|
||||
),
|
||||
@@ -20,7 +20,7 @@ public enum EnumPlacementType {
|
||||
|
||||
final EnumFacing[] allowed;
|
||||
|
||||
EnumPlacementType(EnumFacing... allowed) {
|
||||
PlacementType(EnumFacing... allowed) {
|
||||
this.allowed = allowed;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.raoulvdberge.refinedstorage.RSUtils;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IFluidGridHandler;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IItemGridHandler;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.container.slot.*;
|
||||
import com.raoulvdberge.refinedstorage.gui.grid.IGridDisplay;
|
||||
import com.raoulvdberge.refinedstorage.tile.grid.IGrid;
|
||||
@@ -46,7 +46,7 @@ public class ContainerGrid extends ContainerBase {
|
||||
|
||||
addPlayerInventory(8, display.getYPlayerInventory());
|
||||
|
||||
if (grid.getType() == EnumGridType.CRAFTING) {
|
||||
if (grid.getType() == GridType.CRAFTING) {
|
||||
int x = 26;
|
||||
int y = headerAndSlots + 4;
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ContainerGrid extends ContainerBase {
|
||||
}
|
||||
|
||||
addSlotToContainer(craftingResultSlot = new SlotGridCraftingResult(this, getPlayer(), (NetworkNodeGrid) grid, 0, 130 + 4, headerAndSlots + 22));
|
||||
} else if (grid.getType() == EnumGridType.PATTERN) {
|
||||
} else if (grid.getType() == GridType.PATTERN) {
|
||||
int x = 8;
|
||||
int y = headerAndSlots + 4;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ContainerGrid extends ContainerBase {
|
||||
addSlotToContainer(new SlotOutput(((NetworkNodeGrid) grid).getPatterns(), 1, 152, headerAndSlots + 40));
|
||||
}
|
||||
|
||||
if (grid.getType() != EnumGridType.FLUID) {
|
||||
if (grid.getType() != GridType.FLUID) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
addSlotToContainer(new SlotItemHandler(grid.getFilter(), i, 204, 6 + (18 * i) + getTabDelta()));
|
||||
}
|
||||
@@ -139,9 +139,9 @@ public class ContainerGrid extends ContainerBase {
|
||||
IItemGridHandler itemHandler = grid.getNetwork().getItemGridHandler();
|
||||
IFluidGridHandler fluidHandler = grid.getNetwork().getFluidGridHandler();
|
||||
|
||||
if (grid.getType() != EnumGridType.FLUID && itemHandler != null) {
|
||||
if (grid.getType() != GridType.FLUID && itemHandler != null) {
|
||||
slot.putStack(RSUtils.transformNullToEmpty(itemHandler.onInsert((EntityPlayerMP) player, slot.getStack())));
|
||||
} else if (grid.getType() == EnumGridType.FLUID && fluidHandler != null) {
|
||||
} else if (grid.getType() == GridType.FLUID && fluidHandler != null) {
|
||||
slot.putStack(RSUtils.transformNullToEmpty(fluidHandler.onInsert((EntityPlayerMP) player, slot.getStack())));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.google.common.collect.Multimaps;
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IItemGridHandler;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.container.ContainerGrid;
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
||||
import com.raoulvdberge.refinedstorage.gui.Scrollbar;
|
||||
@@ -92,7 +92,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
}
|
||||
|
||||
public GuiGrid(ContainerGrid container, IGrid grid) {
|
||||
super(container, grid.getType() == EnumGridType.FLUID ? 193 : 227, 0);
|
||||
super(container, grid.getType() == GridType.FLUID ? 193 : 227, 0);
|
||||
|
||||
this.grid = grid;
|
||||
this.wasConnected = this.grid.isActive();
|
||||
@@ -137,11 +137,11 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
searchField.yPosition = sy;
|
||||
}
|
||||
|
||||
if (grid.getType() == EnumGridType.PATTERN) {
|
||||
if (grid.getType() == GridType.PATTERN) {
|
||||
oredictPattern = addCheckBox(x + 64, y + getTabDelta() + getHeader() + (getVisibleRows() * 18) + 46, t("misc.refinedstorage:oredict"), TileGrid.OREDICT_PATTERN.getValue());
|
||||
}
|
||||
|
||||
if (grid.getType() != EnumGridType.FLUID) {
|
||||
if (grid.getType() != GridType.FLUID) {
|
||||
addSideButton(new SideButtonGridViewType(this, grid));
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
List<IGridStack> stacks = new ArrayList<>();
|
||||
|
||||
if (grid.isActive()) {
|
||||
stacks.addAll(grid.getType() == EnumGridType.FLUID ? FLUIDS.values() : ITEMS.values());
|
||||
stacks.addAll(grid.getType() == GridType.FLUID ? FLUIDS.values() : ITEMS.values());
|
||||
|
||||
List<Predicate<IGridStack>> filters = GridFilterParser.getFilters(
|
||||
grid,
|
||||
@@ -244,16 +244,16 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
|
||||
@Override
|
||||
public int getFooter() {
|
||||
return (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 156 : 99;
|
||||
return (grid.getType() == GridType.CRAFTING || grid.getType() == GridType.PATTERN) ? 156 : 99;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getYPlayerInventory() {
|
||||
int yp = getTabDelta() + getHeader() + (getVisibleRows() * 18);
|
||||
|
||||
if (grid.getType() == EnumGridType.NORMAL || grid.getType() == EnumGridType.FLUID) {
|
||||
if (grid.getType() == GridType.NORMAL || grid.getType() == GridType.FLUID) {
|
||||
yp += 16;
|
||||
} else if (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) {
|
||||
} else if (grid.getType() == GridType.CRAFTING || grid.getType() == GridType.PATTERN) {
|
||||
yp += 73;
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
}
|
||||
|
||||
private boolean isOverCreatePattern(int mouseX, int mouseY) {
|
||||
return grid.getType() == EnumGridType.PATTERN && inBounds(152, getTabDelta() + getHeader() + (getVisibleRows() * 18) + 22, 16, 16, mouseX, mouseY) && ((NetworkNodeGrid) grid).canCreatePattern();
|
||||
return grid.getType() == GridType.PATTERN && inBounds(152, getTabDelta() + getHeader() + (getVisibleRows() * 18) + 22, 16, 16, mouseX, mouseY) && ((NetworkNodeGrid) grid).canCreatePattern();
|
||||
}
|
||||
|
||||
private int getTabDelta() {
|
||||
@@ -370,9 +370,9 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
drawTab(tab, false, x, y, mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (grid.getType() == EnumGridType.CRAFTING) {
|
||||
if (grid.getType() == GridType.CRAFTING) {
|
||||
bindTexture("gui/crafting_grid.png");
|
||||
} else if (grid.getType() == EnumGridType.PATTERN) {
|
||||
} else if (grid.getType() == GridType.PATTERN) {
|
||||
bindTexture("gui/pattern_grid.png");
|
||||
} else {
|
||||
bindTexture("gui/grid.png");
|
||||
@@ -380,9 +380,9 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
|
||||
int yy = y + getTabDelta();
|
||||
|
||||
drawTexture(x, yy, 0, 0, screenWidth - (grid.getType() != EnumGridType.FLUID ? 34 : 0), getHeader());
|
||||
drawTexture(x, yy, 0, 0, screenWidth - (grid.getType() != GridType.FLUID ? 34 : 0), getHeader());
|
||||
|
||||
if (grid.getType() != EnumGridType.FLUID) {
|
||||
if (grid.getType() != GridType.FLUID) {
|
||||
drawTexture(x + screenWidth - 34 + 4, y + getTabDelta(), 197, 0, 30, 82);
|
||||
}
|
||||
|
||||
@@ -391,18 +391,18 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
for (int i = 0; i < rows; ++i) {
|
||||
yy += 18;
|
||||
|
||||
drawTexture(x, yy, 0, getHeader() + (i > 0 ? (i == rows - 1 ? 18 * 2 : 18) : 0), screenWidth - (grid.getType() != EnumGridType.FLUID ? 34 : 0), 18);
|
||||
drawTexture(x, yy, 0, getHeader() + (i > 0 ? (i == rows - 1 ? 18 * 2 : 18) : 0), screenWidth - (grid.getType() != GridType.FLUID ? 34 : 0), 18);
|
||||
}
|
||||
|
||||
yy += 18;
|
||||
|
||||
drawTexture(x, yy, 0, getHeader() + (18 * 3), screenWidth - (grid.getType() != EnumGridType.FLUID ? 34 : 0), getFooter());
|
||||
drawTexture(x, yy, 0, getHeader() + (18 * 3), screenWidth - (grid.getType() != GridType.FLUID ? 34 : 0), getFooter());
|
||||
|
||||
for (FilterTab tab : grid.getTabs()) {
|
||||
drawTab(tab, true, x, y, mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (grid.getType() == EnumGridType.PATTERN) {
|
||||
if (grid.getType() == GridType.PATTERN) {
|
||||
int ty = 0;
|
||||
|
||||
if (isOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) {
|
||||
@@ -529,11 +529,11 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
ItemStack held = ((ContainerGrid) this.inventorySlots).getPlayer().inventory.getItemStack();
|
||||
|
||||
if (isOverSlotArea(mouseX - guiLeft, mouseY - guiTop) && !held.isEmpty() && (clickedButton == 0 || clickedButton == 1)) {
|
||||
RS.INSTANCE.network.sendToServer(grid.getType() == EnumGridType.FLUID ? new MessageGridFluidInsertHeld() : new MessageGridItemInsertHeld(clickedButton == 1));
|
||||
RS.INSTANCE.network.sendToServer(grid.getType() == GridType.FLUID ? new MessageGridFluidInsertHeld() : new MessageGridItemInsertHeld(clickedButton == 1));
|
||||
}
|
||||
|
||||
if (isOverSlotWithItem()) {
|
||||
if (grid.getType() != EnumGridType.FLUID && (held.isEmpty() || (!held.isEmpty() && clickedButton == 2))) {
|
||||
if (grid.getType() != GridType.FLUID && (held.isEmpty() || (!held.isEmpty() && clickedButton == 2))) {
|
||||
GridStackItem stack = (GridStackItem) STACKS.get(slotNumber);
|
||||
|
||||
if (stack.isCraftable() && (stack.doesDisplayCraftText() || (GuiScreen.isShiftKeyDown() && GuiScreen.isCtrlKeyDown())) && CAN_CRAFT) {
|
||||
@@ -555,7 +555,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
|
||||
RS.INSTANCE.network.sendToServer(new MessageGridItemPull(stack.getHash(), flags));
|
||||
}
|
||||
} else if (grid.getType() == EnumGridType.FLUID && held.isEmpty()) {
|
||||
} else if (grid.getType() == GridType.FLUID && held.isEmpty()) {
|
||||
RS.INSTANCE.network.sendToServer(new MessageGridFluidPull(STACKS.get(slotNumber).getHash(), GuiScreen.isShiftKeyDown()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.gui.sidebutton;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
||||
import com.raoulvdberge.refinedstorage.tile.grid.IGrid;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -32,7 +32,7 @@ public class SideButtonGridSortingType extends SideButton {
|
||||
if (type == NetworkNodeGrid.SORTING_TYPE_QUANTITY) {
|
||||
type = NetworkNodeGrid.SORTING_TYPE_NAME;
|
||||
} else if (type == NetworkNodeGrid.SORTING_TYPE_NAME) {
|
||||
if (grid.getType() == EnumGridType.FLUID) {
|
||||
if (grid.getType() == GridType.FLUID) {
|
||||
type = NetworkNodeGrid.SORTING_TYPE_QUANTITY;
|
||||
} else {
|
||||
type = NetworkNodeGrid.SORTING_TYPE_ID;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.integration.craftingtweaks;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.container.ContainerGrid;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
@@ -28,7 +28,7 @@ public final class IntegrationCraftingTweaks {
|
||||
public static class ContainerCallback implements Function<ContainerGrid, Boolean> {
|
||||
@Override
|
||||
public Boolean apply(ContainerGrid containerGrid) {
|
||||
return containerGrid.getGrid().getType() == EnumGridType.CRAFTING;
|
||||
return containerGrid.getGrid().getType() == GridType.CRAFTING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.item;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.block.EnumPlacementType;
|
||||
import com.raoulvdberge.refinedstorage.block.PlacementType;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileBase;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -13,9 +13,9 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemBlockBase extends ItemBlock {
|
||||
private EnumPlacementType placementType;
|
||||
private PlacementType placementType;
|
||||
|
||||
public ItemBlockBase(Block block, EnumPlacementType placementType, boolean subtypes) {
|
||||
public ItemBlockBase(Block block, PlacementType placementType, boolean subtypes) {
|
||||
super(block);
|
||||
|
||||
setRegistryName(block.getRegistryName());
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.raoulvdberge.refinedstorage.item;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumControllerType;
|
||||
import com.raoulvdberge.refinedstorage.block.ControllerType;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileController;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -19,7 +19,7 @@ public class ItemBlockController extends ItemBlockBase {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
if (stack.getMetadata() != EnumControllerType.CREATIVE.getId()) {
|
||||
if (stack.getMetadata() != ControllerType.CREATIVE.getId()) {
|
||||
tooltip.add(I18n.format("misc.refinedstorage:energy_stored", getEnergyStored(stack), getEnergyCapacity(stack)));
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class ItemBlockController extends ItemBlockBase {
|
||||
tag = new NBTTagCompound();
|
||||
}
|
||||
|
||||
tag.setInteger(TileController.NBT_ENERGY, stack.getMetadata() == EnumControllerType.CREATIVE.getId() ? RS.INSTANCE.config.controllerCapacity : 0);
|
||||
tag.setInteger(TileController.NBT_ENERGY, stack.getMetadata() == ControllerType.CREATIVE.getId() ? RS.INSTANCE.config.controllerCapacity : 0);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.RSItems;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeFluidStorage;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumFluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.FluidStorageType;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -25,12 +25,12 @@ public class ItemBlockFluidStorage extends ItemBlockBase {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
EnumFluidStorageType type = EnumFluidStorageType.getById(stack.getMetadata());
|
||||
FluidStorageType type = FluidStorageType.getById(stack.getMetadata());
|
||||
|
||||
if (type != null && isValid(stack)) {
|
||||
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(NetworkNodeFluidStorage.NBT_STORAGE);
|
||||
|
||||
if (type == EnumFluidStorageType.TYPE_CREATIVE) {
|
||||
if (type == FluidStorageType.TYPE_CREATIVE) {
|
||||
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", StorageDiskFluid.getStored(tag)));
|
||||
} else {
|
||||
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", StorageDiskFluid.getStored(tag), type.getCapacity()));
|
||||
@@ -42,7 +42,7 @@ public class ItemBlockFluidStorage extends ItemBlockBase {
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
|
||||
EnumFluidStorageType type = EnumFluidStorageType.getById(stack.getMetadata());
|
||||
FluidStorageType type = FluidStorageType.getById(stack.getMetadata());
|
||||
|
||||
if (type != null && stack.getCount() == 1 && isValid(stack) && StorageDiskFluid.getStored(stack.getTagCompound().getCompoundTag(NetworkNodeFluidStorage.NBT_STORAGE)) <= 0 && stack.getMetadata() != ItemFluidStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) {
|
||||
ItemStack storagePart = new ItemStack(RSItems.FLUID_STORAGE_PART, 1, stack.getMetadata());
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.RSItems;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeStorage;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.ItemStorageType;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -25,12 +25,12 @@ public class ItemBlockStorage extends ItemBlockBase {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
EnumItemStorageType type = EnumItemStorageType.getById(stack.getMetadata());
|
||||
ItemStorageType type = ItemStorageType.getById(stack.getMetadata());
|
||||
|
||||
if (type != null && isValid(stack)) {
|
||||
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(NetworkNodeStorage.NBT_STORAGE);
|
||||
|
||||
if (type == EnumItemStorageType.TYPE_CREATIVE) {
|
||||
if (type == ItemStorageType.TYPE_CREATIVE) {
|
||||
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", StorageDiskItem.getStored(tag)));
|
||||
} else {
|
||||
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", StorageDiskItem.getStored(tag), type.getCapacity()));
|
||||
@@ -42,7 +42,7 @@ public class ItemBlockStorage extends ItemBlockBase {
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
|
||||
EnumItemStorageType type = EnumItemStorageType.getById(stack.getMetadata());
|
||||
ItemStorageType type = ItemStorageType.getById(stack.getMetadata());
|
||||
|
||||
if (type != null && stack.getCount() == 1 && isValid(stack) && StorageDiskItem.getStored(stack.getTagCompound().getCompoundTag(NetworkNodeStorage.NBT_STORAGE)) <= 0 && stack.getMetadata() != ItemStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) {
|
||||
ItemStack storagePart = new ItemStack(RSItems.STORAGE_PART, 1, stack.getMetadata());
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.raoulvdberge.refinedstorage.api.storage.IStorageDiskProvider;
|
||||
import com.raoulvdberge.refinedstorage.api.storage.StorageDiskType;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumFluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.FluidStorageType;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -133,6 +133,6 @@ public class ItemFluidStorageDisk extends ItemBase implements IStorageDiskProvid
|
||||
@Nonnull
|
||||
@Override
|
||||
public IStorageDisk<FluidStack> create(ItemStack disk) {
|
||||
return API.instance().getDefaultStorageDiskBehavior().createFluidStorage(disk.getTagCompound(), EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity());
|
||||
return API.instance().getDefaultStorageDiskBehavior().createFluidStorage(disk.getTagCompound(), FluidStorageType.getById(disk.getItemDamage()).getCapacity());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.raoulvdberge.refinedstorage.api.storage.IStorageDiskProvider;
|
||||
import com.raoulvdberge.refinedstorage.api.storage.StorageDiskType;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.block.ItemStorageType;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -143,6 +143,6 @@ public class ItemStorageDisk extends ItemBase implements IStorageDiskProvider<It
|
||||
@Nonnull
|
||||
@Override
|
||||
public IStorageDisk<ItemStack> create(ItemStack disk) {
|
||||
return API.instance().getDefaultStorageDiskBehavior().createItemStorage(disk.getTagCompound(), EnumItemStorageType.getById(disk.getItemDamage()).getCapacity());
|
||||
return API.instance().getDefaultStorageDiskBehavior().createItemStorage(disk.getTagCompound(), ItemStorageType.getById(disk.getItemDamage()).getCapacity());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.raoulvdberge.refinedstorage.network;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSUtils;
|
||||
import com.raoulvdberge.refinedstorage.api.network.security.Permission;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.container.ContainerGrid;
|
||||
import com.raoulvdberge.refinedstorage.tile.grid.IGrid;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@@ -35,7 +35,7 @@ public class MessageGridCraftingClear extends MessageHandlerPlayerToServer<Messa
|
||||
|
||||
InventoryCrafting matrix = grid.getCraftingMatrix();
|
||||
|
||||
if (grid.getType() == EnumGridType.CRAFTING && grid.getNetwork() != null && grid.getNetwork().getSecurityManager().hasPermission(Permission.INSERT, player)) {
|
||||
if (grid.getType() == GridType.CRAFTING && grid.getNetwork() != null && grid.getNetwork().getSecurityManager().hasPermission(Permission.INSERT, player)) {
|
||||
for (int i = 0; i < matrix.getSizeInventory(); ++i) {
|
||||
ItemStack slot = matrix.getStackInSlot(i);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MessageGridCraftingClear extends MessageHandlerPlayerToServer<Messa
|
||||
matrix.setInventorySlotContents(i, RSUtils.transformNullToEmpty(grid.getNetwork().insertItem(slot, slot.getCount(), false)));
|
||||
}
|
||||
}
|
||||
} else if (grid.getType() == EnumGridType.PATTERN) {
|
||||
} else if (grid.getType() == GridType.PATTERN) {
|
||||
for (int i = 0; i < matrix.getSizeInventory(); ++i) {
|
||||
matrix.setInventorySlotContents(i, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.network;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.container.ContainerGrid;
|
||||
import com.raoulvdberge.refinedstorage.tile.grid.IGrid;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@@ -37,7 +37,7 @@ public class MessageGridCraftingTransfer extends MessageHandlerPlayerToServer<Me
|
||||
if (player.openContainer instanceof ContainerGrid) {
|
||||
IGrid grid = ((ContainerGrid) player.openContainer).getGrid();
|
||||
|
||||
if (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) {
|
||||
if (grid.getType() == GridType.CRAFTING || grid.getType() == GridType.PATTERN) {
|
||||
ItemStack[][] actualRecipe = new ItemStack[9][];
|
||||
|
||||
for (int x = 0; x < actualRecipe.length; x++) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.network;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileProcessingPatternEncoder;
|
||||
import com.raoulvdberge.refinedstorage.tile.grid.TileGrid;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@@ -42,7 +41,7 @@ public class MessageGridPatternCreate extends MessageHandlerPlayerToServer<Messa
|
||||
public void handle(MessageGridPatternCreate message, EntityPlayerMP player) {
|
||||
TileEntity tile = player.getEntityWorld().getTileEntity(new BlockPos(message.x, message.y, message.z));
|
||||
|
||||
if (tile instanceof TileGrid && ((TileGrid) tile).getNode().getType() == EnumGridType.PATTERN) {
|
||||
if (tile instanceof TileGrid && ((TileGrid) tile).getNode().getType() == GridType.PATTERN) {
|
||||
((TileGrid) tile).getNode().onCreatePattern();
|
||||
} else if (tile instanceof TileProcessingPatternEncoder) {
|
||||
((TileProcessingPatternEncoder) tile).onCreatePattern();
|
||||
|
||||
@@ -182,10 +182,10 @@ public class ProxyClient extends ProxyCommon {
|
||||
|
||||
// Blocks
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CABLE), 0, new ModelResourceLocation("refinedstorage:cable", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), EnumGridType.NORMAL.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=normal"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), EnumGridType.CRAFTING.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=crafting"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), EnumGridType.PATTERN.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=pattern"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), EnumGridType.FLUID.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=fluid"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), GridType.NORMAL.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=normal"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), GridType.CRAFTING.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=crafting"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), GridType.PATTERN.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=pattern"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), GridType.FLUID.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=fluid"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.MACHINE_CASING), 0, new ModelResourceLocation("refinedstorage:machine_casing", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DISK_DRIVE), 0, new ModelResourceLocation("refinedstorage:disk_drive", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.EXPORTER), 0, new ModelResourceLocation("refinedstorage:exporter", "inventory"));
|
||||
@@ -206,16 +206,16 @@ public class ProxyClient extends ProxyCommon {
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.PROCESSING_PATTERN_ENCODER), 0, new ModelResourceLocation("refinedstorage:processing_pattern_encoder", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.NETWORK_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:network_transmitter", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.NETWORK_RECEIVER), 0, new ModelResourceLocation("refinedstorage:network_receiver", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_1K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=1k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_4K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=4k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_16K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=16k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=64k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:storage", "type=creative"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=64k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_128K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=128k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_256K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=256k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_512K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=512k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=creative"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), ItemStorageType.TYPE_1K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=1k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), ItemStorageType.TYPE_4K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=4k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), ItemStorageType.TYPE_16K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=16k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), ItemStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=64k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), ItemStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:storage", "type=creative"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), FluidStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=64k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), FluidStorageType.TYPE_128K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=128k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), FluidStorageType.TYPE_256K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=256k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), FluidStorageType.TYPE_512K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=512k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), FluidStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=creative"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DISK_MANIPULATOR), 0, new ModelResourceLocation("refinedstorage:disk_manipulator", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.SECURITY_MANAGER), 0, new ModelResourceLocation("refinedstorage:security_manager", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.QUARTZ_ENRICHED_IRON), 0, new ModelResourceLocation("refinedstorage:quartz_enriched_iron_block", "inventory"));
|
||||
@@ -256,7 +256,7 @@ public class ProxyClient extends ProxyCommon {
|
||||
ModelLoader.setCustomStateMapper(RSBlocks.CONTROLLER, new StateMap.Builder().ignore(BlockController.TYPE).build());
|
||||
|
||||
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(RSBlocks.CONTROLLER), stack -> {
|
||||
int energy = stack.getItemDamage() == EnumControllerType.CREATIVE.getId() ? 7 : TileController.getEnergyScaled(ItemBlockController.getEnergyStored(stack), ItemBlockController.getEnergyCapacity(stack), 7);
|
||||
int energy = stack.getItemDamage() == ControllerType.CREATIVE.getId() ? 7 : TileController.getEnergyScaled(ItemBlockController.getEnergyStored(stack), ItemBlockController.getEnergyCapacity(stack), 7);
|
||||
|
||||
return new ModelResourceLocation("refinedstorage:controller", "direction=north,energy=" + energy);
|
||||
});
|
||||
|
||||
@@ -272,7 +272,7 @@ public class ProxyCommon {
|
||||
);
|
||||
|
||||
// Controller
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CONTROLLER, 1, EnumControllerType.NORMAL.getId()),
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CONTROLLER, 1, ControllerType.NORMAL.getId()),
|
||||
"EDE",
|
||||
"SMS",
|
||||
"ESE",
|
||||
@@ -322,7 +322,7 @@ public class ProxyCommon {
|
||||
);
|
||||
|
||||
// Grid
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.GRID, 1, GridType.NORMAL.getId()),
|
||||
"ECE",
|
||||
"PMP",
|
||||
"EDE",
|
||||
@@ -335,29 +335,29 @@ public class ProxyCommon {
|
||||
|
||||
// Crafting Grid
|
||||
API.instance().getSoldererRegistry().addRecipe(API.instance().getSoldererRegistry().createSimpleRecipe(
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.CRAFTING.getId()),
|
||||
new ItemStack(RSBlocks.GRID, 1, GridType.CRAFTING.getId()),
|
||||
500,
|
||||
new ItemStack(Blocks.CRAFTING_TABLE),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId())
|
||||
new ItemStack(RSBlocks.GRID, 1, GridType.NORMAL.getId())
|
||||
));
|
||||
|
||||
// Pattern Grid
|
||||
API.instance().getSoldererRegistry().addRecipe(API.instance().getSoldererRegistry().createSimpleRecipe(
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.PATTERN.getId()),
|
||||
new ItemStack(RSBlocks.GRID, 1, GridType.PATTERN.getId()),
|
||||
500,
|
||||
new ItemStack(RSItems.PATTERN),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId())
|
||||
new ItemStack(RSBlocks.GRID, 1, GridType.NORMAL.getId())
|
||||
));
|
||||
|
||||
// Fluid Grid
|
||||
API.instance().getSoldererRegistry().addRecipe(API.instance().getSoldererRegistry().createSimpleRecipe(
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.FLUID.getId()),
|
||||
new ItemStack(RSBlocks.GRID, 1, GridType.FLUID.getId()),
|
||||
500,
|
||||
new ItemStack(Items.BUCKET),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId())
|
||||
new ItemStack(RSBlocks.GRID, 1, GridType.NORMAL.getId())
|
||||
));
|
||||
|
||||
// Wireless Grid
|
||||
@@ -367,7 +367,7 @@ public class ProxyCommon {
|
||||
"EAE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(Items.ENDER_PEARL),
|
||||
'G', new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
'G', new ItemStack(RSBlocks.GRID, 1, GridType.NORMAL.getId()),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
|
||||
);
|
||||
|
||||
@@ -378,7 +378,7 @@ public class ProxyCommon {
|
||||
"EAE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(Items.ENDER_PEARL),
|
||||
'G', new ItemStack(RSBlocks.GRID, 1, EnumGridType.FLUID.getId()),
|
||||
'G', new ItemStack(RSBlocks.GRID, 1, GridType.FLUID.getId()),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
|
||||
);
|
||||
|
||||
@@ -674,16 +674,16 @@ public class ProxyCommon {
|
||||
);
|
||||
|
||||
// Storage Blocks
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_1K, ItemStoragePart.TYPE_1K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_4K, ItemStoragePart.TYPE_4K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_16K, ItemStoragePart.TYPE_16K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_64K, ItemStoragePart.TYPE_64K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(ItemStorageType.TYPE_1K, ItemStoragePart.TYPE_1K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(ItemStorageType.TYPE_4K, ItemStoragePart.TYPE_4K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(ItemStorageType.TYPE_16K, ItemStoragePart.TYPE_16K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(ItemStorageType.TYPE_64K, ItemStoragePart.TYPE_64K));
|
||||
|
||||
// Fluid Storage Blocks
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_64K, ItemFluidStoragePart.TYPE_64K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_128K, ItemFluidStoragePart.TYPE_128K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_256K, ItemFluidStoragePart.TYPE_256K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_512K, ItemFluidStoragePart.TYPE_512K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(FluidStorageType.TYPE_64K, ItemFluidStoragePart.TYPE_64K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(FluidStorageType.TYPE_128K, ItemFluidStoragePart.TYPE_128K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(FluidStorageType.TYPE_256K, ItemFluidStoragePart.TYPE_256K));
|
||||
API.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(FluidStorageType.TYPE_512K, ItemFluidStoragePart.TYPE_512K));
|
||||
|
||||
// Crafting Monitor
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CRAFTING_MONITOR),
|
||||
|
||||
@@ -31,8 +31,8 @@ import com.raoulvdberge.refinedstorage.apiimpl.network.security.SecurityManager;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageCacheFluid;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageCacheItem;
|
||||
import com.raoulvdberge.refinedstorage.block.BlockController;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumControllerType;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.ControllerType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.container.ContainerCraftingMonitor;
|
||||
import com.raoulvdberge.refinedstorage.container.ContainerGrid;
|
||||
import com.raoulvdberge.refinedstorage.container.ContainerReaderWriter;
|
||||
@@ -173,7 +173,7 @@ public class TileController extends TileBase implements INetworkMaster, IRedston
|
||||
|
||||
private boolean craftingMonitorUpdateRequested;
|
||||
|
||||
private EnumControllerType type;
|
||||
private ControllerType type;
|
||||
|
||||
private RedstoneMode redstoneMode = RedstoneMode.IGNORE;
|
||||
|
||||
@@ -246,7 +246,7 @@ public class TileController extends TileBase implements INetworkMaster, IRedston
|
||||
|
||||
networkItemHandler.update();
|
||||
|
||||
if (getType() == EnumControllerType.NORMAL) {
|
||||
if (getType() == ControllerType.NORMAL) {
|
||||
if (!RS.INSTANCE.config.controllerUsesEnergy) {
|
||||
energy.setEnergyStored(energy.getMaxEnergyStored());
|
||||
} else if (energy.getEnergyStored() - getEnergyUsage() >= 0) {
|
||||
@@ -254,7 +254,7 @@ public class TileController extends TileBase implements INetworkMaster, IRedston
|
||||
} else {
|
||||
energy.setEnergyStored(0);
|
||||
}
|
||||
} else if (getType() == EnumControllerType.CREATIVE) {
|
||||
} else if (getType() == ControllerType.CREATIVE) {
|
||||
energy.setEnergyStored(energy.getMaxEnergyStored());
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ public class TileController extends TileBase implements INetworkMaster, IRedston
|
||||
@Override
|
||||
public void sendItemStorageToClient() {
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.NORMAL, EnumGridType.CRAFTING, EnumGridType.PATTERN))
|
||||
.filter(player -> isWatchingGrid(player, GridType.NORMAL, GridType.CRAFTING, GridType.PATTERN))
|
||||
.forEach(this::sendItemStorageToClient);
|
||||
}
|
||||
|
||||
@@ -329,14 +329,14 @@ public class TileController extends TileBase implements INetworkMaster, IRedston
|
||||
@Override
|
||||
public void sendItemStorageDeltaToClient(ItemStack stack, int delta) {
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.NORMAL, EnumGridType.CRAFTING, EnumGridType.PATTERN))
|
||||
.filter(player -> isWatchingGrid(player, GridType.NORMAL, GridType.CRAFTING, GridType.PATTERN))
|
||||
.forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridItemDelta(this, stack, delta), player));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFluidStorageToClient() {
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.FLUID))
|
||||
.filter(player -> isWatchingGrid(player, GridType.FLUID))
|
||||
.forEach(this::sendFluidStorageToClient);
|
||||
}
|
||||
|
||||
@@ -348,11 +348,11 @@ public class TileController extends TileBase implements INetworkMaster, IRedston
|
||||
@Override
|
||||
public void sendFluidStorageDeltaToClient(FluidStack stack, int delta) {
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.FLUID))
|
||||
.filter(player -> isWatchingGrid(player, GridType.FLUID))
|
||||
.forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridFluidDelta(stack, delta), player));
|
||||
}
|
||||
|
||||
private boolean isWatchingGrid(EntityPlayer player, EnumGridType... types) {
|
||||
private boolean isWatchingGrid(EntityPlayer player, GridType... types) {
|
||||
if (player.openContainer.getClass() == ContainerGrid.class) {
|
||||
IGrid grid = ((ContainerGrid) player.openContainer).getGrid();
|
||||
|
||||
@@ -742,12 +742,12 @@ public class TileController extends TileBase implements INetworkMaster, IRedston
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnumControllerType getType() {
|
||||
public ControllerType getType() {
|
||||
if (type == null && getWorld().getBlockState(pos).getBlock() == RSBlocks.CONTROLLER) {
|
||||
this.type = (EnumControllerType) getWorld().getBlockState(pos).getValue(BlockController.TYPE);
|
||||
this.type = (ControllerType) getWorld().getBlockState(pos).getValue(BlockController.TYPE);
|
||||
}
|
||||
|
||||
return type == null ? EnumControllerType.NORMAL : type;
|
||||
return type == null ? ControllerType.NORMAL : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.tile.grid;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.api.network.INetworkMaster;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
||||
import com.raoulvdberge.refinedstorage.item.filter.Filter;
|
||||
import com.raoulvdberge.refinedstorage.item.filter.FilterTab;
|
||||
@@ -15,7 +15,7 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public interface IGrid {
|
||||
EnumGridType getType();
|
||||
GridType getType();
|
||||
|
||||
@Nullable
|
||||
INetworkMaster getNetwork();
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.raoulvdberge.refinedstorage.tile.grid;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.api.network.INetworkMaster;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemWirelessFluidGrid;
|
||||
@@ -53,8 +53,8 @@ public class WirelessFluidGrid implements IGrid {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumGridType getType() {
|
||||
return EnumGridType.FLUID;
|
||||
public GridType getType() {
|
||||
return GridType.FLUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.raoulvdberge.refinedstorage.tile.grid;
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.RSUtils;
|
||||
import com.raoulvdberge.refinedstorage.api.network.INetworkMaster;
|
||||
import com.raoulvdberge.refinedstorage.block.EnumGridType;
|
||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||
import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFilter;
|
||||
@@ -80,8 +80,8 @@ public class WirelessGrid implements IGrid {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumGridType getType() {
|
||||
return EnumGridType.NORMAL;
|
||||
public GridType getType() {
|
||||
return GridType.NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user