Fix some stuff, crafting is broken
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| plugins { | ||||
|     id 'fabric-loom' version '1.6-SNAPSHOT' | ||||
|     id 'fabric-loom' version '1.8-SNAPSHOT' | ||||
|     id 'maven-publish' | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -3,19 +3,19 @@ org.gradle.jvmargs=-Xmx1G | ||||
| # Fabric Properties | ||||
| # check these on https://modmuss50.me/fabric.html | ||||
|  | ||||
| minecraft_version=1.21.1 | ||||
| yarn_mappings=1.21.1+build.3 | ||||
| loader_version=0.16.0 | ||||
| minecraft_version=1.21.3 | ||||
| yarn_mappings=1.21.3+build.2 | ||||
| loader_version=0.16.8 | ||||
|  | ||||
| # Fabric API | ||||
| fabric_version=0.102.1+1.21.1 | ||||
| fabric_version=0.107.0+1.21.3 | ||||
|  | ||||
| # Mod Properties | ||||
| mod_version=3.2.9 | ||||
| mod_version=3.3.0 | ||||
| maven_group=systems.brn | ||||
| archives_base_name=Serverstorage | ||||
|  | ||||
| # Dependencies | ||||
| polymer_version=0.9.9+1.21 | ||||
| server_translations_api_version=2.3.1+1.21-pre2 | ||||
| servergui_version=1.6.0+1.21 | ||||
| polymer_version=0.10.1+1.21.3 | ||||
| server_translations_api_version=2.4.0+1.21.2-rc1 | ||||
| servergui_version=1.7.2+1.21.2 | ||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| distributionBase=GRADLE_USER_HOME | ||||
| distributionPath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip | ||||
| networkTimeout=10000 | ||||
| validateDistributionUrl=true | ||||
| zipStoreBase=GRADLE_USER_HOME | ||||
|   | ||||
| @@ -56,7 +56,7 @@ public class ServerStorage implements ModInitializer { | ||||
|     public static BlockEntityType<InventoryInterfaceBlockEntity> INVENTORY_INTERFACE_BLOCK_ENTITY; | ||||
|  | ||||
|     public static final GameRules.Key<GameRules.BooleanRule> ServerStorage_Crafting_Enable = | ||||
|             GameRuleRegistry.register("serverstorage_crafting_module", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true)); | ||||
|             GameRuleRegistry.register("serverstorage_crafting_module", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(false)); | ||||
|  | ||||
|     public static final GameRules.Key<GameRules.BooleanRule> ServerStorage_Terminal_Enable = | ||||
|             GameRuleRegistry.register("serverstorage_terminal_module", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true)); | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import net.minecraft.inventory.Inventory; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.nbt.NbtCompound; | ||||
| import net.minecraft.registry.RegistryWrapper; | ||||
| import net.minecraft.server.world.ServerWorld; | ||||
| import net.minecraft.state.property.EnumProperty; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| import net.minecraft.util.math.Direction; | ||||
| @@ -107,7 +108,7 @@ public class InventoryInterfaceBlockEntity extends BlockEntity { | ||||
|     } | ||||
|  | ||||
|     public int processIncoming(ItemStack stack, int count) { | ||||
|         if (world != null && world.getGameRules().getBoolean(ServerStorage_Interface_Enable) && isOutput && filterItem(stack.getItem(), query)) { | ||||
|         if (world != null && ((ServerWorld) world).getGameRules().getBoolean(ServerStorage_Interface_Enable) && isOutput && filterItem(stack.getItem(), query)) { | ||||
|             BlockPos targetedPos = pos.offset(direction); | ||||
|             BlockEntity targetedBlockEntity = world.getBlockEntity(targetedPos); | ||||
|             EnumProperty<ConnectionType> connectionType = getPropertyForDirection(direction); | ||||
| @@ -124,7 +125,7 @@ public class InventoryInterfaceBlockEntity extends BlockEntity { | ||||
|     } | ||||
|  | ||||
|     public static <T extends BlockEntity> void tick(World world, BlockPos blockPos, BlockState ignoredState, T ignoredt) { | ||||
|         if (!world.getGameRules().getBoolean(ServerStorage_Interface_Enable)) { | ||||
|         if (!((ServerWorld) world).getGameRules().getBoolean(ServerStorage_Interface_Enable)) { | ||||
|             return; | ||||
|         } | ||||
|         InventoryInterfaceBlockEntity blockEntity = (InventoryInterfaceBlockEntity) world.getBlockEntity(blockPos); | ||||
|   | ||||
| @@ -7,7 +7,10 @@ import eu.pb4.polymer.blocks.api.PolymerTexturedBlock; | ||||
| import net.minecraft.block.*; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.util.Identifier; | ||||
| import xyz.nucleoid.packettweaker.PacketContext; | ||||
|  | ||||
| import static systems.brn.serverstorage.ServerStorage.*; | ||||
|  | ||||
| @@ -27,14 +30,14 @@ public class BusConnectorBlock extends ConnectedBlock implements PolymerTextured | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public BlockState getPolymerBlockState(BlockState state) { | ||||
|     public BlockState getPolymerBlockState(BlockState state, PacketContext packetContext) { | ||||
|         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)); | ||||
|                 new BusConnectorBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL).registryKey(RegistryKey.of(RegistryKeys.BLOCK, modId)), modId)); | ||||
|         BUS_CONNECTOR_BLOCK.setDefaultState(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -16,6 +16,7 @@ import net.minecraft.util.Identifier; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| import net.minecraft.util.math.Direction; | ||||
| import net.minecraft.world.World; | ||||
| import net.minecraft.world.block.WireOrientation; | ||||
| import systems.brn.serverstorage.lib.ConnectionType; | ||||
|  | ||||
| import java.util.HashMap; | ||||
| @@ -92,9 +93,9 @@ public class ConnectedBlock extends SimplePolymerBlock { | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) { | ||||
|     public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, WireOrientation wireOrientation, boolean notify) { | ||||
|         updateBlockState(world, pos, state); | ||||
|         super.neighborUpdate(state, world, pos, block, fromPos, notify); | ||||
|         super.neighborUpdate(state, world, pos, block, wireOrientation, notify); | ||||
|     } | ||||
|  | ||||
|     private BlockState updateState(BlockState state, World world, BlockPos pos) { | ||||
|   | ||||
| @@ -3,15 +3,17 @@ package systems.brn.serverstorage.blocks; | ||||
| import eu.pb4.polymer.blocks.api.PolymerTexturedBlock; | ||||
| import eu.pb4.polymer.core.api.block.PolymerBlockUtils; | ||||
| import net.fabricmc.fabric.api.event.player.UseBlockCallback; | ||||
| import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; | ||||
| import net.minecraft.block.*; | ||||
| import net.minecraft.block.entity.BlockEntity; | ||||
| import net.minecraft.block.entity.BlockEntityType; | ||||
| import net.minecraft.entity.player.PlayerEntity; | ||||
| import net.minecraft.item.ItemPlacementContext; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.state.StateManager; | ||||
| import net.minecraft.state.property.DirectionProperty; | ||||
| import net.minecraft.state.property.EnumProperty; | ||||
| import net.minecraft.util.ActionResult; | ||||
| import net.minecraft.util.Hand; | ||||
| import net.minecraft.util.Identifier; | ||||
| @@ -23,6 +25,7 @@ import net.minecraft.world.World; | ||||
| import org.jetbrains.annotations.Nullable; | ||||
| import systems.brn.serverstorage.blockentities.HardDriveContainerBlockEntity; | ||||
| import systems.brn.serverstorage.lib.StorageNetwork; | ||||
| import xyz.nucleoid.packettweaker.PacketContext; | ||||
|  | ||||
| import java.util.HashMap; | ||||
|  | ||||
| @@ -31,7 +34,7 @@ import static systems.brn.serverstorage.ServerStorage.*; | ||||
| public class HardDriveContainerBlock extends ConnectedBlock implements PolymerTexturedBlock, BlockEntityProvider { | ||||
|  | ||||
|     final Identifier identifier; | ||||
|     public static final DirectionProperty FACING = FacingBlock.FACING; | ||||
|     public static final EnumProperty<Direction> FACING = FacingBlock.FACING; | ||||
|     private final HashMap<Direction, BlockState> rotations; | ||||
|  | ||||
|     public HardDriveContainerBlock(AbstractBlock.Settings settings, Identifier identifier) { | ||||
| @@ -53,7 +56,7 @@ public class HardDriveContainerBlock extends ConnectedBlock implements PolymerTe | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public BlockState getPolymerBlockState(BlockState state) { | ||||
|     public BlockState getPolymerBlockState(BlockState state, PacketContext context) { | ||||
|         Direction direction = state.get(FACING); | ||||
|         return rotations.get(direction); | ||||
|     } | ||||
| @@ -61,7 +64,7 @@ public class HardDriveContainerBlock extends ConnectedBlock implements PolymerTe | ||||
|     public static void register() { | ||||
|         var modId = id(HARD_DRIVE_CONTAINER_BLOCK_MODEL_ID); | ||||
|         HARD_DRIVE_CONTAINER_BLOCK = Registry.register(Registries.BLOCK, modId, | ||||
|                 new HardDriveContainerBlock(Settings.copy(Blocks.WHITE_WOOL), modId)); | ||||
|                 new HardDriveContainerBlock(Settings.copy(Blocks.WHITE_WOOL).registryKey(RegistryKey.of(RegistryKeys.BLOCK, modId)), modId)); | ||||
|         UseBlockCallback.EVENT.register(HardDriveContainerBlock::onUse); | ||||
|  | ||||
|         HARD_DRIVE_CONTAINER_BLOCK.setDefaultState(); | ||||
| @@ -69,7 +72,7 @@ public class HardDriveContainerBlock extends ConnectedBlock implements PolymerTe | ||||
|         HARD_DRIVE_CONTAINER_BLOCK_ENTITY = Registry.register( | ||||
|                 Registries.BLOCK_ENTITY_TYPE, | ||||
|                 modId, | ||||
|                 BlockEntityType.Builder.create(HardDriveContainerBlockEntity::new, HARD_DRIVE_CONTAINER_BLOCK).build(null) | ||||
|                 FabricBlockEntityTypeBuilder.create(HardDriveContainerBlockEntity::new, HARD_DRIVE_CONTAINER_BLOCK).build(null) | ||||
|         ); | ||||
|         PolymerBlockUtils.registerBlockEntity(HARD_DRIVE_CONTAINER_BLOCK_ENTITY); | ||||
|     } | ||||
|   | ||||
| @@ -4,6 +4,7 @@ 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.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; | ||||
| import net.minecraft.block.*; | ||||
| import net.minecraft.block.entity.BlockEntity; | ||||
| import net.minecraft.block.entity.BlockEntityTicker; | ||||
| @@ -13,10 +14,12 @@ import net.minecraft.item.ItemPlacementContext; | ||||
| import net.minecraft.item.Items; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| 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.state.property.EnumProperty; | ||||
| import net.minecraft.text.Text; | ||||
| import net.minecraft.util.ActionResult; | ||||
| import net.minecraft.util.Formatting; | ||||
| @@ -31,6 +34,7 @@ import systems.brn.serverstorage.blockentities.InventoryInterfaceBlockEntity; | ||||
| import systems.brn.serverstorage.lib.PagedGui; | ||||
| import systems.brn.serverstorage.screens.SearchScreen; | ||||
| import systems.brn.serverstorage.screens.SettingsScreen; | ||||
| import xyz.nucleoid.packettweaker.PacketContext; | ||||
|  | ||||
| import java.util.HashMap; | ||||
|  | ||||
| @@ -39,7 +43,7 @@ import static systems.brn.serverstorage.lib.PagedGui.*; | ||||
|  | ||||
| public class InventoryInterfaceBlock extends ConnectedBlock implements PolymerTexturedBlock, BlockEntityProvider { | ||||
|     final Identifier identifier; | ||||
|     public static final DirectionProperty FACING = FacingBlock.FACING; | ||||
|     public static final EnumProperty<Direction> FACING = FacingBlock.FACING; | ||||
|     private final HashMap<Direction, BlockState> rotations; | ||||
|  | ||||
|     public InventoryInterfaceBlock(Settings settings, Identifier identifier) { | ||||
| @@ -61,7 +65,7 @@ public class InventoryInterfaceBlock extends ConnectedBlock implements PolymerTe | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public BlockState getPolymerBlockState(BlockState state) { | ||||
|     public BlockState getPolymerBlockState(BlockState state, PacketContext packetContext) { | ||||
|         Direction direction = state.get(FACING); | ||||
|         return rotations.get(direction); | ||||
|     } | ||||
| @@ -69,14 +73,15 @@ public class InventoryInterfaceBlock extends ConnectedBlock implements PolymerTe | ||||
|     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)); | ||||
|                 new InventoryInterfaceBlock(Settings.copy(Blocks.WHITE_WOOL).registryKey(RegistryKey.of(RegistryKeys.BLOCK, modId)), 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) | ||||
|                 FabricBlockEntityTypeBuilder.create(InventoryInterfaceBlockEntity::new, INVENTORY_INTERFACE_BLOCK).build(null) | ||||
|         ); | ||||
|         INVENTORY_INTERFACE_BLOCK_ENTITY.addSupportedBlock(INVENTORY_INTERFACE_BLOCK); | ||||
|         PolymerBlockUtils.registerBlockEntity(INVENTORY_INTERFACE_BLOCK_ENTITY); | ||||
|     } | ||||
|  | ||||
| @@ -150,7 +155,7 @@ public class InventoryInterfaceBlock extends ConnectedBlock implements PolymerTe | ||||
|         Block block = state.getBlock(); | ||||
|  | ||||
|         if (block instanceof InventoryInterfaceBlock) { | ||||
|             if (!world.getGameRules().getBoolean(ServerStorage_Interface_Enable)) { | ||||
|             if (!((ServerWorld) world).getGameRules().getBoolean(ServerStorage_Interface_Enable)) { | ||||
|                 playerEntity.sendMessage(Text.translatable("message.serverstorage.block_disabled"), true); | ||||
|                 return ActionResult.PASS; | ||||
|             } | ||||
|   | ||||
| @@ -3,18 +3,20 @@ package systems.brn.serverstorage.blocks; | ||||
| import eu.pb4.polymer.blocks.api.PolymerTexturedBlock; | ||||
| import eu.pb4.polymer.core.api.block.PolymerBlockUtils; | ||||
| import net.fabricmc.fabric.api.event.player.UseBlockCallback; | ||||
| import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; | ||||
| import net.minecraft.block.*; | ||||
| import net.minecraft.block.entity.BlockEntity; | ||||
| import net.minecraft.block.entity.BlockEntityType; | ||||
| import net.minecraft.entity.player.PlayerEntity; | ||||
| import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemPlacementContext; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.server.network.ServerPlayerEntity; | ||||
| import net.minecraft.state.StateManager; | ||||
| import net.minecraft.state.property.DirectionProperty; | ||||
| import net.minecraft.state.property.EnumProperty; | ||||
| import net.minecraft.util.ActionResult; | ||||
| import net.minecraft.util.Hand; | ||||
| import net.minecraft.util.Identifier; | ||||
| @@ -29,6 +31,7 @@ import systems.brn.serverstorage.items.WirelessTerminalItem; | ||||
| import systems.brn.serverstorage.lib.SessionStorageClass; | ||||
| import systems.brn.serverstorage.lib.WirelessTerminalComponents; | ||||
| import systems.brn.serverstorage.screens.RadioBlockPlayerMangementScreen; | ||||
| import xyz.nucleoid.packettweaker.PacketContext; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| @@ -40,7 +43,7 @@ import static systems.brn.serverstorage.lib.Util.removePosition; | ||||
|  | ||||
| public class RadioInterfaceBlock extends ConnectedBlock implements PolymerTexturedBlock, BlockEntityProvider { | ||||
|     final Identifier identifier; | ||||
|     public static final DirectionProperty FACING = FacingBlock.FACING; | ||||
|     public static final EnumProperty<Direction> FACING = FacingBlock.FACING; | ||||
|     private final HashMap<Direction, BlockState> rotations; | ||||
|  | ||||
|     public RadioInterfaceBlock(Settings settings, Identifier identifier) { | ||||
| @@ -63,7 +66,7 @@ public class RadioInterfaceBlock extends ConnectedBlock implements PolymerTextur | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public BlockState getPolymerBlockState(BlockState state) { | ||||
|     public BlockState getPolymerBlockState(BlockState state, PacketContext packetContext) { | ||||
|         Direction direction = state.get(FACING); | ||||
|         return rotations.get(direction); | ||||
|     } | ||||
| @@ -71,7 +74,7 @@ public class RadioInterfaceBlock extends ConnectedBlock implements PolymerTextur | ||||
|     public static void register() { | ||||
|         var modId = id(RADIO_INTERFACE_BLOCK_MODEL_ID); | ||||
|         RADIO_INTERFACE_BLOCK = Registry.register(Registries.BLOCK, modId, | ||||
|                 new RadioInterfaceBlock(Settings.copy(Blocks.WHITE_WOOL), modId)); | ||||
|                 new RadioInterfaceBlock(Settings.copy(Blocks.WHITE_WOOL).registryKey(RegistryKey.of(RegistryKeys.BLOCK, modId)), modId)); | ||||
|         UseBlockCallback.EVENT.register(RadioInterfaceBlock::onUse); | ||||
|  | ||||
|         RADIO_INTERFACE_BLOCK.setDefaultState(); | ||||
| @@ -79,8 +82,9 @@ public class RadioInterfaceBlock extends ConnectedBlock implements PolymerTextur | ||||
|         RADIO_INTERFACE_BLOCK_ENTITY = Registry.register( | ||||
|                 Registries.BLOCK_ENTITY_TYPE, | ||||
|                 modId, | ||||
|                 BlockEntityType.Builder.create(RadioInterfaceBlockEntity::new, RADIO_INTERFACE_BLOCK).build(null) | ||||
|                 FabricBlockEntityTypeBuilder.create(RadioInterfaceBlockEntity::new, RADIO_INTERFACE_BLOCK).build(null) | ||||
|         ); | ||||
|         RADIO_INTERFACE_BLOCK_ENTITY.addSupportedBlock(RADIO_INTERFACE_BLOCK); | ||||
|         PolymerBlockUtils.registerBlockEntity(RADIO_INTERFACE_BLOCK_ENTITY); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -3,9 +3,9 @@ package systems.brn.serverstorage.blocks; | ||||
| import eu.pb4.polymer.blocks.api.PolymerTexturedBlock; | ||||
| import eu.pb4.polymer.core.api.block.PolymerBlockUtils; | ||||
| import net.fabricmc.fabric.api.event.player.UseBlockCallback; | ||||
| import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; | ||||
| import net.minecraft.block.*; | ||||
| import net.minecraft.block.entity.BlockEntity; | ||||
| import net.minecraft.block.entity.BlockEntityType; | ||||
| import net.minecraft.component.DataComponentTypes; | ||||
| import net.minecraft.component.type.WrittenBookContentComponent; | ||||
| import net.minecraft.entity.player.PlayerEntity; | ||||
| @@ -14,9 +14,12 @@ import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.item.Items; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| 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.state.property.EnumProperty; | ||||
| import net.minecraft.text.RawFilteredPair; | ||||
| import net.minecraft.text.Text; | ||||
| import net.minecraft.util.ActionResult; | ||||
| @@ -29,6 +32,7 @@ import net.minecraft.world.World; | ||||
| import org.jetbrains.annotations.Nullable; | ||||
| import systems.brn.serverstorage.blockentities.StorageInterfaceBlockEntity; | ||||
| import systems.brn.serverstorage.screens.StorageScreen; | ||||
| import xyz.nucleoid.packettweaker.PacketContext; | ||||
|  | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| @@ -38,7 +42,7 @@ import static systems.brn.serverstorage.lib.Util.generateBookContent; | ||||
|  | ||||
| public class StorageInterfaceBlock extends ConnectedBlock implements PolymerTexturedBlock, BlockEntityProvider { | ||||
|     final Identifier identifier; | ||||
|     public static final DirectionProperty FACING = FacingBlock.FACING; | ||||
|     public static final EnumProperty<Direction> FACING = FacingBlock.FACING; | ||||
|     private final HashMap<Direction, BlockState> rotations; | ||||
|  | ||||
|     public StorageInterfaceBlock(Settings settings, Identifier identifier) { | ||||
| @@ -60,7 +64,7 @@ public class StorageInterfaceBlock extends ConnectedBlock implements PolymerText | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public BlockState getPolymerBlockState(BlockState state) { | ||||
|     public BlockState getPolymerBlockState(BlockState state, PacketContext packetContext) { | ||||
|         Direction direction = state.get(FACING); | ||||
|         return rotations.get(direction); | ||||
|     } | ||||
| @@ -68,14 +72,15 @@ public class StorageInterfaceBlock extends ConnectedBlock implements PolymerText | ||||
|     public static void register() { | ||||
|         var modId = id(STORAGE_MODEL_ID); | ||||
|         STORAGE_INTERFACE_BLOCK = Registry.register(Registries.BLOCK, modId, | ||||
|                 new StorageInterfaceBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL), modId)); | ||||
|                 new StorageInterfaceBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL).registryKey(RegistryKey.of(RegistryKeys.BLOCK, modId)), modId)); | ||||
|         UseBlockCallback.EVENT.register(StorageInterfaceBlock::onUse); | ||||
|         STORAGE_INTERFACE_BLOCK.setDefaultState(); | ||||
|         STORAGE_INTERFACE_BLOCK_ENTITY = Registry.register( | ||||
|                 Registries.BLOCK_ENTITY_TYPE, | ||||
|                 modId, | ||||
|                 BlockEntityType.Builder.create(StorageInterfaceBlockEntity::new, STORAGE_INTERFACE_BLOCK).build(null) | ||||
|                 FabricBlockEntityTypeBuilder.create(StorageInterfaceBlockEntity::new, STORAGE_INTERFACE_BLOCK).build(null) | ||||
|         ); | ||||
|         STORAGE_INTERFACE_BLOCK_ENTITY.addSupportedBlock(STORAGE_INTERFACE_BLOCK); | ||||
|         PolymerBlockUtils.registerBlockEntity(STORAGE_INTERFACE_BLOCK_ENTITY); | ||||
|     } | ||||
|  | ||||
| @@ -85,7 +90,7 @@ public class StorageInterfaceBlock extends ConnectedBlock implements PolymerText | ||||
|         Block block = state.getBlock(); | ||||
|  | ||||
|         if (block instanceof StorageInterfaceBlock) { | ||||
|             if (!world.getGameRules().getBoolean(ServerStorage_Terminal_Enable)){ | ||||
|             if (!((ServerWorld) world).getGameRules().getBoolean(ServerStorage_Terminal_Enable)){ | ||||
|                 player.sendMessage(Text.translatable("message.serverstorage.block_disabled"), true); | ||||
|                 return ActionResult.PASS; | ||||
|             } | ||||
|   | ||||
| @@ -5,6 +5,8 @@ import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemGroups; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.util.Identifier; | ||||
| import systems.brn.serverstorage.lib.DriveComponents; | ||||
|  | ||||
| @@ -25,7 +27,7 @@ public class HardDriveItem extends SimpleItem { | ||||
|             Identifier identifier = id(tier + "_drive"); | ||||
|             Item item = Registry.register(Registries.ITEM, identifier, new SimpleItem(new Settings() | ||||
|                     .maxCount(1) | ||||
|                     .component(DriveComponents.ITEMSTACK_MAP, new HashMap<>()) | ||||
|                     .component(DriveComponents.ITEMSTACK_MAP, new HashMap<>()).registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)) | ||||
|                     , identifier)); | ||||
|             ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item)); | ||||
|             items.add(item); | ||||
|   | ||||
| @@ -2,7 +2,6 @@ package systems.brn.serverstorage.items; | ||||
|  | ||||
| import eu.pb4.polymer.core.api.item.PolymerBlockItem; | ||||
| import eu.pb4.polymer.core.api.item.PolymerItem; | ||||
| 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.block.Block; | ||||
| @@ -12,33 +11,34 @@ import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.item.Items; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.server.network.ServerPlayerEntity; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.util.Identifier; | ||||
| import org.jetbrains.annotations.Nullable; | ||||
| import xyz.nucleoid.packettweaker.PacketContext; | ||||
|  | ||||
| import static systems.brn.serverstorage.ServerStorage.id; | ||||
|  | ||||
| public class SimpleBlockItem extends PolymerBlockItem implements PolymerItem { | ||||
|     private final PolymerModelData polymerModel; | ||||
|     private final Identifier polymerModel; | ||||
|  | ||||
|     public SimpleBlockItem(Item.Settings settings, Block block, Identifier identifier) { | ||||
|         super(block, settings, Items.BARRIER); | ||||
|         this.polymerModel = PolymerResourcePackUtils.requestModel(Items.BARRIER, identifier.withPath("item/" + identifier.getPath())); | ||||
|         this.polymerModel = PolymerResourcePackUtils.getBridgedModelId(identifier.withPath("item/" + identifier.getPath())); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity player) { | ||||
|         return this.polymerModel.item(); | ||||
|     public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { | ||||
|         return this.polymerModel; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public int getPolymerCustomModelData(ItemStack itemStack, @Nullable ServerPlayerEntity player) { | ||||
|         return this.polymerModel.value(); | ||||
|     public Item getPolymerItem(ItemStack itemStack, PacketContext player) { | ||||
|         return Items.BARRIER; | ||||
|     } | ||||
|  | ||||
|     public static void register(Block block) { | ||||
|         Identifier identifier = id(block.getRegistryEntry().registryKey().getValue().getPath()); | ||||
|         Item item = Registry.register(Registries.ITEM, identifier, new SimpleBlockItem(new Item.Settings(), block, identifier)); | ||||
|         Item item = Registry.register(Registries.ITEM, identifier, new SimpleBlockItem(new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)), block, identifier)); | ||||
|         ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item)); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,16 +2,18 @@ package systems.brn.serverstorage.items; | ||||
|  | ||||
| import eu.pb4.polymer.core.api.item.PolymerItem; | ||||
| 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.*; | ||||
| import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemGroup; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.item.Items; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.server.network.ServerPlayerEntity; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.util.Identifier; | ||||
| import org.jetbrains.annotations.Nullable; | ||||
| import xyz.nucleoid.packettweaker.PacketContext; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| @@ -19,21 +21,21 @@ import java.util.List; | ||||
| import static systems.brn.serverstorage.ServerStorage.id; | ||||
|  | ||||
| public class SimpleItem extends SimplePolymerItem implements PolymerItem { | ||||
|     private final PolymerModelData polymerModel; | ||||
|     private final Identifier polymerModel; | ||||
|  | ||||
|     public SimpleItem(Settings settings, Identifier identifier) { | ||||
|         super(settings, Items.STICK); | ||||
|         this.polymerModel = PolymerResourcePackUtils.requestModel(Items.STICK, identifier.withPath("item/" + identifier.getPath())); | ||||
|         this.polymerModel = PolymerResourcePackUtils.getBridgedModelId(identifier.withPath("item/" + identifier.getPath())); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity player) { | ||||
|         return this.polymerModel.item(); | ||||
|     public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { | ||||
|         return this.polymerModel; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public int getPolymerCustomModelData(ItemStack itemStack, @Nullable ServerPlayerEntity player) { | ||||
|         return this.polymerModel.value(); | ||||
|     public Item getPolymerItem(ItemStack itemStack, PacketContext player) { | ||||
|         return Items.STICK; | ||||
|     } | ||||
|  | ||||
|     public static Item register(String name, RegistryKey<ItemGroup> group){ | ||||
| @@ -42,7 +44,7 @@ public class SimpleItem extends SimplePolymerItem implements PolymerItem { | ||||
|  | ||||
|     public static Item register(String name, int maxCount, RegistryKey<ItemGroup> group) { | ||||
|         Identifier identifier = id(name); | ||||
|         Item item = Registry.register(Registries.ITEM, identifier, new SimpleItem(new Settings().maxCount(maxCount), identifier)); | ||||
|         Item item = Registry.register(Registries.ITEM, identifier, new SimpleItem(new Settings().maxCount(maxCount).registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)), identifier)); | ||||
|         ItemGroupEvents.modifyEntriesEvent(group).register(content -> content.add(item)); | ||||
|         return item; | ||||
|     } | ||||
|   | ||||
| @@ -10,6 +10,8 @@ import net.minecraft.item.ItemGroups; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.server.MinecraftServer; | ||||
| import net.minecraft.server.network.ServerPlayerEntity; | ||||
| import net.minecraft.server.world.ServerWorld; | ||||
| @@ -45,6 +47,7 @@ public class WirelessTerminalItem extends SimpleItem { | ||||
|                         .component(WirelessTerminalComponents.SORT_ALPHABETICALLY, false) | ||||
|                         .component(WirelessTerminalComponents.QUERY_STRING, "") | ||||
|                         .component(WirelessTerminalComponents.PAGE, 0) | ||||
|                         .registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)) | ||||
|                 , identifier)); | ||||
|         ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item)); | ||||
|         return item; | ||||
|   | ||||
| @@ -7,6 +7,8 @@ import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemGroups; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.text.Text; | ||||
| import net.minecraft.util.Identifier; | ||||
| import systems.brn.serverstorage.items.SimpleItem; | ||||
| @@ -34,7 +36,7 @@ public class Antenna extends SimpleItem { | ||||
|         for (String tier : tiers) { | ||||
|             Identifier identifier = id(tier + "_antenna"); | ||||
|             Item item = Registry.register(Registries.ITEM, identifier, new Antenna(new Settings() | ||||
|                     .maxCount(1) | ||||
|                     .maxCount(1).registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)) | ||||
|                     , identifier, range)); | ||||
|             ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item)); | ||||
|             items.add(item); | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| package systems.brn.serverstorage.lib; | ||||
|  | ||||
| import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.recipe.CraftingRecipe; | ||||
| import net.minecraft.recipe.RecipeEntry; | ||||
| @@ -33,11 +32,12 @@ public class CraftingEntry { | ||||
|         for (Map.Entry<ItemStack, Integer> entry : inputs.entrySet()) { | ||||
|             ItemStack stackIn = entry.getKey(); | ||||
|             Integer count = entry.getValue(); | ||||
|             if (count > 0 && stackIn.isEmpty() && stackIn.getItem().hasRecipeRemainder()) { | ||||
|                 Item remainderItem = stackIn.getItem().getRecipeRemainder(); | ||||
|                 if (remainderItem != null) { | ||||
|                     ItemStack remainderStack = new ItemStack(stackIn.getItem().getRecipeRemainder(), count); | ||||
|                     tempOutputStacks.add(remainderStack); | ||||
|             if (count > 0 && stackIn.isEmpty() && stackIn.getItem().getRecipeRemainder() != null) { | ||||
|                 ItemStack remainderStack = stackIn.getItem().getRecipeRemainder(); | ||||
|                 if (!remainderStack.isEmpty()) { | ||||
|                     ItemStack remainderStackNew = remainderStack.copy(); | ||||
|                     remainderStackNew.setCount(count); | ||||
|                     tempOutputStacks.add(remainderStackNew); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|   | ||||
| @@ -5,27 +5,27 @@ import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.server.network.ServerPlayerEntity; | ||||
| import net.minecraft.server.world.ServerWorld; | ||||
| import net.minecraft.util.ActionResult; | ||||
| import net.minecraft.util.Hand; | ||||
| import net.minecraft.util.TypedActionResult; | ||||
| import net.minecraft.world.World; | ||||
| import systems.brn.serverstorage.items.WirelessTerminalItem; | ||||
|  | ||||
| import static systems.brn.serverstorage.ServerStorage.WIRELESS_TERMINAL; | ||||
|  | ||||
| public class EventHandler { | ||||
|     public static TypedActionResult<ItemStack> onItemUse(PlayerEntity playerEntity, World worldTemp, Hand hand) { | ||||
|     public static ActionResult onItemUse(PlayerEntity playerEntity, World worldTemp, Hand hand) { | ||||
|         ItemStack itemStack = playerEntity.getStackInHand(hand); | ||||
|         Item item = itemStack.getItem(); | ||||
|         if (!worldTemp.isClient) { | ||||
|             if (playerEntity instanceof ServerPlayerEntity player) { | ||||
|                 if (worldTemp instanceof ServerWorld world) { | ||||
|                     if (item == WIRELESS_TERMINAL) { | ||||
|                         return WirelessTerminalItem.useItem(world, player, itemStack) ? TypedActionResult.success(itemStack) : TypedActionResult.pass(itemStack); | ||||
|                         return WirelessTerminalItem.useItem(world, player, itemStack) ? ActionResult.SUCCESS : ActionResult.PASS; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return TypedActionResult.pass(itemStack); | ||||
|         return ActionResult.PASS; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -187,7 +187,7 @@ public abstract class PagedGui extends SimpleGui { | ||||
|             if (gui.canNextPage()) { | ||||
|                 return DisplayElement.of( | ||||
|                         new GuiElementBuilder(Items.PLAYER_HEAD) | ||||
|                                 .setName(Text.translatable("createWorld.customize.custom.next").formatted(Formatting.WHITE)) | ||||
|                                 .setName(Text.translatable("spectatorMenu.next_page").formatted(Formatting.WHITE)) | ||||
|                                 .hideDefaultTooltip().noDefaults() | ||||
|                                 .setSkullOwner(GUI_NEXT_PAGE) | ||||
|                                 .setCallback((x, y, z) -> { | ||||
| @@ -198,7 +198,7 @@ public abstract class PagedGui extends SimpleGui { | ||||
|             } else { | ||||
|                 return DisplayElement.of( | ||||
|                         new GuiElementBuilder(Items.PLAYER_HEAD) | ||||
|                                 .setName(Text.translatable("createWorld.customize.custom.next").formatted(Formatting.DARK_GRAY)) | ||||
|                                 .setName(Text.translatable("spectatorMenu.next_page").formatted(Formatting.DARK_GRAY)) | ||||
|                                 .hideDefaultTooltip().noDefaults() | ||||
|                                 .setSkullOwner(GUI_NEXT_PAGE_BLOCKED) | ||||
|                 ); | ||||
| @@ -209,7 +209,7 @@ public abstract class PagedGui extends SimpleGui { | ||||
|             if (gui.canPreviousPage()) { | ||||
|                 return DisplayElement.of( | ||||
|                         new GuiElementBuilder(Items.PLAYER_HEAD) | ||||
|                                 .setName(Text.translatable("createWorld.customize.custom.prev").formatted(Formatting.WHITE)) | ||||
|                                 .setName(Text.translatable("spectatorMenu.previous_page").formatted(Formatting.WHITE)) | ||||
|                                 .hideDefaultTooltip().noDefaults() | ||||
|                                 .setSkullOwner(GUI_PREVIOUS_PAGE) | ||||
|                                 .setCallback((x, y, z) -> { | ||||
| @@ -220,7 +220,7 @@ public abstract class PagedGui extends SimpleGui { | ||||
|             } else { | ||||
|                 return DisplayElement.of( | ||||
|                         new GuiElementBuilder(Items.PLAYER_HEAD) | ||||
|                                 .setName(Text.translatable("createWorld.customize.custom.prev").formatted(Formatting.DARK_GRAY)) | ||||
|                                 .setName(Text.translatable("spectatorMenu.previous_page").formatted(Formatting.DARK_GRAY)) | ||||
|                                 .hideDefaultTooltip().noDefaults() | ||||
|                                 .setSkullOwner(GUI_PREVIOUS_PAGE_BLOCKED) | ||||
|                 ); | ||||
|   | ||||
| @@ -5,7 +5,12 @@ import net.minecraft.component.DataComponentTypes; | ||||
| import net.minecraft.component.type.LoreComponent; | ||||
| import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.recipe.*; | ||||
| import net.minecraft.recipe.CraftingRecipe; | ||||
| import net.minecraft.recipe.Ingredient; | ||||
| import net.minecraft.recipe.RecipeEntry; | ||||
| import net.minecraft.recipe.ServerRecipeManager; | ||||
| import net.minecraft.recipe.input.CraftingRecipeInput; | ||||
| import net.minecraft.registry.entry.RegistryEntry; | ||||
| import net.minecraft.server.MinecraftServer; | ||||
| import net.minecraft.text.RawFilteredPair; | ||||
| import net.minecraft.text.Style; | ||||
| @@ -130,40 +135,42 @@ public class Util { | ||||
|     } | ||||
|  | ||||
|     public static ArrayList<CraftingEntry> getCraftableRecipes(Map<ItemStack, Integer> itemStackMap, MinecraftServer server) { | ||||
|         RecipeManager recipeManager = server.getRecipeManager(); | ||||
|         List<RecipeEntry<CraftingRecipe>> allRecipes = recipeManager.listAllOfType(RecipeType.CRAFTING); | ||||
|         ServerRecipeManager recipeManager = server.getRecipeManager(); | ||||
|         List<RecipeEntry<?>> allRecipes = (List<RecipeEntry<?>>) recipeManager.values(); | ||||
|  | ||||
|         ArrayList<CraftingEntry> craftingEntries = new ArrayList<>(); | ||||
|  | ||||
|         for (RecipeEntry<CraftingRecipe> recipe : allRecipes) { | ||||
|         for (RecipeEntry<?> recipex : allRecipes) { | ||||
|             if (! (recipex.value() instanceof CraftingRecipe)) { | ||||
|                 continue; | ||||
|             } | ||||
|             RecipeEntry<CraftingRecipe> recipe = (RecipeEntry<CraftingRecipe>) recipex; | ||||
|             int maxAmount = Integer.MAX_VALUE; | ||||
|             boolean canMake = true; | ||||
|             HashMap<ItemStack, Integer> finalInputs = new HashMap<>(); | ||||
|             Map<Item, Integer> ingredientCounts = new HashMap<>(); | ||||
|  | ||||
|             // Count the occurrences of each ingredient in the recipe | ||||
|             for (Ingredient ingredient : recipe.value().getIngredients()) { | ||||
|                 for (ItemStack stack : ingredient.getMatchingStacks()) { | ||||
|                     if (stack.isEmpty()) continue; | ||||
|                     ingredientCounts.put(stack.getItem(), ingredientCounts.getOrDefault(stack.getItem(), 0) + 1); | ||||
|             for (Ingredient ingredient : recipe.value().getIngredientPlacement().getIngredients()) { | ||||
|                 for (RegistryEntry<Item> item : ingredient.getMatchingItems()) { | ||||
|                     ingredientCounts.put(item.value(), ingredientCounts.getOrDefault(item.value(), 0) + 1); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             boolean usesAnyIngredient = false; | ||||
|  | ||||
|             for (Ingredient ingredient : recipe.value().getIngredients()) { | ||||
|             for (Ingredient ingredient : recipe.value().getIngredientPlacement().getIngredients()) { | ||||
|                 int totalAvailable = 0; | ||||
|                 HashMap<ItemStack, Integer> inputsTemp = new HashMap<>(); | ||||
|  | ||||
|                 for (ItemStack stack : ingredient.getMatchingStacks()) { | ||||
|                     if (stack.isEmpty()) continue; | ||||
|                 for (RegistryEntry<Item> item : ingredient.getMatchingItems()) { | ||||
|                     for (Map.Entry<ItemStack, Integer> entry : itemStackMap.entrySet()) { | ||||
|                         ItemStack inventoryStack = entry.getKey(); | ||||
|                         int inventoryCount = entry.getValue(); | ||||
|  | ||||
|                         if (ItemStack.areItemsEqual(stack, inventoryStack)) { | ||||
|                         if (item.value() == inventoryStack.getItem()) { | ||||
|                             totalAvailable += inventoryCount; | ||||
|                             inputsTemp.put(stack, inventoryCount); | ||||
|                             inputsTemp.put(item.value().getDefaultStack(), inventoryCount); | ||||
|                             usesAnyIngredient = true; | ||||
|                         } | ||||
|                     } | ||||
| @@ -173,10 +180,12 @@ public class Util { | ||||
|                     canMake = false; | ||||
|                     break; | ||||
|                 } | ||||
|  | ||||
|                 int requiredCount = ingredient.getMatchingStacks()[0].getCount(); | ||||
|                 int occurrences = ingredientCounts.get(ingredient.getMatchingStacks()[0].getItem()); | ||||
|                 maxAmount = Math.min(maxAmount, totalAvailable / (requiredCount * occurrences)); | ||||
|                 int occurrences = ingredientCounts.getOrDefault(ingredient.getMatchingItems().getFirst(),0); | ||||
|                 if (occurrences == 0) { | ||||
|                     canMake = false; | ||||
|                     break; | ||||
|                 } | ||||
|                 maxAmount = Math.min(maxAmount, totalAvailable / occurrences); | ||||
|  | ||||
|                 for (Map.Entry<ItemStack, Integer> entry : inputsTemp.entrySet()) { | ||||
|                     ItemStack stackIn = entry.getKey(); | ||||
| @@ -186,7 +195,9 @@ public class Util { | ||||
|             } | ||||
|  | ||||
|             if (canMake && maxAmount > 0 && usesAnyIngredient) { | ||||
|                 ItemStack outputItem = recipe.value().getResult(server.getRegistryManager()).copy(); | ||||
|                 List<ItemStack> stacks = finalInputs.keySet().stream().toList(); | ||||
|                 CraftingRecipeInput input = CraftingRecipeInput.create(stacks.size(), 1, stacks); | ||||
|                 ItemStack outputItem = recipe.value().craft(input, server.getRegistryManager()).copy(); | ||||
|                 CraftingEntry finalEntry = new CraftingEntry(outputItem, recipe, finalInputs, maxAmount); | ||||
|                 craftingEntries.add(finalEntry); | ||||
|             } | ||||
|   | ||||
| @@ -4,11 +4,14 @@ 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.Item; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.item.Items; | ||||
| import net.minecraft.recipe.CraftingRecipe; | ||||
| import net.minecraft.recipe.Ingredient; | ||||
| import net.minecraft.recipe.RecipeEntry; | ||||
| import net.minecraft.recipe.input.CraftingRecipeInput; | ||||
| import net.minecraft.registry.entry.RegistryEntry; | ||||
| import net.minecraft.text.Text; | ||||
| import net.minecraft.util.Formatting; | ||||
| import systems.brn.serverstorage.blockentities.StorageInterfaceBlockEntity; | ||||
| @@ -108,7 +111,7 @@ public class CraftingScreen extends PagedGui implements Searchable { | ||||
|  | ||||
|     private boolean canCraft(RecipeEntry<CraftingRecipe> recipeEntry) { | ||||
|         reindexDrives(); | ||||
|         for (Ingredient ingredient : recipeEntry.value().getIngredients()) { | ||||
|         for (Ingredient ingredient : recipeEntry.value().getIngredientPlacement().getIngredients()) { | ||||
|             if (findMatchingStack(ingredient) == null) { | ||||
|                 return false; | ||||
|             } | ||||
| @@ -121,7 +124,7 @@ public class CraftingScreen extends PagedGui implements Searchable { | ||||
|         ArrayList<ItemStack> stacksToRemove = new ArrayList<>(); | ||||
|  | ||||
|         // Check and remove ingredients for one crafting operation | ||||
|         for (Ingredient ingredient : recipeEntry.value().getIngredients()) { | ||||
|         for (Ingredient ingredient : recipeEntry.value().getIngredientPlacement().getIngredients()) { | ||||
|             ItemStack stackToRemove = findMatchingStack(ingredient); | ||||
|             if (stackToRemove == null) { | ||||
|                 return false; // Unable to find required ingredient | ||||
| @@ -135,7 +138,7 @@ public class CraftingScreen extends PagedGui implements Searchable { | ||||
|         } | ||||
|  | ||||
|         // Add crafted item to the appropriate inventory | ||||
|         ItemStack outputStack = recipeEntry.value().getResult(storageScreen.getPlayer().getRegistryManager()).copy(); | ||||
|         ItemStack outputStack = recipeEntry.value().craft(CraftingRecipeInput.create(stacksToRemove.size(), 1, stacksToRemove), storageScreen.getPlayer().getRegistryManager()).copy(); | ||||
|  | ||||
|         if (toPlayerInventory) { | ||||
|             PlayerInventory playerInventory = player.getInventory(); | ||||
| @@ -164,9 +167,10 @@ public class CraftingScreen extends PagedGui implements Searchable { | ||||
|             ItemStack playerStack = playerInventory.getStack(i); | ||||
|             if (ingredient.test(playerStack)) { | ||||
|                 ItemStack stackToRemove = playerStack.copy(); | ||||
|                 for (ItemStack matchingStack : ingredient.getMatchingStacks()) { | ||||
|                     if (matchingStack.getItem() == stackToRemove.getItem()) { | ||||
|                         stackToRemove.setCount(matchingStack.getCount()); // Set count to ingredient requirement | ||||
|                 for (RegistryEntry<Item> matchingItemx : ingredient.getMatchingItems()) { | ||||
|                     Item matchingItem = matchingItemx.value(); | ||||
|                     if (matchingItem == stackToRemove.getItem()) { | ||||
|                         stackToRemove.setCount(1); // Set count to ingredient requirement | ||||
|                         break; | ||||
|                     } | ||||
|                 } | ||||
| @@ -175,10 +179,11 @@ public class CraftingScreen extends PagedGui implements Searchable { | ||||
|         } | ||||
|  | ||||
|         // Check storage network | ||||
|         for (ItemStack stack : ingredient.getMatchingStacks()) { | ||||
|             if (this.storageScreen.getNetwork().canRemove(stack)) { | ||||
|                 ItemStack stackToRemove = stack.copy(); | ||||
|                 stackToRemove.setCount(ingredient.getMatchingStacks()[0].getCount()); // Set count to ingredient requirement | ||||
|         for (RegistryEntry<Item> itemx : ingredient.getMatchingItems()) { | ||||
|             Item item = itemx.value(); | ||||
|             if (this.storageScreen.getNetwork().canRemove(item.getDefaultStack())) { | ||||
|                 ItemStack stackToRemove = item.getDefaultStack(); | ||||
|                 stackToRemove.setCount(1); // Set count to ingredient requirement | ||||
|                 return stackToRemove; | ||||
|             } | ||||
|         } | ||||
|   | ||||
| @@ -379,7 +379,7 @@ public class StorageScreen extends PagedGui implements Searchable { | ||||
|  | ||||
|     @Override | ||||
|     protected DisplayElement crafting() { | ||||
|         if (world != null && world.getGameRules().getBoolean(ServerStorage_Crafting_Enable)) { | ||||
|         if (world != null && ((ServerWorld) world).getGameRules().getBoolean(ServerStorage_Crafting_Enable)) { | ||||
|             return DisplayElement.of( | ||||
|                     new GuiElementBuilder(Items.PLAYER_HEAD) | ||||
|                             .setName(Text.translatable("container.crafting").formatted(Formatting.WHITE)) | ||||
|   | ||||
| @@ -7,21 +7,11 @@ | ||||
|     "BBP" | ||||
|   ], | ||||
|   "key": { | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "serverstorage:material_pcb" | ||||
|     }, | ||||
|     "R": { | ||||
|       "item": "minecraft:redstone_block" | ||||
|     }, | ||||
|     "B": { | ||||
|       "item": "serverstorage:module_bus" | ||||
|     } | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "P": "serverstorage:material_pcb", | ||||
|     "R": "minecraft:redstone_block", | ||||
|     "B": "serverstorage:module_bus" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:bus_connector", | ||||
|   | ||||
| @@ -7,15 +7,9 @@ | ||||
|     "GSG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "minecraft:amethyst_shard" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_cpu_substrate" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "P": "minecraft:amethyst_shard", | ||||
|     "S": "serverstorage:material_cpu_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:material_cpu", | ||||
|   | ||||
| @@ -7,12 +7,8 @@ | ||||
|     "AAA" | ||||
|   ], | ||||
|   "key": { | ||||
|     "D": { | ||||
|       "item": "minecraft:light_gray_dye" | ||||
|     }, | ||||
|     "A": { | ||||
|       "item": "minecraft:amethyst_shard" | ||||
|     } | ||||
|     "D": "minecraft:light_gray_dye", | ||||
|     "A": "minecraft:amethyst_shard" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:material_cpu_substrate", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     "#  " | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:diamond" | ||||
|     } | ||||
|     "#": "minecraft:diamond" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:diamond_antenna", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "HXH" | ||||
|   ], | ||||
|   "key": { | ||||
|     "H": { | ||||
|       "item": "serverstorage:diamond_head" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "serverstorage:diamond_platter" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_drive_casing" | ||||
|     }, | ||||
|     "X": { | ||||
|       "item": "serverstorage:material_drive_controller" | ||||
|     } | ||||
|     "H": "serverstorage:diamond_head", | ||||
|     "P": "serverstorage:diamond_platter", | ||||
|     "C": "serverstorage:material_drive_casing", | ||||
|     "X": "serverstorage:material_drive_controller" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:diamond_drive", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     " ##" | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:diamond" | ||||
|     } | ||||
|     "#": "minecraft:diamond" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:diamond_head", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     "###" | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:diamond" | ||||
|     } | ||||
|     "#": "minecraft:diamond" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:diamond_platter", | ||||
|   | ||||
| @@ -7,15 +7,9 @@ | ||||
|     "IRI" | ||||
|   ], | ||||
|   "key": { | ||||
|     "I": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     }, | ||||
|     "R": { | ||||
|       "item": "minecraft:redstone" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "minecraft:paper" | ||||
|     } | ||||
|     "I": "minecraft:iron_ingot", | ||||
|     "R": "minecraft:redstone", | ||||
|     "P": "minecraft:paper" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:material_drive_casing", | ||||
|   | ||||
| @@ -7,21 +7,11 @@ | ||||
|     "DDP" | ||||
|   ], | ||||
|   "key": { | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "serverstorage:material_pcb" | ||||
|     }, | ||||
|     "R": { | ||||
|       "item": "minecraft:redstone_block" | ||||
|     }, | ||||
|     "D": { | ||||
|       "item": "serverstorage:module_drive" | ||||
|     }, | ||||
|     "B": { | ||||
|       "item": "serverstorage:module_bus" | ||||
|     } | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "P": "serverstorage:material_pcb", | ||||
|     "R": "minecraft:redstone_block", | ||||
|     "D": "serverstorage:module_drive", | ||||
|     "B": "serverstorage:module_bus" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:drive_container", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "III" | ||||
|   ], | ||||
|   "key": { | ||||
|     "I": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     }, | ||||
|     "X": { | ||||
|       "item": "serverstorage:material_drive_casing" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     } | ||||
|     "I": "minecraft:gold_ingot", | ||||
|     "X": "serverstorage:material_drive_casing", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:material_drive_controller", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     "#  " | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     } | ||||
|     "#": "minecraft:gold_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:golden_antenna", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "HXH" | ||||
|   ], | ||||
|   "key": { | ||||
|     "H": { | ||||
|       "item": "serverstorage:golden_head" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "serverstorage:golden_platter" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_drive_casing" | ||||
|     }, | ||||
|     "X": { | ||||
|       "item": "serverstorage:material_drive_controller" | ||||
|     } | ||||
|     "H": "serverstorage:golden_head", | ||||
|     "P": "serverstorage:golden_platter", | ||||
|     "C": "serverstorage:material_drive_casing", | ||||
|     "X": "serverstorage:material_drive_controller" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:golden_drive", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     " ##" | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     } | ||||
|     "#": "minecraft:gold_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:golden_head", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     "###" | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     } | ||||
|     "#": "minecraft:gold_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:golden_platter", | ||||
|   | ||||
| @@ -7,30 +7,14 @@ | ||||
|     "SPF" | ||||
|   ], | ||||
|   "key": { | ||||
|     "P": { | ||||
|       "item": "serverstorage:material_pcb" | ||||
|     }, | ||||
|     "U": { | ||||
|       "item": "serverstorage:material_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" | ||||
|     } | ||||
|     "P": "serverstorage:material_pcb", | ||||
|     "U": "serverstorage:material_cpu", | ||||
|     "C": "serverstorage:module_container", | ||||
|     "B": "serverstorage:module_bus", | ||||
|     "H": "minecraft:hopper", | ||||
|     "S": "minecraft:chest", | ||||
|     "G": "serverstorage:module_configuration", | ||||
|     "F": "serverstorage:module_filtering" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:inventory_interface", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     "#  " | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     } | ||||
|     "#": "minecraft:iron_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:iron_antenna", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "HXH" | ||||
|   ], | ||||
|   "key": { | ||||
|     "H": { | ||||
|       "item": "serverstorage:iron_head" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "serverstorage:iron_platter" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_drive_casing" | ||||
|     }, | ||||
|     "X": { | ||||
|       "item": "serverstorage:material_drive_controller" | ||||
|     } | ||||
|     "H": "serverstorage:iron_head", | ||||
|     "P": "serverstorage:iron_platter", | ||||
|     "C": "serverstorage:material_drive_casing", | ||||
|     "X": "serverstorage:material_drive_controller" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:iron_drive", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     " ##" | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     } | ||||
|     "#": "minecraft:iron_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:iron_head", | ||||
|   | ||||
| @@ -7,9 +7,7 @@ | ||||
|     "###" | ||||
|   ], | ||||
|   "key": { | ||||
|     "#": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     } | ||||
|     "#": "minecraft:iron_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:iron_platter", | ||||
|   | ||||
| @@ -7,21 +7,11 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "R": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "R": "minecraft:iron_ingot", | ||||
|     "I": "minecraft:gold_ingot", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_antenna", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "R": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "R": "minecraft:iron_ingot", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_antenna_connector", | ||||
|   | ||||
| @@ -7,21 +7,11 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     }, | ||||
|     "A": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "I": "minecraft:iron_ingot", | ||||
|     "A": "minecraft:gold_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_bus", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "I": "minecraft:iron_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_configuration", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "H": { | ||||
|       "item": "minecraft:chest" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "H": "minecraft:chest" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_container", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "D": { | ||||
|       "item": "minecraft:gray_stained_glass" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "D": "minecraft:gray_stained_glass" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_display", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "I": "minecraft:gold_ingot", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_drive", | ||||
|   | ||||
| @@ -7,21 +7,11 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "L": { | ||||
|       "item": "minecraft:glass" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "L": "minecraft:glass", | ||||
|     "I": "minecraft:iron_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_filtering", | ||||
|   | ||||
| @@ -7,21 +7,11 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "H": { | ||||
|       "item": "minecraft:chest" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "H": "minecraft:chest", | ||||
|     "I": "minecraft:iron_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_inventory", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "I": "minecraft:gold_ingot", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_modem", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:iron_ingot" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "I": "minecraft:iron_ingot" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_pagination", | ||||
|   | ||||
| @@ -7,15 +7,9 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_pcb", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "minecraft:gold_ingot" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "I": "minecraft:gold_ingot", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_radio", | ||||
|   | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:gold_nugget" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "H": { | ||||
|       "item": "minecraft:hopper" | ||||
|     } | ||||
|     "G": "minecraft:gold_nugget", | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "H": "minecraft:hopper" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_transport", | ||||
|   | ||||
| @@ -1,16 +1,10 @@ | ||||
| { | ||||
|   "type": "minecraft:smithing_transform", | ||||
|   "addition": { | ||||
|     "item": "minecraft:netherite_ingot" | ||||
|   }, | ||||
|   "base": { | ||||
|     "item": "serverstorage:diamond_antenna" | ||||
|   }, | ||||
|   "addition": "minecraft:netherite_ingot", | ||||
|   "base": "serverstorage:diamond_antenna", | ||||
|   "result": { | ||||
|     "count": 1, | ||||
|     "id": "serverstorage:netherite_antenna" | ||||
|   }, | ||||
|   "template": { | ||||
|     "item": "serverstorage:module_netherite_upgrade" | ||||
|   } | ||||
|   "template": "serverstorage:module_netherite_upgrade" | ||||
| } | ||||
| @@ -7,18 +7,10 @@ | ||||
|     "HXH" | ||||
|   ], | ||||
|   "key": { | ||||
|     "H": { | ||||
|       "item": "serverstorage:netherite_head" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "serverstorage:netherite_platter" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_drive_casing" | ||||
|     }, | ||||
|     "X": { | ||||
|       "item": "serverstorage:material_drive_controller" | ||||
|     } | ||||
|     "H": "serverstorage:netherite_head", | ||||
|     "P": "serverstorage:netherite_platter", | ||||
|     "C": "serverstorage:material_drive_casing", | ||||
|     "X": "serverstorage:material_drive_controller" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:netherite_drive", | ||||
|   | ||||
| @@ -1,16 +1,10 @@ | ||||
| { | ||||
|   "type": "minecraft:smithing_transform", | ||||
|   "addition": { | ||||
|     "item": "minecraft:netherite_ingot" | ||||
|   }, | ||||
|   "base": { | ||||
|     "item": "serverstorage:diamond_head" | ||||
|   }, | ||||
|   "addition": "minecraft:netherite_ingot", | ||||
|   "base": "serverstorage:diamond_head", | ||||
|   "result": { | ||||
|     "count": 1, | ||||
|     "id": "serverstorage:netherite_head" | ||||
|   }, | ||||
|   "template": { | ||||
|     "item": "serverstorage:module_netherite_upgrade" | ||||
|   } | ||||
|   "template": "serverstorage:module_netherite_upgrade" | ||||
| } | ||||
| @@ -1,16 +1,10 @@ | ||||
| { | ||||
|   "type": "minecraft:smithing_transform", | ||||
|   "addition": { | ||||
|     "item": "minecraft:netherite_ingot" | ||||
|   }, | ||||
|   "base": { | ||||
|     "item": "serverstorage:diamond_platter" | ||||
|   }, | ||||
|   "addition": "minecraft:netherite_ingot", | ||||
|   "base": "serverstorage:diamond_platter", | ||||
|   "result": { | ||||
|     "count": 1, | ||||
|     "id": "serverstorage:netherite_platter" | ||||
|   }, | ||||
|   "template": { | ||||
|     "item": "serverstorage:module_netherite_upgrade" | ||||
|   } | ||||
|   "template": "serverstorage:module_netherite_upgrade" | ||||
| } | ||||
| @@ -7,15 +7,9 @@ | ||||
|     "SLS" | ||||
|   ], | ||||
|   "key": { | ||||
|     "C": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "S": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     }, | ||||
|     "L": { | ||||
|       "item": "minecraft:glass" | ||||
|     } | ||||
|     "C": "serverstorage:material_cpu", | ||||
|     "S": "serverstorage:material_pcb_substrate", | ||||
|     "L": "minecraft:glass" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:module_netherite_upgrade", | ||||
|   | ||||
| @@ -7,12 +7,8 @@ | ||||
|     "GGG" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:lime_dye" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "serverstorage:material_pcb_substrate" | ||||
|     } | ||||
|     "G": "minecraft:lime_dye", | ||||
|     "P": "serverstorage:material_pcb_substrate" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:material_pcb", | ||||
|   | ||||
| @@ -7,12 +7,8 @@ | ||||
|     "AAA" | ||||
|   ], | ||||
|   "key": { | ||||
|     "G": { | ||||
|       "item": "minecraft:green_dye" | ||||
|     }, | ||||
|     "A": { | ||||
|       "item": "minecraft:amethyst_shard" | ||||
|     } | ||||
|     "G": "minecraft:green_dye", | ||||
|     "A": "minecraft:amethyst_shard" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:material_pcb_substrate", | ||||
|   | ||||
| @@ -7,30 +7,14 @@ | ||||
|     "MPF" | ||||
|   ], | ||||
|   "key": { | ||||
|     "P": { | ||||
|       "item": "serverstorage:material_pcb" | ||||
|     }, | ||||
|     "U": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:module_radio" | ||||
|     }, | ||||
|     "B": { | ||||
|       "item": "serverstorage:module_bus" | ||||
|     }, | ||||
|     "H": { | ||||
|       "item": "serverstorage:module_antenna_connector" | ||||
|     }, | ||||
|     "M": { | ||||
|       "item": "serverstorage:module_modem" | ||||
|     }, | ||||
|     "G": { | ||||
|       "item": "serverstorage:module_configuration" | ||||
|     }, | ||||
|     "F": { | ||||
|       "item": "serverstorage:module_pagination" | ||||
|     } | ||||
|     "P": "serverstorage:material_pcb", | ||||
|     "U": "serverstorage:material_cpu", | ||||
|     "C": "serverstorage:module_radio", | ||||
|     "B": "serverstorage:module_bus", | ||||
|     "H": "serverstorage:module_antenna_connector", | ||||
|     "M": "serverstorage:module_modem", | ||||
|     "G": "serverstorage:module_configuration", | ||||
|     "F": "serverstorage:module_pagination" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:radio_interface", | ||||
|   | ||||
| @@ -7,33 +7,15 @@ | ||||
|     "ILX" | ||||
|   ], | ||||
|   "key": { | ||||
|     "L": { | ||||
|       "item": "minecraft:diamond_block" | ||||
|     }, | ||||
|     "D": { | ||||
|       "item": "serverstorage:module_display" | ||||
|     }, | ||||
|     "F": { | ||||
|       "item": "serverstorage:module_filtering" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:module_configuration" | ||||
|     }, | ||||
|     "P": { | ||||
|       "item": "serverstorage:module_pagination" | ||||
|     }, | ||||
|     "B": { | ||||
|       "item": "serverstorage:module_bus" | ||||
|     }, | ||||
|     "I": { | ||||
|       "item": "serverstorage:module_inventory" | ||||
|     }, | ||||
|     "X": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "O": { | ||||
|       "item": "serverstorage:material_pcb" | ||||
|     } | ||||
|     "L": "minecraft:diamond_block", | ||||
|     "D": "serverstorage:module_display", | ||||
|     "F": "serverstorage:module_filtering", | ||||
|     "C": "serverstorage:module_configuration", | ||||
|     "P": "serverstorage:module_pagination", | ||||
|     "B": "serverstorage:module_bus", | ||||
|     "I": "serverstorage:module_inventory", | ||||
|     "X": "serverstorage:material_cpu", | ||||
|     "O": "serverstorage:material_pcb" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:storage", | ||||
|   | ||||
| @@ -7,30 +7,14 @@ | ||||
|     "UMP" | ||||
|   ], | ||||
|   "key": { | ||||
|     "P": { | ||||
|       "item": "serverstorage:material_pcb" | ||||
|     }, | ||||
|     "U": { | ||||
|       "item": "serverstorage:material_cpu" | ||||
|     }, | ||||
|     "A": { | ||||
|       "item": "serverstorage:module_antenna" | ||||
|     }, | ||||
|     "C": { | ||||
|       "item": "serverstorage:module_radio" | ||||
|     }, | ||||
|     "H": { | ||||
|       "item": "serverstorage:module_antenna_connector" | ||||
|     }, | ||||
|     "M": { | ||||
|       "item": "serverstorage:module_modem" | ||||
|     }, | ||||
|     "G": { | ||||
|       "item": "serverstorage:module_configuration" | ||||
|     }, | ||||
|     "F": { | ||||
|       "item": "serverstorage:module_pagination" | ||||
|     } | ||||
|     "P": "serverstorage:material_pcb", | ||||
|     "U": "serverstorage:material_cpu", | ||||
|     "A": "serverstorage:module_antenna", | ||||
|     "C": "serverstorage:module_radio", | ||||
|     "H": "serverstorage:module_antenna_connector", | ||||
|     "M": "serverstorage:module_modem", | ||||
|     "G": "serverstorage:module_configuration", | ||||
|     "F": "serverstorage:module_pagination" | ||||
|   }, | ||||
|   "result": { | ||||
|     "id": "serverstorage:wireless_terminal", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user