From c6b94b2716cbc13433e8c5b4a02a611c0c4dcee2 Mon Sep 17 00:00:00 2001 From: bruno Date: Thu, 4 Jul 2024 13:44:48 +0200 Subject: [PATCH] A bit of an update --- assets/CPU.aseprite | Bin 0 -> 468 bytes assets/Connector.aseprite | Bin 0 -> 571 bytes assets/Drive_Controller.aseprite | Bin 0 -> 424 bytes assets/Inventory_Interface.aseprite | Bin 0 -> 647 bytes assets/Module_PCB.aseprite | Bin 0 -> 1928 bytes assets/PCB.aseprite | Bin 0 -> 421 bytes gradle.properties | 4 +- .../brn/server_storage/ServerStorage.java | 59 +++- .../HardDriveContainerBlockEntity.java | 53 +++- .../InventoryInterfaceBlockEntity.java | 173 ++++++++++ .../blockentities/StorageBlockEntity.java | 181 ----------- .../StorageInterfaceBlockEntity.java | 71 +++++ .../blocks/BusConnectorBlock.java | 40 +++ .../server_storage/blocks/ConnectedBlock.java | 90 ++++++ .../blocks/HardDriveContainerBlock.java | 8 +- .../blocks/InventoryInterfaceBlock.java | 179 +++++++++++ ...eBlock.java => StorageInterfaceBlock.java} | 33 +- .../brn/server_storage/items/HardDrive.java | 300 ++++++++++++++++++ .../server_storage/items/HardDriveItem.java | 4 - .../brn/server_storage/items/SimpleItem.java | 32 +- .../server_storage/lib/ConnectedChests.java | 212 ------------- .../server_storage/lib/ConnectionType.java | 24 ++ .../server_storage/lib/DriveComponents.java | 34 +- .../brn/server_storage/lib/PagedGui.java | 11 +- .../server_storage/lib/StorageNetwork.java | 199 ++++++++++++ .../server_storage/lib/StorageOperations.java | 117 ++++--- .../systems/brn/server_storage/lib/Util.java | 21 +- .../DriveContainerScreenHandler.java | 54 ++-- .../screens/CraftingScreen.java | 72 +++-- .../server_storage/screens/DriveScreen.java | 14 - .../server_storage/screens/SearchScreen.java | 21 +- .../screens/SettingsScreen.java | 104 +++--- .../server_storage/screens/StorageScreen.java | 88 ++--- .../blockstates/bus_connector.json | 32 ++ .../blockstates/inventory_interface.json | 32 ++ .../assets/serverstorage/lang/en_us.json | 38 ++- .../models/block/bus_connector.json | 6 + .../models/block/bus_connector_blank.json | 6 + .../models/block/bus_connector_bus_blank.json | 6 + .../models/block/bus_connector_bus_down.json | 11 + .../models/block/bus_connector_bus_east.json | 11 + .../models/block/bus_connector_bus_north.json | 11 + .../models/block/bus_connector_bus_south.json | 11 + .../models/block/bus_connector_bus_up.json | 11 + .../models/block/bus_connector_bus_west.json | 11 + .../block/bus_connector_inventory_blank.json | 6 + .../models/block/inventory_interface.json | 6 + .../block/inventory_interface_blank.json | 6 + .../inventory_interface_inventory_down.json | 11 + .../inventory_interface_inventory_east.json | 11 + .../inventory_interface_inventory_north.json | 11 + .../inventory_interface_inventory_south.json | 11 + .../inventory_interface_inventory_up.json | 11 + .../inventory_interface_inventory_west.json | 11 + .../models/item/bus_connector.json | 3 + .../assets/serverstorage/models/item/cpu.json | 6 + .../models/item/cpu_substrate.json | 6 + .../models/item/drive_controller.json | 6 + .../models/item/inventory_interface.json | 3 + .../serverstorage/models/item/module_bus.json | 6 + .../models/item/module_configuration.json | 6 + .../models/item/module_container.json | 6 + .../models/item/module_display.json | 6 + .../models/item/module_drive.json | 6 + .../models/item/module_filtering.json | 6 + .../models/item/module_inventory.json | 6 + .../models/item/module_pagination.json | 6 + .../serverstorage/models/item/module_pcb.json | 6 + .../models/item/module_transport.json | 6 + .../assets/serverstorage/models/item/pcb.json | 6 + .../models/item/pcb_substrate.json | 6 + .../textures/block/bus_connector_blank.png | Bin 0 -> 372 bytes .../textures/block/bus_connector_bus.png | Bin 0 -> 388 bytes .../block/bus_connector_inventory.png | Bin 0 -> 410 bytes .../textures/block/controller_back.png | Bin 390 -> 434 bytes .../textures/block/controller_bottom.png | Bin 402 -> 441 bytes .../textures/block/controller_front.png | Bin 414 -> 448 bytes .../textures/block/controller_left.png | Bin 386 -> 439 bytes .../textures/block/controller_right.png | Bin 399 -> 438 bytes .../textures/block/controller_top.png | Bin 408 -> 441 bytes .../textures/block/drive_container_front.png | Bin 317 -> 403 bytes .../textures/block/drive_container_side.png | Bin 143 -> 331 bytes .../block/inventory_interface_blank.png | Bin 0 -> 397 bytes .../block/inventory_interface_inventory.png | Bin 0 -> 396 bytes .../serverstorage/textures/item/cpu.png | Bin 0 -> 379 bytes .../textures/item/cpu_substrate.png | Bin 0 -> 313 bytes .../textures/item/drive_casing.png | Bin 173 -> 322 bytes .../textures/item/drive_controller.png | Bin 0 -> 396 bytes .../textures/item/drive_diamond.png | Bin 757 -> 1260 bytes .../textures/item/drive_gold.png | Bin 764 -> 1260 bytes .../textures/item/drive_iron.png | Bin 759 -> 1260 bytes .../textures/item/drive_netherite.png | Bin 761 -> 1260 bytes .../textures/item/head_diamond.png | Bin 342 -> 419 bytes .../serverstorage/textures/item/head_gold.png | Bin 248 -> 401 bytes .../serverstorage/textures/item/head_iron.png | Bin 238 -> 350 bytes .../textures/item/head_netherite.png | Bin 365 -> 410 bytes .../textures/item/module_bus.png | Bin 0 -> 377 bytes .../textures/item/module_configuration.png | Bin 0 -> 421 bytes .../textures/item/module_container.png | Bin 0 -> 504 bytes .../textures/item/module_display.png | Bin 0 -> 380 bytes .../textures/item/module_drive.png | Bin 0 -> 415 bytes .../textures/item/module_filtering.png | Bin 0 -> 403 bytes .../textures/item/module_inventory.png | Bin 0 -> 571 bytes .../textures/item/module_pagination.png | Bin 0 -> 391 bytes .../textures/item/module_pcb.png | Bin 0 -> 359 bytes .../textures/item/module_transport.png | Bin 0 -> 406 bytes .../serverstorage/textures/item/pcb.png | Bin 0 -> 323 bytes .../textures/item/pcb_substrate.png | Bin 0 -> 313 bytes .../textures/item/platter_diamond.png | Bin 445 -> 469 bytes .../textures/item/platter_gold.png | Bin 377 -> 432 bytes .../textures/item/platter_iron.png | Bin 300 -> 387 bytes .../textures/item/platter_netherite.png | Bin 505 -> 466 bytes .../loot_table/blocks/bus_connector.json | 19 ++ .../blocks/inventory_interface.json | 19 ++ .../serverstorage/recipe/bus_connector.json | 30 ++ .../data/serverstorage/recipe/cpu.json | 24 ++ .../serverstorage/recipe/cpu_substrate.json | 21 ++ .../serverstorage/recipe/diamond_drive.json | 20 +- .../serverstorage/recipe/drive_container.json | 23 +- .../recipe/drive_controller.json | 24 ++ .../serverstorage/recipe/golden_drive.json | 20 +- .../recipe/inventory_interface.json | 39 +++ .../data/serverstorage/recipe/iron_drive.json | 20 +- .../data/serverstorage/recipe/module_bus.json | 30 ++ .../recipe/module_configuration.json | 27 ++ .../recipe/module_container.json | 27 ++ .../serverstorage/recipe/module_display.json | 27 ++ .../serverstorage/recipe/module_drive.json | 24 ++ .../recipe/module_filtering.json | 30 ++ .../recipe/module_inventory.json | 30 ++ .../recipe/module_pagination.json | 27 ++ .../data/serverstorage/recipe/module_pcb.json | 24 ++ .../recipe/module_transport.json | 27 ++ .../serverstorage/recipe/netherite_drive.json | 20 +- .../data/serverstorage/recipe/pcb.json | 21 ++ .../serverstorage/recipe/pcb_substrate.json | 21 ++ .../data/serverstorage/recipe/storage.json | 34 +- 137 files changed, 2468 insertions(+), 724 deletions(-) create mode 100644 assets/CPU.aseprite create mode 100644 assets/Connector.aseprite create mode 100644 assets/Drive_Controller.aseprite create mode 100644 assets/Inventory_Interface.aseprite create mode 100644 assets/Module_PCB.aseprite create mode 100644 assets/PCB.aseprite create mode 100644 src/main/java/systems/brn/server_storage/blockentities/InventoryInterfaceBlockEntity.java delete mode 100644 src/main/java/systems/brn/server_storage/blockentities/StorageBlockEntity.java create mode 100644 src/main/java/systems/brn/server_storage/blockentities/StorageInterfaceBlockEntity.java create mode 100644 src/main/java/systems/brn/server_storage/blocks/BusConnectorBlock.java create mode 100644 src/main/java/systems/brn/server_storage/blocks/ConnectedBlock.java create mode 100644 src/main/java/systems/brn/server_storage/blocks/InventoryInterfaceBlock.java rename src/main/java/systems/brn/server_storage/blocks/{StorageBlock.java => StorageInterfaceBlock.java} (76%) create mode 100644 src/main/java/systems/brn/server_storage/items/HardDrive.java delete mode 100644 src/main/java/systems/brn/server_storage/lib/ConnectedChests.java create mode 100644 src/main/java/systems/brn/server_storage/lib/ConnectionType.java create mode 100644 src/main/java/systems/brn/server_storage/lib/StorageNetwork.java delete mode 100644 src/main/java/systems/brn/server_storage/screens/DriveScreen.java create mode 100644 src/main/resources/assets/serverstorage/blockstates/bus_connector.json create mode 100644 src/main/resources/assets/serverstorage/blockstates/inventory_interface.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_blank.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_bus_blank.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_bus_down.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_bus_east.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_bus_north.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_bus_south.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_bus_up.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_bus_west.json create mode 100644 src/main/resources/assets/serverstorage/models/block/bus_connector_inventory_blank.json create mode 100644 src/main/resources/assets/serverstorage/models/block/inventory_interface.json create mode 100644 src/main/resources/assets/serverstorage/models/block/inventory_interface_blank.json create mode 100644 src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_down.json create mode 100644 src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_east.json create mode 100644 src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_north.json create mode 100644 src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_south.json create mode 100644 src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_up.json create mode 100644 src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_west.json create mode 100644 src/main/resources/assets/serverstorage/models/item/bus_connector.json create mode 100644 src/main/resources/assets/serverstorage/models/item/cpu.json create mode 100644 src/main/resources/assets/serverstorage/models/item/cpu_substrate.json create mode 100644 src/main/resources/assets/serverstorage/models/item/drive_controller.json create mode 100644 src/main/resources/assets/serverstorage/models/item/inventory_interface.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_bus.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_configuration.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_container.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_display.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_drive.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_filtering.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_inventory.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_pagination.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_pcb.json create mode 100644 src/main/resources/assets/serverstorage/models/item/module_transport.json create mode 100644 src/main/resources/assets/serverstorage/models/item/pcb.json create mode 100644 src/main/resources/assets/serverstorage/models/item/pcb_substrate.json create mode 100644 src/main/resources/assets/serverstorage/textures/block/bus_connector_blank.png create mode 100644 src/main/resources/assets/serverstorage/textures/block/bus_connector_bus.png create mode 100644 src/main/resources/assets/serverstorage/textures/block/bus_connector_inventory.png create mode 100644 src/main/resources/assets/serverstorage/textures/block/inventory_interface_blank.png create mode 100644 src/main/resources/assets/serverstorage/textures/block/inventory_interface_inventory.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/cpu.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/cpu_substrate.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/drive_controller.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_bus.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_configuration.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_container.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_display.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_drive.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_filtering.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_inventory.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_pagination.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_pcb.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/module_transport.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/pcb.png create mode 100644 src/main/resources/assets/serverstorage/textures/item/pcb_substrate.png create mode 100644 src/main/resources/data/serverstorage/loot_table/blocks/bus_connector.json create mode 100644 src/main/resources/data/serverstorage/loot_table/blocks/inventory_interface.json create mode 100644 src/main/resources/data/serverstorage/recipe/bus_connector.json create mode 100644 src/main/resources/data/serverstorage/recipe/cpu.json create mode 100644 src/main/resources/data/serverstorage/recipe/cpu_substrate.json create mode 100644 src/main/resources/data/serverstorage/recipe/drive_controller.json create mode 100644 src/main/resources/data/serverstorage/recipe/inventory_interface.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_bus.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_configuration.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_container.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_display.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_drive.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_filtering.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_inventory.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_pagination.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_pcb.json create mode 100644 src/main/resources/data/serverstorage/recipe/module_transport.json create mode 100644 src/main/resources/data/serverstorage/recipe/pcb.json create mode 100644 src/main/resources/data/serverstorage/recipe/pcb_substrate.json diff --git a/assets/CPU.aseprite b/assets/CPU.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..282fb0c0632cd92f0ef9098965507c4c2af33e57 GIT binary patch literal 468 zcmcb@$iVPmDHDSL5GpVLISeU4i~v9}kRVtdAxb@#7|`@zA6dY*vH*=017dasu$4%b zWC7VMAlE4X8A=K!t{OIJmWKUd*7pn5ZZ1fBcX-zCPi8Zp24w9sFrSj=ov9z>tzu+j zX>VU*kkAyJ_b_?(|M;^{PT&6X|NsBlYqz)5wP$8!MTP~HId!cuGP)U_e7$;C|8%de zd;@uqO$y9F5(fSQ8SD%`iIu5E3Wn)G4yyu0>OT{Nh6GNsQYs@+_W_U`bk-=EB8J`Kp)XJ9@h&pT5;$Xmt8 z#?s!t#2}$5I`3if?Emp+pPat^=l}ozv)68KscX;7%8CpNDs$>uV`OwQJo$R{uKwv> zUHJy`Ae$7Jfg}w42Qt_hd=e{DixdpofE-o@h}3^z&_Mtw@G9o~{(JIG{iiqo|1bV5 zH_7LJ+pE96ZITMM3Q}rrU6KZS73?<2c-*ulKvt*Z#&Eb<@8}xBWf;DZ1-#l4Q7js+3(LM-J5rO#oy-RbxD``&3=3O?mzJ@cvAg|i`_YF3?|oh GivR#Ly`eV% literal 0 HcmV?d00001 diff --git a/assets/Drive_Controller.aseprite b/assets/Drive_Controller.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..c6bdfda6c3f7558b82dbce66e653073430222f07 GIT binary patch literal 424 zcmZ3%$iVPmDItzu+j zX>VU*kkAyJ_b_?(|M;^{PT&6X|NsBlYqz)5wP$8!MTP~HId!cuGP)U_e7$;C|8%de zd;@uqO$y9F5(fSQ8SD%`iIu5E3Wk+H4yyu0>OT{Nh6GN<9PX^-AM!4WX$ryum+Y(G ze*3TB(^oemt|sllrT%r|(l^lmsQYs@+_W_U`bk-=EB8J`Kp)XJ9@h&pT5;$Xmt8 z#?s!t#2}$5I`3if?Emp+pPat^=l}ozv)68KscX;7%8CpNDs$>uV`OwQJo$R{uKwv> zUHJy`Ae$7Jfg}w42Qt_hd=e{Dixdo306DA*5UKybpo0KV;8o07I(Z{+gMxso`=-sQ z4DK7YY}!~Py}Xz;n(K`Jo+qsjI3s2>TmP$`m9Xd778%X6w{ONgp4=mwsLSV4ig0Elt9`}g0I zZ|Xn2`Tu|MXSqo}|Jz>u^=*?>uvL&!bL)~c*sEZ-Nyg*Oy?reDZr8eV>^s;_9{zD} z<}VEiHNK$c9CagUHTIzXcWE;uPn0EWmY*G$V$5-~|4mql)UtYm+x;?OFRD6u>w&To i(K3r~`{(>Rm}bB7rTEP{uTT7zRTIxLFw6{F;ROJA_{g0A literal 0 HcmV?d00001 diff --git a/assets/Module_PCB.aseprite b/assets/Module_PCB.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..b88154e415c98a1f5e261fcf994751b961d1dc13 GIT binary patch literal 1928 zcmb_ce@s(X6n=&BLt8BqopmbjX`v9E+JY+*kq79&2@Gw~>U3ILEU_98aDWUeSR)EG zU;t??o4+UvBE?~h4p9oNP&1fd0~F`hnc@Vxh}|fwrH{J@X45n?>mR!>=e={!&AZ=s z&b{9`2DrNhGkr8>6um@zR<=fg?7^)CvUrxn;w_6C)sZS-m8#h<>rkPWCJYHvhWOauE>kgkd#kPD+%;w*p?s^L7>!Opt%4V}r+6~$JzYz{7c{yP-9Od*i!S}e7C$;kV5Ra8q$M_vISI=fWtwd?EWKz5+}BqF0u6|ne-GlgF!n~ zNZ6H^XFp4bU>>yh5SFATV+Lp?#t0KVPMifeG)L`wpt|PWr}t1Y5mV?yA=^a?SIk^4 zH*ls&zlu&jIp6nD$wPAVxGBW_^HnRc+l~TN_H}bC%Uxl#49A8R8phVA+G)LulGl+p zM_zTV1bu6E+aV_!JQrzjI4zBh!Bowlx5cYY%x9`z((W&oYypwg@H;Q9-X}LY9M{F$ z68R9HyCRV*=1}%Ltf7J28ncWKz9=Vx13JrOKidZql-~C9F+HN_NgCn#Ip8a+KUh2R zAfLIBoJ^0v6l*ioIoz}!py8Oo=*Tj+#yEA(zWrmzGFN<3Wv}e7#*Bt4Qadt!)&2y8 zkOW|KD9Ftum*3+_KQCu zqSgivinkkD$69U3_}J1Nm)j`9`SGJgxgKlieV8tnmlJz8APPIMuwqLm)Po$=8YsoI zJnBxzCB=Gg+LVIX){u(?*`)D8rNaRgpYde0 zQxhhu%t0UnjX1{ux?t*j`vsvH%OJZia#61+p)UnbPuHsxf#Pc7ew{ z+S`{HBs4|mJxrecKmP2K)3^Wp|NnpX+U+fM?U`9wkzqk)PF-t^jBbV}U$5TPKi#V< z-#{K@lL9l4gn|D+20MdKVr6QPf}tLe!>Rz0`p*QRA%Rmd=P^gppYw)Y?jJSeCQ2~$ z*G36=02TcD$O!fv$V(PLj7v9nR`L&d7sY2BNh;j^ujH@VubN- moduleList = Arrays.asList("bus", "configuration", "container", "display", "drive", "filtering", "inventory", "pagination", "pcb", "transport"); public static final List tiers = Arrays.asList("iron", "golden", "diamond", "netherite"); public static final String MOD_ID = "serverstorage"; - public static final String STORAGE_MODEL_ID = "storage"; - public static final String HARD_DRIVE_CONTAINER_BLOCK_MODEL_ID = "drive_container"; + public static final String BUS_CONNECTOR_MODEL_ID = "bus_connector"; + public static BusConnectorBlock BUS_CONNECTOR_BLOCK; + public static final String HARD_DRIVE_CONTAINER_BLOCK_MODEL_ID = "drive_container"; public static BlockEntityType HARD_DRIVE_CONTAINER_BLOCK_ENTITY; public static HardDriveContainerBlock HARD_DRIVE_CONTAINER_BLOCK; - public static StorageBlock STORAGE_BLOCK; - public static BlockEntityType STORAGE_BLOCK_ENTITY; + public static final String STORAGE_MODEL_ID = "storage"; + public static StorageInterfaceBlock STORAGE_INTERFACE_BLOCK; + public static BlockEntityType STORAGE_INTERFACE_BLOCK_ENTITY; + + public static final String INVENTORY_INTERFACE_BLOCK_MODEL_ID = "inventory_interface"; + public static InventoryInterfaceBlock INVENTORY_INTERFACE_BLOCK; + public static BlockEntityType INVENTORY_INTERFACE_BLOCK_ENTITY; + public static Item DRIVE_CASING; + public static Item CPU; + public static Item CPU_SUBSTRATE; + public static Item DRIVE_CONTROLLER; + public static Item PCB; + public static Item PCB_SUBSTRATE; + public static List MODULES; public static List PLATTERS; public static List DRIVES; public static List HEADS; public static final GameRules.Key ServerStorage_Crafting_Enable = - GameRuleRegistry.register("enableserverstoragecrafting", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(false)); + GameRuleRegistry.register("enableServerStorageCrafting", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(false)); public static Identifier id(String path) { @@ -49,17 +67,34 @@ public class ServerStorage implements ModInitializer { @Override public void onInitialize() { - StorageBlock.register(); - SimpleBlockItem.register(STORAGE_BLOCK); + StorageInterfaceBlock.register(); + SimpleBlockItem.register(STORAGE_INTERFACE_BLOCK); HardDriveContainerBlock.register(); SimpleBlockItem.register(HARD_DRIVE_CONTAINER_BLOCK); - HEADS = SimpleItem.register("head", tiers); - PLATTERS = SimpleItem.register("platter", tiers); - DRIVE_CASING = SimpleItem.register("drive_casing"); + BusConnectorBlock.register(); + SimpleBlockItem.register(BUS_CONNECTOR_BLOCK); + + InventoryInterfaceBlock.register(); + SimpleBlockItem.register(INVENTORY_INTERFACE_BLOCK); + + PCB = SimpleItem.register("pcb", ItemGroups.INGREDIENTS); + PCB_SUBSTRATE = SimpleItem.register("pcb_substrate", ItemGroups.INGREDIENTS); + CPU = SimpleItem.register("cpu", ItemGroups.INGREDIENTS); + CPU_SUBSTRATE = SimpleItem.register("cpu_substrate", ItemGroups.INGREDIENTS); + DRIVE_CONTROLLER = SimpleItem.register("drive_controller", ItemGroups.INGREDIENTS); + DRIVE_CASING = SimpleItem.register("drive_casing", ItemGroups.INGREDIENTS); + + MODULES = SimpleItem.register("module", moduleList, false, ItemGroups.INGREDIENTS); + + HEADS = SimpleItem.register("head", tiers, ItemGroups.INGREDIENTS); + PLATTERS = SimpleItem.register("platter", tiers, ItemGroups.INGREDIENTS); + DRIVES = HardDriveItem.register(tiers); + + PolymerResourcePackUtils.addModAssets(MOD_ID); PolymerResourcePackUtils.markAsRequired(); diff --git a/src/main/java/systems/brn/server_storage/blockentities/HardDriveContainerBlockEntity.java b/src/main/java/systems/brn/server_storage/blockentities/HardDriveContainerBlockEntity.java index cb35b82..6760ea8 100644 --- a/src/main/java/systems/brn/server_storage/blockentities/HardDriveContainerBlockEntity.java +++ b/src/main/java/systems/brn/server_storage/blockentities/HardDriveContainerBlockEntity.java @@ -11,13 +11,22 @@ import net.minecraft.screen.ScreenHandler; import net.minecraft.text.Text; import net.minecraft.util.collection.DefaultedList; import net.minecraft.util.math.BlockPos; +import systems.brn.server_storage.items.HardDrive; import systems.brn.server_storage.screenhandlers.DriveContainerScreenHandler; +import java.util.ArrayList; + +import static systems.brn.server_storage.ServerStorage.DRIVES; import static systems.brn.server_storage.ServerStorage.HARD_DRIVE_CONTAINER_BLOCK_ENTITY; public class HardDriveContainerBlockEntity extends LootableContainerBlockEntity { - private DefaultedList inventory; - private static final int INVENTORY_SIZE = 9; + public DefaultedList inventory; + public ArrayList drives = new ArrayList<>(); + public static final int INVENTORY_SIZE = 5; + + private int totalSlots; + private int usedSlots; + private int availableSlots; public HardDriveContainerBlockEntity(BlockPos pos, BlockState state) { super(HARD_DRIVE_CONTAINER_BLOCK_ENTITY, pos, state); @@ -65,4 +74,44 @@ public class HardDriveContainerBlockEntity extends LootableContainerBlockEntity Inventories.writeNbt(nbt, this.inventory, registryLookup); } } + + public void commitDrives(){ + for (int i = 0; i < this.inventory.size(); i++) { + for (HardDrive drive: this.drives) { + if(drive.getContainerIndex() == i){ + this.inventory.set(i, drive.getCommitedStack()); + break; + } + } + } + } + + public void indexDrives() { + drives = new ArrayList<>(); + totalSlots = 0; + availableSlots = 0; + usedSlots = 0; + for (int i = 0; i < this.inventory.size(); i++) { + ItemStack stack = this.inventory.get(i); + if (!stack.isEmpty() && DRIVES.contains(stack.getItem())) { + HardDrive drive = new HardDrive(stack, this, i); + totalSlots += drive.getMaxItems(); + availableSlots += drive.getAvailableItems(); + usedSlots += drive.getUsedItems(); + drives.add(drive); + } + } + } + + public int getTotalSlots() { + return totalSlots; + } + + public int getUsedSlots() { + return usedSlots; + } + + public int getAvailableSlots() { + return availableSlots; + } } diff --git a/src/main/java/systems/brn/server_storage/blockentities/InventoryInterfaceBlockEntity.java b/src/main/java/systems/brn/server_storage/blockentities/InventoryInterfaceBlockEntity.java new file mode 100644 index 0000000..3c691fe --- /dev/null +++ b/src/main/java/systems/brn/server_storage/blockentities/InventoryInterfaceBlockEntity.java @@ -0,0 +1,173 @@ +package systems.brn.server_storage.blockentities; + +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.inventory.Inventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.state.property.EnumProperty; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import systems.brn.server_storage.lib.ConnectionType; +import systems.brn.server_storage.lib.StorageNetwork; +import systems.brn.server_storage.screens.SettingsScreen; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import static systems.brn.server_storage.ServerStorage.INVENTORY_INTERFACE_BLOCK_ENTITY; +import static systems.brn.server_storage.blocks.ConnectedBlock.getPropertyForDirection; +import static systems.brn.server_storage.lib.StorageOperations.*; + +public class InventoryInterfaceBlockEntity extends BlockEntity { + + public StorageNetwork network; + + public final ArrayList openSettingsScreens = new ArrayList<>(); + + public boolean isOutput = false; + + public String query = ""; + + public int tickCounter = 0; + + public Direction direction = Direction.NORTH; + + public InventoryInterfaceBlockEntity(BlockPos pos, BlockState state) { + super(INVENTORY_INTERFACE_BLOCK_ENTITY, pos, state); + } + + public void reindexDrives() { + if (this.network != null) { + this.network.reindexNetwork(world, this.pos, false, query); + } else { + this.network = new StorageNetwork(world, this.pos, false, query); + } + } + + public void updateDisplays() { + for (SettingsScreen screen : openSettingsScreens) { + screen.updateDisplay(); + } + } + + public void nextDirection() { + int newId = (direction.getId() + 1) % 6; + direction = Direction.byId(newId); + } + + // Serialize the BlockEntity + @Override + public void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapperLookup) { + // Save the current value of the number to the nbt + nbt.putBoolean("isOutput", isOutput); + nbt.putInt("direction", direction.getId()); + nbt.putInt("tickCounter", tickCounter); + nbt.putString("query", query); + super.writeNbt(nbt, wrapperLookup); + } + + // Deserialize the BlockEntity + @Override + public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapperLookup) { + super.readNbt(nbt, wrapperLookup); + isOutput = nbt.getBoolean("isOutput"); + direction = Direction.byId(nbt.getInt("direction")); + tickCounter = nbt.getInt("tickCounter"); + query = nbt.getString("query"); + } + + private static int processIncomingInternal(ItemStack stack, int count, InventoryInterfaceBlockEntity blockEntity, Inventory targetedBlockEntityInventory) { + int maxFit = howMuchFits(stack, targetedBlockEntityInventory); + int finalCount = Math.min(count, maxFit); + ItemStack insertedStack = stack.copy(); + insertedStack.setCount(finalCount); + blockEntity.network.removeItemStack(insertedStack); + blockEntity.network.updateDisplays(); + int remainingToInsert = finalCount; + for (int i = 0; i < Math.ceilDivExact(finalCount, stack.getMaxCount()); i++) { + ItemStack cappedStack = insertedStack.copy(); + cappedStack.setCount(Math.min(insertedStack.getMaxCount(), remainingToInsert)); + + ItemStack remaining = insertStackIntoInventory(targetedBlockEntityInventory, cappedStack.copy()); + if (!remaining.isEmpty()) { + ItemStack reverseStack = stack.copy(); + reverseStack.setCount(remaining.getCount() + remainingToInsert); + blockEntity.network.putItemStackRemainder(reverseStack); + break; + } + remainingToInsert -= cappedStack.getCount(); + } + return count - (finalCount - remainingToInsert); + } + + public int processIncoming(ItemStack stack, int count) { + if (world != null && isOutput && filterItem(stack.getItem(), query)) { + BlockPos targetedPos = pos.offset(direction); + BlockEntity targetedBlockEntity = world.getBlockEntity(targetedPos); + EnumProperty connectionType = getPropertyForDirection(direction); + BlockState thisState = world.getBlockState(pos); + if (targetedBlockEntity instanceof Inventory targetedBlockEntityInventory && + thisState.contains(connectionType) && + thisState.get(connectionType) == ConnectionType.INVENTORY) { + reindexDrives(); + + return processIncomingInternal(stack, count, this, targetedBlockEntityInventory); + } + } + return count; + } + + public static void tick(World world, BlockPos blockPos, BlockState state, T t) { + InventoryInterfaceBlockEntity blockEntity = (InventoryInterfaceBlockEntity) world.getBlockEntity(blockPos); + if (blockEntity != null) { + if (blockEntity.tickCounter == 0) { + BlockPos targetedPos = blockPos.offset(blockEntity.direction); + BlockEntity targetedBlockEntity = world.getBlockEntity(targetedPos); + BlockState thisState = world.getBlockState(blockPos); + EnumProperty connectionType = getPropertyForDirection(blockEntity.direction); + if (targetedBlockEntity instanceof Inventory targetedBlockEntityInventory && + thisState.contains(connectionType) && + thisState.get(connectionType) == ConnectionType.INVENTORY) { + blockEntity.reindexDrives(); + + if (blockEntity.isOutput) { + for (Map.Entry entry : blockEntity.network.filteredItemStackMap.entrySet()) { + int leftOver = processIncomingInternal(entry.getKey(), entry.getValue(), blockEntity, targetedBlockEntityInventory); + if (leftOver > 0) { + break; + } + } + } else { + Map targetedBlockInventoryMap = new HashMap<>(); + addInventoryToMap(targetedBlockEntityInventory, targetedBlockInventoryMap); + targetedBlockInventoryMap = sortAndFilterMap(targetedBlockInventoryMap, false, blockEntity.query); + for (Map.Entry entry : targetedBlockInventoryMap.entrySet()) { + ItemStack stack = entry.getKey(); + int count = entry.getValue(); + ItemStack insertingStack = stack.copy(); + insertingStack.setCount(count); + if (count > 0) { + int canPutInside = count - blockEntity.network.putItemStackRemainder(insertingStack.copy()); + blockEntity.network.updateDisplays(); + if (canPutInside > 0) { + removeFromInventory(targetedBlockEntityInventory, insertingStack.copy(), canPutInside); + } + } + } + } + } + } + blockEntity.tickCounter = (blockEntity.tickCounter + 1) % 160; + } + } + + public void doSearch(String query) { + this.query = query; + reindexDrives(); + updateDisplays(); + } +} \ No newline at end of file diff --git a/src/main/java/systems/brn/server_storage/blockentities/StorageBlockEntity.java b/src/main/java/systems/brn/server_storage/blockentities/StorageBlockEntity.java deleted file mode 100644 index 24be7d1..0000000 --- a/src/main/java/systems/brn/server_storage/blockentities/StorageBlockEntity.java +++ /dev/null @@ -1,181 +0,0 @@ -package systems.brn.server_storage.blockentities; - -import net.minecraft.block.BlockState; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.inventory.Inventory; -import net.minecraft.inventory.SidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.registry.RegistryWrapper; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import systems.brn.server_storage.lib.ConnectedChests; -import systems.brn.server_storage.screens.StorageScreen; - -import java.util.ArrayList; - -import static systems.brn.server_storage.ServerStorage.STORAGE_BLOCK_ENTITY; - -public class StorageBlockEntity extends BlockEntity implements Inventory, SidedInventory { - - public void removeScreen(StorageScreen storageScreenToDelete) { - openStorageScreens.remove(storageScreenToDelete); - } - - public Boolean sortAlphabetically = false; - public Boolean allInventories = false; - public Boolean autoSuck = false; - public String searchString = ""; - public int page = 0; - public ConnectedChests chests; - - public ArrayList openStorageScreens = new ArrayList<>(); - - public StorageBlockEntity(BlockPos pos, BlockState state) { - super(STORAGE_BLOCK_ENTITY, pos, state); - } - - public void rescanChests() { - this.chests = new ConnectedChests(world, this.pos, sortAlphabetically, searchString, allInventories); - if(autoSuck){ - this.chests.autoSuck(); - } - this.updateDisplays(); - } - - @Override - public int size() { - if (chests != null) { - this.rescanChests(); - return chests.inventory.size(); - } - else { - return 1; - } - } - - @Override - public boolean isEmpty() { - if (chests != null) { - this.rescanChests(); - return chests.inventory.isEmpty(); - } - else { - return true; - } - } - - @Override - public ItemStack getStack(int slot) { - if (chests != null) { - this.rescanChests(); - return chests.inventory.getStack(slot); - } - else { - return ItemStack.EMPTY; - } - } - - @Override - public ItemStack removeStack(int slot, int amount) { - if (chests != null) { - ItemStack stackToRemove = chests.inventory.getStack(slot); - stackToRemove.setCount( - Math.min( - Math.min(stackToRemove.getCount(), amount), stackToRemove.getMaxCount()) - ); - return chests.removeItemStack(stackToRemove); - } - else { - return ItemStack.EMPTY; - } - } - - @Override - public ItemStack removeStack(int slot) { - if (chests != null) { - ItemStack stackToRemove = chests.inventory.getStack(slot); - stackToRemove.setCount(Math.min(stackToRemove.getCount(), stackToRemove.getMaxCount())); - return chests.removeItemStack(stackToRemove); - } - else { - return ItemStack.EMPTY; - } - } - - @Override - public void setStack(int slot, ItemStack stack) { - chests.tryPutItemStack(stack); - updateDisplays(); - } - - public void updateDisplays() { - for (StorageScreen screen : openStorageScreens) { - screen.updateDisplay(); - } - } - - @Override - public boolean canPlayerUse(PlayerEntity player) { - return false; - } - - @Override - public void clear() { - // Do nothing, prevent clearing the inventory - } - - // SidedInventory methods - @Override - public int[] getAvailableSlots(Direction side) { - if(this.chests != null) { - this.rescanChests(); - int[] output = new int[chests.inventory.size()]; - for (int i = 0; i < chests.inventory.size() - 1; i++) { - output[i] = i; - } - return output; - } - else { - return new int[0]; - } - } - - @Override - public boolean canInsert(int slot, ItemStack stack, Direction dir) { - rescanChests(); - return chests.canAddItemStack(stack); - } - - @Override - public boolean canExtract(int slot, ItemStack stack, Direction dir) { - rescanChests(); - return chests.canRemove(stack); - } - - // Serialize the BlockEntity - @Override - public void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapperLookup) { - // Save the current value of the number to the nbt - nbt.putInt("page", page); - nbt.putBoolean("sortAlphabetically", sortAlphabetically); - nbt.putString("searchString", searchString); - nbt.putBoolean("allInventories", allInventories); - nbt.putBoolean("autoSuck", autoSuck); - - super.writeNbt(nbt, wrapperLookup); - } - - // Deserialize the BlockEntity - @Override - public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapperLookup) { - super.readNbt(nbt, wrapperLookup); - - page = nbt.getInt("page"); - sortAlphabetically = nbt.getBoolean("sortAlphabetically"); - searchString = nbt.getString("searchString"); - allInventories = nbt.getBoolean("allInventories"); - autoSuck = nbt.getBoolean("autoSuck"); - } -} diff --git a/src/main/java/systems/brn/server_storage/blockentities/StorageInterfaceBlockEntity.java b/src/main/java/systems/brn/server_storage/blockentities/StorageInterfaceBlockEntity.java new file mode 100644 index 0000000..f739f03 --- /dev/null +++ b/src/main/java/systems/brn/server_storage/blockentities/StorageInterfaceBlockEntity.java @@ -0,0 +1,71 @@ +package systems.brn.server_storage.blockentities; + +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.util.math.BlockPos; +import systems.brn.server_storage.lib.StorageNetwork; +import systems.brn.server_storage.screens.StorageScreen; + +import java.util.ArrayList; + +import static systems.brn.server_storage.ServerStorage.STORAGE_INTERFACE_BLOCK_ENTITY; + +public class StorageInterfaceBlockEntity extends BlockEntity { + + public void removeScreen(StorageScreen storageScreenToDelete) { + openStorageScreens.remove(storageScreenToDelete); + } + + public Boolean sortAlphabetically = false; + public String searchString = ""; + public int page = 0; + public StorageNetwork network; + + public final ArrayList openStorageScreens = new ArrayList<>(); + + public StorageInterfaceBlockEntity(BlockPos pos, BlockState state) { + super(STORAGE_INTERFACE_BLOCK_ENTITY, pos, state); + } + + public void justReindexDrives() { + if (this.network != null) { + this.network.reindexNetwork(world, this.pos, sortAlphabetically, searchString); + } else { + this.network = new StorageNetwork(world, this.pos, sortAlphabetically, searchString); + } + } + + public void reindexDrives() { + justReindexDrives(); + this.network.updateDisplays(); + } + + public void updateDisplays() { + for (StorageScreen screen : openStorageScreens) { + screen.updateDisplay(); + } + } + + // Serialize the BlockEntity + @Override + public void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapperLookup) { + // Save the current value of the number to the nbt + nbt.putInt("page", page); + nbt.putBoolean("sortAlphabetically", sortAlphabetically); + nbt.putString("searchString", searchString); + + super.writeNbt(nbt, wrapperLookup); + } + + // Deserialize the BlockEntity + @Override + public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapperLookup) { + super.readNbt(nbt, wrapperLookup); + + page = nbt.getInt("page"); + sortAlphabetically = nbt.getBoolean("sortAlphabetically"); + searchString = nbt.getString("searchString"); + } +} diff --git a/src/main/java/systems/brn/server_storage/blocks/BusConnectorBlock.java b/src/main/java/systems/brn/server_storage/blocks/BusConnectorBlock.java new file mode 100644 index 0000000..cebf844 --- /dev/null +++ b/src/main/java/systems/brn/server_storage/blocks/BusConnectorBlock.java @@ -0,0 +1,40 @@ +package systems.brn.server_storage.blocks; + +import eu.pb4.polymer.blocks.api.BlockModelType; +import eu.pb4.polymer.blocks.api.PolymerBlockModel; +import eu.pb4.polymer.blocks.api.PolymerBlockResourceUtils; +import eu.pb4.polymer.blocks.api.PolymerTexturedBlock; +import net.minecraft.block.*; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.util.Identifier; + +import static systems.brn.server_storage.ServerStorage.*; + +public class BusConnectorBlock extends ConnectedBlock implements PolymerTexturedBlock { + final Identifier identifier; + private final BlockState polymerBlockState; + + public BusConnectorBlock(Settings settings, Identifier identifier) { + super(settings, Blocks.NOTE_BLOCK); + this.identifier = identifier; + this.polymerBlockState = PolymerBlockResourceUtils.requestBlock( + BlockModelType.FULL_BLOCK, + PolymerBlockModel.of( + identifier.withPath("block/" + identifier.getPath()) + ) + ); + } + + @Override + public BlockState getPolymerBlockState(BlockState state) { + return this.polymerBlockState; + } + + public static void register() { + var modId = id(BUS_CONNECTOR_MODEL_ID); + BUS_CONNECTOR_BLOCK = Registry.register(Registries.BLOCK, modId, + new BusConnectorBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL), modId)); + BUS_CONNECTOR_BLOCK.setDefaultState(); + } +} diff --git a/src/main/java/systems/brn/server_storage/blocks/ConnectedBlock.java b/src/main/java/systems/brn/server_storage/blocks/ConnectedBlock.java new file mode 100644 index 0000000..e202730 --- /dev/null +++ b/src/main/java/systems/brn/server_storage/blocks/ConnectedBlock.java @@ -0,0 +1,90 @@ +package systems.brn.server_storage.blocks; + +import eu.pb4.polymer.core.api.block.SimplePolymerBlock; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.inventory.Inventory; +import net.minecraft.item.ItemStack; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.EnumProperty; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import systems.brn.server_storage.lib.ConnectionType; + +public class ConnectedBlock extends SimplePolymerBlock { + + public static final EnumProperty NORTH = EnumProperty.of("north", ConnectionType.class); + public static final EnumProperty SOUTH = EnumProperty.of("south", ConnectionType.class); + public static final EnumProperty WEST = EnumProperty.of("west", ConnectionType.class); + public static final EnumProperty EAST = EnumProperty.of("east", ConnectionType.class); + public static final EnumProperty UP = EnumProperty.of("up", ConnectionType.class); + public static final EnumProperty DOWN = EnumProperty.of("down", ConnectionType.class); + + public void setDefaultState() { + setDefaultState(getStateManager().getDefaultState() + .with(NORTH, ConnectionType.NONE) + .with(SOUTH, ConnectionType.NONE) + .with(WEST, ConnectionType.NONE) + .with(EAST, ConnectionType.NONE) + .with(UP, ConnectionType.NONE) + .with(DOWN, ConnectionType.NONE)); + } + + public ConnectedBlock(Settings settings, Block block) { + super(settings, block); + } + + @Override + public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) { + super.onPlaced(world, pos, state, placer, itemStack); + updateBlockState(world, pos, state); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + builder.add(NORTH, SOUTH, WEST, EAST, UP, DOWN); + } + + public void updateBlockState(World world, BlockPos pos, BlockState state) { + world.setBlockState(pos, updateState(state, world, pos), Block.NOTIFY_LISTENERS); + } + + @Override + public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) { + updateBlockState(world, pos, state); + super.neighborUpdate(state, world, pos, block, fromPos, notify); + } + + private BlockState updateState(BlockState state, World world, BlockPos pos) { + for (Direction direction : Direction.values()) { + BlockPos neighborPos = pos.offset(direction); + BlockState neighborState = world.getBlockState(neighborPos); + boolean isConnectedToBus = neighborState.getBlock() instanceof ConnectedBlock; + BlockEntity blockEntity = world.getBlockEntity(neighborPos); + boolean isConnectedToInventory = blockEntity instanceof Inventory; + ConnectionType connectionType = ConnectionType.NONE; + if (isConnectedToBus){ + connectionType = ConnectionType.BUS; + } else if (isConnectedToInventory){ + connectionType = ConnectionType.INVENTORY; + } + + state = state.with(getPropertyForDirection(direction), connectionType); + } + return state; + } + + public static EnumProperty getPropertyForDirection(Direction direction) { + return switch (direction) { + case NORTH -> NORTH; + case SOUTH -> SOUTH; + case WEST -> WEST; + case EAST -> EAST; + case UP -> UP; + case DOWN -> DOWN; + }; + } +} diff --git a/src/main/java/systems/brn/server_storage/blocks/HardDriveContainerBlock.java b/src/main/java/systems/brn/server_storage/blocks/HardDriveContainerBlock.java index d56c7c1..5b0ad0b 100644 --- a/src/main/java/systems/brn/server_storage/blocks/HardDriveContainerBlock.java +++ b/src/main/java/systems/brn/server_storage/blocks/HardDriveContainerBlock.java @@ -5,7 +5,6 @@ import eu.pb4.polymer.blocks.api.PolymerBlockModel; import eu.pb4.polymer.blocks.api.PolymerBlockResourceUtils; import eu.pb4.polymer.blocks.api.PolymerTexturedBlock; import eu.pb4.polymer.core.api.block.PolymerBlockUtils; -import eu.pb4.polymer.core.api.block.SimplePolymerBlock; import net.fabricmc.fabric.api.event.player.UseBlockCallback; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; @@ -29,7 +28,7 @@ import systems.brn.server_storage.blockentities.HardDriveContainerBlockEntity; import static systems.brn.server_storage.ServerStorage.*; -public class HardDriveContainerBlock extends SimplePolymerBlock implements PolymerTexturedBlock, BlockEntityProvider { +public class HardDriveContainerBlock extends ConnectedBlock implements PolymerTexturedBlock, BlockEntityProvider { final Identifier identifier; public static final DirectionProperty FACING = FacingBlock.FACING; @@ -49,6 +48,7 @@ public class HardDriveContainerBlock extends SimplePolymerBlock implements Polym @Override protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); builder.add(FACING); } @@ -63,12 +63,14 @@ public class HardDriveContainerBlock extends SimplePolymerBlock implements Polym new HardDriveContainerBlock(Settings.copy(Blocks.WHITE_WOOL), modId)); UseBlockCallback.EVENT.register(HardDriveContainerBlock::onUse); + HARD_DRIVE_CONTAINER_BLOCK.setDefaultState(); + HARD_DRIVE_CONTAINER_BLOCK_ENTITY = Registry.register( Registries.BLOCK_ENTITY_TYPE, modId, BlockEntityType.Builder.create(HardDriveContainerBlockEntity::new, HARD_DRIVE_CONTAINER_BLOCK).build(null) ); - PolymerBlockUtils.registerBlockEntity(STORAGE_BLOCK_ENTITY); + PolymerBlockUtils.registerBlockEntity(STORAGE_INTERFACE_BLOCK_ENTITY); } private static ActionResult onUse(PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) { diff --git a/src/main/java/systems/brn/server_storage/blocks/InventoryInterfaceBlock.java b/src/main/java/systems/brn/server_storage/blocks/InventoryInterfaceBlock.java new file mode 100644 index 0000000..c58e395 --- /dev/null +++ b/src/main/java/systems/brn/server_storage/blocks/InventoryInterfaceBlock.java @@ -0,0 +1,179 @@ +package systems.brn.server_storage.blocks; + +import eu.pb4.polymer.blocks.api.BlockModelType; +import eu.pb4.polymer.blocks.api.PolymerBlockModel; +import eu.pb4.polymer.blocks.api.PolymerBlockResourceUtils; +import eu.pb4.polymer.blocks.api.PolymerTexturedBlock; +import eu.pb4.polymer.core.api.block.PolymerBlockUtils; +import eu.pb4.sgui.api.elements.GuiElementBuilder; +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.minecraft.block.*; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.BlockEntityTicker; +import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.item.Items; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.DirectionProperty; +import net.minecraft.text.Text; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Formatting; +import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; +import systems.brn.server_storage.blockentities.InventoryInterfaceBlockEntity; +import systems.brn.server_storage.lib.PagedGui; +import systems.brn.server_storage.screens.SearchScreen; +import systems.brn.server_storage.screens.SettingsScreen; + +import static systems.brn.server_storage.ServerStorage.*; +import static systems.brn.server_storage.lib.PagedGui.*; + +public class InventoryInterfaceBlock extends ConnectedBlock implements PolymerTexturedBlock, BlockEntityProvider { + final Identifier identifier; + public static final DirectionProperty FACING = FacingBlock.FACING; + private final BlockState polymerBlockState; + + public InventoryInterfaceBlock(Settings settings, Identifier identifier) { + super(settings, Blocks.NOTE_BLOCK); + this.identifier = identifier; + this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH)); + this.polymerBlockState = PolymerBlockResourceUtils.requestBlock(BlockModelType.FULL_BLOCK, PolymerBlockModel.of(identifier.withPath("block/" + identifier.getPath()))); + } + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + return this.getDefaultState().with(FACING, ctx.getHorizontalPlayerFacing().getOpposite()); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); + builder.add(FACING); + } + + @Override + public BlockState getPolymerBlockState(BlockState state) { + return this.polymerBlockState; + } + + public static void register() { + var modId = id(INVENTORY_INTERFACE_BLOCK_MODEL_ID); + INVENTORY_INTERFACE_BLOCK = Registry.register(Registries.BLOCK, modId, + new InventoryInterfaceBlock(Settings.copy(Blocks.WHITE_WOOL), modId)); + UseBlockCallback.EVENT.register(InventoryInterfaceBlock::onUse); + INVENTORY_INTERFACE_BLOCK.setDefaultState(); + INVENTORY_INTERFACE_BLOCK_ENTITY = Registry.register( + Registries.BLOCK_ENTITY_TYPE, + modId, + BlockEntityType.Builder.create(InventoryInterfaceBlockEntity::new, INVENTORY_INTERFACE_BLOCK).build(null) + ); + PolymerBlockUtils.registerBlockEntity(INVENTORY_INTERFACE_BLOCK_ENTITY); + } + + private static void loadSettings(SettingsScreen settingsScreen, InventoryInterfaceBlockEntity blockEntity) { + settingsScreen.clearSettings(); + settingsScreen.addSetting(PagedGui.DisplayElement.of( + new GuiElementBuilder(Items.PLAYER_HEAD) + .setName(Text.translatable(switch (blockEntity.direction) { + case NORTH -> "gui.serverstorage.direction_north"; + case SOUTH -> "gui.serverstorage.direction_south"; + case WEST -> "gui.serverstorage.direction_west"; + case EAST -> "gui.serverstorage.direction_east"; + case UP -> "gui.serverstorage.direction_up"; + case DOWN -> "gui.serverstorage.direction_down"; + }).formatted(Formatting.WHITE)) + .hideDefaultTooltip().noDefaults() + .setSkullOwner(switch (blockEntity.direction) { + case NORTH -> GUI_SIDE_NORTH; + case SOUTH -> GUI_SIDE_SOUTH; + case WEST -> GUI_SIDE_WEST; + case EAST -> GUI_SIDE_EAST; + case UP -> GUI_SIDE_UP; + case DOWN -> GUI_SIDE_DOWN; + }) + .setCallback((x, y, z) -> { + playClickSound(settingsScreen.getPlayer()); + blockEntity.nextDirection(); + loadSettings(settingsScreen, blockEntity); + blockEntity.updateDisplays(); + }) + )); + + settingsScreen.addSetting(PagedGui.DisplayElement.of( + new GuiElementBuilder(Items.PLAYER_HEAD) + .setName(Text.translatable(blockEntity.isOutput ? "gui.serverstorage.mode_output" : "gui.serverstorage.mode_input").formatted(Formatting.WHITE)) + .hideDefaultTooltip().noDefaults() + .setSkullOwner(blockEntity.isOutput ? GUI_MODE_OUTPUT : GUI_MODE_INPUT) + .setCallback((x, y, z) -> { + playClickSound(settingsScreen.getPlayer()); + blockEntity.isOutput ^= true; + loadSettings(settingsScreen, blockEntity); + blockEntity.updateDisplays(); + }) + )); + + String queryNow = blockEntity.query; + if (queryNow == null || queryNow.isEmpty() || queryNow.equals("*")) { + queryNow = "Filter not set"; + } + + settingsScreen.addSetting(PagedGui.DisplayElement.of( + new GuiElementBuilder(Items.PLAYER_HEAD) + .setName(Text.literal(queryNow).formatted(Formatting.WHITE)) + .hideDefaultTooltip().noDefaults() + .setSkullOwner(GUI_QUESTION_MARK) + .setCallback((x, y, z) -> { + SearchScreen searchScreen = new SearchScreen(settingsScreen, ""); + playClickSound(settingsScreen.getPlayer()); + searchScreen.open(); + }) + )); + } + + private static ActionResult onUse(PlayerEntity playerEntity, World world, Hand hand, BlockHitResult hitResult) { + BlockPos pos = hitResult.getBlockPos(); + BlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + + if (block instanceof InventoryInterfaceBlock) { + BlockEntity tempBlockEntity = world.getBlockEntity(pos); + if (tempBlockEntity instanceof InventoryInterfaceBlockEntity blockEntity) { + if (!world.isClient && !playerEntity.isSpectator()) { + ServerPlayerEntity player = (ServerPlayerEntity) playerEntity; + if (!player.isSneaking()) { + SettingsScreen settingsScreen = new SettingsScreen(player, blockEntity); + blockEntity.reindexDrives(); + loadSettings(settingsScreen, blockEntity); + settingsScreen.updateDisplay(); + settingsScreen.open(); + } else { + return ActionResult.PASS; + } + } + return ActionResult.SUCCESS; + } + } + return ActionResult.PASS; + } + + @Override + public BlockEntityTicker getTicker(World world, BlockState state, BlockEntityType type) { + return world instanceof ServerWorld && type == INVENTORY_INTERFACE_BLOCK_ENTITY ? InventoryInterfaceBlockEntity::tick : null; + } + + @Nullable + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return new InventoryInterfaceBlockEntity(pos, state); + } +} diff --git a/src/main/java/systems/brn/server_storage/blocks/StorageBlock.java b/src/main/java/systems/brn/server_storage/blocks/StorageInterfaceBlock.java similarity index 76% rename from src/main/java/systems/brn/server_storage/blocks/StorageBlock.java rename to src/main/java/systems/brn/server_storage/blocks/StorageInterfaceBlock.java index 72b3c69..ae01821 100644 --- a/src/main/java/systems/brn/server_storage/blocks/StorageBlock.java +++ b/src/main/java/systems/brn/server_storage/blocks/StorageInterfaceBlock.java @@ -5,7 +5,6 @@ import eu.pb4.polymer.blocks.api.PolymerBlockModel; import eu.pb4.polymer.blocks.api.PolymerBlockResourceUtils; import eu.pb4.polymer.blocks.api.PolymerTexturedBlock; import eu.pb4.polymer.core.api.block.PolymerBlockUtils; -import eu.pb4.polymer.core.api.block.SimplePolymerBlock; import net.fabricmc.fabric.api.event.player.UseBlockCallback; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; @@ -31,7 +30,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import systems.brn.server_storage.blockentities.StorageBlockEntity; +import systems.brn.server_storage.blockentities.StorageInterfaceBlockEntity; import systems.brn.server_storage.screens.StorageScreen; import java.util.List; @@ -39,12 +38,12 @@ import java.util.List; import static systems.brn.server_storage.ServerStorage.*; import static systems.brn.server_storage.lib.Util.generateBookContent; -public class StorageBlock extends SimplePolymerBlock implements PolymerTexturedBlock, BlockEntityProvider { +public class StorageInterfaceBlock extends ConnectedBlock implements PolymerTexturedBlock, BlockEntityProvider { final Identifier identifier; public static final DirectionProperty FACING = FacingBlock.FACING; private final BlockState polymerBlockState; - public StorageBlock(Settings settings, Identifier identifier) { + public StorageInterfaceBlock(Settings settings, Identifier identifier) { super(settings, Blocks.NOTE_BLOCK); this.identifier = identifier; this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH)); @@ -58,6 +57,7 @@ public class StorageBlock extends SimplePolymerBlock implements PolymerTexturedB @Override protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); builder.add(FACING); } @@ -68,16 +68,16 @@ public class StorageBlock extends SimplePolymerBlock implements PolymerTexturedB public static void register() { var modId = id(STORAGE_MODEL_ID); - STORAGE_BLOCK = Registry.register(Registries.BLOCK, modId, - new StorageBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL), modId)); - UseBlockCallback.EVENT.register(StorageBlock::onUse); - - STORAGE_BLOCK_ENTITY = Registry.register( + STORAGE_INTERFACE_BLOCK = Registry.register(Registries.BLOCK, modId, + new StorageInterfaceBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL), modId)); + UseBlockCallback.EVENT.register(StorageInterfaceBlock::onUse); + STORAGE_INTERFACE_BLOCK.setDefaultState(); + STORAGE_INTERFACE_BLOCK_ENTITY = Registry.register( Registries.BLOCK_ENTITY_TYPE, modId, - BlockEntityType.Builder.create(StorageBlockEntity::new, STORAGE_BLOCK).build(null) + BlockEntityType.Builder.create(StorageInterfaceBlockEntity::new, STORAGE_INTERFACE_BLOCK).build(null) ); - PolymerBlockUtils.registerBlockEntity(STORAGE_BLOCK_ENTITY); + PolymerBlockUtils.registerBlockEntity(STORAGE_INTERFACE_BLOCK_ENTITY); } private static ActionResult onUse(PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) { @@ -85,17 +85,18 @@ public class StorageBlock extends SimplePolymerBlock implements PolymerTexturedB BlockState state = world.getBlockState(pos); Block block = state.getBlock(); - if (block instanceof StorageBlock) { + if (block instanceof StorageInterfaceBlock) { if (!world.isClient && !player.isSpectator()) { if (!player.isSneaking()) { StorageScreen storageScreen = new StorageScreen((ServerPlayerEntity) player, pos, null); + storageScreen.updateDisplay(); storageScreen.open(); } else if (player.getStackInHand(hand).getItem() == Items.WRITTEN_BOOK) { ItemStack book = player.getStackInHand(hand); - StorageBlockEntity storageBlockEntity = (StorageBlockEntity) world.getBlockEntity(pos); - assert storageBlockEntity != null; - List> generatedContent = generateBookContent(storageBlockEntity.chests.inventory); + StorageInterfaceBlockEntity storageInterfaceBlockEntity = (StorageInterfaceBlockEntity) world.getBlockEntity(pos); + assert storageInterfaceBlockEntity != null; + List> generatedContent = generateBookContent(storageInterfaceBlockEntity.network.itemStackMap); book.set(DataComponentTypes.WRITTEN_BOOK_CONTENT, new WrittenBookContentComponent( RawFilteredPair.of("Item Listing"), player.getGameProfile().getName(), @@ -115,6 +116,6 @@ public class StorageBlock extends SimplePolymerBlock implements PolymerTexturedB @Nullable @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return new StorageBlockEntity(pos, state); + return new StorageInterfaceBlockEntity(pos, state); } } diff --git a/src/main/java/systems/brn/server_storage/items/HardDrive.java b/src/main/java/systems/brn/server_storage/items/HardDrive.java new file mode 100644 index 0000000..9fc6240 --- /dev/null +++ b/src/main/java/systems/brn/server_storage/items/HardDrive.java @@ -0,0 +1,300 @@ +package systems.brn.server_storage.items; + +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.LoreComponent; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.text.Style; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; +import systems.brn.server_storage.blockentities.HardDriveContainerBlockEntity; + +import java.util.*; + +import static systems.brn.server_storage.lib.DriveComponents.*; +import static systems.brn.server_storage.lib.StorageOperations.canCombine; + +public class HardDrive { + private ItemStack driveStack; + public final HardDriveContainerBlockEntity blockEntity; + private int containerIndex; + + private int maxItems; + private int usedItems; + private int availableItems; + private final UUID myUUID; + private int tier; + + public Map items; + + public void loadComponents() { + Map loadedItems = driveStack.getComponents().getOrDefault(ITEMSTACK_MAP, new HashMap<>()); + if (this.items == null) { + this.items = loadedItems; + } + updateData(); + } + + public void setMaxItems() { + String itemName = driveStack.getItem().getRegistryEntry().registryKey().getValue().getPath(); + switch (itemName) { + case "iron_drive": + tier = 0; + break; + case "golden_drive": + tier = 1; + break; + case "diamond_drive": + tier = 2; + break; + case "netherite_drive": + tier = 3; + break; + default: + tier = -1; + break; + } + + maxItems = 0; + + if (tier >= 0) { + maxItems = (int) Math.pow(2, tier + 8); + } + } + + public void updateData() { + usedItems = 0; + for (Map.Entry entry : items.entrySet()) { + if (entry.getKey().getItem() == Items.AIR) { + items.remove(entry.getKey()); + } else { + usedItems += entry.getValue(); + } + } + addLoreInfo(); + availableItems = maxItems - usedItems; + assert maxItems >= usedItems; + assert usedItems >= 0; + } + + public void saveComponents() { + ItemStack tempStack = driveStack.copy(); + HashMap itemsTemp = new HashMap<>(); + for (Map.Entry entry : items.entrySet()) { + int count = entry.getKey().getCount(); + if (count > entry.getKey().getMaxCount()) { + count = entry.getKey().getMaxCount(); + } + ItemStack limitedStack = entry.getKey().copy(); + limitedStack.setCount(count); + itemsTemp.put(limitedStack, entry.getValue()); + } + tempStack.remove(ITEMSTACK_MAP); + tempStack.set(ITEMSTACK_MAP, itemsTemp); + driveStack = tempStack; + } + + private boolean isNotTheSameDrive(ItemStack currentStack) { + return currentStack.getItem() != driveStack.getItem() || (currentStack.contains(UUID_COMPONENT) && currentStack.get(UUID_COMPONENT) != myUUID); + } + + public ItemStack getCommitedStack() { + ItemStack tempDriveStack = driveStack.copy(); + driveStack = ensureUUID(tempDriveStack); + loadComponents(); + updateData(); + saveComponents(); + return driveStack; + } + + public void commitChangesToContainer() { + getCommitedStack(); + ItemStack currentStack = blockEntity.inventory.get(containerIndex); + boolean updated = false; + if (isNotTheSameDrive(currentStack)) { + updateIndex(); + updated = true; + } + if (updated && isNotTheSameDrive(currentStack)) { + return; + } + + blockEntity.inventory.set(containerIndex, driveStack); + blockEntity.markDirty(); + } + + public ItemStack removeStackFromInventory(ItemStack stack) { + int outCount = 0; + ItemStack outStack = stack.copy(); + for (Map.Entry entry : items.entrySet()) { + if (canCombine(entry.getKey(), stack)) { + int countInDrive = entry.getValue(); + int needToRemove = stack.getCount(); + + if (countInDrive <= needToRemove) { + items.remove(entry.getKey()); + needToRemove -= countInDrive; + outCount += needToRemove; + } else { + entry.setValue(countInDrive - needToRemove); + } + break; + } + } + outStack.setCount(outCount); + commitChangesToContainer(); + blockEntity.markDirty(); + return outStack; + } + + public ItemStack insertStackIntoInventory(ItemStack stack) { + // First, try to merge with existing stacks + boolean merged = false; + if (stack.isEmpty()) { + return stack; + } + int transferAmount = Math.min(stack.getCount(), availableItems); + if (transferAmount > 0) { + for (Map.Entry entry : items.entrySet()) { + ItemStack slotStack = entry.getKey(); + if (canCombine(slotStack, stack)) { + entry.setValue(transferAmount + entry.getValue()); + stack.decrement(transferAmount); + merged = true; + break; + } + } + if (!merged) { + ItemStack inStack = stack.copy(); + inStack.capCount(inStack.getMaxCount()); + items.put(inStack, transferAmount); + stack.decrement(transferAmount); + } + } + commitChangesToContainer(); + blockEntity.markDirty(); + if (stack.isEmpty() || stack.getCount() < 1) { + return ItemStack.EMPTY; + } else { + return stack; + } + } + + private void addLoreInfo() { + ItemStack tempDriveStack = driveStack.copy(); + + Formatting availableLineFormatting; + Formatting usedLineFormatting; + + if (usedItems > maxItems){ + usedLineFormatting = Formatting.LIGHT_PURPLE; + } else if (usedItems == maxItems) { + usedLineFormatting = Formatting.RED; + } else if (usedItems >= maxItems * 0.8){ + usedLineFormatting = Formatting.YELLOW; + } else if (usedItems >= maxItems * 0.5){ + usedLineFormatting = Formatting.GOLD; + } else { + usedLineFormatting = Formatting.GREEN; + } + + if (usedItems > maxItems) { + availableLineFormatting = Formatting.LIGHT_PURPLE; //how did you do this + } else if (usedItems == maxItems) { + availableLineFormatting = Formatting.RED; // full + } else if (usedItems >= maxItems * 0.9) { + availableLineFormatting = Formatting.YELLOW; //90% or more full + } else { + availableLineFormatting = Formatting.GREEN; //good + } + + + Formatting totalLineFormatting = switch (tier) { + case 0 -> Formatting.DARK_GRAY; + case 1 -> Formatting.GOLD; + case 2 -> Formatting.AQUA; + case 3 -> Formatting.BLACK; + default -> Formatting.OBFUSCATED; + }; + + Text usedLine = Text.literal("Used slots: " + usedItems).setStyle(Style.EMPTY.withColor(usedLineFormatting).withItalic(true)); + Text availableLine = Text.literal("Available slots: " + availableItems).setStyle(Style.EMPTY.withColor(availableLineFormatting).withItalic(true)); + Text totalLine = Text.literal("Total slots: " + maxItems).setStyle(Style.EMPTY.withColor(totalLineFormatting).withItalic(true)); + + LoreComponent newLore; + List loreList = new ArrayList<>(); + loreList.add(availableLine); + loreList.add(usedLine); + loreList.add(totalLine); + newLore = new LoreComponent(loreList); + + tempDriveStack.set(DataComponentTypes.LORE, newLore); + driveStack = tempDriveStack; + } + + private void updateIndex() { + for (int i = 0; i < blockEntity.inventory.size(); i++) { + ItemStack stack = blockEntity.inventory.get(i); + UUID foundUUID = stack.getOrDefault(UUID_COMPONENT, null); + if (foundUUID != null && foundUUID.equals(myUUID)) { + containerIndex = i; + break; + } + } + } + + public HardDrive(ItemStack driveStack, HardDriveContainerBlockEntity blockEntity, int containerIndex) { + this.driveStack = driveStack; + this.blockEntity = blockEntity; + this.myUUID = driveStack.get(UUID_COMPONENT); + this.containerIndex = containerIndex; + setMaxItems(); + loadComponents(); + updateData(); + } + + public int getMaxItems() { + return maxItems; + } + + public int getAvailableItems() { + return availableItems; + } + + public int getUsedItems() { + return usedItems; + } + + public Map addToMap(Map itemStackMap) { + for (Map.Entry diskEntry : items.entrySet()) { + boolean found = false; + for (Map.Entry mapEntry : itemStackMap.entrySet()) { + ItemStack existingStack = mapEntry.getKey(); + if (ItemStack.areItemsAndComponentsEqual(diskEntry.getKey(), existingStack)) { + int newCount = mapEntry.getValue() + diskEntry.getValue(); + itemStackMap.put(existingStack, newCount); + found = true; + break; + } + } + if (!found) { + itemStackMap.put(diskEntry.getKey(), diskEntry.getValue()); + } + } + return itemStackMap; + } + + public int getContainerIndex() { + return containerIndex; + } + + public static ItemStack ensureUUID(ItemStack driveStack) { + if (driveStack.getComponents().contains(UUID_COMPONENT)) { + return driveStack; + } else { + ItemStack tempStack = driveStack.copy(); + tempStack.set(UUID_COMPONENT, UUID.randomUUID()); + return tempStack; + } + } +} \ No newline at end of file diff --git a/src/main/java/systems/brn/server_storage/items/HardDriveItem.java b/src/main/java/systems/brn/server_storage/items/HardDriveItem.java index aa097cf..329d055 100644 --- a/src/main/java/systems/brn/server_storage/items/HardDriveItem.java +++ b/src/main/java/systems/brn/server_storage/items/HardDriveItem.java @@ -21,18 +21,14 @@ public class HardDriveItem extends SimpleItem { public static List register(List tiers){ ArrayList items = new ArrayList<>(); - int numberItems = 128; for (String tier : tiers) { Identifier identifier = id(tier + "_drive"); Item item = Registry.register(Registries.ITEM, identifier, new SimpleItem(new Settings() .maxCount(1) - .component(DriveComponents.MAX_ITEMS, numberItems) - .component(DriveComponents.USED_ITEMS, 0) .component(DriveComponents.ITEMSTACK_MAP, new HashMap<>()) , identifier)); ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item)); items.add(item); - numberItems *= 2; } return items; } diff --git a/src/main/java/systems/brn/server_storage/items/SimpleItem.java b/src/main/java/systems/brn/server_storage/items/SimpleItem.java index 24c4fff..cd9c2f9 100644 --- a/src/main/java/systems/brn/server_storage/items/SimpleItem.java +++ b/src/main/java/systems/brn/server_storage/items/SimpleItem.java @@ -5,12 +5,10 @@ import eu.pb4.polymer.core.api.item.SimplePolymerItem; import eu.pb4.polymer.resourcepack.api.PolymerModelData; import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; -import net.minecraft.item.Item; -import net.minecraft.item.ItemGroups; -import net.minecraft.item.ItemStack; -import net.minecraft.item.Items; +import net.minecraft.item.*; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; @@ -38,25 +36,35 @@ public class SimpleItem extends SimplePolymerItem implements PolymerItem { return this.polymerModel.value(); } - public static Item register(String name){ - return register(name, 64); + public static Item register(String name, RegistryKey group){ + return register(name, 64, group); } - public static Item register(String name, int maxCount) { + public static Item register(String name, int maxCount, RegistryKey group) { Identifier identifier = id(name); Item item = Registry.register(Registries.ITEM, identifier, new SimpleItem(new Settings().maxCount(maxCount), identifier)); - ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item)); + ItemGroupEvents.modifyEntriesEvent(group).register(content -> content.add(item)); return item; } - public static List register(String name, List tiers) { - return register(name, tiers, 64); + public static List register(String name, List tiers, boolean tierFirst, RegistryKey group) { + return register(name, tiers, 64, tierFirst, group); } - public static List register(String name, List tiers, int maxCount) { + public static List register(String name, List tiers, RegistryKey group) { + return register(name, tiers, 64, true, group); + } + + public static List register(String name, List tiers, int maxCount, boolean tierFirst, RegistryKey group) { ArrayList items = new ArrayList<>(); for (String tier : tiers) { - items.add(SimpleItem.register(tier + "_" + name, maxCount)); + String itemName; + if (tierFirst){ + itemName = tier + "_" + name; + } else { + itemName = name + "_" + tier; + } + items.add(SimpleItem.register(itemName, maxCount, group)); } return items; } diff --git a/src/main/java/systems/brn/server_storage/lib/ConnectedChests.java b/src/main/java/systems/brn/server_storage/lib/ConnectedChests.java deleted file mode 100644 index 70eacac..0000000 --- a/src/main/java/systems/brn/server_storage/lib/ConnectedChests.java +++ /dev/null @@ -1,212 +0,0 @@ -package systems.brn.server_storage.lib; - -import net.minecraft.block.entity.*; -import net.minecraft.inventory.Inventory; -import net.minecraft.inventory.SimpleInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.World; -import systems.brn.server_storage.blockentities.HardDriveContainerBlockEntity; -import systems.brn.server_storage.blockentities.StorageBlockEntity; -import systems.brn.server_storage.items.HardDriveItem; - -import java.util.*; - -import static systems.brn.server_storage.lib.StorageOperations.*; - -public class ConnectedChests { - public final List inventories; - public final List hoppers; - public final List driveContainers; - public final List drives; - public final Inventory inventory; - - public final int containerCount; - public final int containerSlots; - public final int containerUsedSlots; - public final int containerFreeSlots; - - public ConnectedChests(World world, BlockPos startPos, boolean sortAlphabetically, String searchString, boolean allInventories) { - List inventories = new ArrayList<>(); - List hoppers = new ArrayList<>(); - List driveContainers = new ArrayList<>(); - List drives = new ArrayList<>(); - Set visited = new HashSet<>(); - - getConnectedChestsHelper(world, startPos, inventories, hoppers, driveContainers, drives, visited, allInventories); - - this.inventories = inventories; - this.hoppers = hoppers; - this.driveContainers = driveContainers; - this.drives = drives; - this.containerCount = inventories.size(); - this.inventory = getCombinedInventory(sortAlphabetically, searchString); - - int tempContainerSlots = 0; - int tempContainerUsedSlots = 0; - int tempContainerFreeSlots = 0; - for (Inventory inventory : inventories) { - tempContainerSlots += inventory.size(); - for (int slot = 0; slot < inventory.size(); slot++) { - if (inventory.getStack(slot).isEmpty()) { - tempContainerFreeSlots++; - } else { - tempContainerUsedSlots++; - } - } - assert tempContainerSlots == tempContainerUsedSlots + tempContainerFreeSlots; - } - containerSlots = tempContainerSlots; - containerUsedSlots = tempContainerUsedSlots; - containerFreeSlots = tempContainerFreeSlots; - } - - private static boolean isEnabledContainer(BlockEntity blockEntity, boolean allContainers) { - return (allContainers && blockEntity instanceof Inventory) || - blockEntity instanceof BarrelBlockEntity || - blockEntity instanceof ChestBlockEntity || - blockEntity instanceof ShulkerBoxBlockEntity; - } - - private static void getConnectedChestsHelper(World world, BlockPos pos, List inventories, List hoppers, List driveContainers, List drives, Set visited, Boolean allContainers) { - if (visited.contains(pos)) { - return; - } - visited.add(pos); - - BlockEntity blockEntity = world.getBlockEntity(pos); - - if (blockEntity instanceof HardDriveContainerBlockEntity) { - driveContainers.add((Inventory) blockEntity); - //loop over all items in inventory - for (int slot = 0; slot < inventories.size(); slot++) { - ItemStack slotStack = ((Inventory) blockEntity).getStack(slot); - //drives.add(new HardDriveItem(slotStack, (HardDriveContainerBlockEntity) blockEntity)); - } - } - - if (isEnabledHopper(blockEntity)) { - hoppers.add((Inventory) blockEntity); - } - - if (isEnabledContainer(blockEntity, allContainers) || blockEntity instanceof StorageBlockEntity) { - if (isEnabledContainer(blockEntity, allContainers) && !(blockEntity instanceof StorageBlockEntity)) { - inventories.add((Inventory) blockEntity); - } - - for (Direction direction : Direction.values()) { - BlockPos nextPos = pos.offset(direction); - getConnectedChestsHelper(world, nextPos, inventories, hoppers, driveContainers, drives, visited, allContainers); - } - } - } - - // Modify getCombinedInventoryFromChests to include item metadata and combine stacks - private SimpleInventory getCombinedInventory(boolean sortAlphabetically, String query) { - Map itemStackMap = new HashMap<>(); - for (Inventory inventory : inventories) { - addInventoryToMap(inventory, itemStackMap); - } - return filterInventory(getSimpleInventory(itemStackMap.size(), itemStackMap, sortAlphabetically), query, sortAlphabetically); - } - - // Modify filterInventory to include item metadata - private SimpleInventory filterInventory(SimpleInventory inventory, String query, boolean sortAlphabetically) { - if (query == null || query.isEmpty()) { - return inventory; - } - Map itemStackMap = new HashMap<>(); - int itemCount = 0; - for (int slot = 0; slot < inventory.size(); slot++) { - ItemStack stack = inventory.getStack(slot); - ItemStack filteredStack = filterStack(stack, query); - if (!filteredStack.isEmpty()) { - itemCount++; - int count = itemStackMap.getOrDefault(filteredStack, 0) + filteredStack.getCount(); - itemStackMap.put(filteredStack, count); - } - } - return getSimpleInventory(itemCount, itemStackMap, sortAlphabetically); - } - - public boolean tryPutItemStack(ItemStack stack) { - - // Iterate over each chest to try and insert the ItemStack - for (Inventory chest : inventories) { - if (!(chest instanceof HopperBlockEntity)) { - stack = insertStackIntoInventory(chest, stack); - if (stack.isEmpty()) { - return true; - } - } - } - - // If we still have remaining items, return false - return stack.isEmpty(); - } - - public static boolean isEnabledHopper(BlockEntity blockEntity) { - return blockEntity instanceof HopperBlockEntity || - blockEntity instanceof TrappedChestBlockEntity || - blockEntity instanceof FurnaceBlockEntity || - blockEntity instanceof BlastFurnaceBlockEntity || - blockEntity instanceof SmokerBlockEntity || - blockEntity instanceof BrewingStandBlockEntity; - } - - public boolean canAddItemStack(ItemStack stack) { - // Iterate over each chest to check if it's possible to insert the ItemStack - for (Inventory chest : inventories) { - if (!(chest instanceof HopperBlockEntity)) { - // Attempt to insert the ItemStack into the current chest - for (int i = 0; i < chest.size(); i++) { - ItemStack slotStack = chest.getStack(i); - if (slotStack.isEmpty() || canCombine(slotStack, stack)) { - // If the slot is empty or can be combined with the ItemStack, return true - return true; - } - } - } - } - // If it's not possible to insert into any chest, return false - return false; - } - - public void autoSuck() { - for (Inventory chest : hoppers) { - for (int i = 0; i < chest.size(); i++) { - ItemStack slotStack = chest.getStack(i); - if (!slotStack.isEmpty()) { - if (this.canAddItemStack(slotStack)) { - if (this.tryPutItemStack(slotStack)) { - removeFromInventory(chest, slotStack, slotStack.getCount()); - } - ; - } else { - return; - } - } - } - } - } - - public boolean canRemove(ItemStack stackToRemove) { - return canRemoveCount(stackToRemove, inventory) == 0; - } - - public ItemStack removeItemStack(ItemStack stackToRemove) { - - int remainingToRemove = stackToRemove.getCount(); - ItemStack outStack = stackToRemove.copy(); - - for (Inventory chest : inventories) { - remainingToRemove = removeFromInventory(chest, stackToRemove, remainingToRemove); - if (remainingToRemove <= 0) { - return outStack; - } - } - outStack.setCount(outStack.getCount() - remainingToRemove); - return outStack; - } -} diff --git a/src/main/java/systems/brn/server_storage/lib/ConnectionType.java b/src/main/java/systems/brn/server_storage/lib/ConnectionType.java new file mode 100644 index 0000000..e127736 --- /dev/null +++ b/src/main/java/systems/brn/server_storage/lib/ConnectionType.java @@ -0,0 +1,24 @@ +package systems.brn.server_storage.lib; + +import net.minecraft.util.StringIdentifiable; + +public enum ConnectionType implements StringIdentifiable { + NONE("none"), + BUS("bus"), + INVENTORY("inventory"); + private final String name; + + ConnectionType(String name) { + this.name = name; + } + + @Override + public String asString() { + return this.name; + } + + @Override + public String toString() { + return this.name; + } +} \ No newline at end of file diff --git a/src/main/java/systems/brn/server_storage/lib/DriveComponents.java b/src/main/java/systems/brn/server_storage/lib/DriveComponents.java index 4351788..c1060ae 100644 --- a/src/main/java/systems/brn/server_storage/lib/DriveComponents.java +++ b/src/main/java/systems/brn/server_storage/lib/DriveComponents.java @@ -1,34 +1,50 @@ package systems.brn.server_storage.lib; import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import eu.pb4.polymer.core.api.other.PolymerComponent; import net.minecraft.component.ComponentType; import net.minecraft.item.ItemStack; -import net.minecraft.network.codec.PacketCodecs; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; -import net.minecraft.util.dynamic.Codecs; -import java.util.Map; +import java.util.*; import java.util.function.UnaryOperator; public class DriveComponents { - public static final Codec> ITEMSTACK_MAP_CODEC = Codec.unboundedMap(ItemStack.CODEC, Codec.INT); + public static final Codec> ITEMSTACK_LIST_CODEC = Codec.list(ItemStack.CODEC); + public static final Codec> INTEGER_LIST_CODEC = Codec.list(Codec.INT); - public static final ComponentType MAX_ITEMS = register( - "max_items", builder -> builder.codec(Codecs.POSITIVE_INT).packetCodec(PacketCodecs.VAR_INT) + public static final Codec> ITEMSTACK_MAP_CODEC = RecordCodecBuilder.create(instance -> + instance.group( + ITEMSTACK_LIST_CODEC.fieldOf("itemStacks").forGetter(map -> new ArrayList<>(map.keySet())), + INTEGER_LIST_CODEC.fieldOf("counts").forGetter(map -> new ArrayList<>(map.values())) + ).apply(instance, (itemStacks, counts) -> { + Map map = new HashMap<>(); + for (int i = 0; i < itemStacks.size(); i++) { + map.put(itemStacks.get(i), counts.get(i)); + } + return map; + }) ); - public static final ComponentType USED_ITEMS = register( - "used_items", builder -> builder.codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT) - ); + public static final Codec UUID_CODEC = RecordCodecBuilder.create(instance -> + instance.group( + Codec.LONG.fieldOf("mostSigBits").forGetter(UUID::getMostSignificantBits), + Codec.LONG.fieldOf("leastSigBits").forGetter(UUID::getLeastSignificantBits) + ).apply(instance, UUID::new)); public static final ComponentType> ITEMSTACK_MAP = register( "itemstack_map", builder -> builder.codec(ITEMSTACK_MAP_CODEC) // No packetCodec needed for this example ); + public static final ComponentType UUID_COMPONENT = register( + "drive_uuid", + builder -> builder.codec(UUID_CODEC) // No packetCodec needed for this example + ); + private static ComponentType register(String id, UnaryOperator> builderOperator) { ComponentType componentType = Registry.register( diff --git a/src/main/java/systems/brn/server_storage/lib/PagedGui.java b/src/main/java/systems/brn/server_storage/lib/PagedGui.java index 1a35054..4bb764d 100644 --- a/src/main/java/systems/brn/server_storage/lib/PagedGui.java +++ b/src/main/java/systems/brn/server_storage/lib/PagedGui.java @@ -37,6 +37,15 @@ public abstract class PagedGui extends SimpleGui { public static final String GUI_AUTOSUCK_OFF = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGViODFlZjg5MDIzNzk2NTBiYTc5ZjQ1NzIzZDZiOWM4ODgzODhhMDBmYzRlMTkyZjM0NTRmZTE5Mzg4MmVlMSJ9fX0="; public static final String GUI_AUTOSUCK_ON = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMThjNDQzYWRhNmUzOWZjYTgzN2EwMzgzYjBhNWUzZTU1NDc3M2I5NjYwYzQ4NzNmNTkxMDMyZGJlOWFkY2RmOCJ9fX0="; + public static final String GUI_SIDE_NORTH = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGEyMjFlNGY5NmJlZTYyNjE3NTIzOTZhMzI2NWZmYTRkZWRmOGZmNDgzOWFiZDE0ZjQ5ZWRlZTFlNTMwOTIifX19"; + public static final String GUI_SIDE_SOUTH = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDcxMDEzODQxNjUyODg4OTgxNTU0OGI0NjIzZDI4ZDg2YmJiYWU1NjE5ZDY5Y2Q5ZGJjNWFkNmI0Mzc0NCJ9fX0="; + public static final String GUI_SIDE_EAST = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWFlZWY4OGUyYzkyOGI0NjZjNmVkNWRlYWE0ZTE5NzVhOTQzNmMyYjFiNDk4ZjlmN2NiZjkyYTliNTk5YTYifX19"; + public static final String GUI_SIDE_WEST = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODBjOTQ4M2Y1MWQxMjY3NDMyZTBmMmYzYmFhOGNkOTNlNjViNWVhYzc0ODJiMjdkYmNjZWJhZmI3MjE3NDhiIn19fQ=="; + public static final String GUI_SIDE_UP = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDY5OTFkY2JhMjVlYWUyNDNlYjVjZWI4MzI1ZjRhYjc4ZjlmMTQxMjdjMzgyZjZjZDQyYzRjNzgwNDJkNGI1In19fQ=="; + public static final String GUI_SIDE_DOWN = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmE2NjE0MTlkZTQ5ZmY0YTJjOTdiMjdmODY4MDE0ZmJkYWViOGRkN2Y0MzkyNzc3ODMwYjI3MTRjYWFmZDFmIn19fQ=="; + public static final String GUI_MODE_INPUT = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWM5OWRmYjI3MDRlMWJkNmU3ZmFjZmI0M2IzZTZmYmFiYWYxNmViYzdlMWZhYjA3NDE3YTZjNDY0ZTFkIn19fQ=="; + public static final String GUI_MODE_OUTPUT = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2JiMWQxN2NlYmM1ZjBlY2M5ODdiODBlZmMwM2UzMmVjYjFjYjQwZGJjNWJjZTJmYWYzZTYwNTQyYTQwIn19fQ=="; + public static final int PAGE_SIZE = 9 * 5; protected final Runnable closeCallback; public boolean ignoreCloseCallback; @@ -73,7 +82,7 @@ public abstract class PagedGui extends SimpleGui { return this.page - 1 >= 0; } - protected void updateDisplay() { + public void updateDisplay() { var offset = page * PAGE_SIZE; for (int i = 0; i < PAGE_SIZE; i++) { diff --git a/src/main/java/systems/brn/server_storage/lib/StorageNetwork.java b/src/main/java/systems/brn/server_storage/lib/StorageNetwork.java new file mode 100644 index 0000000..ae59146 --- /dev/null +++ b/src/main/java/systems/brn/server_storage/lib/StorageNetwork.java @@ -0,0 +1,199 @@ +package systems.brn.server_storage.lib; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.*; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import systems.brn.server_storage.blockentities.HardDriveContainerBlockEntity; +import systems.brn.server_storage.blockentities.InventoryInterfaceBlockEntity; +import systems.brn.server_storage.blockentities.StorageInterfaceBlockEntity; +import systems.brn.server_storage.blocks.BusConnectorBlock; +import systems.brn.server_storage.blocks.HardDriveContainerBlock; +import systems.brn.server_storage.blocks.InventoryInterfaceBlock; +import systems.brn.server_storage.blocks.StorageInterfaceBlock; +import systems.brn.server_storage.items.HardDrive; + +import java.util.*; + +import static systems.brn.server_storage.ServerStorage.DRIVES; +import static systems.brn.server_storage.blocks.BusConnectorBlock.*; +import static systems.brn.server_storage.lib.StorageOperations.*; + +public class StorageNetwork { + public List driveContainers; + public List storageInterfaceBlockEntities; + public List inventoryInterfaceBlockEntities; + public List drives; + public Map itemStackMap; + public Map filteredItemStackMap; + + public int driveContainerCount; + public int drivesCount; + public int driveTotalSlots; + public int driveUsedSlots; + public int driveFreeSlots; + + public StorageNetwork(World world, BlockPos startPos, boolean sortAlphabetically, String searchString) { + reindexNetwork(world, startPos, sortAlphabetically, searchString); + } + + public void reindexNetwork(World world, BlockPos startPos, boolean sortAlphabetically, String searchString) { + List driveContainers = new ArrayList<>(); + List storageInterfaceBlockEntities = new ArrayList<>(); + List inventoryInterfaceBlockEntities = new ArrayList<>(); + List drives = new ArrayList<>(); + Set visited = new HashSet<>(); + + scan(world, startPos, startPos, driveContainers, storageInterfaceBlockEntities, inventoryInterfaceBlockEntities, drives, visited); + + this.driveContainers = driveContainers; + this.drives = drives; + this.storageInterfaceBlockEntities = storageInterfaceBlockEntities; + this.inventoryInterfaceBlockEntities = inventoryInterfaceBlockEntities; + + countStuff(); + + filteredItemStackMap = getCombinedMap(sortAlphabetically, searchString); + } + + private void countStuff() { + driveUsedSlots = 0; + driveFreeSlots = 0; + driveTotalSlots = 0; + driveContainerCount = driveContainers.size(); + drivesCount = drives.size(); + for (HardDriveContainerBlockEntity driveContainer : this.driveContainers) { + driveFreeSlots += driveContainer.getAvailableSlots(); + driveUsedSlots += driveContainer.getUsedSlots(); + driveTotalSlots += driveContainer.getTotalSlots(); + } + } + + public void updateDisplays(){ + for (StorageInterfaceBlockEntity storageInterfaceBlockEntity : storageInterfaceBlockEntities) { + storageInterfaceBlockEntity.updateDisplays(); + } + } + + private static void scan(World world, BlockPos pos, BlockPos startPos, List driveContainers, List storageInterfaceBlockEntities, List inventoryInterfaceBlockEntities, List drives, Set visited) { + if (visited.contains(pos)) { + return; + } + visited.add(pos); + + BlockState blockState = world.getBlockState(pos); + + Block block = blockState.getBlock(); + + if (block instanceof HardDriveContainerBlock) { + BlockEntity blockEntity = world.getBlockEntity(pos); + if (blockEntity instanceof HardDriveContainerBlockEntity driveContainerBlockEntity) { + driveContainers.add(driveContainerBlockEntity); + driveContainerBlockEntity.indexDrives(); + drives.addAll(driveContainerBlockEntity.drives); + } + } + + if (block instanceof StorageInterfaceBlock) { + BlockEntity blockEntity = world.getBlockEntity(pos); + if (blockEntity instanceof StorageInterfaceBlockEntity storageInterfaceBlockEntity){ + storageInterfaceBlockEntities.add(storageInterfaceBlockEntity); + } + } + + if (block instanceof InventoryInterfaceBlock) { + BlockEntity blockEntity = world.getBlockEntity(pos); + if (blockEntity instanceof InventoryInterfaceBlockEntity inventoryInterfaceBlockEntity){ + inventoryInterfaceBlockEntities.add(inventoryInterfaceBlockEntity); + } + } + + if (block instanceof BusConnectorBlock || pos == startPos) { + + if (blockState.getOrEmpty(NORTH).isPresent() && blockState.get(NORTH) == ConnectionType.BUS) { + BlockPos nextPos = pos.offset(Direction.NORTH); + scan(world, nextPos, startPos, driveContainers, storageInterfaceBlockEntities, inventoryInterfaceBlockEntities, drives, visited); + } + if (blockState.getOrEmpty(SOUTH).isPresent() && blockState.get(SOUTH) == ConnectionType.BUS) { + BlockPos nextPos = pos.offset(Direction.SOUTH); + scan(world, nextPos, startPos, driveContainers, storageInterfaceBlockEntities, inventoryInterfaceBlockEntities, drives, visited); + } + if (blockState.getOrEmpty(EAST).isPresent() && blockState.get(EAST) == ConnectionType.BUS) { + BlockPos nextPos = pos.offset(Direction.EAST); + scan(world, nextPos, startPos, driveContainers, storageInterfaceBlockEntities, inventoryInterfaceBlockEntities, drives, visited); + } + if (blockState.getOrEmpty(WEST).isPresent() && blockState.get(WEST) == ConnectionType.BUS) { + BlockPos nextPos = pos.offset(Direction.WEST); + scan(world, nextPos, startPos, driveContainers, storageInterfaceBlockEntities, inventoryInterfaceBlockEntities, drives, visited); + } + if (blockState.getOrEmpty(UP).isPresent() && blockState.get(UP) == ConnectionType.BUS) { + BlockPos nextPos = pos.offset(Direction.UP); + scan(world, nextPos, startPos, driveContainers, storageInterfaceBlockEntities, inventoryInterfaceBlockEntities, drives, visited); + } + if (blockState.getOrEmpty(DOWN).isPresent() && blockState.get(DOWN) == ConnectionType.BUS) { + BlockPos nextPos = pos.offset(Direction.DOWN); + scan(world, nextPos, startPos, driveContainers, storageInterfaceBlockEntities, inventoryInterfaceBlockEntities, drives, visited); + } + } + } + + // Modify getCombinedInventoryFromChests to include item metadata and combine stacks + private TreeMap getCombinedMap(boolean sortAlphabetically, String query) { + itemStackMap = new HashMap<>(); + for (HardDrive drive : drives) { + itemStackMap = drive.addToMap(itemStackMap); + } + return sortAndFilterMap(itemStackMap, sortAlphabetically, query); + } + + + public int putItemStackRemainder(ItemStack stack) { + if (DRIVES.contains(stack.getItem())){ + return stack.getCount(); + } + // Iterate over each chest to try and insert the ItemStack + int leftOvers = stack.getCount(); + for (InventoryInterfaceBlockEntity inventoryInterfaceBlockEntity : inventoryInterfaceBlockEntities) { + leftOvers = inventoryInterfaceBlockEntity.processIncoming(stack.copy(), leftOvers); + if (leftOvers <= 0) { + return 0; + } + } + ItemStack driveStack = stack.copy(); + driveStack.setCount(leftOvers); + for (HardDrive drive : drives) { + driveStack = drive.insertStackIntoInventory(driveStack); + if (driveStack.isEmpty()) { + return 0; + } + } + + // If we still have remaining items, return false + return driveStack.getCount(); + } + + public boolean canAddItemStack(ItemStack stack) { + return stack.getCount() <= driveFreeSlots && !DRIVES.contains(stack.getItem()); + } + + public boolean canRemove(ItemStack stackToRemove) { + return canRemoveCount(stackToRemove, itemStackMap) == 0; + } + + public ItemStack removeItemStack(ItemStack stackToRemove) { + ItemStack outStack = stackToRemove.copy(); + + for (HardDrive drive : drives) { + outStack = drive.removeStackFromInventory(outStack); + if (outStack.getCount() >= stackToRemove.getCount()) { + break; + } + } + + // If we still have remaining items, return false + return outStack; + } +} diff --git a/src/main/java/systems/brn/server_storage/lib/StorageOperations.java b/src/main/java/systems/brn/server_storage/lib/StorageOperations.java index b8c0b83..31c824a 100644 --- a/src/main/java/systems/brn/server_storage/lib/StorageOperations.java +++ b/src/main/java/systems/brn/server_storage/lib/StorageOperations.java @@ -1,19 +1,43 @@ package systems.brn.server_storage.lib; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Inventory; -import net.minecraft.inventory.SimpleInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import org.jetbrains.annotations.NotNull; +import java.util.HashMap; import java.util.Map; import java.util.TreeMap; public class StorageOperations { // Modify getSimpleInventory to include item metadata and sort conditionally - public static @NotNull SimpleInventory getSimpleInventory(int size, Map itemStackMap, boolean sortAlphabetically) { + public static TreeMap sortAndFilterMap(Map itemStackMap, boolean sortAlphabetically, String query) { + TreeMap sortedMap = getItemStackIntegerTreeMap(itemStackMap, sortAlphabetically); + + if (query == null || query.isEmpty() || query.equals("*")) { + sortedMap.putAll(itemStackMap); + } else { + Map filteredMap = new HashMap<>(); + for (Map.Entry entry : itemStackMap.entrySet()) { + if (filterItem(entry.getKey().getItem(), query)){ + filteredMap.put(entry.getKey(), entry.getValue()); + } + } + sortedMap.putAll(filteredMap); + } + return sortedMap; + } + + public static boolean filterItem(Item item, String query){ + if (item != null) { + String itemName = String.valueOf(item); + return itemName == null || itemName.contains(query); + } + return false; + } + + private static @NotNull TreeMap getItemStackIntegerTreeMap(Map itemStackMap, boolean sortAlphabetically) { TreeMap sortedMap; if (sortAlphabetically) { @@ -33,51 +57,35 @@ public class StorageOperations { return countCompare == 0 ? String.valueOf(o1.getItem()).compareToIgnoreCase(String.valueOf(o2.getItem())) : countCompare; }); } - - sortedMap.putAll(itemStackMap); - - SimpleInventory inv = new SimpleInventory(size); - int invPointer = 0; - for (Map.Entry entry : sortedMap.entrySet()) { - ItemStack stack = entry.getKey(); - int count = entry.getValue(); - stack.setCount(count); - inv.heldStacks.set(invPointer, stack); //bypass stack maximum - invPointer++; - } - return inv; + return sortedMap; } - // Modify filterStack to include item metadata - public static ItemStack filterStack(ItemStack stack, String query) { - Item item = stack.getItem(); - if (item != null) { - String itemName = String.valueOf(item); - if (itemName != null && !itemName.contains(query)) { - return ItemStack.EMPTY; + public static int canInsertToStack(ItemStack stack1, ItemStack stack2, int maxInsert) { + if (stack1.isEmpty() || ItemStack.areItemsEqual(stack1, stack2)) { + int remainingSpace = stack1.isEmpty() ? stack2.getMaxCount() : stack1.getMaxCount() - stack1.getCount(); + maxInsert += remainingSpace; + // If the maximum insertion count is greater than or equal to the item count, return the item count + if (maxInsert >= stack2.getCount()) { + return stack2.getCount(); } } - return stack; + return maxInsert; } - public static int canInsertItemIntoPlayerInventory(PlayerEntity player, ItemStack itemStack) { + public static int canInsertItemIntoInventory(Inventory inventory, ItemStack itemStack) { // Get the player's inventory - PlayerInventory playerInventory = player.getInventory(); - int maxInsert = 0; - // Iterate through the slots in the player's inventory - for (int i = 0; i < playerInventory.main.size(); i++) { - ItemStack slotStack = playerInventory.main.get(i); - - // Check if the slot is empty or if there's space for the item - if (slotStack.isEmpty() || ItemStack.areItemsEqual(slotStack, itemStack)) { - int remainingSpace = slotStack.isEmpty() ? itemStack.getMaxCount() : slotStack.getMaxCount() - slotStack.getCount(); - maxInsert += remainingSpace; - // If the maximum insertion count is greater than or equal to the item count, return the item count - if (maxInsert >= itemStack.getCount()) { - return itemStack.getCount(); - } + if (inventory instanceof PlayerInventory playerInventory) { + // Iterate through the slots in the player's inventory + for (int i = 0; i < playerInventory.main.size(); i++) { + ItemStack slotStack = playerInventory.main.get(i); + maxInsert = canInsertToStack(slotStack, itemStack, maxInsert); + } + } else { + for (int i = 0; i < inventory.size(); i++) { + ItemStack slotStack = inventory.getStack(i); + maxInsert = canInsertToStack(slotStack, itemStack, maxInsert); } } @@ -115,7 +123,7 @@ public class StorageOperations { return stack; } - public static int removeFromInventory(Inventory inventory, ItemStack stackToRemove, int remainingToRemove) { + public static void removeFromInventory(Inventory inventory, ItemStack stackToRemove, int remainingToRemove) { for (int i = 0; i < inventory.size(); i++) { ItemStack slotStack = inventory.getStack(i); if (canCombine(slotStack, stackToRemove)) { @@ -129,21 +137,36 @@ public class StorageOperations { } if (remainingToRemove <= 0) { - return remainingToRemove; + return; } } } - return remainingToRemove; } - public static int canRemoveCount(ItemStack stackToRemove, Inventory inventory) { - int remainingToRemove = stackToRemove.getCount(); - + public static int howMuchFits(ItemStack stack, Inventory inventory){ + int out = 0; for (int i = 0; i < inventory.size(); i++) { ItemStack slotStack = inventory.getStack(i); + if (slotStack.isEmpty()) { + out += stack.getMaxCount(); + continue; + } + if (canCombine(slotStack, stack)) { + int remaining = slotStack.getMaxCount() - slotStack.getCount(); + out += remaining; + } + } + return out; + } + + public static int canRemoveCount(ItemStack stackToRemove, Map itemsMap) { + int remainingToRemove = stackToRemove.getCount(); + + for (Map.Entry entry : itemsMap.entrySet()) { + ItemStack slotStack = entry.getKey(); if (canCombine(slotStack, stackToRemove)) { // If the slot contains the same item type - if (slotStack.getCount() >= remainingToRemove) { + if (entry.getValue() >= remainingToRemove) { // If the count in the slot is sufficient to remove the requested amount return 0; } else { @@ -174,7 +197,7 @@ public class StorageOperations { ItemStack existingStack = entry.getKey(); if (ItemStack.areItemsAndComponentsEqual(stack, existingStack)) { int newCount = entry.getValue() + stack.getCount(); - itemStackMap.put(existingStack, newCount); + entry.setValue(newCount); return; } } diff --git a/src/main/java/systems/brn/server_storage/lib/Util.java b/src/main/java/systems/brn/server_storage/lib/Util.java index a89085e..e120eed 100644 --- a/src/main/java/systems/brn/server_storage/lib/Util.java +++ b/src/main/java/systems/brn/server_storage/lib/Util.java @@ -2,7 +2,6 @@ package systems.brn.server_storage.lib; import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.LoreComponent; -import net.minecraft.inventory.Inventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -21,13 +20,13 @@ import java.util.stream.Collectors; public class Util { - public static List> generateBookContent(Inventory inventory) { + public static List> generateBookContent(Map itemMap) { List pages = new ArrayList<>(); - for (int i = 0; i < inventory.size(); i++) { - ItemStack slotStack = inventory.getStack(i); + for (Map.Entry entry : itemMap.entrySet()) { + ItemStack slotStack = entry.getKey(); if (!slotStack.isEmpty()) { Item itemName = slotStack.getItem(); - pages.add(itemName + " " + slotStack.getCount()); + pages.add(itemName + " " + entry.getValue()); } } return stringToBookContent(String.join(System.lineSeparator(), pages)); @@ -106,7 +105,7 @@ public class Util { } } - public static ArrayList getCraftableRecipes(Inventory inventory, MinecraftServer server) { + public static ArrayList getCraftableRecipes(Map itemStackMap, MinecraftServer server) { RecipeManager recipeManager = server.getRecipeManager(); List> allRecipes = recipeManager.listAllOfType(RecipeType.CRAFTING); @@ -152,10 +151,9 @@ public class Util { ItemStack stackIn = entry.getKey(); Integer count = entry.getValue(); boolean itemFound = false; - for (int i = 0; i < inventory.size(); i++) { - ItemStack slotStack = inventory.getStack(i); - Item slotItem = slotStack.getItem(); - int slotCount = slotStack.getCount(); + for (Map.Entry itemEntry : itemStackMap.entrySet()){ + Item slotItem = itemEntry.getKey().getItem(); + int slotCount = itemEntry.getValue(); if (stackIn.getItem() == slotItem) { count -= slotCount; entry.setValue(count); @@ -172,9 +170,6 @@ public class Util { if (count > 0) { canMake = false; } else { - if(recipe.value().getResult(server.getRegistryManager()).getItem() == Items.REDSTONE_BLOCK){ - int asdasd = 0; - } int thisMaxAmount = Math.floorDivExact(Math.abs(count), stackIn.getCount()); if (maxAmount == -1) { maxAmount = thisMaxAmount; diff --git a/src/main/java/systems/brn/server_storage/screenhandlers/DriveContainerScreenHandler.java b/src/main/java/systems/brn/server_storage/screenhandlers/DriveContainerScreenHandler.java index ba4faa4..a725c95 100644 --- a/src/main/java/systems/brn/server_storage/screenhandlers/DriveContainerScreenHandler.java +++ b/src/main/java/systems/brn/server_storage/screenhandlers/DriveContainerScreenHandler.java @@ -7,36 +7,34 @@ import net.minecraft.item.ItemStack; import net.minecraft.screen.ScreenHandler; import net.minecraft.screen.ScreenHandlerType; import net.minecraft.screen.slot.Slot; -import systems.brn.server_storage.lib.HardDriveSlot; +import systems.brn.server_storage.blockentities.HardDriveContainerBlockEntity; public class DriveContainerScreenHandler extends ScreenHandler { - private static final int CONTAINER_SIZE = 9; - private static final int INVENTORY_START = 9; - private static final int INVENTORY_END = 36; - private static final int HOTBAR_START = 36; - private static final int HOTBAR_END = 45; private final Inventory inventory; + private final HardDriveContainerBlockEntity blockEntity; - public DriveContainerScreenHandler(int syncId, PlayerInventory playerInventory, Inventory inventory) { - super(ScreenHandlerType.GENERIC_3X3, syncId); - checkSize(inventory, 9); - this.inventory = inventory; + public DriveContainerScreenHandler(int syncId, PlayerInventory playerInventory, HardDriveContainerBlockEntity blockEntity) { + super(ScreenHandlerType.HOPPER, syncId); + this.blockEntity = blockEntity; + checkSize(blockEntity, HardDriveContainerBlockEntity.INVENTORY_SIZE); + this.inventory = blockEntity; + blockEntity.indexDrives(); + blockEntity.commitDrives(); inventory.onOpen(playerInventory.player); - for(int i = 0; i < 3; ++i) { - for(int j = 0; j < 3; ++j) { - this.addSlot(new HardDriveSlot(inventory, j + i * 3, 62 + j * 18, 17 + i * 18)); + int j; + for (j = 0; j < 5; ++j) { + this.addSlot(new Slot(inventory, j, 44 + j * 18, 20)); + } + + for (j = 0; j < 3; ++j) { + for (int k = 0; k < 9; ++k) { + this.addSlot(new Slot(playerInventory, k + j * 9 + 9, 8 + k * 18, j * 18 + 51)); } } - for(int i = 0; i < 3; ++i) { - for(int j = 0; j < 9; ++j) { - this.addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for(int i = 0; i < 9; ++i) { - this.addSlot(new Slot(playerInventory, i, 8 + i * 18, 142)); + for (j = 0; j < 9; ++j) { + this.addSlot(new Slot(playerInventory, j, 8 + j * 18, 109)); } } @@ -45,18 +43,25 @@ public class DriveContainerScreenHandler extends ScreenHandler { return this.inventory.canPlayerUse(player); } + @Override public ItemStack quickMove(PlayerEntity player, int slot) { + ItemStack temp = quickMoveHelper(player, slot); + blockEntity.indexDrives(); + return temp; + } + + public ItemStack quickMoveHelper(PlayerEntity player, int slot) { ItemStack itemStack = ItemStack.EMPTY; Slot slot2 = this.slots.get(slot); if (slot2.hasStack()) { ItemStack itemStack2 = slot2.getStack(); itemStack = itemStack2.copy(); - if (slot < 9) { - if (!this.insertItem(itemStack2, 9, 45, true)) { + if (slot < this.inventory.size()) { + if (!this.insertItem(itemStack2, this.inventory.size(), this.slots.size(), true)) { return ItemStack.EMPTY; } - } else if (!this.insertItem(itemStack2, 0, 9, false)) { + } else if (!this.insertItem(itemStack2, 0, this.inventory.size(), false)) { return ItemStack.EMPTY; } @@ -80,5 +85,6 @@ public class DriveContainerScreenHandler extends ScreenHandler { public void onClosed(PlayerEntity player) { super.onClosed(player); this.inventory.onClose(player); + blockEntity.indexDrives(); } } diff --git a/src/main/java/systems/brn/server_storage/screens/CraftingScreen.java b/src/main/java/systems/brn/server_storage/screens/CraftingScreen.java index bc77377..c9f745f 100644 --- a/src/main/java/systems/brn/server_storage/screens/CraftingScreen.java +++ b/src/main/java/systems/brn/server_storage/screens/CraftingScreen.java @@ -2,12 +2,14 @@ package systems.brn.server_storage.screens; import eu.pb4.sgui.api.elements.GuiElementBuilder; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import net.minecraft.recipe.CraftingRecipe; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.RecipeEntry; import net.minecraft.text.Text; +import systems.brn.server_storage.blockentities.StorageInterfaceBlockEntity; import systems.brn.server_storage.lib.CraftingEntry; import systems.brn.server_storage.lib.PagedGui; @@ -24,23 +26,26 @@ public class CraftingScreen extends PagedGui { private ArrayList craftingEntries; + private final StorageInterfaceBlockEntity blockEntity; + private ArrayList recipesList; public CraftingScreen(StorageScreen storageScreen) { super(storageScreen.getPlayer(), null); this.storageScreen = storageScreen; + this.blockEntity = storageScreen.blockEntity; this.setTitle(Text.translatable("container.crafting")); this.updateDisplay(); } @Override public void updateDisplay(){ - storageScreen.blockEntity.rescanChests(); + blockEntity.reindexDrives(); Map itemStackMap = new HashMap<>(); addInventoryToMap(storageScreen.getPlayer().getInventory(), itemStackMap); - addInventoryToMap(storageScreen.blockEntity.chests.inventory, itemStackMap); - Inventory inventory = getSimpleInventory(itemStackMap.size(), itemStackMap, false); - this.craftingEntries = getCraftableRecipes(inventory, Objects.requireNonNull(player.getServer())); + itemStackMap.putAll(blockEntity.network.itemStackMap); + Map items = sortAndFilterMap(itemStackMap, false, null); + this.craftingEntries = getCraftableRecipes(items, Objects.requireNonNull(player.getServer())); this.recipesList = getAvailableRecipes(); super.updateDisplay(); } @@ -89,6 +94,23 @@ public class CraftingScreen extends PagedGui { } } + private boolean canCraft(RecipeEntry recipeEntry) { + for (Ingredient ingredient : recipeEntry.value().getIngredients()) { + ItemStack stackToRemove = findMatchingStack(ingredient); + if (stackToRemove == null) { + return false; + } + int requiredCount = canRemoveCount(stackToRemove, this.blockEntity.network.itemStackMap); + + Map playerInventory = new HashMap<>(); + addInventoryToMap(this.storageScreen.getPlayer().getInventory(), playerInventory); + if (requiredCount > 0 && canRemoveCount(stackToRemove, playerInventory) < requiredCount) { + return false; + } + } + return true; + } + private boolean craftOneStack(PlayerEntity player, RecipeEntry recipeEntry, boolean toPlayerInventory) { if (!canCraft(recipeEntry)) { return true; //stop @@ -97,18 +119,12 @@ public class CraftingScreen extends PagedGui { ArrayList stacksToRemove = new ArrayList<>(); // Check and remove ingredients + if (!canCraft(recipeEntry)) { + return true; + } for (Ingredient ingredient : recipeEntry.value().getIngredients()) { ItemStack stackToRemove = findMatchingStack(ingredient); - if (stackToRemove == null){ - return false; - } - int requiredCount = canRemoveCount(stackToRemove, this.storageScreen.blockEntity.chests.inventory); - - if (requiredCount > 0 && canRemoveCount(stackToRemove, this.storageScreen.getPlayer().getInventory()) < requiredCount) { - return true; - } else { - stacksToRemove.add(stackToRemove); - } + stacksToRemove.add(stackToRemove); } for (ItemStack stack : stacksToRemove) { @@ -118,14 +134,15 @@ public class CraftingScreen extends PagedGui { // Add the result to the appropriate inventory ItemStack outputStack = recipeEntry.value().getResult(storageScreen.getPlayer().getRegistryManager()).copy(); if (toPlayerInventory) { - if (canInsertItemIntoPlayerInventory(player, outputStack) == outputStack.getCount()) { - player.getInventory().insertStack(outputStack); + PlayerInventory playerInventory = player.getInventory(); + if (canInsertItemIntoInventory(playerInventory, outputStack) == outputStack.getCount()) { + playerInventory.insertStack(outputStack); } else { return true; } } else { - if (this.storageScreen.blockEntity.chests.canAddItemStack(outputStack)) { - this.storageScreen.blockEntity.chests.tryPutItemStack(outputStack); + if (this.blockEntity.network.canAddItemStack(outputStack)) { + this.blockEntity.network.putItemStackRemainder(outputStack); } else { return true; } @@ -142,24 +159,9 @@ public class CraftingScreen extends PagedGui { return false; } - private boolean canCraft(RecipeEntry recipeEntry) { - for (Ingredient ingredient : recipeEntry.value().getIngredients()) { - ItemStack stackToRemove = findMatchingStack(ingredient); - if (stackToRemove == null){ - return false; - } - int requiredCount = canRemoveCount(stackToRemove, this.storageScreen.blockEntity.chests.inventory); - - if (requiredCount > 0 && canRemoveCount(stackToRemove, this.storageScreen.getPlayer().getInventory()) < requiredCount) { - return false; - } - } - return true; - } - private ItemStack findMatchingStack(Ingredient ingredient) { for (ItemStack stack : ingredient.getMatchingStacks()) { - if (this.storageScreen.blockEntity.chests.canRemove(stack)) { + if (this.blockEntity.network.canRemove(stack)) { return stack; } } @@ -168,7 +170,7 @@ public class CraftingScreen extends PagedGui { private void removeItems(ItemStack stack) { // Logic to remove items from the storage - ItemStack fromPlayer = this.storageScreen.blockEntity.chests.removeItemStack(stack); + ItemStack fromPlayer = this.blockEntity.network.removeItemStack(stack); if (fromPlayer != null && fromPlayer.getCount() > 0) { Inventory playerInventory = player.getInventory(); for (int i = 0; i < playerInventory.size(); i++) { diff --git a/src/main/java/systems/brn/server_storage/screens/DriveScreen.java b/src/main/java/systems/brn/server_storage/screens/DriveScreen.java deleted file mode 100644 index 6289c0e..0000000 --- a/src/main/java/systems/brn/server_storage/screens/DriveScreen.java +++ /dev/null @@ -1,14 +0,0 @@ -package systems.brn.server_storage.screens; - -import eu.pb4.sgui.api.gui.SimpleGui; -import net.minecraft.screen.ScreenHandlerType; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.util.math.BlockPos; - -public class DriveScreen extends SimpleGui { - BlockPos pos; - public DriveScreen(ServerPlayerEntity player, BlockPos pos) { - super(ScreenHandlerType.HOPPER, player, false); - this.pos = pos; - } -} diff --git a/src/main/java/systems/brn/server_storage/screens/SearchScreen.java b/src/main/java/systems/brn/server_storage/screens/SearchScreen.java index 0e8f0e4..557a563 100644 --- a/src/main/java/systems/brn/server_storage/screens/SearchScreen.java +++ b/src/main/java/systems/brn/server_storage/screens/SearchScreen.java @@ -1,26 +1,29 @@ package systems.brn.server_storage.screens; import eu.pb4.sgui.api.gui.AnvilInputGui; -import systems.brn.server_storage.lib.PagedGui; +import eu.pb4.sgui.api.gui.SimpleGui; +import systems.brn.server_storage.blockentities.InventoryInterfaceBlockEntity; public class SearchScreen extends AnvilInputGui { - private final PagedGui storageScreen; + private final SimpleGui parentScreen; - public SearchScreen(PagedGui storageScreen, String defaultText) { - super(storageScreen.getPlayer(), storageScreen.getLockPlayerInventory()); - this.storageScreen = storageScreen; - storageScreen.close(); + public SearchScreen(SimpleGui parentScreen, String defaultText) { + super(parentScreen.getPlayer(), parentScreen.getLockPlayerInventory()); + this.parentScreen = parentScreen; + parentScreen.close(); this.setDefaultInputValue(defaultText); } @Override public void onClose() { super.onClose(); - storageScreen.open(); + parentScreen.open(); String query = this.getInput(); - if (storageScreen instanceof StorageScreen) { - ((StorageScreen) storageScreen).doSearch(query); + if (parentScreen instanceof StorageScreen storageScreen) { + storageScreen.doSearch(query); + } else if (parentScreen instanceof SettingsScreen settingsScreen && settingsScreen.blockEntity instanceof InventoryInterfaceBlockEntity inventoryInterfaceBlockEntity) { + inventoryInterfaceBlockEntity.doSearch(query); } } } diff --git a/src/main/java/systems/brn/server_storage/screens/SettingsScreen.java b/src/main/java/systems/brn/server_storage/screens/SettingsScreen.java index 1c5a3cc..93a117c 100644 --- a/src/main/java/systems/brn/server_storage/screens/SettingsScreen.java +++ b/src/main/java/systems/brn/server_storage/screens/SettingsScreen.java @@ -1,83 +1,97 @@ package systems.brn.server_storage.screens; import eu.pb4.sgui.api.elements.GuiElementBuilder; +import eu.pb4.sgui.api.gui.SimpleGui; +import net.minecraft.block.entity.BlockEntity; import net.minecraft.item.Items; +import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import org.jetbrains.annotations.Nullable; +import systems.brn.server_storage.blockentities.InventoryInterfaceBlockEntity; import systems.brn.server_storage.lib.PagedGui; import java.util.ArrayList; public class SettingsScreen extends PagedGui { - private final StorageScreen storageScreen; + private final SimpleGui parentScreen; private ArrayList settingsList; - public SettingsScreen(StorageScreen storageScreen) { - super(storageScreen.getPlayer(), null); - this.storageScreen = storageScreen; + public final BlockEntity blockEntity; + + public SettingsScreen(@Nullable SimpleGui parentScreen, ServerPlayerEntity player, BlockEntity blockEntity) { + super(player, null); + this.parentScreen = parentScreen; + this.blockEntity = blockEntity; + clearSettings(); this.setTitle(Text.translatable("mco.configure.world.buttons.settings")); + if (blockEntity instanceof InventoryInterfaceBlockEntity inventoryInterfaceBlockEntity) { + inventoryInterfaceBlockEntity.openSettingsScreens.add(this); + } this.updateDisplay(); } + public SettingsScreen(StorageScreen parentScreen) { + this(parentScreen, parentScreen.getPlayer(), parentScreen.blockEntity); + } + + public SettingsScreen(SimpleGui parentScreen, BlockEntity blockEntity) { + this(parentScreen, parentScreen.getPlayer(), blockEntity); + } + + public SettingsScreen(ServerPlayerEntity player, BlockEntity blockEntity) { + this(null, player, blockEntity); + } + + public void addSetting(DisplayElement setting) { + this.settingsList.add(setting); + } + @Override public void onClose() { super.onClose(); - storageScreen.open(); - } - - @Override - public void updateDisplay() { - this.settingsList = new ArrayList<>(); - this.settingsList.add(containers()); - this.settingsList.add(autoSuck()); - super.updateDisplay(); - } - - protected PagedGui.DisplayElement containers() { - return PagedGui.DisplayElement.of( - new GuiElementBuilder(Items.PLAYER_HEAD) - .setName(Text.translatable(storageScreen.blockEntity.allInventories ? "gui.all" : "options.fov.min").formatted(Formatting.WHITE)) - .hideDefaultTooltip().noDefaults() - .setSkullOwner(GUI_CONTAINERS) - .setCallback((x, y, z) -> { - storageScreen.blockEntity.allInventories ^= true; - storageScreen.blockEntity.markDirty(); - storageScreen.blockEntity.rescanChests(); - playClickSound(getPlayer()); - updateDisplay(); - }) - ); + if (parentScreen != null) { + parentScreen.open(); + } + if (blockEntity instanceof InventoryInterfaceBlockEntity inventoryInterfaceBlockEntity) { + inventoryInterfaceBlockEntity.openSettingsScreens.remove(this); + } } @Override protected int getPageAmount() { - return Math.ceilDivExact(settingsList.size(), 9*6); + return Math.ceilDivExact(settingsList.size(), 9 * 6); } @Override protected DisplayElement getElement(int id) { if (id >= 0 && id < settingsList.size()) { return settingsList.get(id); - } - else { + } else { return DisplayElement.empty(); } } - protected PagedGui.DisplayElement autoSuck() { - return PagedGui.DisplayElement.of( - new GuiElementBuilder(Items.PLAYER_HEAD) - .setName(Text.translatable(storageScreen.blockEntity.autoSuck ? "gui.yes" : "gui.no").formatted(Formatting.WHITE)) - .hideDefaultTooltip().noDefaults() - .setSkullOwner(storageScreen.blockEntity.autoSuck ? GUI_AUTOSUCK_ON : GUI_AUTOSUCK_OFF) - .setCallback((x, y, z) -> { - storageScreen.blockEntity.autoSuck ^= true; - storageScreen.blockEntity.rescanChests(); - playClickSound(getPlayer()); - updateDisplay(); - }) - ); + public DisplayElement getItem() { + if (settingsList.isEmpty()) { + return DisplayElement.filler(); + } else { + return DisplayElement.of( + new GuiElementBuilder(Items.PLAYER_HEAD) + .setName(Text.translatable("mco.configure.world.settings.title").formatted(Formatting.WHITE)) + .hideDefaultTooltip().noDefaults() + .setSkullOwner(GUI_SETTINGS) + .setCallback((x, y, z) -> { + playClickSound(getPlayer()); + this.open(); + }) + ); + } + } + + public void clearSettings() { + this.settingsList = new ArrayList<>(); } } diff --git a/src/main/java/systems/brn/server_storage/screens/StorageScreen.java b/src/main/java/systems/brn/server_storage/screens/StorageScreen.java index 21101b7..7f02cf6 100644 --- a/src/main/java/systems/brn/server_storage/screens/StorageScreen.java +++ b/src/main/java/systems/brn/server_storage/screens/StorageScreen.java @@ -3,6 +3,7 @@ package systems.brn.server_storage.screens; import eu.pb4.sgui.api.ClickType; import eu.pb4.sgui.api.elements.GuiElementBuilder; import eu.pb4.sgui.api.elements.GuiElementInterface; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.screen.slot.SlotActionType; @@ -11,7 +12,7 @@ import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.math.BlockPos; import org.jetbrains.annotations.Nullable; -import systems.brn.server_storage.blockentities.StorageBlockEntity; +import systems.brn.server_storage.blockentities.StorageInterfaceBlockEntity; import systems.brn.server_storage.lib.PagedGui; import static systems.brn.server_storage.ServerStorage.ServerStorage_Crafting_Enable; @@ -21,13 +22,13 @@ import static systems.brn.server_storage.lib.Util.removeCountFromLore; public class StorageScreen extends PagedGui { private final ServerPlayerEntity player; - public final StorageBlockEntity blockEntity; + public final StorageInterfaceBlockEntity blockEntity; public StorageScreen(ServerPlayerEntity player, BlockPos pos, @Nullable Runnable closeCallback) { super(player, closeCallback); this.player = player; this.setLockPlayerInventory(false); - this.blockEntity = (StorageBlockEntity) player.getWorld().getBlockEntity(pos); + this.blockEntity = (StorageInterfaceBlockEntity) player.getWorld().getBlockEntity(pos); assert blockEntity != null; } @@ -35,21 +36,25 @@ public class StorageScreen extends PagedGui { public boolean open() { page = blockEntity.page; this.blockEntity.openStorageScreens.add(this); - this.blockEntity.rescanChests(); + blockEntity.updateDisplays(); return super.open(); } @Override public void updateDisplay() { - String title = blockEntity.chests.containerUsedSlots + + blockEntity.justReindexDrives(); + String title = blockEntity.network.driveUsedSlots + "u/" + - blockEntity.chests.containerSlots + + blockEntity.network.driveTotalSlots + "t(" + - blockEntity.chests.containerFreeSlots + + blockEntity.network.driveFreeSlots + "f)" + "[" + - blockEntity.chests.containerCount + - "c]"; + blockEntity.network.driveContainerCount + + "c]" + + "[" + + blockEntity.network.drivesCount + + "d]"; setTitle(Text.of(title)); super.updateDisplay(); @@ -57,14 +62,17 @@ public class StorageScreen extends PagedGui { @Override protected int getPageAmount() { - return Math.ceilDivExact(blockEntity.chests.inventory.size(), 9 * 6); + return Math.ceilDivExact(blockEntity.network.itemStackMap.size(), 9 * 6); } @Override protected DisplayElement getElement(int id) { - if (blockEntity.chests.inventory.size() > id) { - ItemStack itemStack = blockEntity.chests.inventory.getStack(id); - ItemStack newStack = addCountToLore(itemStack.getCount(), itemStack, null); + if (blockEntity.network.itemStackMap.size() > id) { + ItemStack itemStackKey = (ItemStack) blockEntity.network.itemStackMap.keySet().toArray()[id]; + ItemStack aestheticStack = itemStackKey.copy(); + int count = blockEntity.network.itemStackMap.get(itemStackKey); + aestheticStack.setCount(Math.max(aestheticStack.getMaxCount(), count)); + ItemStack newStack = addCountToLore(count, aestheticStack, null); GuiElementBuilder guiElement = new GuiElementBuilder(newStack); return DisplayElement.of(guiElement); } @@ -74,7 +82,8 @@ public class StorageScreen extends PagedGui { @Override public boolean onClick(int index, ClickType type, SlotActionType action, GuiElementInterface element) { GuiElementInterface clickedElement = getSlot(index); - if (clickedElement != null) { + ItemStack cursorStack = getPlayer().currentScreenHandler.getCursorStack(); + if (clickedElement != null && cursorStack.isEmpty()) { ItemStack clickedItem = clickedElement.getItemStack(); ItemStack noLoreStack = removeCountFromLore(clickedItem); if (type.isRight) { @@ -95,27 +104,35 @@ public class StorageScreen extends PagedGui { } } if (!(type.isRight && type.shift)) { - int insertCount = canInsertItemIntoPlayerInventory(player, noLoreStack); + PlayerInventory playerInventory = player.getInventory(); + int insertCount = canInsertItemIntoInventory(playerInventory, noLoreStack); ItemStack insertingStack = noLoreStack.copy(); insertingStack.setCount(insertCount); - blockEntity.rescanChests(); - if (blockEntity.chests.canRemove(noLoreStack) && insertCount > 0) { - player.getInventory().insertStack(insertingStack.copy()); - blockEntity.chests.removeItemStack(insertingStack); - blockEntity.rescanChests(); + blockEntity.reindexDrives(); + if (blockEntity.network.canRemove(noLoreStack) && insertCount > 0) { + playerInventory.insertStack(insertingStack.copy()); + blockEntity.network.removeItemStack(insertingStack); + blockEntity.reindexDrives(); } } + } else if (!cursorStack.isEmpty()) { + insertItem(cursorStack); } return false; } + public void insertItem(ItemStack stack) { + int canPutIn = stack.getCount() - blockEntity.network.putItemStackRemainder(stack); + if (canPutIn > 0) { + removeFromInventory(player.getInventory(), stack, canPutIn); + blockEntity.reindexDrives(); + } + } + @Override public boolean insertItem(ItemStack stack, int startIndex, int endIndex, boolean fromLast) { - blockEntity.rescanChests(); - if (blockEntity.chests.tryPutItemStack(stack)) { - removeFromInventory(player.getInventory(), stack, stack.getCount()); - } - blockEntity.rescanChests(); + blockEntity.reindexDrives(); + insertItem(stack); return super.insertItem(stack, startIndex, endIndex, fromLast); } @@ -136,17 +153,8 @@ public class StorageScreen extends PagedGui { @Override protected DisplayElement settings() { - return DisplayElement.of( - new GuiElementBuilder(Items.PLAYER_HEAD) - .setName(Text.translatable("mco.configure.world.settings.title").formatted(Formatting.WHITE)) - .hideDefaultTooltip().noDefaults() - .setSkullOwner(GUI_SETTINGS) - .setCallback((x, y, z) -> { - SettingsScreen settingsScreen = new SettingsScreen(this); - playClickSound(getPlayer()); - settingsScreen.open(); - }) - ); + SettingsScreen settingsScreen = new SettingsScreen(this); + return settingsScreen.getItem(); } @Override @@ -159,7 +167,7 @@ public class StorageScreen extends PagedGui { .setCallback((x, y, z) -> { this.blockEntity.sortAlphabetically ^= true; playClickSound(getPlayer()); - this.blockEntity.rescanChests(); + this.blockEntity.reindexDrives(); }) ); } @@ -184,7 +192,7 @@ public class StorageScreen extends PagedGui { @Override protected DisplayElement crafting() { - if (!this.getPlayer().getWorld().getGameRules().getBoolean(ServerStorage_Crafting_Enable)){ + if (!this.getPlayer().getWorld().getGameRules().getBoolean(ServerStorage_Crafting_Enable)) { return DisplayElement.filler(); } return DisplayElement.of( @@ -203,7 +211,7 @@ public class StorageScreen extends PagedGui { public void doSearch(String query) { this.blockEntity.searchString = query; - this.blockEntity.rescanChests(); + this.blockEntity.reindexDrives(); this.page = 0; } @@ -218,7 +226,7 @@ public class StorageScreen extends PagedGui { playClickSound(player); this.page = 0; this.blockEntity.searchString = ""; - this.blockEntity.rescanChests(); + this.blockEntity.reindexDrives(); }) ); } diff --git a/src/main/resources/assets/serverstorage/blockstates/bus_connector.json b/src/main/resources/assets/serverstorage/blockstates/bus_connector.json new file mode 100644 index 0000000..52ea263 --- /dev/null +++ b/src/main/resources/assets/serverstorage/blockstates/bus_connector.json @@ -0,0 +1,32 @@ +{ + "multipart": [ + { + "when": { "north": "none", "south": "none", "west": "none", "east": "none", "up": "none", "down": "none" }, + "apply": { "model": "serverstorage:block/bus_connector_blank" } + }, + { + "when": { "north": "bus" }, + "apply": { "model": "serverstorage:block/bus_connector_bus_north" } + }, + { + "when": { "south": "bus" }, + "apply": { "model": "serverstorage:block/bus_connector_bus_south" } + }, + { + "when": { "west": "bus" }, + "apply": { "model": "serverstorage:block/bus_connector_bus_west" } + }, + { + "when": { "east": "bus" }, + "apply": { "model": "serverstorage:block/bus_connector_bus_east" } + }, + { + "when": { "up": "bus" }, + "apply": { "model": "serverstorage:block/bus_connector_bus_up" } + }, + { + "when": { "down": "bus" }, + "apply": { "model": "serverstorage:block/bus_connector_bus_down" } + } + ] +} diff --git a/src/main/resources/assets/serverstorage/blockstates/inventory_interface.json b/src/main/resources/assets/serverstorage/blockstates/inventory_interface.json new file mode 100644 index 0000000..d0cded5 --- /dev/null +++ b/src/main/resources/assets/serverstorage/blockstates/inventory_interface.json @@ -0,0 +1,32 @@ +{ + "multipart": [ + { + "when": { "north": "none", "south": "none", "west": "none", "east": "none", "up": "none", "down": "none" }, + "apply": { "model": "serverstorage:block/inventory_interface_blank" } + }, + { + "when": { "north": "inventory" }, + "apply": { "model": "serverstorage:block/inventory_interface_inventory_north" } + }, + { + "when": { "south": "inventory" }, + "apply": { "model": "serverstorage:block/inventory_interface_inventory_south" } + }, + { + "when": { "west": "inventory" }, + "apply": { "model": "serverstorage:block/inventory_interface_inventory_west" } + }, + { + "when": { "east": "inventory" }, + "apply": { "model": "serverstorage:block/inventory_interface_inventory_east" } + }, + { + "when": { "up": "inventory" }, + "apply": { "model": "serverstorage:block/inventory_interface_inventory_up" } + }, + { + "when": { "down": "inventory" }, + "apply": { "model": "serverstorage:block/inventory_interface_inventory_down" } + } + ] +} diff --git a/src/main/resources/assets/serverstorage/lang/en_us.json b/src/main/resources/assets/serverstorage/lang/en_us.json index b62195f..ce3c943 100644 --- a/src/main/resources/assets/serverstorage/lang/en_us.json +++ b/src/main/resources/assets/serverstorage/lang/en_us.json @@ -1,10 +1,14 @@ { "block.serverstorage.storage": "Networked storage interface", + "block.serverstorage.inventory_interface": "Networked inventory interface", + "block.serverstorage.drive_container": "Hard drive container", "item.serverstorage.drive_casing": "Hard drive casing", + "block.serverstorage.bus_connector": "Storage network connector", + "item.serverstorage.iron_drive": "Iron hard drive", "item.serverstorage.iron_head": "Iron hard drive head", "item.serverstorage.iron_platter": "Iron hard drive platter", @@ -19,5 +23,37 @@ "item.serverstorage.netherite_drive": "Netherite hard drive", "item.serverstorage.netherite_head": "Netherite hard drive head", - "item.serverstorage.netherite_platter": "Netherite hard drive platter" + "item.serverstorage.netherite_platter": "Netherite hard drive platter", + + "item.serverstorage.module_bus": "Bus module", + "item.serverstorage.module_configuration": "Configuration module", + "item.serverstorage.module_container": "Container module", + "item.serverstorage.module_display": "Display module", + "item.serverstorage.module_drive": "Drive module", + "item.serverstorage.module_filtering": "Filtering module", + "item.serverstorage.module_inventory": "Inventory module", + "item.serverstorage.module_pagination": "Pagination module", + "item.serverstorage.module_transport": "Transport module", + + "item.serverstorage.module_pcb": "Module PCB", + + "item.serverstorage.drive_controller": "Drive controller", + "item.serverstorage.cpu": "Central Processing Unit", + "item.serverstorage.cpu_substrate": "CPU substrate", + "item.serverstorage.pcb": "Printed Circuit Board", + "item.serverstorage.pcb_substrate": "PCB substrate", + + + "gui.serverstorage.store_all": "Store all items from inventory", + "gui.serverstorage.filter": "Filter", + "gui.serverstorage.sort_alphabetically": "Sort alphabetically", + "gui.serverstorage.sort_descending": "Sort by count descending", + "gui.serverstorage.mode_input": "Input", + "gui.serverstorage.mode_output": "Output", + "gui.serverstorage.direction_north": "North", + "gui.serverstorage.direction_south": "South", + "gui.serverstorage.direction_west": "West", + "gui.serverstorage.direction_east": "East", + "gui.serverstorage.direction_up": "Up", + "gui.serverstorage.direction_down": "Down" } \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector.json b/src/main/resources/assets/serverstorage/models/block/bus_connector.json new file mode 100644 index 0000000..03a8c86 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "serverstorage:block/bus_connector_bus" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_blank.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_blank.json new file mode 100644 index 0000000..ef03a84 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_blank.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "serverstorage:block/bus_connector_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_blank.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_blank.json new file mode 100644 index 0000000..ef03a84 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_blank.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "serverstorage:block/bus_connector_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_down.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_down.json new file mode 100644 index 0000000..b457aa3 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_down.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/bus_connector_bus", + "up": "serverstorage:block/bus_connector_blank", + "north": "serverstorage:block/bus_connector_blank", + "south": "serverstorage:block/bus_connector_blank", + "west": "serverstorage:block/bus_connector_blank", + "east": "serverstorage:block/bus_connector_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_east.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_east.json new file mode 100644 index 0000000..6df909b --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_east.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/bus_connector_blank", + "up": "serverstorage:block/bus_connector_blank", + "north": "serverstorage:block/bus_connector_blank", + "south": "serverstorage:block/bus_connector_blank", + "west": "serverstorage:block/bus_connector_blank", + "east": "serverstorage:block/bus_connector_bus" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_north.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_north.json new file mode 100644 index 0000000..5a72c76 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_north.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/bus_connector_blank", + "up": "serverstorage:block/bus_connector_blank", + "north": "serverstorage:block/bus_connector_bus", + "south": "serverstorage:block/bus_connector_blank", + "west": "serverstorage:block/bus_connector_blank", + "east": "serverstorage:block/bus_connector_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_south.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_south.json new file mode 100644 index 0000000..e99a59c --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_south.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/bus_connector_blank", + "up": "serverstorage:block/bus_connector_blank", + "north": "serverstorage:block/bus_connector_blank", + "south": "serverstorage:block/bus_connector_bus", + "west": "serverstorage:block/bus_connector_blank", + "east": "serverstorage:block/bus_connector_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_up.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_up.json new file mode 100644 index 0000000..09434d2 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_up.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/bus_connector_blank", + "up": "serverstorage:block/bus_connector_bus", + "north": "serverstorage:block/bus_connector_blank", + "south": "serverstorage:block/bus_connector_blank", + "west": "serverstorage:block/bus_connector_blank", + "east": "serverstorage:block/bus_connector_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_west.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_west.json new file mode 100644 index 0000000..028dc60 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_bus_west.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/bus_connector_blank", + "up": "serverstorage:block/bus_connector_blank", + "north": "serverstorage:block/bus_connector_blank", + "south": "serverstorage:block/bus_connector_blank", + "west": "serverstorage:block/bus_connector_bus", + "east": "serverstorage:block/bus_connector_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/bus_connector_inventory_blank.json b/src/main/resources/assets/serverstorage/models/block/bus_connector_inventory_blank.json new file mode 100644 index 0000000..ef03a84 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/bus_connector_inventory_blank.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "serverstorage:block/bus_connector_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/inventory_interface.json b/src/main/resources/assets/serverstorage/models/block/inventory_interface.json new file mode 100644 index 0000000..9451742 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/inventory_interface.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "serverstorage:block/inventory_interface_blank" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/block/inventory_interface_blank.json b/src/main/resources/assets/serverstorage/models/block/inventory_interface_blank.json new file mode 100644 index 0000000..30ac750 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/inventory_interface_blank.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "serverstorage:block/inventory_interface_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_down.json b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_down.json new file mode 100644 index 0000000..46090d1 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_down.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/inventory_interface_inventory", + "up": "serverstorage:block/inventory_interface_blank", + "north": "serverstorage:block/inventory_interface_blank", + "south": "serverstorage:block/inventory_interface_blank", + "west": "serverstorage:block/inventory_interface_blank", + "east": "serverstorage:block/inventory_interface_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_east.json b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_east.json new file mode 100644 index 0000000..01b8957 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_east.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/inventory_interface_blank", + "up": "serverstorage:block/inventory_interface_blank", + "north": "serverstorage:block/inventory_interface_blank", + "south": "serverstorage:block/inventory_interface_blank", + "west": "serverstorage:block/inventory_interface_blank", + "east": "serverstorage:block/inventory_interface_inventory" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_north.json b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_north.json new file mode 100644 index 0000000..55ecafd --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_north.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/inventory_interface_blank", + "up": "serverstorage:block/inventory_interface_blank", + "north": "serverstorage:block/inventory_interface_inventory", + "south": "serverstorage:block/inventory_interface_blank", + "west": "serverstorage:block/inventory_interface_blank", + "east": "serverstorage:block/inventory_interface_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_south.json b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_south.json new file mode 100644 index 0000000..b5eb707 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_south.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/inventory_interface_blank", + "up": "serverstorage:block/inventory_interface_blank", + "north": "serverstorage:block/inventory_interface_blank", + "south": "serverstorage:block/inventory_interface_inventory", + "west": "serverstorage:block/inventory_interface_blank", + "east": "serverstorage:block/inventory_interface_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_up.json b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_up.json new file mode 100644 index 0000000..a06da33 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_up.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/inventory_interface_blank", + "up": "serverstorage:block/inventory_interface_inventory", + "north": "serverstorage:block/inventory_interface_blank", + "south": "serverstorage:block/inventory_interface_blank", + "west": "serverstorage:block/inventory_interface_blank", + "east": "serverstorage:block/inventory_interface_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_west.json b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_west.json new file mode 100644 index 0000000..9f3d17b --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/block/inventory_interface_inventory_west.json @@ -0,0 +1,11 @@ +{ + "parent": "block/cube", + "textures": { + "down": "serverstorage:block/inventory_interface_blank", + "up": "serverstorage:block/inventory_interface_blank", + "north": "serverstorage:block/inventory_interface_blank", + "south": "serverstorage:block/inventory_interface_blank", + "west": "serverstorage:block/inventory_interface_inventory", + "east": "serverstorage:block/inventory_interface_blank" + } +} diff --git a/src/main/resources/assets/serverstorage/models/item/bus_connector.json b/src/main/resources/assets/serverstorage/models/item/bus_connector.json new file mode 100644 index 0000000..edfa5df --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/bus_connector.json @@ -0,0 +1,3 @@ +{ + "parent": "serverstorage:block/bus_connector_blank" +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/cpu.json b/src/main/resources/assets/serverstorage/models/item/cpu.json new file mode 100644 index 0000000..a26ba02 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/cpu.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/cpu" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/cpu_substrate.json b/src/main/resources/assets/serverstorage/models/item/cpu_substrate.json new file mode 100644 index 0000000..33fc958 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/cpu_substrate.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/cpu_substrate" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/drive_controller.json b/src/main/resources/assets/serverstorage/models/item/drive_controller.json new file mode 100644 index 0000000..679ec93 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/drive_controller.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/drive_controller" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/inventory_interface.json b/src/main/resources/assets/serverstorage/models/item/inventory_interface.json new file mode 100644 index 0000000..14332a1 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/inventory_interface.json @@ -0,0 +1,3 @@ +{ + "parent": "serverstorage:block/inventory_interface" +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_bus.json b/src/main/resources/assets/serverstorage/models/item/module_bus.json new file mode 100644 index 0000000..c96167f --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_bus.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_bus" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_configuration.json b/src/main/resources/assets/serverstorage/models/item/module_configuration.json new file mode 100644 index 0000000..02d28bb --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_configuration.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_configuration" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_container.json b/src/main/resources/assets/serverstorage/models/item/module_container.json new file mode 100644 index 0000000..bcea4c0 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_container.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_container" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_display.json b/src/main/resources/assets/serverstorage/models/item/module_display.json new file mode 100644 index 0000000..dd4db27 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_display.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_display" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_drive.json b/src/main/resources/assets/serverstorage/models/item/module_drive.json new file mode 100644 index 0000000..ec81c17 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_drive.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_drive" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_filtering.json b/src/main/resources/assets/serverstorage/models/item/module_filtering.json new file mode 100644 index 0000000..60e1d90 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_filtering.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_filtering" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_inventory.json b/src/main/resources/assets/serverstorage/models/item/module_inventory.json new file mode 100644 index 0000000..70be306 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_inventory" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_pagination.json b/src/main/resources/assets/serverstorage/models/item/module_pagination.json new file mode 100644 index 0000000..cb69ed6 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_pagination.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_pagination" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_pcb.json b/src/main/resources/assets/serverstorage/models/item/module_pcb.json new file mode 100644 index 0000000..ef6be10 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_pcb.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_pcb" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/module_transport.json b/src/main/resources/assets/serverstorage/models/item/module_transport.json new file mode 100644 index 0000000..5e707f0 --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/module_transport.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/module_transport" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/pcb.json b/src/main/resources/assets/serverstorage/models/item/pcb.json new file mode 100644 index 0000000..63f7e7e --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/pcb.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/pcb" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/models/item/pcb_substrate.json b/src/main/resources/assets/serverstorage/models/item/pcb_substrate.json new file mode 100644 index 0000000..1e880ab --- /dev/null +++ b/src/main/resources/assets/serverstorage/models/item/pcb_substrate.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "serverstorage:item/pcb_substrate" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/serverstorage/textures/block/bus_connector_blank.png b/src/main/resources/assets/serverstorage/textures/block/bus_connector_blank.png new file mode 100644 index 0000000000000000000000000000000000000000..c24a345c1ea2c87a0635d8f39ba515220469a1ec GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNqTH%1AAvZrIGp!Q0 zhF=y3{s1*-z-=hW%uOvWNz5%k=rIW~Ft;)=vobM(Sn@*X`)Z&b22WQ%mvv4FO#qBF BWs3j+ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/block/bus_connector_bus.png b/src/main/resources/assets/serverstorage/textures/block/bus_connector_bus.png new file mode 100644 index 0000000000000000000000000000000000000000..a5e83a9b4f1a5eb5f3e7167033ecc6622672517f GIT binary patch literal 388 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNOaJki%Z$>Fdh=f}Mq(O()A|DbP>`4^J1z5RU7~2_Y=ZtZa;m1_?<4 zEZmwJMjV_H%#4!-nip;27LZ_aZHaYucJ6UdQeeBNr0`Zjkaa?1kAq-`s1pyDfp_9L z28NvvMY4>~v19?wR4s9hC`m~yNwrEYN(E93Mg~SEx(4RD21X%nr!1_o9J z1`n9(bx<_q=BH$)RU$MPh8P-K8Jb%eSwb`j%EVX$HE6(XD9OxCEiOsSEkNio2{ACY bGBC3;F@flLA@qGUP!EHrtDnm{r-UW|ka=d9 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/block/bus_connector_inventory.png b/src/main/resources/assets/serverstorage/textures/block/bus_connector_inventory.png new file mode 100644 index 0000000000000000000000000000000000000000..b033eda20b8371d245218d94f6e9cb7fe93556d5 GIT binary patch literal 410 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNpwst#w2fd7ml`jQ>%a+_7YEDSN0d|EbMGLSw2gFMl(csx;Tb#TsJ*;k@tWC z2TMQ+le2h33DaAyQs&r$c^7_GJM7i}9Kz@IN>J;~$t8Y^jy!cTnmo@uNYQVlzq^7#dj_8(0}yY8x0>85k^3&{>V5AvZrIGp!Q0hKsdR#DN+#;5L+G o=B5^xB<2<%^q7Pgm|Gc`S(%tXEO{aH9b^fEr>mdKI;Vst0L{UC5&!@I literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/block/controller_back.png b/src/main/resources/assets/serverstorage/textures/block/controller_back.png index 37ec25907a7a35530f71bc77b0666c984f0ac454..9706dc623d9bec9d9a0e76decb52e327e8491cce 100644 GIT binary patch literal 434 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN?G|(9CouXofMv z7E1{my~bB-f!3&&xJHzuB$lLFB^RXvDF!10BNJT%GhHK-5Ccmq19K~5Gi?I{D+2@9 zUyLtNH00)|WTsW3XfU@jwXiZVfM`(XsN)1`(16=el9`)YT#}eu0M%ozYXG#w+{(br Y%ESbs=Y`Ps)j&NAp00i_>zopr0BZ7mXaE2J delta 375 zcmV--0f_#x1BL^T7=H)`0000V^Z#K00004VQb$4nuFf3k0003%Nkl6V5YMTm%lmYZ5~bjz*&0HH-9f`=`#s+Ke&6T!`29pQK9si8BkcQR_0mRbyMI|FWjj4uweqjTR-;2E z?EBa#6Pxu&VsTb4A8=IzSG4iKnkC z`wMm!b~c?XpQS)68R9)%977~7$M!!IYEa;4HWU%ra_@ic>q%KB>o)%8Gh4J}VaKKO z3%y?)ag%YreB0u9!7P^NN>Qs)>N?ZjZDn4V6elfk`06i)LtXv*m>(`Gd(itlS0H|a zXTq1=XM^(A)-z4YV*2kj|41FsD%BF#h?11Vl2ohYqEsNoU}RuqqHAELYh)5)U}nB8JJm_m_YQr5c<9vsE5JR)z4*}Q$iB}_kEC& delta 386 zcmV-|0e$|t1Cj%f8Gi-<001BJ|6u?C00DDSM?wIu&K&6g00B%%L_t(Ijir+zY{Ebk zhQGVf3^vh)u&Jeni5W6C9I6(zkeUgSna(4TxS^&k2nHshQg=iox zxrx%XWUOP`Gj}id{`bDS_fGipOJzGF7Gsxe$@taUZPk#rGk>CEmH#BJH+y6jV;7q+ ziOp^#kvLm25H}A>MTZ@$j9IOaW`q9lQ@j|vAwlGrj}@}7?bHNjwZYkSOq5CD@f-%- zU+tkufhNHV6y6f_oZz+>0Bl@mgCH`01=G305928uhJIwpqH=>^ZTh~zI1*@?7+ufB z`(#nMjbJ)gynDEpcLF~EO$yFW1YQ8ef?)Et z{SCHuq5ZTvzucV7v*ts1s7;`AbYl21szhGx!XVb~@Sqik6A;HtdF+}2WY=5*^g93+3;DPX2TmPS(cF<5{-;Cl$ zNrvaS%sX5gx366!yg;nu*~BduI2(^BwoTzw7u+GUQL1Uh+~icD&S=kR56=Bv)pp|X ztG#z7Z1?(etYyQs{U*^nZ2vJg^)cP=-Y4b?v`e+bHKHUXu_V^cTAvZrIGp!OugSnNd1zdwVM;#|ng9hA&lFZ!H p;*!MN0;nEyT?3#c=2iw~RwgD8OI`?lUk%j5;OXk;vd$@?2>=+DnP>n2 delta 399 zcmV;A0dW4n1D*qr8Gi-<001BJ|6u?C00DDSM?wIu&K&6g00CG@L_t(Ijir-4OT$nU zhM%M8w`@$bY8Qp=xCRBrcX4D5I{8 ziC4sAITBy2W;CS33nBc=s*y#{=ZK0{v;8d|b#0HpPxR{?YVSO|pAiR73}%9Ka!wI!8cJ}~m;rFP zFXOr{$G7f}F@J(hl`w*up^!?zBo;$eRceNUGZviOxyuox5@7cQ+SMk#zF<8q!8n{C z)Pu(tfwm^$483B53A}!+;DPVD%PDHLkV1l7Bv$y~N diff --git a/src/main/resources/assets/serverstorage/textures/block/controller_left.png b/src/main/resources/assets/serverstorage/textures/block/controller_left.png index 87452c6c084da45580fd53c10c6ed8303c57cd7c..0a7c9b1c83f2e18a6c6e471851469a3aacb22db0 100644 GIT binary patch literal 439 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZJGL_=LFr{$!Rs`+s!aLwoxYcXfuFRm|s$nXi;H zzinmNoxyw{hxtVl%e@+w$8{{H3Yd@PG5`PnKkIYWF`#zFByV>YfvKB#b$}f95>H=O z_806d>})z&K1+dCGQ@hiIEF}EF73a~cR+!|dG(44$shmgcc)q%_i>w_!MB8U&UU6d z#}BH$KErFme)zM9Uk%j5;OXk;vd$@?2>?T=jer0E delta 370 zcmV-&0ge8*1A+sP8Gi-<001BJ|6u?C00DDSM?wIu&K&6g00BHnL_t(Ijir;nOT$1I zhM!AvHgqtvBAr}|o83BPw3C!Bf(0EiId$wz?OJIgbG_NcnEC+@ zafrieB#GH977%B5N+pNwS_!*SCQJR^;Kw}mgP0)M*!N}3x0}oWyV79)WKLwH@py?Z z-5%>qK0z9=vn_ajRY(IapJo6HAl3zq#vD8c;i9lDE5yz|>8=IzSG4iKnkC z`wMm!b~c?XpQS)68DczL977~7m-astYEa;4Ufz+Aw(tM#Yps%%;=hl+Yrfqeu(#nu zVZll3Wai$+%88dGxZDCBorx@3;vHTcs^GA-L61ZV3`vZqLy+p`rc&p$3N<4wvADhMe3S!`bB)gCbDK zF4TSv*XfDJq4t)?^ zq&rikKa}k62>L@wHZADANiLtJ01Mwy!a-mO6|!jo_>-pLVd17~ z6hY-=i_9J*Rd_KYdjFJMJWiJglm&u6OKw9-7xX?Pqlu(Hkfe06I>GqI@0d_vR}-Xk z7<{cUgRAH1W;19xZH!_iR@`#hSoZZYL8Df}vO63c#jkR?>e8sq*Io&WS3Rb3wMpH~ d10eo;&c8^uEosVx&#nLf002ovPDHLkV1kLcuDt*N diff --git a/src/main/resources/assets/serverstorage/textures/block/controller_top.png b/src/main/resources/assets/serverstorage/textures/block/controller_top.png index d0d05c87489795c255226bb1a96c647a12722620..c9c2341aa91e9b5ad4baa395a3818b953b71a4e5 100644 GIT binary patch literal 441 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNnmpnZ!PJ?=WW7VYcpt3=TNRBd5pVgS*g&QZq+)Sv;kp(HamwYVfPw*acgT-N|- eiMf@5nU#qNM9&MM@2i1&7(8A5T-G@yGywp@V}Nb| delta 394 zcmV;50d@Yl1DFGl7=H)`0000V^Z#K00004VQb$4nuFf3k0003}Nkll3&AVcaj}iZ~5`#{l4G#`SIQpAFqefa)t!1hh8ddbbog28j9r%Y1hkt5;t01 z)WG$y2u&>3BUy;`QUP&tCFLU7u9q>Z6_TRg8+?lc*9!?27xTJ;{&bOOU{; Y;iJ z9FP0((dAK!kq?FregFr%0(T@iyPW|neP@Xv9>tu%pGpAk9wmkz<>Ez^C4zZqDR>x% zVn3Lh1(89#sDHAGz#Btag=|Kkso+l~d1C_tLx;&HJikebIl;(>v?kUk&{B}iKz>Uw zd56-rzc`0UY9JB>S}#|00000NkvXXt^-0~g5vb7rvLx| diff --git a/src/main/resources/assets/serverstorage/textures/block/drive_container_front.png b/src/main/resources/assets/serverstorage/textures/block/drive_container_front.png index 53e9ac543118f69f2955b4e2943d37a66bd016f5..995b18ec7783cc1121f941de6d2fee15c6de6acf 100644 GIT binary patch literal 403 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN4CA%&e^0Yq$UZ|G)e7 za*!>IN#5=*Y>8<*YJnW~5>H=O_806d>})z&K1+dyGK71&IEHXs_dRoww?RRG`NCn& zGlKtBk1%e?JD|JZ zH|$%K(y(cV+v@sCtGchD)oIJuy5)s5^RLUCYyTf;g=&dwL`h0wNvc(HQ7VvPFfuSQ z(KRsBH8Ke?u(UETw=y-;HZZUdW572-;T|on)Vd=8l1;Usy zGqd0R|BM&!j~6}&AHY8ds-h%_!nd*?_nHA!Q8ND(Kn?PqlYi7b!E}Ke20I!@QB~qKVZ7FWw(7{y{VZ50T})mc@D`=}F&%E=-rjrUrbg zqCrc8E{k8*peM^>V-sywxh&QQTpGA;!Ta=_uUDn&pvRfe=Kufz07*qoM6N<$f}o{| A2mk;8 diff --git a/src/main/resources/assets/serverstorage/textures/block/drive_container_side.png b/src/main/resources/assets/serverstorage/textures/block/drive_container_side.png index 99c64a08a500db55b32c882feb81fded5580efdc..7cd3b17eed9c6ccca11f1a633754a57daeecf90c 100644 GIT binary patch literal 331 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx93dtTpz6=aiY77hwEes65fIFdh=f}Mq(O()A|DbOqi2~QWt5RU7~2@H%UXBwv)tXR5qX}}RCMuv_Z zViWvU{xJorQ7v(eC`m~yNwrEYN(E93Mg~SEx&~&tMkXN!mR1H9RtARJ1_o9J2LEp+ zbE0U-%}>cpt3=UYZe?m|Wn>A_FxxgV8K^-6ZbM0CZfbE!Vr~IckGZY^&=PYi12ZcV X6NsJ{Lf=;d^)Pt4`njxgN@xNA!$?~B delta 126 zcmX@j)Xz9UqMU<`fq_B(^Z!I3#aJBV?!>U}oXkrg$J5irF~p)bxySzZ6MJUXhSo+P zcsj@AaR2Fk35$}a9*ZI$&6J!WAt7<%(wT+Y#}6Dhz+l)QbJkwZ-bupXRa2liPp!B? c(5$(P9E)}ROk_-!0u5#GboFyt=akR{07Z~3lK=n! diff --git a/src/main/resources/assets/serverstorage/textures/block/inventory_interface_blank.png b/src/main/resources/assets/serverstorage/textures/block/inventory_interface_blank.png new file mode 100644 index 0000000000000000000000000000000000000000..a6b34aca04d1fe9adc38cb00e0fe1b68507f2b68 GIT binary patch literal 397 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN zW0JSK3+s>km&bt|_7YEDSN0d|EbMGLSw2gFCNhM0x;Tb#TsJ*;P_V&(!zD0@b>>v2 z8xz^Ca4q=1$fx7y@$!U;$4)I-Y}MlG=2-8}-V#2cj^9%BL^{{uNG4yMk3UpPJ0}ND zYVg}wxq&xQSm5^J-@W`Ellg7jw#hdD%~vgPjVMV;EJ?LWE=mPb3`PbNoH zW0JSK3+s>km&bt|_7YEDSN0d|EbMGLSw2gFCNczjx;Tb#TrWL$Q1E~PhfClVru1aS zH%Hheg)DIXZ_0Y2;*9-1=5CQRE#62`HBHvHAGKQ4&sOY|k&P%nq2hju=~q8b(Xs

UO_QmvAUQh^kMk%5tku7SC(fk}vg zxs`#5m64&gfq|8QLEMiSS5Y+N=BH$)RibM!vNAD%XmDB_Bn#A_0k@$fGdH!kBr&%D cU5}ZSi3vo{3!(3;fqED`UHx3vIVCg!0Ggh6jQ{`u literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/cpu.png b/src/main/resources/assets/serverstorage/textures/item/cpu.png new file mode 100644 index 0000000000000000000000000000000000000000..bdd96375afbcb037eb974890211a70b17f2f8194 GIT binary patch literal 379 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN2q)fkLL9E{-7_*OL44a{{7j6)19tqcsT3=On_q=CWH--_NS8glbfGSez? zYnZZZ=69e54Y&;@nYpROC5gEO2t6ht2If{EWD2oF_3g~tKs^keu6{1-oD!M<%{ylD literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/cpu_substrate.png b/src/main/resources/assets/serverstorage/textures/item/cpu_substrate.png new file mode 100644 index 0000000000000000000000000000000000000000..5c5043cc5587c0aa843a45169e1809f6a98232b1 GIT binary patch literal 313 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrOULb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZOn1_=LC`*;xMn|DSc{?dw1h#w2fd7smfgy7zz_ z_7YEDSN0d|EbQ#8hEI8p0)==yT^vI=t|uob@B(=T42;KDwe|s7swJ)wB`Jv|saDBF zsX&Us$iT=%*T7uYz&OOn(8|cn%G5;Lz`)AD;MqHqNhlg}^HVa@DsgL=zPU#as6hj6 pLrG?CYH>+oZUI7%Nr-{D6$qI^EKz+s^EOZqgQu&X%Q~loCICmzPn7@w literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/drive_casing.png b/src/main/resources/assets/serverstorage/textures/item/drive_casing.png index 7ea389355eb24c7ee6d566c8a3a58648294ebf69..ee17d57e908c6f47c6bc76f0cc2b83b1e735e3a9 100644 GIT binary patch literal 322 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx*Bp9q_EZ7UAm`Z~Df*BafCZDwc@shmVT^Rni z_n+AhnXZvZh=HY*p`n$5xwe6Um4U&+NsBB|H00)| zWTsW3XfU@jwXiap?tN;K2 delta 156 zcmX@aw3cy#WIY=L1B3kM|A|0~u{g-xiDBJ2nU_FLx~Gd{h(&L5iUX6ZtnB}{Z{JFO zXl!QZHwp;}F*x)?=ftFM-@fsPiHTM4I}mAy(OJMeDYFVdQ I&MBb@0DQ(Y@c;k- diff --git a/src/main/resources/assets/serverstorage/textures/item/drive_controller.png b/src/main/resources/assets/serverstorage/textures/item/drive_controller.png new file mode 100644 index 0000000000000000000000000000000000000000..4f32764c1c06e4a52965a0d8c5bae266f17af943 GIT binary patch literal 396 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN@4i;tcFi{jsk_8JzX3_IIbrP zv@o$TvKb_>7|sw`z@w_l(d_Bz$vBm9x|2p*HanA=gtMohqEZGATN6){nxf*ub>~j- z2nq^1y1P3vEbZWwec#WZ0W?mv#5JNMC9x#cD!C{XNHG{07@6oAnCluChZtH|nOa&I z8)+LDSQ!{3OwANR(U6;;l9^VCTZ7<|`;NWLm0q9iD>T%n*SKP@vSRiUJ^AXNeAN(Kgt-nk*sea!|uf6i-ud_JvJ(mTO)8=v> z@Xmc!A?fGQcI=#7qlm~7p60b-k3)adGiRmbb`=P4UoO)4E%4I$zvY+a$==s5X(xE8 zEjzdEdiUa->K*Rw3*-;n;a?!p`u2gm!4HwQQ!+C6L#osw&Yu7C>52Zo*9W&d+_oum zo~pcgenr#El`qabUT9LOohxO^%n{A|^5)4+J6l^DCKgv~q)D$`5jgLdQ$a4FK5e?a&tvZQ-D+F!Xr|4a_HAzCH``T_ z`QFOOZ!&Mkv)NpWxx`=Y{QRMw&+Rr~9L(@^aSYKoU!RNE~%&^@_@WzC^TUB=LE<4KZDN-cBrG?ZQ_HTko)F&q?V-lZ&}$iVu9 zdxQ4DMM0da>X}5&JIDz*>|M{6q9x798BoE%kk93LP>44_59mtO64!{5l*E!$tK_0o zAjM#0U}U0eV5Vzi5@KL!WngY)V61ImU}a!1(^qpXiiX_$l+3hB6bZa# zjDU=4vqg|42VWPk>H;ElMGja*0Qjo|Re)R{w&JV=$b>S{l!!RFh=MG!?vhag7O#Om z^4U{RH`QnYCjtQAsv?Yv*f`P4EeZBIF=j$egQkfmja^TYa0Ln002ov JPDHLkV1ly0$C&^C diff --git a/src/main/resources/assets/serverstorage/textures/item/drive_gold.png b/src/main/resources/assets/serverstorage/textures/item/drive_gold.png index a55c76ee91987187fe9a01bfd8dac123f3ef5074..dfb50270603cc4313f5dab915a4a7f95d361f209 100644 GIT binary patch delta 974 zcmeyv`i66Yga`{W0|P^2NcwRG21c1oXXk*-S2NLa|-cM4r5Wp6$z``%x=WIday#{~zTCMBmu4m$$3-FWqAiHe@fg2`!f zIS+W}KC6)Q^JqJEPOeczWC>66+OWr=KkAvYQgXWr1h_93Y5W#=>HOdFOY>y!>zA|> zywsMR+jhNsaZdFP_x1(y2k!7MkZ67TK;Gbo$lECy8T=ttY7uA8|M~Pp|KIC_+Z}G( zlsQjT-aNme>E+57XC5y!snpJuGG*q7=6!kdBUi2p~XZ?qlKmNrjW={JyxAB|p zs>pnA<>WV+x8vDtuEkv9FL!?aP|xRf8!!%Lc)B=-Xq>N4PDn@)329<-WMmUKAR=JY z#^l<;FnLlZx5N%9O$U}KzAOhB6a|_TAH3*TrOI-*N5EZB+}%-x(Xm9dNzcLcL|VrJ z?gf%kU5X1HaTIkLhcxJ(+`_WvP^2znXt(hs$tIPnpqk8e4S==)tpFlZh$hvyGj9WJF$d`ZrcJBl{DR7& z%=C;B24@&c!O+suQo%7LKPgoqxU#q;HMdy7GcP&6s35-x=z|o)od3B%BNQM;=p|dF qq!uR^WfqiV0(}h87Ub@vpaC?-LUY5eSKok&89ZJ6T-G@yGywpR-EXe| delta 474 zcmV<00VV$I3H$|+7#Ro#0001UdV2H#00ALsLqkwOWN%_+Qb$6uEExfRyo`i_0004& zNklwSZqEVW`}VG*kIvnm}I`pd-MGc3rO(wdEL-@yNhKe+PJ!WYS(Ayn}xVTy0RZsw`rNK5-r`rpp$)4c4MCcw007_j!5Bk-5CjOr5btjv0FHA( z6#~!m+Vf;Mn$G}`=XnDhW&yS0)$&4p6$u_5?^_W7;JWVk_W+fgPTA?q5v?lVZ$D)T zY71zMgX_d*+cLz zKst;Z$7zxz0f5mpzh*Ru0QoSICLxiF2k;Pu_1O{nMzS&lsyWUR4kZVGZ!o`?4DZx5 Qf&c&j07*qoM6N<$g7<&Y^Z)<= diff --git a/src/main/resources/assets/serverstorage/textures/item/drive_iron.png b/src/main/resources/assets/serverstorage/textures/item/drive_iron.png index f63431ca577486d0e28b9f4416ba55bd8ba52ce5..88cf07d087a8980f6ee930098016d8920d13ac06 100644 GIT binary patch delta 974 zcmey)`i66Yga`{W0|P^2NcwRG21c1oXXk*--+$k_ zb*s6#Sz229|NsAUgIk?}(u^fRe!&b5&u*lFI7!~_E*x$5rd9zt>?NMQuIw+^S=ia@ zSq-1^90kc&g+!DDC6+4`6y>L7=A`t@^(r_27gGETEyA&e?C3Y|M&Xfc8A+G zWzJKTH_xwVdb#q&na2xFDz$T^Oqn^Nd0*ZYs19iYK=7MwJQSW9djzED74P+ zF6K(E?=#%~_{oJjUh`!B+LsR*k9eQBvGvNd-evQO7yZf0S^weXkN@&7c1Wp*T-$ae zd7_}M-rc#6Ws?L=cV+C)=&9cIRex`BMY_C`-qNQ{xA%F>{k~gm>mALsnbW?_ZTx1t zDl*?&Ir&ZI?RYkuYcZGj%blM;)bqLB28@Flo-U3d8t3bi6A}_cLYkNy8QBC5hzJ<9 zF}ZdyOrF%qEwMvN(}87*FUvs&MS&*82QNBSsj}Sd5pWk2cXt$FbSx2V(sOVm*Rp)97UbRAq~1Gx3H`^6sgM?+HE{ZvPr3Bj-H0n3#BH1);5NN0?oUWMHCrW zpKx!`KDa1|b5%W)$ax1j0f)Wo*;2Hm894(g7#Q-oJP!)-=H~%jsaoP1QIe8al4_M) zlnSI6j0}uSbPddOjZ8ueEUgU8tqd%*4GgRd3}$=PhNEc6%}>cpt3=UYZezo4=x zGd-h(!5PL>lWB+&;P1Z9 zBN#0}5Eh#llk{bdMx;tW%pIVO(EolD`ncGO=-h~kz-+$k_ zb*s6#Sz229|NsA2dM};@N;8%O`2{mLJiCzw;v{*yyKuDKn_30ru$OrHy0X7uXJKcr zXEl7va}*?B6%tVrlvu7%P?VpRnUkteQdy9y0CXh-gGKM$km$Z<1D-$UHNSDx&6a6r zQ+oSXe*>S2NLa|-cM4r5Wp6$z``%x=WIday#{~zTCMBmu4m$$3-FWqAiHe@fg2`!f zIS+W}KC6)Q^JqJEPOeczWC>66+OWr=KkAvYQgXWr1h_93Y5W#=>HOdFOY>y!>zA|> zywsMR+jhNsaZdFP_x1(y2k!7MkZ67TK;Gbo$lECy8T=ttY7uA8|M~Pp|KIC_+Z}G( zlsQjT-aNme>E+57XC5y!snpJuGG*q7=6!kdBUi2p~XZ?qlKmNrjW={JyxAB|p zs>pnA<>WV+x8vDtuEkv9FL!?aP|xRf8!!%Lc)B=-Xq>N4PDn@)329<-WMmUKAR=JY z#^l<;FnLlZx5N%9O$U}KzAOhB6a|_TAH3*TrOI-*N5EZB+}%-x(Xm9dNzcLcL|VrJ z?gf%kU5X1HaTIkLhcxJ(+`_WvP^2znXt(hs$tIPnpqk8e4S=?ogKRM{g=kWJJM%Ws7ITmuVA`}w&M&Ae z%1qBFVQ_}A6bvmbEfpM7@{>{(f-8$lQge$HJoA$Ciwg3KfIdhu%=w=SG(rJlgkG{$ qN@{U(QD#9&CeX(aZ9(o%3K~FTEHpRldi4#cn8DN4&t;ucLK6V69&hac delta 471 zcmV;|0Vw|L3Hb$(7#Ro#0001UdV2H#00ALsLqkwOWN%_+Qb$6uEExfRyo`i_0004# zNkl#A0;p|n*qDYstXZ+K&+)7 zGOkiHX`0FHgSzl+5=h87x#!;8b_EUAx9g*rr&+4oVvWt?rkx*N4=Z*3V$|sq;L^01 zW+^!5qX^P0J&A&fPDlWMpe)PQ0?s+^?;Zw`*G&b+7(CAd0JyH(;WI`+zI_x1B=YTU zZ?*4i4#aUxBBsI^0U6uf9#I&aj8lMA1%h-ca)1y4;5QFc0djs&#gPQagfh{Xh)nVj zMPWd$l0gC%&w)Pj*)6D>YB0eh0s!Fs4LL2GGp~lLemVwdd(zY(|{(_9?!;x-nlxgXfp0Rs^7LM&vRSC1+E1HhsjZ3gp{Q zS%TIA1k_uL#w6xq4@D$NfXy2~jnLozCX}(*7t!3Xia^~|WN&SsZ)*$Y>IaKk@Gn5y zj2y=~=6MbPqkqjZL?Z$Se@22_JwS#ktZ$z{UrRPxVCv&C;ZSk__yIo;ptg0cS3Up$ N002ovPDHLkV1gKO)A|4a diff --git a/src/main/resources/assets/serverstorage/textures/item/head_diamond.png b/src/main/resources/assets/serverstorage/textures/item/head_diamond.png index 9d31b0ded96229884292b577a01c5bcb35047a33..797e42f81bf61ceec6bc5c11ef663bb3d5d787f5 100644 GIT binary patch literal 419 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNp1!W^FW6bw*;x&r z@*D*U`FXlHhHzX@7D#AdQe)O=4rEb#@`xdILx+=O&P&#SuxQmO2OnB;pPChSlOZvr zO2bKFj4ri!;z<)e_f;l9a@f zRIB8oR3OD*WME{XYhb2pWD;UvX=Pw;WoW8xU|?lnU}i4EiJ~DlKP5A*5=Dc#m8qqb zi3LQ%Z`J4kpau=N4JDbmsl_FUxdl)?=DG$zOUyx*7(gvieLM3uP!EHrtDnm{r-UW| DX1sZ) delta 327 zcmV-N0l5C71J(kN7=H)`0000V^Z#K00004VQb$4nuFf3k0003HNkl zf;F{#q;3Se`$1i<*<@J}Yrax!T&&FB3SU#}qm)^pdpP`TBX9|f|WE9<$c zjbBy*t)yr@S6gQ%0K8w{@@@Bd>s;o)P<1$v^<4Q;pmM7%Ny;*vlhq6h0WVI^6Lm?& zbV*OIPe++den5@%R6hz78!wkAF@Q0~EIYOr&hi1k;$I%`9_F=4qgm*0sPwz44hM;K ZegI^YfScB$O6C9n002ovPDHLkV1nfnm8<{& diff --git a/src/main/resources/assets/serverstorage/textures/item/head_gold.png b/src/main/resources/assets/serverstorage/textures/item/head_gold.png index a55243f2583e677c4f6367c600baa4f44b463811..801a6d0ec97ff8661bb00580ffdd568840258643 100644 GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN^mS!_!Op_Y&T9CS=O|Ff!_&nvgyVX$ zKtcnP8>>dMCx==J%jA@hCZhT68Kn)sj8%i>BQ;SOy ka|@t)%ykWbmY9PqF))SbQGGk}Hc$_Pr>mdKI;Vst0Q(JdA^-pY delta 232 zcmVf;u8vy`;(vdMma+1ES(A7HcIUFpaGkHjK2J>Q*pke3?=Ed$V_d7-3R*Q&Q zLnJys-}Jgaru)nFGwrPcbA*VfC>tenQ8s^f7ZI7|?zj~Jd#K{9I9MD`w-KW4#Y%}% iXjkj~U)$CCXK?^BVYdb?%N&US0000ClS;lP%O?@fb zUa&oDWbr+zKka;B#+l1=uCZQ7ndq)6=k9r8{-!@_>lqd<&hBQ^ocq};VzbIw!)xWO z53HJOzcOd3vMoH5tMmJ8#lDUQY<-pLj-PIYivjIYEpd$~Nl7e8wMs5Z1yT$~21X{j z24=cOCLsovRtDx)Mh4mj237_JuNq8zQ8eV{r(~v8qG&L;GPSfav4Cj!tr{Hw)Sv;k sp(HamwYVfPw*acgT-N|-i8;s;15=0|)weTm1NAU?y85}Sb4q9e0PdJ=$p8QV delta 221 zcmV<303!e10`38j8Gi-<001BJ|6u?C00DDSM?wIu&K&6g005{-L_t(Ijipk-4a6V} zbE?~=nU4`*i%!5uW(ziOKi8^9=~c9rcmyJ2Cq~X$c#E8~Bt0UUjs?l*YDh|wMoH{S zfxFwe{fz1A;jx{~#)iB8PkUizMp7vy)LKDO^E|`Mx|X^Y+*aLctpI>!Sx`zDx3p!0 zf^W_!*?7mAWNGa`gjB!j!`)de6Ap`+UknRZF-CpIRmyy3SIO3QC`vL$~ X64#uBitS8s00000NkvXXu0mjfH`!tP diff --git a/src/main/resources/assets/serverstorage/textures/item/head_netherite.png b/src/main/resources/assets/serverstorage/textures/item/head_netherite.png index 951c2275d0fb42584cd47d8d1353378992c207da..e68f291853430e4b4bc8a3b9de2b1d06db05eea3 100644 GIT binary patch literal 410 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN*?#^>S3s< z_5c6>Jk}{QfhrhFg8YIR9G=}s196hP-Ca08-dy?y$YC$>^mS!_!Op_Y&T9CS=O|Ff z!_&nvgyVX$KtcnPnnZV`pxTlb43mo+jUrr_7pze*-0{g|Mv*EjhqH|?)1d?rp4^5F zEW$nu+z#qI(%7(~fy1=iL3E=8(7`iGI5^V({ptjosaoP1QIe8al4_M)lnSI6j0}uS zbPddOjZ8ueEUgU8t&EJc4GgRd3~J?7Q&2SI=BH$)RibDxw=%V~GO>VY_^lcp0MwuX tx1l66H?_DVF}DD!$6VI{Xo)$<5(86+9@V!qZv*u(c)I$ztaD0e0s!6jaWnt` delta 350 zcmV-k0iphy1MLEk7=H)`0000V^Z#K00004VQb$4nuFf3k0003eNklu<@G$VErkZRWI!YEr9-HeFKxmd0e7-b9L w+v{ck2`LsBma8Q7zAtpGoR%Y8&NFqs0DJUmo^h=kpa1{>07*qoM6N<$f&}`Uod5s; diff --git a/src/main/resources/assets/serverstorage/textures/item/module_bus.png b/src/main/resources/assets/serverstorage/textures/item/module_bus.png new file mode 100644 index 0000000000000000000000000000000000000000..e6c4b4ef6cba5d778f977a293300fe07bd1b6414 GIT binary patch literal 377 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN0 zg8YIR9G=}s196hP-CbCJZQWgyxrLY+cKj9i@afRL$w2L@ zC9V-ADTyViR>?)FK#IZ0z{o_`z+BhBIKnC}Q!>*k z(KVP^nV3K{BqrB512t&CZ79jiO)V}-%q>9ZF$pm+w*nzkh#u9qGj9X+FnGH9xvX#1v?8nJFDSSo})maNKY5X5RU7~ z0xe8zimIxq%BrfaY>KJM!s)5X0*7zjJi>A$z$lE(6rNP+o;(S%S3w^>m^QbNoOGyaIQL~h@_0BDJ7iEBhjN@7W> zRdP`(kYX@0Ff!3KFxNFO4l%T_GPbZXu+%m%ure@soi)1*MMG|WN@iLmx&|{V6BCGr x#N--hpau=N4JDbmsl_FUxdjM4CLspqRv=^w(WCly=53%J22WQ%mvv4FO#mXJa&77X_Sjv&UE5Vs&Nn>nRY^U4et*Eyb< zVtl04(!oOOOt0IU_aFD}-MhcWz*tx5_~GLX)eSRqwY#zurWeVss8`rgZ@IQn`S&NY z|NsA&S|z>$n#foZ&pIuorRs9)$l3LQJ_$n zr;B5V#O2)nw|vb89IlzHd#^-pU3cz#{iUn?Ya+{>eiRlpI=o{qx@UgoEMs*&mtdx~ zMib}T-`53_O%5vdT(+5(*STd$VqDNJ_XduPy9bp51Z%G^<(fF>bF#|&HQRrPG;dXF zDx6p9D*0RA#ow`{BX{?!`9GMHU$YgT-@JV}&;_a`t`Q|Ei6yC4$wjF^iowXh$VAt` zT-U%j#L&XZ*uu)xRNKJ7%D^B+>p#d#2o1UUDVb@N=o-wdOiUme5|eA3ff_X6Hk4%M lrWThZ<`y9In1mRZTY(VN64kdeZv*u(c)I$ztaD0e0svxNsh9u& literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/module_display.png b/src/main/resources/assets/serverstorage/textures/item/module_display.png new file mode 100644 index 0000000000000000000000000000000000000000..a37ec09d3673e6126eb821ec2252da6e6f3dc02b GIT binary patch literal 380 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNKJ|0Vx7TY|ILWkFavgIhl6gY~xHFjxzL95DkgRHO@c{8gLs*GILXlOA>Pn5PD2P49u-S$P}VS_3g~tKs^keu6{1- HoD!MQKHa3oC#uEWXL19iw3=HMnV&T&_9P$7fuUg_7QIe8al4_M)lnSI6 zj0}uSbPddP4U9t!Ev$?!tqhE`4GgRd4A|B$*@U7YH$NpatrA^>nU#qNL_=b7jWbY# r2Hb{{%-q!ClEmBsgdUR+19K}7GKJ_-eLM3uP!EHrtDnm{r-UW|JezU) literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/module_filtering.png b/src/main/resources/assets/serverstorage/textures/item/module_filtering.png new file mode 100644 index 0000000000000000000000000000000000000000..a762cff1c50fbf581d42efa83246f0a9c7de5fe7 GIT binary patch literal 403 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNxvqh6 zh@pj*v4xd^k+y+>m4U&_-19vs8glbfGSe#2HJDkMm_RfnCf7IvHE6(XD9OxCEiOsS hEkNio2{ACY0wGg~9@V!qZv*u(c)I$ztaD0e0sz8Waq<8F literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/module_inventory.png b/src/main/resources/assets/serverstorage/textures/item/module_inventory.png new file mode 100644 index 0000000000000000000000000000000000000000..809adcb491a64ab68e64cc3652719ff5f876c106 GIT binary patch literal 571 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZOz7_=LCu>7X_Sjvz)ORZ)FqQ5_{g4LM#d1pzZn z31>Y?M?IO%9XY#tiw;k%-_cRDtG8rjY4q}%w2jTVtLk%S7RJuZ^!@+;e~@j*rmFOr z$sQZ3lD0G!WjdMcZqJ#YAjehDSxK-l z%&x-U?Dr?LUj=odK&LR41o;IsI6S+N2I3@nySs?hTwEaulk~Dp**d;?nFoOL5)Ds}1%= zKjG$Uc>K@G6#EUUeL_Po*0xwmn3Yv!VxP3Bd#T$*-I4$cL-MYY5=q9i4; zB-JXpC>2OC7#SFu=o*;o8W@KdT38udSeck=8yHv_7_4ac{{uxsZhlH;S|z#$GbgTe~DWM4fp1-() literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/module_pagination.png b/src/main/resources/assets/serverstorage/textures/item/module_pagination.png new file mode 100644 index 0000000000000000000000000000000000000000..a1ccf5e341b015b3eac43fff9831d7d77b771f47 GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN21szhGx!XJ=dSCbk|Z@8~g&y4BpvKZgPA3`jUgI|B@>`tR1`pJ{AudS#~^N{6D+;^S*cIBCkzZ`Q}tg z;ubqQpM7P5jK>ZgyaqH+wZt`|BqgyV)hf9t6-Y4{85o)98kp-E7>5{ISQ%Sb8JcSw z7+4t?l>dLQ6-7gCeoAIqCAtPPD-#olhQ#C=XP^cRxD6$lxv9k^iMa&`JtiRr=2jqN W2GJwJ+Uy3@!{F)a=d#Wzp$PytR&;y- literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/module_pcb.png b/src/main/resources/assets/serverstorage/textures/item/module_pcb.png new file mode 100644 index 0000000000000000000000000000000000000000..3d1b7044e46bb1aa8eedfa9011a167c738ad4623 GIT binary patch literal 359 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNCd21szhGx!XJ=dSCbk|Zq~ht~7{YNqS)hf9O;Ob# zV2Pr$z?mSClm-q>BL>N1r`(Qt@G$5a@qJ4E-royUuUg_7QIe8al4_M)lnSI6j0}uS zbPddP4U9t!Ev$^qt&AH$NpatrA^>nU#qNL_=b7jWbY#2Hb{{ n%-q!ClEmBsgdUR+19K}7GK1(5VQqE;>S6G7^>bP0l+XkK+aq6j literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/module_transport.png b/src/main/resources/assets/serverstorage/textures/item/module_transport.png new file mode 100644 index 0000000000000000000000000000000000000000..6466115d4420d24b7e62382ed335b3fbafaac894 GIT binary patch literal 406 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPN4M~_M@apTlTZ|P2a#FMC@DXr-!AuyTs zppL5}TgL2OC7#SFu=o*;o z8W@KdT38tak%_i}ft7&)i_zau6b-rgDVb@N=o-wdOrRPPlWUxT8Z_WGlw{_n7MCRE g79jMPgcz7xfsh%*5)syBH=rH{Pgg&ebxsLQ0C5j$1poj5 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/pcb.png b/src/main/resources/assets/serverstorage/textures/item/pcb.png new file mode 100644 index 0000000000000000000000000000000000000000..ac5995d22d2ce59502582058dad7bded7ffbfaee GIT binary patch literal 323 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx93dtTpz6=aiY77hwEes65fIYrZn!F z6d;Ga#M9T6{RKMHcLda!)?x3$fCIh8a zOI#yLQW8s2t&)pUffR$0fsu)>fw``MafqR%m4Shkv5_{AG%zr5G?z!wkei>9nO2Eg ygQHCUVxR^MxD6$lxv9k^iMa&`JtiRr=2jqN2C+nhwb>1*hr!d;&t;ucLK6UDtx*5~ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/pcb_substrate.png b/src/main/resources/assets/serverstorage/textures/item/pcb_substrate.png new file mode 100644 index 0000000000000000000000000000000000000000..05e04ae003198d552ea090fc82b086f60621d5b6 GIT binary patch literal 313 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrOULb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZOn1_=LD}1Tp^q|9|t-XLUdk#w2fd7smfgy7zz_ z_7YEDSN0d|EbQ!TE8fJ`1BG}zT^vI=t|uob@B(=T42;KDwe|s7swJ)wB`Jv|saDBF zsX&Us$iT=%*T7uYz&OOn(8|!%%G6TZz`)AD;Om=?02B?m`6-!cmAEyuY&3WS)Sv;k pp(HamwYVfPw*aBXB*ehn3WUrcmWZ%6y8-nuc)I$ztaD0e0ssvkPfh>; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/serverstorage/textures/item/platter_diamond.png b/src/main/resources/assets/serverstorage/textures/item/platter_diamond.png index 2c5c7ac73a807274a9c35bf6e07a0ec93736d2c3..53b9dc8ae9eb544c5c07752b4dae1e9a10d77276 100644 GIT binary patch literal 469 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNs{a4~fA#-2ueUcB{(d2~ zYPrnBS(39)=K)nPmIV0)GdMiEkp|)`*1ajC*Jbhi+U$C>Vv$L&u6I%}y zYW8$-4B@z*oRE+pV3f$vyg_BMh``x6#W&BUF{Dfh=i1#mm6`RF@$A?mr-daftfW|P z7+Fb4%<9#ZkdW%_mGp^Wl8~4Y8zXt=QX|i_EkSKxE*Y`0ZU0ojHf_QNmNfHlcD8L_ zxHuvz9ro5f5S#V%WA?I!?OBv>50d)e_f;l9a@f zRIB8oR3OD*WME{XYhb2pWD;UvX=Pw;Wn`jlU|?lnAa`CM4n;$5eoAIqC5i?MpgJo< zGl&My6E#ly$pF$Y;<0M#SH+Uy3@!{F)a=d#Wzp$Pz} CIE?22 delta 431 zcmV;g0Z{(c1HA)~7=H)`0000V^Z#K00004VQb$4nuFf3k0004ZNkl zBuWBC7z^Fy_PjXV&c63{_RWJiRp_*3^9sxwLNey)gJ! z2!PsbAhp>*^3A#wI&Jg1CVOEZUKm&+sVLbrU*G?TKQaZN>SS$foZJ|X0Qh_!8*+PP z1OMils*|<81fT%&&AK&K#&rOA+VNEse1Fxorh3`iS1RAE%k=iax>(%a;$?4NMSJ;X zT{5o2sMWFmrhkpn)sx9wr<1TsM8qHVjX{;P!=_qNNdie&<%NN0b1G?vyRR{g@rcV@ zQ6-V%SaaEvi5V-t?|2?G79b4}9ZS2NaUHb5!_yP|VgF~HF>DIpGFMd59VZ0|>@XcJ ztSKV^m_|~Nzz&nfS^`?+{;Es5;*xP4Gsz=U{9&JRX(-(y!*3Fks?cf6$Jx0#zg@Hv ZvENTM3XTyK{Fwj%002ovPDHLkV1kHU#~=Uz diff --git a/src/main/resources/assets/serverstorage/textures/item/platter_gold.png b/src/main/resources/assets/serverstorage/textures/item/platter_gold.png index 899817726b5966c06b6e275b55d19cb26776248a..7db0ab88e3d69fed8de5824c33ac6ed30d79f002 100644 GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFvNcITwWnidMV_;}#VPNI z_creV1rD21#zqTwT*GhV6_tzO6PyRgr{_Qj47Ypt! z)kjSa0Rg9W zH00)|WTsW3Xs`gPvobV;Xz)Bya|NhD18ze}W^QV6Nn&mRRFAo?0nie2kR=9CJtC~l QZa_T@p00i_>zopr0Kln<*Z=?k delta 362 zcmV-w0hRu+1Nj1w7=H)`0000V^Z#K00004VQb$4nuFf3k0003qNkl0=S62WSx)jpO z7M)oFL_`1}y$mYwp{oXv0XWA807#cK5$KDEhOa9~FPqpN=juE(`8p5ryg4Dmpf4g) zfsc>79X{U%oLxU+=u$K9-1eAk(sbspm7<`TdGA}G z;)F`NBtE*07r)1MCjWv^r((Ww42$#g&d#?5U{;l5o$Q^pKiHVMShe!dv;Y7A07*qo IM6N<$f>^YlD*ylh diff --git a/src/main/resources/assets/serverstorage/textures/item/platter_iron.png b/src/main/resources/assets/serverstorage/textures/item/platter_iron.png index 0da70f02c14cf2be3f0642c956ec14d41a1da93b..662afb0a25148a6e7adec0b5dc404bd803ff6313 100644 GIT binary patch literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx*Bp9q_EZ7UAm`Z~Df*BafCZDwc@shmVT^Rni z_n+AhgnPbB5^tN{BFTR4m_?GH=AsJ$MH%*-Eb%O z0;c}eg&L)f>`Dfw)i0g7`uvsYf=Qev9d|8dU$nfqP~Fe$;=k$n+?i^9+Hwh!2~t}_ z%ZieE+>XZNmxs7^zdc#>Wx?8Wnfq(P*NARi7ZMusHzRlZoq67$zn@sN@I+oq&u`g_&EIC9V-ADTyViR>?)FK#IZ0z{o_`z)aW3B*ehd%D~*p z$Wq(Dz{V dH2_*-4zk1msz-#i*$t?N!PC{xWt~$(69A~Pg0uht delta 284 zcmV+%0ptFI1FQm&8Gi-<001BJ|6u?C00DDSM?wIu&K&6g008DmL_t(Ijg3>m5riNN zT&@}HNbBJ52mcme1q{{jOuDdxy;m4expQZD7?Mpkiw*;jq^j2MX`0+q-YqC1ETsSd z=6Oa-@04Y_92FjAV`OA)X>F*f z_5c5WsfjmOfGQYEg8YIR9G=}s196hP-Ca08-dy?y$YC$>^mS!_!Op_Y&bH!BY&}q@ z!PCVtgyVX0LPCN-P#OdC#Dv6PfwQxoW#vdQr0kfsdzZy71A`5#r>tIKnW_O~uyYx( zOL7}*nc8V!Fr$sjh=og)!L&t+*;L%Xz+hJkgKNVv&y);<4J_Q!8@S3$3^p+Ka+~_G zpK9*mW|TT{fXT#9nK32O-Q8XK$gjQ<1xALQ|HaZ?PjKJ^x<$3bHKHUXu_V85lIg+NYyv$jwj5OshoEU;$KTWoQP`;CZ6v w3Q&Uv+=i0O+|=Td#M}a?9&=p-pe5!YOAMfTL|B{MfO;4_UHx3vIVCg!01?WAiU0rr delta 491 zcmVvxYJ5OS$pX`G#g%J8WRv* z>a?=LyF>PUq-}g4koU{;Jo%pYeGOhf%WKNav;eS7i{q1HBY%&#blCEmvRSJUUWZJQ z2{L`eD82^3DLWi}KAO|K$`+l2j@z5PuKJE#CnZ3?nFkpRcog|K6 z_Lsv?hXz1Ziq`;)7iP@8`L`NJ>)hGhL7^@f*bdm*zjRSj1#0ZvCF zqu%fY(#27@I6q&?%>VCdN^?2=t}nqj;Ndo=-tbWG*~}%oI5(xGaqVnv%i@{BqBz%J h(MV-J`*xPg{Rc*4&JjwRLQVhx002ovPDHLkV1le^@16hv diff --git a/src/main/resources/data/serverstorage/loot_table/blocks/bus_connector.json b/src/main/resources/data/serverstorage/loot_table/blocks/bus_connector.json new file mode 100644 index 0000000..f088231 --- /dev/null +++ b/src/main/resources/data/serverstorage/loot_table/blocks/bus_connector.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "serverstorage:bus_connector" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/loot_table/blocks/inventory_interface.json b/src/main/resources/data/serverstorage/loot_table/blocks/inventory_interface.json new file mode 100644 index 0000000..c2bc5d4 --- /dev/null +++ b/src/main/resources/data/serverstorage/loot_table/blocks/inventory_interface.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "serverstorage:inventory_interface" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/bus_connector.json b/src/main/resources/data/serverstorage/recipe/bus_connector.json new file mode 100644 index 0000000..6b9c65d --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/bus_connector.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "BBC", + "BRG", + "BBP" + ], + "key": { + "C": { + "item": "serverstorage:cpu" + }, + "G": { + "item": "minecraft:gold_nugget" + }, + "P": { + "item": "serverstorage:pcb" + }, + "R": { + "item": "minecraft:redstone_block" + }, + "B": { + "item": "serverstorage:module_bus" + } + }, + "result": { + "id": "serverstorage:bus_connector", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/cpu.json b/src/main/resources/data/serverstorage/recipe/cpu.json new file mode 100644 index 0000000..d754ee8 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/cpu.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "GSG", + "SPS", + "GSG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "P": { + "item": "minecraft:amethyst_shard" + }, + "S": { + "item": "serverstorage:cpu_substrate" + } + }, + "result": { + "id": "serverstorage:cpu", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/cpu_substrate.json b/src/main/resources/data/serverstorage/recipe/cpu_substrate.json new file mode 100644 index 0000000..2dfbf72 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/cpu_substrate.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + " D ", + "AAA", + "AAA" + ], + "key": { + "D": { + "item": "minecraft:light_gray_dye" + }, + "A": { + "item": "minecraft:amethyst_shard" + } + }, + "result": { + "id": "serverstorage:cpu_substrate", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/diamond_drive.json b/src/main/resources/data/serverstorage/recipe/diamond_drive.json index 1391ca3..c809698 100644 --- a/src/main/resources/data/serverstorage/recipe/diamond_drive.json +++ b/src/main/resources/data/serverstorage/recipe/diamond_drive.json @@ -1,17 +1,25 @@ { - "type": "minecraft:crafting_shapeless", + "type": "minecraft:crafting_shaped", "category": "misc", - "ingredients": [ - { + "pattern": [ + "CPC", + "CPC", + "HXH" + ], + "key": { + "H": { "item": "serverstorage:diamond_head" }, - { + "P": { "item": "serverstorage:diamond_platter" }, - { + "C": { "item": "serverstorage:drive_casing" + }, + "X": { + "item": "serverstorage:drive_controller" } - ], + }, "result": { "id": "serverstorage:diamond_drive", "count": 1 diff --git a/src/main/resources/data/serverstorage/recipe/drive_container.json b/src/main/resources/data/serverstorage/recipe/drive_container.json index b11cef5..ca29769 100644 --- a/src/main/resources/data/serverstorage/recipe/drive_container.json +++ b/src/main/resources/data/serverstorage/recipe/drive_container.json @@ -2,22 +2,25 @@ "type": "minecraft:crafting_shaped", "category": "misc", "pattern": [ - "IDR", - "DCD", - "RDI" + "DDB", + "DRC", + "DDP" ], "key": { - "D": { - "item": "minecraft:diamond" + "C": { + "item": "serverstorage:cpu" + }, + "P": { + "item": "serverstorage:pcb" }, "R": { - "item": "minecraft:redstone" + "item": "minecraft:redstone_block" }, - "C": { - "item": "minecraft:chest" + "D": { + "item": "serverstorage:module_drive" }, - "I": { - "item": "minecraft:iron_ingot" + "B": { + "item": "serverstorage:module_bus" } }, "result": { diff --git a/src/main/resources/data/serverstorage/recipe/drive_controller.json b/src/main/resources/data/serverstorage/recipe/drive_controller.json new file mode 100644 index 0000000..7d48117 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/drive_controller.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "GGG", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + } + }, + "result": { + "id": "serverstorage:drive_controller", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/golden_drive.json b/src/main/resources/data/serverstorage/recipe/golden_drive.json index 438dde1..0bc4b53 100644 --- a/src/main/resources/data/serverstorage/recipe/golden_drive.json +++ b/src/main/resources/data/serverstorage/recipe/golden_drive.json @@ -1,17 +1,25 @@ { - "type": "minecraft:crafting_shapeless", + "type": "minecraft:crafting_shaped", "category": "misc", - "ingredients": [ - { + "pattern": [ + "CPC", + "CPC", + "HXH" + ], + "key": { + "H": { "item": "serverstorage:golden_head" }, - { + "P": { "item": "serverstorage:golden_platter" }, - { + "C": { "item": "serverstorage:drive_casing" + }, + "X": { + "item": "serverstorage:drive_controller" } - ], + }, "result": { "id": "serverstorage:golden_drive", "count": 1 diff --git a/src/main/resources/data/serverstorage/recipe/inventory_interface.json b/src/main/resources/data/serverstorage/recipe/inventory_interface.json new file mode 100644 index 0000000..949d9d4 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/inventory_interface.json @@ -0,0 +1,39 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "CBH", + "SUG", + "SPF" + ], + "key": { + "P": { + "item": "serverstorage:pcb" + }, + "U": { + "item": "serverstorage:cpu" + }, + "C": { + "item": "serverstorage:module_container" + }, + "B": { + "item": "serverstorage:module_bus" + }, + "H": { + "item": "minecraft:hopper" + }, + "S": { + "item": "minecraft:chest" + }, + "G": { + "item": "serverstorage:module_configuration" + }, + "F": { + "item": "serverstorage:module_filtering" + } + }, + "result": { + "id": "serverstorage:inventory_interface", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/iron_drive.json b/src/main/resources/data/serverstorage/recipe/iron_drive.json index a1ebc70..a9a1324 100644 --- a/src/main/resources/data/serverstorage/recipe/iron_drive.json +++ b/src/main/resources/data/serverstorage/recipe/iron_drive.json @@ -1,17 +1,25 @@ { - "type": "minecraft:crafting_shapeless", + "type": "minecraft:crafting_shaped", "category": "misc", - "ingredients": [ - { + "pattern": [ + "CPC", + "CPC", + "HXH" + ], + "key": { + "H": { "item": "serverstorage:iron_head" }, - { + "P": { "item": "serverstorage:iron_platter" }, - { + "C": { "item": "serverstorage:drive_casing" + }, + "X": { + "item": "serverstorage:drive_controller" } - ], + }, "result": { "id": "serverstorage:iron_drive", "count": 1 diff --git a/src/main/resources/data/serverstorage/recipe/module_bus.json b/src/main/resources/data/serverstorage/recipe/module_bus.json new file mode 100644 index 0000000..5d02929 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_bus.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "AIA", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + }, + "I": { + "item": "minecraft:iron_ingot" + }, + "A": { + "item": "minecraft:gold_ingot" + } + }, + "result": { + "id": "serverstorage:module_bus", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_configuration.json b/src/main/resources/data/serverstorage/recipe/module_configuration.json new file mode 100644 index 0000000..bceb293 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_configuration.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "I I", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + }, + "I": { + "item": "minecraft:iron_ingot" + } + }, + "result": { + "id": "serverstorage:module_configuration", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_container.json b/src/main/resources/data/serverstorage/recipe/module_container.json new file mode 100644 index 0000000..d5defb7 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_container.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "HHH", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + }, + "H": { + "item": "minecraft:chest" + } + }, + "result": { + "id": "serverstorage:module_container", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_display.json b/src/main/resources/data/serverstorage/recipe/module_display.json new file mode 100644 index 0000000..10c42c5 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_display.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "DDD", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + }, + "D": { + "item": "minecraft:gray_stained_glass" + } + }, + "result": { + "id": "serverstorage:module_display", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_drive.json b/src/main/resources/data/serverstorage/recipe/module_drive.json new file mode 100644 index 0000000..127fcd1 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_drive.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "GGG", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + } + }, + "result": { + "id": "serverstorage:module_drive", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_filtering.json b/src/main/resources/data/serverstorage/recipe/module_filtering.json new file mode 100644 index 0000000..8994d46 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_filtering.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "ILI", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + }, + "L": { + "item": "minecraft:glass" + }, + "I": { + "item": "minecraft:iron_ingot" + } + }, + "result": { + "id": "serverstorage:module_filtering", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_inventory.json b/src/main/resources/data/serverstorage/recipe/module_inventory.json new file mode 100644 index 0000000..3fe7c3f --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_inventory.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "IHI", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + }, + "H": { + "item": "minecraft:chest" + }, + "I": { + "item": "minecraft:iron_ingot" + } + }, + "result": { + "id": "serverstorage:module_inventory", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_pagination.json b/src/main/resources/data/serverstorage/recipe/module_pagination.json new file mode 100644 index 0000000..6f08576 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_pagination.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "SSS", + "ICI", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + }, + "I": { + "item": "minecraft:iron_ingot" + } + }, + "result": { + "id": "serverstorage:module_pagination", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_pcb.json b/src/main/resources/data/serverstorage/recipe/module_pcb.json new file mode 100644 index 0000000..f193f49 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_pcb.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "SSS", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + } + }, + "result": { + "id": "serverstorage:module_pcb", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/module_transport.json b/src/main/resources/data/serverstorage/recipe/module_transport.json new file mode 100644 index 0000000..6318df3 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/module_transport.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "HHH", + "SCS", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:gold_nugget" + }, + "C": { + "item": "serverstorage:cpu" + }, + "S": { + "item": "serverstorage:pcb_substrate" + }, + "H": { + "item": "minecraft:hopper" + } + }, + "result": { + "id": "serverstorage:module_transport", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/netherite_drive.json b/src/main/resources/data/serverstorage/recipe/netherite_drive.json index 293719c..b17a8fe 100644 --- a/src/main/resources/data/serverstorage/recipe/netherite_drive.json +++ b/src/main/resources/data/serverstorage/recipe/netherite_drive.json @@ -1,17 +1,25 @@ { - "type": "minecraft:crafting_shapeless", + "type": "minecraft:crafting_shaped", "category": "misc", - "ingredients": [ - { + "pattern": [ + "CPC", + "CPC", + "HXH" + ], + "key": { + "H": { "item": "serverstorage:netherite_head" }, - { + "P": { "item": "serverstorage:netherite_platter" }, - { + "C": { "item": "serverstorage:drive_casing" + }, + "X": { + "item": "serverstorage:drive_controller" } - ], + }, "result": { "id": "serverstorage:netherite_drive", "count": 1 diff --git a/src/main/resources/data/serverstorage/recipe/pcb.json b/src/main/resources/data/serverstorage/recipe/pcb.json new file mode 100644 index 0000000..a049966 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/pcb.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "GGG", + "GPG", + "GGG" + ], + "key": { + "G": { + "item": "minecraft:lime_dye" + }, + "P": { + "item": "serverstorage:pcb_substrate" + } + }, + "result": { + "id": "serverstorage:pcb", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/pcb_substrate.json b/src/main/resources/data/serverstorage/recipe/pcb_substrate.json new file mode 100644 index 0000000..f076c73 --- /dev/null +++ b/src/main/resources/data/serverstorage/recipe/pcb_substrate.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + " G ", + "AAA", + "AAA" + ], + "key": { + "G": { + "item": "minecraft:green_dye" + }, + "A": { + "item": "minecraft:amethyst_shard" + } + }, + "result": { + "id": "serverstorage:pcb_substrate", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/serverstorage/recipe/storage.json b/src/main/resources/data/serverstorage/recipe/storage.json index 56cffd8..ce50af5 100644 --- a/src/main/resources/data/serverstorage/recipe/storage.json +++ b/src/main/resources/data/serverstorage/recipe/storage.json @@ -2,19 +2,37 @@ "type": "minecraft:crafting_shaped", "category": "redstone", "pattern": [ - "DRD", - "RCR", - "DRD" + "DFC", + "PBO", + "ILX" ], "key": { - "D": { - "item": "minecraft:diamond" + "L": { + "item": "minecraft:diamond_block" }, - "R": { - "item": "minecraft:redstone" + "D": { + "item": "serverstorage:module_display" + }, + "F": { + "item": "serverstorage:module_filtering" }, "C": { - "item": "minecraft:chest" + "item": "serverstorage:module_configuration" + }, + "P": { + "item": "serverstorage:module_pagination" + }, + "B": { + "item": "serverstorage:module_bus" + }, + "I": { + "item": "serverstorage:module_inventory" + }, + "X": { + "item": "serverstorage:cpu" + }, + "O": { + "item": "serverstorage:pcb" } }, "result": {