Fix some position bugs in crafter manager container and add model and recipe

This commit is contained in:
raoulvdberge
2018-03-17 23:12:18 +01:00
parent 992d868bf7
commit 0d80759496
11 changed files with 352 additions and 76 deletions

View File

@@ -3,6 +3,7 @@ package com.raoulvdberge.refinedstorage;
import com.raoulvdberge.refinedstorage.item.*;
public final class RSItems {
// @todo: Switch to registry inject
public static final ItemStorageDisk STORAGE_DISK = new ItemStorageDisk();
public static final ItemWirelessGrid WIRELESS_GRID = new ItemWirelessGrid();
public static final ItemWirelessFluidGrid WIRELESS_FLUID_GRID = new ItemWirelessFluidGrid();

View File

@@ -61,4 +61,9 @@ public class NetworkNodeCrafterManager extends NetworkNode {
size = tag.getInteger(NBT_SIZE);
}
}
@Override
public boolean hasConnectivityState() {
return true;
}
}

View File

@@ -30,4 +30,9 @@ public class BlockCrafterManager extends BlockNode {
return true;
}
@Override
public boolean hasConnectivityState() {
return true;
}
}

View File

@@ -116,7 +116,7 @@ public class ContainerCrafterManager extends ContainerBase {
int x = 8;
for (Map.Entry<String, Integer> entry : containerData.entrySet()) {
// @todo: broken on servers prolly
// @todo: Test on servers
boolean visible = I18n.format(entry.getKey()).toLowerCase().contains(display.getSearchFieldText().toLowerCase());
IItemHandlerModifiable dummy;
@@ -133,7 +133,8 @@ public class ContainerCrafterManager extends ContainerBase {
if (visible) {
x += 18;
if ((slot + 1) % 9 == 0) {
// Don't increase y level if we are on our last slot row (otherwise we do y += 18 * 3)
if ((slot + 1) % 9 == 0 && slot + 1 < entry.getValue()) {
x = 8;
y += 18;
}

View File

@@ -122,6 +122,7 @@ public class GuiCrafterManager extends GuiBase implements IResizableDisplay {
if (searchField == null) {
searchField = new TextFieldSearch(0, fontRenderer, sx, sy, 88 - 6);
searchField.addListener(() -> container.initSlots(null));
} else {
searchField.x = sx;
searchField.y = sy;

View File

@@ -265,6 +265,9 @@ public class ProxyClient extends ProxyCommon {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DESTRUCTOR), 0, new ModelResourceLocation("refinedstorage:destructor", "inventory"));
ModelLoader.setCustomStateMapper(RSBlocks.DESTRUCTOR, new StateMapperCTM("refinedstorage:destructor"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CRAFTER_MANAGER), 0, new ModelResourceLocation("refinedstorage:crafter_manager", "connected=false,direction=north"));
ModelLoader.setCustomStateMapper(RSBlocks.CRAFTER_MANAGER, new StateMapperCTM("refinedstorage:crafter_manager"));
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(RSBlocks.CONTROLLER), stack -> {
ControllerEnergyType energyType = stack.getItemDamage() == ControllerType.CREATIVE.getId() ? ControllerEnergyType.ON : TileController.getEnergyType(ItemBlockController.getEnergyStored(stack), ItemBlockController.getEnergyCapacity(stack));