From 681a8299ca937da5e23706ffbb8b1bfefb598e36 Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:51 +0200 Subject: [PATCH 01/29] chore: update translation Polish from crowdin --- .../assets/refinedstorage2/lang/pl_pl.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pl_pl.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pl_pl.json index f0385525f..c6470a816 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pl_pl.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pl_pl.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Kreatywny przenośny terminal", "block.refinedstorage2.security_manager": "Security Manager", "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "Gdy to urządzenie jest nieaktywne, sieć magazynowa nie będzie w stanie używać tego urządzenia jako źródła energii.", "gui.refinedstorage2.disk_drive.disks": "Dyski", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Zapewnia sieć magazynowania w energie. Sieć może mieć ich kilka.", "item.refinedstorage2.creative_controller.help": "Zapewnia sieć magazynowania w nieskończoną energię.", "item.refinedstorage2.disk_drive.help": "Akceptuje dyski do zapewnienia przestrzeni dyskowej dla sieci magazynowania.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From 418124f71f0a4ad203ce01788d159118c34c17f1 Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:52 +0200 Subject: [PATCH 02/29] chore: update translation French from crowdin --- .../assets/refinedstorage2/lang/fr_fr.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/fr_fr.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/fr_fr.json index 62901bcd9..002bd3922 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/fr_fr.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/fr_fr.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Grille portable créative", "block.refinedstorage2.security_manager": "Poste de sécurité", "block.refinedstorage2.security_manager.help": "Lorsque ce périphérique est actif, il protège le réseau par défaut et bloque toutes les opérations. Commencez à ajouter des Cartes de Sécurité pour permettre ou refuser des opérations spécifiques pour un joueur.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "Lorsque ce périphérique est inactif, le réseau de stockage ne peut pas utiliser ce périphérique comme source d'énergie.", "gui.refinedstorage2.disk_drive.disks": "Disques", "gui.refinedstorage2.storage.redstone_mode_help": "Lorsque ce périphérique est inactif, le stockage contenu ne sera plus accessible depuis le réseau de stockage.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "Lorsque ce périphérique est inactif, le réseau ne sera pas protégé.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Emplacement pour une carte de sécurité de repli.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Ajoutez une Carte de sécurité de repli à cet emplacement pour définir les permissions de tous les joueurs sans Carte de sécurité. Par défaut, toutes les actions sont interdites.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Alimente le réseau de stockage en énergie. Plusieurs sont autorisés dans un seul réseau de stockage. ", "item.refinedstorage2.creative_controller.help": "Alimente le réseau de stockage avec une source d'énergie infinie. ", "item.refinedstorage2.disk_drive.help": "Accepte des disques de stockage pour fournir de l'espace de stockage au réseau.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Utiliser un câble pour connecter pour connecter des périphériques ensembles, ou placer les périphériques l'un contre l'autre", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From df6ede36868c1c9ef9fac4bbdc8a5e6b9b5408ed Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:53 +0200 Subject: [PATCH 03/29] chore: update translation Spanish from crowdin --- .../assets/refinedstorage2/lang/es_es.json | 368 +++++++++--------- 1 file changed, 193 insertions(+), 175 deletions(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/es_es.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/es_es.json index 29a6bc96d..e14428c33 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/es_es.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/es_es.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Rejilla Portátil Creativa", "block.refinedstorage2.security_manager": "Gestor de seguridad", "block.refinedstorage2.security_manager.help": "Cuando este dispositivo está activo, protegerá la red por defecto y bloqueará todas las operaciones. Empieza a añadir tarjetas de seguridad para permitir o denegar operaciones específicas para un jugador.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "Cuando este dispositivo está inactivo, la red de almacenamiento no podrá utilizar este dispositivo como fuente de energía.", "gui.refinedstorage2.disk_drive.disks": "Discos", "gui.refinedstorage2.storage.redstone_mode_help": "Cuando este dispositivo está inactivo, ya no se podrá acceder al almacenamiento contenido desde la red de almacenamiento.", @@ -82,139 +84,150 @@ "gui.refinedstorage2.destructor.filter_help": "Los bloques que pueden o no ser destruidos, dependiendo de si el dispositivo está en la lista de permitidos o en el modo de lista de bloqueos.", "gui.refinedstorage2.destructor.filter_mode.allow.help": "Solo permitir bloques en esta red de almacenamiento que estén configurados en los filtros.", "gui.refinedstorage2.destructor.filter_mode.block.help": "Disallow blocks into the storage network that are configured in the filters.", - "gui.refinedstorage2.constructor.drop_items": "Drop items instead of placing blocks", + "gui.refinedstorage2.constructor.drop_items": "Soltar objetos en lugar de poner bloques", "gui.refinedstorage2.constructor.filter_help": "The resources that should be placed from the storage network.", "gui.refinedstorage2.interface.filter_help": "The resources that should be exported from the storage network.", "gui.refinedstorage2.exporter.filter_help": "The resources that should be exported from the storage network.", "gui.refinedstorage2.importer.filter_help": "The resources that may be imported from the target inventory.", "gui.refinedstorage2.importer.filter_mode.allow.help": "Only allow resources into the storage network that are configured in the filters.", "gui.refinedstorage2.importer.filter_mode.block.help": "Disallow resources into the storage network that are configured in the filters.", - "gui.refinedstorage2.wireless_transmitter.distance": "%d block(s)", - "gui.refinedstorage2.storage_monitor.filter_help": "The resource to display.", - "gui.refinedstorage2.redstone_mode": "Redstone mode", - "gui.refinedstorage2.redstone_mode.ignore": "Ignore", - "gui.refinedstorage2.redstone_mode.ignore.help": "This device will always be active, regardless of redstone signal.", - "gui.refinedstorage2.redstone_mode.high": "High", - "gui.refinedstorage2.redstone_mode.high.help": "This device will only be active with a redstone signal.", - "gui.refinedstorage2.redstone_mode.low": "Low", + "gui.refinedstorage2.wireless_transmitter.distance": "%d bloque(s)", + "gui.refinedstorage2.storage_monitor.filter_help": "El recurso a mostrar.", + "gui.refinedstorage2.redstone_mode": "Modo Redstone", + "gui.refinedstorage2.redstone_mode.ignore": "Ignorar", + "gui.refinedstorage2.redstone_mode.ignore.help": "Este dispositivo siempre estará activo, independientemente de la señal de redstone.", + "gui.refinedstorage2.redstone_mode.high": "Alto", + "gui.refinedstorage2.redstone_mode.high.help": "Este dispositivo solo estará activo con una señal de redstone.", + "gui.refinedstorage2.redstone_mode.low": "Bajo", "gui.refinedstorage2.redstone_mode.low.help": "This device will only be active without a redstone signal.", - "gui.refinedstorage2.scheduling_mode": "Scheduling mode", - "gui.refinedstorage2.scheduling_mode.default": "Default", - "gui.refinedstorage2.scheduling_mode.default.help": "Use the first available filter.", + "gui.refinedstorage2.scheduling_mode": "Modo programado", + "gui.refinedstorage2.scheduling_mode.default": "Por defecto", + "gui.refinedstorage2.scheduling_mode.default.help": "Usar el primer filtro disponible.", "gui.refinedstorage2.scheduling_mode.round_robin": "Round robin", - "gui.refinedstorage2.scheduling_mode.round_robin.help": "Use each filter in turn.", - "gui.refinedstorage2.scheduling_mode.random": "Random", - "gui.refinedstorage2.scheduling_mode.random.help": "Use a random filter.", - "gui.refinedstorage2.priority": "Priority", + "gui.refinedstorage2.scheduling_mode.round_robin.help": "Usar cada filtro al girar.", + "gui.refinedstorage2.scheduling_mode.random": "Aleatorio", + "gui.refinedstorage2.scheduling_mode.random.help": "Usar un filtro aleatorio.", + "gui.refinedstorage2.priority": "Prioridad", "gui.refinedstorage2.priority.storage_help": "The order in which the storage network will insert or extract resources, highest-first.", - "gui.refinedstorage2.amount": "Amount", - "gui.refinedstorage2.amount.reset": "Reset", - "gui.refinedstorage2.amount.set": "Set", - "gui.refinedstorage2.filter_mode": "Filter mode", - "gui.refinedstorage2.filter_mode.allow": "Allowlist", - "gui.refinedstorage2.filter_mode.block": "Blocklist", - "gui.refinedstorage2.fuzzy_mode": "Fuzzy mode", - "gui.refinedstorage2.fuzzy_mode.on": "On", + "gui.refinedstorage2.amount": "Cantidad", + "gui.refinedstorage2.amount.reset": "Reiniciar", + "gui.refinedstorage2.amount.set": "Establecer", + "gui.refinedstorage2.filter_mode": "Modo de filtro", + "gui.refinedstorage2.filter_mode.allow": "Lista blanca", + "gui.refinedstorage2.filter_mode.block": "Lista negra", + "gui.refinedstorage2.fuzzy_mode": "Modo Fuzzy", + "gui.refinedstorage2.fuzzy_mode.on": "Encendido", "gui.refinedstorage2.fuzzy_mode.on.storage_help": "Match the filters for the allowlist or blocklist exactly.", - "gui.refinedstorage2.fuzzy_mode.on.generic_help": "Match the filter exactly.", + "gui.refinedstorage2.fuzzy_mode.on.generic_help": "Coincidir exactamente con el filtro.", "gui.refinedstorage2.fuzzy_mode.on.extracting_storage_network_help": "Match the filters when extracting from the storage network exactly.", "gui.refinedstorage2.fuzzy_mode.on.extracting_source_help": "Match the filters when extracting from the source exactly.", - "gui.refinedstorage2.fuzzy_mode.off": "Off", + "gui.refinedstorage2.fuzzy_mode.off": "Apagado", "gui.refinedstorage2.fuzzy_mode.off.storage_help": "Match the filters for the allowlist or blocklist without comparing NBT tags.", "gui.refinedstorage2.fuzzy_mode.off.generic_help": "Match the filter without comparing NBT tags.", - "gui.refinedstorage2.fuzzy_mode.off.extracting_storage_network_help": "Match the filters when extracting from the storage network without comparing NBT tags.", - "gui.refinedstorage2.fuzzy_mode.off.extracting_source_help": "Match the filters when extracting from the source without comparing NBT tags.", - "gui.refinedstorage2.access_mode": "Access mode", - "gui.refinedstorage2.access_mode.insert_extract": "Insert and extract", + "gui.refinedstorage2.fuzzy_mode.off.extracting_storage_network_help": "Coincide los filtros al extraer de la red de almacenamiento sin comparar las etiquetas NBT.", + "gui.refinedstorage2.fuzzy_mode.off.extracting_source_help": "Coincide los filtros al extraer de la fuente sin comparar las etiquetas NBT.", + "gui.refinedstorage2.access_mode": "Modo de acceso", + "gui.refinedstorage2.access_mode.insert_extract": "Insertar y extraer", "gui.refinedstorage2.access_mode.insert_extract.help": "The storage network will be able to insert or extract from this storage.", - "gui.refinedstorage2.access_mode.insert": "Insert only", + "gui.refinedstorage2.access_mode.insert": "Solo Insertar", "gui.refinedstorage2.access_mode.insert.help": "The storage network will only be able to insert into this storage. Contained resources will still be visible in a Grid.", - "gui.refinedstorage2.access_mode.extract": "Extract only", + "gui.refinedstorage2.access_mode.extract": "Solo Extraer", "gui.refinedstorage2.access_mode.extract.help": "The storage network will only be able to extract from this storage.", - "gui.refinedstorage2.void_excess": "Void excess resources", + "gui.refinedstorage2.void_excess": "Eliminar recursos excedentes", "gui.refinedstorage2.void_excess.help": "When void excess mode is turned on and the storage is full, it will keep accepting resources but void them.", "gui.refinedstorage2.void_excess.allowlist_warning": "Void excess will only work when the storage is in allowlist mode.", - "gui.refinedstorage2.upgrade_slot": "Empty upgrade slot", - "gui.refinedstorage2.filter_slot.empty_filter": "Empty filter", - "gui.refinedstorage2.filter_slot.left_click_for": "Left click for", - "gui.refinedstorage2.filter_slot.right_click_for": "Right click for", - "gui.refinedstorage2.filter_slot.click_to_clear": "Click to clear", + "gui.refinedstorage2.upgrade_slot": "Ranura de mejora vacía", + "gui.refinedstorage2.filter_slot.empty_filter": "Filtro vacío", + "gui.refinedstorage2.filter_slot.left_click_for": "Clic izquierdo para", + "gui.refinedstorage2.filter_slot.right_click_for": "Clic derecho para", + "gui.refinedstorage2.filter_slot.click_to_clear": "Clic para limpiar", "gui.refinedstorage2.regulator_upgrade.filter_help": "The resource that should be regulated in the target.", "gui.refinedstorage2.network_transmitter.status.inactive": "Inactive", - "gui.refinedstorage2.network_transmitter.status.missing_network_card": "Missing Network Card", - "gui.refinedstorage2.network_transmitter.status.transmitting": "%d block(s)", - "gui.refinedstorage2.network_transmitter.status.receiver_unreachable": "Unreachable", - "gui.refinedstorage2.security_card.permission.reset": "Reset", - "gui.refinedstorage2.security_card.permission.modified": "Modified", + "gui.refinedstorage2.network_transmitter.status.missing_network_card": "Falta tarjeta de red", + "gui.refinedstorage2.network_transmitter.status.transmitting": "%d bloque(s)", + "gui.refinedstorage2.network_transmitter.status.receiver_unreachable": "Fuera del alcance", + "gui.refinedstorage2.security_card.permission.reset": "Reiniciar", + "gui.refinedstorage2.security_card.permission.modified": "Modificado", "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", "item.refinedstorage2.grid.help": "Allows for interacting with the storage network.", "item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.", "item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.", - "item.refinedstorage2.exporter.help": "Exports resources from the storage network to an external destination.", - "item.refinedstorage2.interface.help": "Acts as the combination of an Importer and Exporter.", + "item.refinedstorage2.exporter.help": "Exporta recursos de la red de almacenamiento a un destino externo.", + "item.refinedstorage2.interface.help": "Actúa como la combinación de un importador y exportador.", "item.refinedstorage2.external_storage.help": "Provides the storage network with storage from an external source.", "item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.", "item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.", "item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.", - "item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron", + "item.refinedstorage2.quartz_enriched_iron": "Hierro enriquecido con cuarzo", "item.refinedstorage2.processor_binding": "Processor Binding", - "item.refinedstorage2.silicon": "Silicon", + "item.refinedstorage2.silicon": "Silicio", "item.refinedstorage2.raw_basic_processor": "Raw Basic Processor", - "item.refinedstorage2.raw_improved_processor": "Raw Improved Processor", - "item.refinedstorage2.raw_advanced_processor": "Raw Advanced Processor", - "item.refinedstorage2.basic_processor": "Basic Processor", - "item.refinedstorage2.improved_processor": "Improved Processor", - "item.refinedstorage2.advanced_processor": "Advanced Processor", - "item.refinedstorage2.1k_storage_part": "1K Storage Part", - "item.refinedstorage2.4k_storage_part": "4K Storage Part", - "item.refinedstorage2.16k_storage_part": "16K Storage Part", - "item.refinedstorage2.64k_storage_part": "64K Storage Part", - "item.refinedstorage2.1k_storage_disk": "1K Storage Disk", - "item.refinedstorage2.4k_storage_disk": "4K Storage Disk", - "item.refinedstorage2.16k_storage_disk": "16K Storage Disk", - "item.refinedstorage2.64k_storage_disk": "64K Storage Disk", - "item.refinedstorage2.creative_storage_disk": "Creative Storage Disk", - "item.refinedstorage2.64b_fluid_storage_part": "64B Fluid Storage Part", - "item.refinedstorage2.256b_fluid_storage_part": "256B Fluid Storage Part", - "item.refinedstorage2.1024b_fluid_storage_part": "1024B Fluid Storage Part", - "item.refinedstorage2.4096b_fluid_storage_part": "4096B Fluid Storage Part", - "item.refinedstorage2.64b_fluid_storage_disk": "64B Fluid Storage Disk", - "item.refinedstorage2.256b_fluid_storage_disk": "256B Fluid Storage Disk", - "item.refinedstorage2.1024b_fluid_storage_disk": "1024B Fluid Storage Disk", - "item.refinedstorage2.4096b_fluid_storage_disk": "4096B Fluid Storage Disk", - "item.refinedstorage2.creative_fluid_storage_disk": "Creative Fluid Storage Disk", - "item.refinedstorage2.storage_housing": "Storage Housing", - "item.refinedstorage2.construction_core": "Construction Core", - "item.refinedstorage2.destruction_core": "Destruction Core", - "item.refinedstorage2.wrench": "Wrench", + "item.refinedstorage2.raw_improved_processor": "Procesador Mejorado Bruto", + "item.refinedstorage2.raw_advanced_processor": "Procesador Avanzado Bruto", + "item.refinedstorage2.basic_processor": "Procesador básico", + "item.refinedstorage2.improved_processor": "Procesador Mejorado", + "item.refinedstorage2.advanced_processor": "Procesador Avanzado", + "item.refinedstorage2.1k_storage_part": "Parte de almacenamiento de 1K", + "item.refinedstorage2.4k_storage_part": "Parte de almacenamiento de 4K", + "item.refinedstorage2.16k_storage_part": "Parte de almacenamiento de 16K", + "item.refinedstorage2.64k_storage_part": "Parte de almacenamiento de 64K", + "item.refinedstorage2.1k_storage_disk": "Disco de almacenamiento de 1K", + "item.refinedstorage2.4k_storage_disk": "Disco de almacenamiento de 4K", + "item.refinedstorage2.16k_storage_disk": "Disco de almacenamiento de 16K", + "item.refinedstorage2.64k_storage_disk": "Disco de almacenamiento de 64K", + "item.refinedstorage2.creative_storage_disk": "Disco de almacenamiento creativo", + "item.refinedstorage2.64b_fluid_storage_part": "Parte de almacenamiento de fluidos de 64B", + "item.refinedstorage2.256b_fluid_storage_part": "Parte de almacenamiento de fluidos de 256B", + "item.refinedstorage2.1024b_fluid_storage_part": "Parte de almacenamiento de fluidos de 1024B", + "item.refinedstorage2.4096b_fluid_storage_part": "Parte de almacenamiento de fluidos de 4096B", + "item.refinedstorage2.64b_fluid_storage_disk": "Disco de almacenamiento de fluidos de 64B", + "item.refinedstorage2.256b_fluid_storage_disk": "Disco de almacenamiento de fluidos de 256B", + "item.refinedstorage2.1024b_fluid_storage_disk": "Disco de almacenamiento de fluidos de 1024B", + "item.refinedstorage2.4096b_fluid_storage_disk": "Disco de almacenamiento de fluidos de 4096B", + "item.refinedstorage2.creative_fluid_storage_disk": "Disco de almacenamiento de fluidos creativo", + "item.refinedstorage2.storage_housing": "Carcasa de almacenamiento", + "item.refinedstorage2.construction_core": "Núcleo de construcción", + "item.refinedstorage2.destruction_core": "Núcleo de destrucción", + "item.refinedstorage2.wrench": "Llave inglesa", "item.refinedstorage2.wrench.helper": "Use to rotate blocks or press SHIFT and use to dismantle Refined Storage blocks.", - "item.refinedstorage2.upgrade": "Upgrade", - "item.refinedstorage2.speed_upgrade": "Speed Upgrade", - "item.refinedstorage2.stack_upgrade": "Stack Upgrade", - "item.refinedstorage2.silk_touch_upgrade": "Silk Touch Upgrade", - "item.refinedstorage2.fortune_upgrade.1": "Fortune I Upgrade", - "item.refinedstorage2.fortune_upgrade.2": "Fortune II Upgrade", - "item.refinedstorage2.fortune_upgrade.3": "Fortune III Upgrade", - "item.refinedstorage2.regulator_upgrade": "Regulator Upgrade", + "item.refinedstorage2.upgrade": "Mejora", + "item.refinedstorage2.speed_upgrade": "Mejora de Velocidad", + "item.refinedstorage2.stack_upgrade": "Mejora de Stack", + "item.refinedstorage2.silk_touch_upgrade": "Mejora de Toque de Seda", + "item.refinedstorage2.fortune_upgrade.1": "Mejora de Fortuna I", + "item.refinedstorage2.fortune_upgrade.2": "Mejora de Fortune II", + "item.refinedstorage2.fortune_upgrade.3": "Mejora de Fortuna III", + "item.refinedstorage2.regulator_upgrade": "Mejora de Regulador", "item.refinedstorage2.regulator_upgrade.help": "In an Exporter, will only export if the amount in the target is less than configured in the upgrade. In an Importer, will only import if the amount in the target is more than configured in the upgrade. Use item to configure.", - "item.refinedstorage2.range_upgrade": "Range Upgrade", - "item.refinedstorage2.creative_range_upgrade": "Creative Range Upgrade", + "item.refinedstorage2.range_upgrade": "Mejora de rango", + "item.refinedstorage2.creative_range_upgrade": "Mejora de Rango Creativo", "item.refinedstorage2.wireless_grid": "Wireless Grid", "item.refinedstorage2.creative_wireless_grid": "Creative Wireless Grid", "item.refinedstorage2.wireless_transmitter.help": "Provides wireless network access for items like the Wireless Grid. Multiple are allowed in an area for wider coverage.", - "item.refinedstorage2.network_item.unbound": "Unbound.", + "item.refinedstorage2.network_item.unbound": "Desvincular.", "item.refinedstorage2.network_item.unbound.help": "Use on any storage network device to bind.", - "item.refinedstorage2.network_item.bound_to": "Bound to %d, %d, %d.", + "item.refinedstorage2.network_item.bound_to": "Vinculado a %d, %d, %d.", "item.refinedstorage2.network_item.cannot_open_with_shortcut_due_to_duplicate": "There is more than one %s in your inventory.", "item.refinedstorage2.network_item.cannot_open_because_not_found": "There isn't any %s in your inventory.", - "item.refinedstorage2.configuration_card": "Configuration Card", - "item.refinedstorage2.configuration_card.empty": "Empty.", - "item.refinedstorage2.configuration_card.configured": "Contains configuration for %s.", + "item.refinedstorage2.configuration_card": "Tarjeta de Configuración", + "item.refinedstorage2.configuration_card.empty": "Vacío.", + "item.refinedstorage2.configuration_card.configured": "Contiene configuración para %s.", "item.refinedstorage2.configuration_card.copied_configuration": "Copied configuration for %s.", "item.refinedstorage2.configuration_card.cleared_configuration": "Cleared configuration.", "item.refinedstorage2.configuration_card.cannot_apply_configuration": "Cannot apply configuration card to different type of device. It is configured for %s.", @@ -223,23 +236,23 @@ "item.refinedstorage2.configuration_card.configured_help": "Use on the destination storage network device while crouching to transfer the configuration and upgrades. Use while crouching to clear.", "item.refinedstorage2.network_card": "Network Card", "item.refinedstorage2.network_card.unbound_help": "Use while crouching on a Network Receiver.", - "item.refinedstorage2.network_card.unbound": "Unbound.", + "item.refinedstorage2.network_card.unbound": "Desvinculado.", "item.refinedstorage2.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", "item.refinedstorage2.network_card.bound": "Bound to %d, %d, %d in %s.", - "item.refinedstorage2.security_card": "Security Card", - "item.refinedstorage2.security_card.cleared_configuration": "Cleared configuration.", - "item.refinedstorage2.security_card.unbound": "Unbound.", + "item.refinedstorage2.security_card": "Tarjeta de Seguridad", + "item.refinedstorage2.security_card.cleared_configuration": "Configuración limpiada.", + "item.refinedstorage2.security_card.unbound": "Desvinculado.", "item.refinedstorage2.security_card.unbound.help": "Right click to configure and bind to the current player.", - "item.refinedstorage2.security_card.bound": "Bound to %s.", + "item.refinedstorage2.security_card.bound": "Vinculado a %s.", "item.refinedstorage2.security_card.bound.help": "Right click to configure. Use while crouching to clear configuration and binding.", "item.refinedstorage2.fallback_security_card": "Fallback Security Card", "item.refinedstorage2.fallback_security_card.help": "Acts as a fallback if no matching Security Card for a player is found. Right click to configure. Use while crouching to clear configuration.", - "misc.refinedstorage2.stored": "Stored: %s", - "misc.refinedstorage2.stored_with_capacity": "Stored: %s / %s (%d%%)", + "misc.refinedstorage2.stored": "Almacenado: %s", + "misc.refinedstorage2.stored_with_capacity": "Almacenado: %s / %s (%d%%)", "misc.refinedstorage2.total": "%d total", - "misc.refinedstorage2.last_modified.just_now": "Last modified just now by %s", - "misc.refinedstorage2.last_modified.second": "Last modified %d second ago by %s", - "misc.refinedstorage2.last_modified.seconds": "Last modified %d seconds ago by %s", + "misc.refinedstorage2.last_modified.just_now": "Última modificación ahora por %s", + "misc.refinedstorage2.last_modified.second": "Última modificación hace %d segundo por %s", + "misc.refinedstorage2.last_modified.seconds": "Última modificación hace %d segundos por %s", "misc.refinedstorage2.last_modified.minute": "Last modified %d minute ago by %s", "misc.refinedstorage2.last_modified.minutes": "Last modified %d minutes ago by %s", "misc.refinedstorage2.last_modified.hour": "Last modified %d hour ago by %s", @@ -250,84 +263,84 @@ "misc.refinedstorage2.last_modified.weeks": "Last modified %d weeks ago by %s", "misc.refinedstorage2.last_modified.year": "Last modified %d year ago by %s", "misc.refinedstorage2.last_modified.years": "Last modified %d years ago by %s", - "misc.refinedstorage2.resource_type.item": "Item", - "misc.refinedstorage2.resource_type.fluid": "Fluid", - "misc.refinedstorage2.press_shift_for_help": "Press SHIFT for help", - "misc.refinedstorage2.no_permission": "No permission", - "misc.refinedstorage2.no_permission.open": "You are not allowed to open the %s.", - "misc.refinedstorage2.no_permission.insert": "You are not allowed to insert.", - "misc.refinedstorage2.no_permission.extract": "You are not allowed to extract.", + "misc.refinedstorage2.resource_type.item": "Objeto", + "misc.refinedstorage2.resource_type.fluid": "Fluido", + "misc.refinedstorage2.press_shift_for_help": "Presiona SHIFT para ayuda", + "misc.refinedstorage2.no_permission": "No tienes permisos", + "misc.refinedstorage2.no_permission.open": "No tienes permiso para abrir el %s.", + "misc.refinedstorage2.no_permission.insert": "No tienes permiso para insertar.", + "misc.refinedstorage2.no_permission.extract": "No tienes permiso para extraer.", "misc.refinedstorage2.no_permission.build.place": "You are not allowed to place a %s here.", "misc.refinedstorage2.no_permission.build.break": "You are not allowed to break the %s.", "misc.refinedstorage2.no_permission.build.rotate": "You are not allowed to rotate the %s.", "misc.refinedstorage2.no_permission.build.dismantle": "You are not allowed to dismantle the %s.", - "key.refinedstorage2.focus_search_bar": "Focus search bar", + "key.refinedstorage2.focus_search_bar": "Enfocar la barra de búsqueda", "key.refinedstorage2.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage2.open_wireless_grid": "Open Wireless Grid", - "refinedstorage2.subtitle.wrench": "Wrench used", + "refinedstorage2.subtitle.wrench": "Llave Inglesa usada", "curios.identifier.refinedstorage2": "Refined Storage 2", "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2", - "permission.refinedstorage2.insert": "Insert", - "permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.", - "permission.refinedstorage2.extract": "Extract", - "permission.refinedstorage2.extract.description": "Whether the player can extract resources from a network.", - "permission.refinedstorage2.autocrafting": "Autocrafting", - "permission.refinedstorage2.autocrafting.description": "Whether the player can start, cancel or view an autocrafting task.", - "permission.refinedstorage2.open": "Open", + "permission.refinedstorage2.insert": "Insertar", + "permission.refinedstorage2.insert.description": "Si el jugador puede insertar recursos en una red.", + "permission.refinedstorage2.extract": "Extraer", + "permission.refinedstorage2.extract.description": "Si el jugador puede extraer recursos de una red.", + "permission.refinedstorage2.autocrafting": "Autocrafteo", + "permission.refinedstorage2.autocrafting.description": "Si el jugador puede comenzar, cancelar o ver una tarea de autocrafteo.", + "permission.refinedstorage2.open": "Abrir", "permission.refinedstorage2.open.description": "Whether the player can open network device GUIs.", - "permission.refinedstorage2.build": "Build", + "permission.refinedstorage2.build": "Construir", "permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.", - "permission.refinedstorage2.security": "Security", + "permission.refinedstorage2.security": "Seguridad", "permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.", "text.autoconfig.refinedstorage2.title": "Refined Storage 2", - "text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling", - "text.autoconfig.refinedstorage2.option.screenSize": "Screen size", + "text.autoconfig.refinedstorage2.option.smoothScrolling": "Desplazamiento suave", + "text.autoconfig.refinedstorage2.option.screenSize": "Tamaño de pantalla", "text.autoconfig.refinedstorage2.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", "text.autoconfig.refinedstorage2.option.grid": "Grid", - "text.autoconfig.refinedstorage2.option.grid.largeFont": "Large font", - "text.autoconfig.refinedstorage2.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", - "text.autoconfig.refinedstorage2.option.grid.detailedTooltip": "Detailed tooltip", - "text.autoconfig.refinedstorage2.option.grid.rememberSearchQuery": "Remember search query", - "text.autoconfig.refinedstorage2.option.grid.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.grid.largeFont": "Fuente grande", + "text.autoconfig.refinedstorage2.option.grid.preventSortingWhileShiftIsDown": "Evitar ordenar mientras SHIFT está presionado", + "text.autoconfig.refinedstorage2.option.grid.detailedTooltip": "Descripción detallada", + "text.autoconfig.refinedstorage2.option.grid.rememberSearchQuery": "Recordar búsqueda", + "text.autoconfig.refinedstorage2.option.grid.energyUsage": "Uso de energía", "text.autoconfig.refinedstorage2.option.grid.autoSelected": "Auto selected search box", "text.autoconfig.refinedstorage2.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage2.option.grid.resourceTypeId": "Resource type", - "text.autoconfig.refinedstorage2.option.grid.sortingDirection": "Sorting direction", - "text.autoconfig.refinedstorage2.option.grid.sortingType": "Sorting type", + "text.autoconfig.refinedstorage2.option.grid.resourceTypeId": "Tipo de Recurso", + "text.autoconfig.refinedstorage2.option.grid.sortingDirection": "Dirección de ordenación", + "text.autoconfig.refinedstorage2.option.grid.sortingType": "Tipo de ordenación", "text.autoconfig.refinedstorage2.option.craftingGrid": "Crafting Grid", "text.autoconfig.refinedstorage2.option.craftingGrid.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", "text.autoconfig.refinedstorage2.option.controller": "Controller", "text.autoconfig.refinedstorage2.option.controller.energyCapacity": "Energy capacity", "text.autoconfig.refinedstorage2.option.cable": "Cable", - "text.autoconfig.refinedstorage2.option.cable.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive", - "text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", - "text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block", - "text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage", - "text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage", - "text.autoconfig.refinedstorage2.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", - "text.autoconfig.refinedstorage2.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", - "text.autoconfig.refinedstorage2.option.storageBlock.creativeEnergyUsage": "Creative energy usage", + "text.autoconfig.refinedstorage2.option.cable.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage2.option.diskDrive": "Disco Duro", + "text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Uso de energía por disco", + "text.autoconfig.refinedstorage2.option.storageBlock": "Bloque de almacenamiento", + "text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K de consumo de energía", + "text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K de consumo de energía", + "text.autoconfig.refinedstorage2.option.storageBlock.sixteenKEnergyUsage": "16K de consumo de energía", + "text.autoconfig.refinedstorage2.option.storageBlock.sixtyFourKEnergyUsage": "64K de consumo de energía", + "text.autoconfig.refinedstorage2.option.storageBlock.creativeEnergyUsage": "Consumo de energía creativo", "text.autoconfig.refinedstorage2.option.fluidStorageBlock": "Fluid Storage Block", "text.autoconfig.refinedstorage2.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", "text.autoconfig.refinedstorage2.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", "text.autoconfig.refinedstorage2.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", "text.autoconfig.refinedstorage2.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", "text.autoconfig.refinedstorage2.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", - "text.autoconfig.refinedstorage2.option.importer": "Importer", - "text.autoconfig.refinedstorage2.option.importer.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage2.option.exporter": "Exporter", - "text.autoconfig.refinedstorage2.option.exporter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.importer": "Importador", + "text.autoconfig.refinedstorage2.option.importer.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage2.option.exporter": "Exportador", + "text.autoconfig.refinedstorage2.option.exporter.energyUsage": "Uso de energía", "text.autoconfig.refinedstorage2.option.detector": "Detector", - "text.autoconfig.refinedstorage2.option.detector.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.detector.energyUsage": "Uso de energía", "text.autoconfig.refinedstorage2.option.constructor": "Constructor", - "text.autoconfig.refinedstorage2.option.constructor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.constructor.energyUsage": "Uso de energía", "text.autoconfig.refinedstorage2.option.destructor": "Destructor", - "text.autoconfig.refinedstorage2.option.destructor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage2.option.upgrade": "Upgrade", + "text.autoconfig.refinedstorage2.option.destructor.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage2.option.upgrade": "Mejora", "text.autoconfig.refinedstorage2.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", "text.autoconfig.refinedstorage2.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", "text.autoconfig.refinedstorage2.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", @@ -337,11 +350,11 @@ "text.autoconfig.refinedstorage2.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", "text.autoconfig.refinedstorage2.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", "text.autoconfig.refinedstorage2.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", - "text.autoconfig.refinedstorage2.option.upgrade.rangeUpgradeRange": "Range Upgrade range", - "text.autoconfig.refinedstorage2.option.iface": "Interface", - "text.autoconfig.refinedstorage2.option.iface.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage2.option.externalStorage": "External Storage", - "text.autoconfig.refinedstorage2.option.externalStorage.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.upgrade.rangeUpgradeRange": "Rango de mejora de rango", + "text.autoconfig.refinedstorage2.option.iface": "Interfaz", + "text.autoconfig.refinedstorage2.option.iface.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage2.option.externalStorage": "Almacenamiento Externo", + "text.autoconfig.refinedstorage2.option.externalStorage.energyUsage": "Uso de energía", "text.autoconfig.refinedstorage2.option.wirelessGrid": "Wireless Grid", "text.autoconfig.refinedstorage2.option.wirelessGrid.energyCapacity": "Energy capacity", "text.autoconfig.refinedstorage2.option.wirelessGrid.openEnergyUsage": "Open energy usage", @@ -360,17 +373,20 @@ "text.autoconfig.refinedstorage2.option.portableGrid.energyCapacity": "Energy capacity", "text.autoconfig.refinedstorage2.option.portableGrid.openEnergyUsage": "Open energy usage", "text.autoconfig.refinedstorage2.option.portableGrid.insertEnergyUsage": "Insert energy usage", - "text.autoconfig.refinedstorage2.option.portableGrid.extractEnergyUsage": "Extract energy usage", - "text.autoconfig.refinedstorage2.option.securityCard": "Security Card", - "text.autoconfig.refinedstorage2.option.securityCard.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.portableGrid.extractEnergyUsage": "Consumo de energía al extraer", + "text.autoconfig.refinedstorage2.option.securityCard": "Tarjeta de Seguridad", + "text.autoconfig.refinedstorage2.option.securityCard.energyUsage": "Uso de energía", "text.autoconfig.refinedstorage2.option.fallbackSecurityCard": "Fallback Security Card", - "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", - "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", - "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", - "advancements.refinedstorage2.connecting": "Connecting", + "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage2.option.securityManager": "Gestor de seguridad", + "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Uso de energía", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "advancements.refinedstorage2.root.description": "Utilice uno o varios controladores en una red de almacenamiento para proporcionar energía a su red", + "advancements.refinedstorage2.connecting": "Conectando", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", - "advancements.refinedstorage2.drives": "Drives", + "advancements.refinedstorage2.drives": "Dispositivos y unidades", "advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks", "advancements.refinedstorage2.storing_items": "Storing items", "advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive", @@ -378,32 +394,34 @@ "advancements.refinedstorage2.viewing_your_storage.description": "Craft a Grid to interact with your storage", "advancements.refinedstorage2.upgrading_your_grid": "Upgrading your Grid", "advancements.refinedstorage2.upgrading_your_grid.description": "Upgrade your Grid to a Crafting Grid to get crafting abilities", - "advancements.refinedstorage2.storing_fluids": "Storing fluids", - "advancements.refinedstorage2.storing_fluids.description": "Craft a Fluid Storage Disk and put it in your Disk Drive", + "advancements.refinedstorage2.storing_fluids": "Almacenando fluidos", + "advancements.refinedstorage2.storing_fluids.description": "Crea un disco de almacenamiento de fluidos y colócalo en tu unidad de discos", "advancements.refinedstorage2.importing": "Importing", "advancements.refinedstorage2.importing.description": "Get resources into the storage network with an Importer", "advancements.refinedstorage2.exporting": "Exporting", "advancements.refinedstorage2.exporting.description": "Get resources out of the storage network with an Exporter", - "advancements.refinedstorage2.upgrading": "Upgrading", - "advancements.refinedstorage2.upgrading.description": "Craft an Upgrade to improve various devices", - "advancements.refinedstorage2.interface_to_the_world": "Interface to the world", + "advancements.refinedstorage2.upgrading": "Mejorando", + "advancements.refinedstorage2.upgrading.description": "Crea una mejora para actualizar varios dispositivos", + "advancements.refinedstorage2.interface_to_the_world": "Interfaz al mundo", "advancements.refinedstorage2.interface_to_the_world.description": "Export and import items at the same time with an Interface", - "advancements.refinedstorage2.storing_externally": "Storing externally", + "advancements.refinedstorage2.storing_externally": "Almacenando externamente", "advancements.refinedstorage2.storing_externally.description": "Use an External Storage to provide the network with storage from an external block like a chest", - "advancements.refinedstorage2.detecting": "Detecting", + "advancements.refinedstorage2.detecting": "Detectando", "advancements.refinedstorage2.detecting.description": "Use redstone to check resources stored in the storage network", - "advancements.refinedstorage2.construction": "Construction", + "advancements.refinedstorage2.construction": "Construcción", "advancements.refinedstorage2.construction.description": "Get blocks from the storage network into the world with a Constructor", - "advancements.refinedstorage2.destruction": "Destruction", - "advancements.refinedstorage2.destruction.description": "Get blocks from in the world into the storage network with a Destructor", - "advancements.refinedstorage2.wireless": "Wireless", + "advancements.refinedstorage2.destruction": "Destrucción", + "advancements.refinedstorage2.destruction.description": "Obtén bloques del mundo a la red mediante un Destructor", + "advancements.refinedstorage2.wireless": "Comunicaciones Inalámbricas", "advancements.refinedstorage2.wireless.description": "Access your resources wirelessly with a Wireless Grid", - "advancements.refinedstorage2.better_than_a_barrel": "Better than a barrel", + "advancements.refinedstorage2.better_than_a_barrel": "Mejor que un barril", "advancements.refinedstorage2.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network", - "advancements.refinedstorage2.no_cables_required": "No cables required", + "advancements.refinedstorage2.no_cables_required": "No se necesitan cables", "advancements.refinedstorage2.no_cables_required.description": "Add extra components to your storage network without using cables by using a Network Transmitter, Network Receiver and Network Card", - "advancements.refinedstorage2.portable_storage": "Portable storage", + "advancements.refinedstorage2.portable_storage": "Almacenamiento portátil", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", - "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security": "Seguridad", + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From b6b882381b5e673bcc6ffddd23433834ab26f73a Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:54 +0200 Subject: [PATCH 04/29] chore: update translation German from crowdin --- .../assets/refinedstorage2/lang/de_de.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/de_de.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/de_de.json index fb02cd86c..5b2a9c5cd 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/de_de.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/de_de.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Mobile Kreative Konsole", "block.refinedstorage2.security_manager": "Sicherheits-Manager", "block.refinedstorage2.security_manager.help": "Während aktivem Betrieb ist das Netzwerk geschützt und es werden alle Zugriffe blockiert. Füge Sicherheits-Karten hinzu, um spezifische Zugriffe für Spieler zuzulassen.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "Falls dieses Gerät inaktiv ist, kann das Speichernetzwerk dieses Gerät nicht als Energiequelle nutzen.", "gui.refinedstorage2.disk_drive.disks": "Speicherplatten", "gui.refinedstorage2.storage.redstone_mode_help": "Falls dieses Gerät inaktiv ist, ist der enthaltene Speicher nicht mehr über das Speichernetzwerk zugänglich.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "Wenn dieses Gerät inaktiv ist, wird das Netzwerk nicht geschützt.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot für eine Standard-Sicherheitskarte.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Fügen Sie diesem Slot eine Standard-Sicherheitskarte hinzu, um Berechtigungen für jeden Spieler ohne Sicherheitskarte festzulegen. Standardmäßig werden alle Aktionen verweigert.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Stellt das Speichernetzwerk mit Energie zur Verfügung. Mehrere sind in einem einzigen Speichernetzwerk erlaubt.", "item.refinedstorage2.creative_controller.help": "Stellt dem Speichernetzwerk eine unendliche Energiequelle zur Verfügung.", "item.refinedstorage2.disk_drive.help": "Akzeptiert Speicherplatten, um dem Speichernetz Speicherplatz zur Verfügung zu stellen.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energieverbrauch", "text.autoconfig.refinedstorage2.option.securityManager": "Sicherheits-Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energieverbrauch", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Nutzen Sie einen oder mehrere Kontrollblöcke in einem Speichernetzwerk, um das Netzwerk mit Energie zu versorgen", "advancements.refinedstorage2.connecting": "Verbinden", "advancements.refinedstorage2.connecting.description": "Benutze Kabel um Geräte miteinander zu verbinden, oder platziere Geräte nebeneinander", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Tragbarer Speicher", "advancements.refinedstorage2.portable_storage.description": "Erstelle eine mobile Konsole um auf den Inhalt von Speicherplatten zuzugreifen, ohne ein Speichernetzwerk zu benötigen", "advancements.refinedstorage2.security": "Sicherheit", - "advancements.refinedstorage2.security.description": "Sichern Sie Ihr Speichernetzwerk mit einem Security-Manager und einer Sicherheitskarte" + "advancements.refinedstorage2.security.description": "Sichern Sie Ihr Speichernetzwerk mit einem Security-Manager und einer Sicherheitskarte", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From 2a617796ba030a188f065ceee4bf533f87ef90ca Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:55 +0200 Subject: [PATCH 05/29] chore: update translation Hungarian from crowdin --- .../assets/refinedstorage2/lang/hu_hu.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/hu_hu.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/hu_hu.json index 36f89262b..6e06c5772 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/hu_hu.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/hu_hu.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Creative Portable Grid", "block.refinedstorage2.security_manager": "Security Manager", "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Disks", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From c77925829bc14b114584caf5295654cd51c3da54 Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:56 +0200 Subject: [PATCH 06/29] chore: update translation Italian from crowdin --- .../assets/refinedstorage2/lang/it_it.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/it_it.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/it_it.json index 36f89262b..6e06c5772 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/it_it.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/it_it.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Creative Portable Grid", "block.refinedstorage2.security_manager": "Security Manager", "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Disks", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From 72794dee4ca6121dd8b6d1e5974ec3a4c7487793 Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:57 +0200 Subject: [PATCH 07/29] chore: update translation Japanese from crowdin --- .../assets/refinedstorage2/lang/ja_jp.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ja_jp.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ja_jp.json index 36f89262b..6e06c5772 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ja_jp.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ja_jp.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Creative Portable Grid", "block.refinedstorage2.security_manager": "Security Manager", "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Disks", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From cbf7b9409d4a39d6a1828f4133f5d9800bc172c2 Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:58 +0200 Subject: [PATCH 08/29] chore: update translation Korean from crowdin --- .../assets/refinedstorage2/lang/ko_kr.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ko_kr.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ko_kr.json index 36f89262b..6e06c5772 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ko_kr.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ko_kr.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Creative Portable Grid", "block.refinedstorage2.security_manager": "Security Manager", "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Disks", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From eec64116f1985e4cd6013fb13d7ee8e5257c7138 Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:27:59 +0200 Subject: [PATCH 09/29] chore: update translation Russian from crowdin --- .../assets/refinedstorage2/lang/ru_ru.json | 86 +++++++++++-------- 1 file changed, 52 insertions(+), 34 deletions(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ru_ru.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ru_ru.json index 646c11f96..ed1c6a6dd 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ru_ru.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ru_ru.json @@ -21,7 +21,7 @@ "block.refinedstorage2.creative_fluid_storage_block": "Творческий блок хранения жидкости", "block.refinedstorage2.importer": "Шина импорта", "block.refinedstorage2.exporter": "Шина экспорта", - "block.refinedstorage2.interface": "Interface", + "block.refinedstorage2.interface": "Интерфейс", "block.refinedstorage2.external_storage": "Шина внешнего хранения", "block.refinedstorage2.detector": "Детектор", "block.refinedstorage2.constructor": "Шина формирования", @@ -32,8 +32,10 @@ "block.refinedstorage2.network_transmitter": "Сетевой передатчик", "block.refinedstorage2.portable_grid": "Переносной терминал", "block.refinedstorage2.creative_portable_grid": "Творческий переносной терминал", - "block.refinedstorage2.security_manager": "Security Manager", - "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.security_manager": "Диспетчер безопасности", + "block.refinedstorage2.security_manager.help": "Когда это устройство активно, оно по умолчанию защищает сеть и блокирует все операции. Начните добавлять карты безопасности, чтобы разрешить или запретить определённые операции для игрока.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Диски", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -47,12 +49,12 @@ "gui.refinedstorage2.grid.sorting.type": "Тип сортировки", "gui.refinedstorage2.grid.sorting.type.quantity": "Кол-во", "gui.refinedstorage2.grid.sorting.type.name": "Название", - "gui.refinedstorage2.grid.sorting.type.id": "ID", + "gui.refinedstorage2.grid.sorting.type.id": "Идентификатор", "gui.refinedstorage2.grid.sorting.type.last_modified": "Last modified", "gui.refinedstorage2.grid.auto_selected": "Auto-selected", "gui.refinedstorage2.grid.auto_selected.help": "Whether to auto-select the search box when opening the Grid.", - "gui.refinedstorage2.grid.synchronizer": "Synchronization mode", - "gui.refinedstorage2.grid.synchronizer.off": "Off", + "gui.refinedstorage2.grid.synchronizer": "Режим синхронизации", + "gui.refinedstorage2.grid.synchronizer.off": "Выкл.", "gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.", "gui.refinedstorage2.grid.synchronizer.jei": "JEI", "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.", @@ -73,7 +75,7 @@ "gui.refinedstorage2.screen_size.medium": "Medium", "gui.refinedstorage2.screen_size.large": "Large", "gui.refinedstorage2.screen_size.extra_large": "Extra large", - "gui.refinedstorage2.detector.mode": "Mode", + "gui.refinedstorage2.detector.mode": "Режим", "gui.refinedstorage2.detector.mode.under": "Emit redstone signal when under the amount", "gui.refinedstorage2.detector.mode.equal": "Emit redstone signal when on the amount", "gui.refinedstorage2.detector.mode.above": "Emit redstone signal when above the amount", @@ -99,7 +101,7 @@ "gui.refinedstorage2.redstone_mode.low": "Low", "gui.refinedstorage2.redstone_mode.low.help": "This device will only be active without a redstone signal.", "gui.refinedstorage2.scheduling_mode": "Scheduling mode", - "gui.refinedstorage2.scheduling_mode.default": "Default", + "gui.refinedstorage2.scheduling_mode.default": "По умолчанию", "gui.refinedstorage2.scheduling_mode.default.help": "Use the first available filter.", "gui.refinedstorage2.scheduling_mode.round_robin": "Round robin", "gui.refinedstorage2.scheduling_mode.round_robin.help": "Use each filter in turn.", @@ -110,7 +112,7 @@ "gui.refinedstorage2.amount": "Amount", "gui.refinedstorage2.amount.reset": "Reset", "gui.refinedstorage2.amount.set": "Set", - "gui.refinedstorage2.filter_mode": "Filter mode", + "gui.refinedstorage2.filter_mode": "Режим фильтрации", "gui.refinedstorage2.filter_mode.allow": "Allowlist", "gui.refinedstorage2.filter_mode.block": "Blocklist", "gui.refinedstorage2.fuzzy_mode": "Fuzzy mode", @@ -119,7 +121,7 @@ "gui.refinedstorage2.fuzzy_mode.on.generic_help": "Match the filter exactly.", "gui.refinedstorage2.fuzzy_mode.on.extracting_storage_network_help": "Match the filters when extracting from the storage network exactly.", "gui.refinedstorage2.fuzzy_mode.on.extracting_source_help": "Match the filters when extracting from the source exactly.", - "gui.refinedstorage2.fuzzy_mode.off": "Off", + "gui.refinedstorage2.fuzzy_mode.off": "Выкл.", "gui.refinedstorage2.fuzzy_mode.off.storage_help": "Match the filters for the allowlist or blocklist without comparing NBT tags.", "gui.refinedstorage2.fuzzy_mode.off.generic_help": "Match the filter without comparing NBT tags.", "gui.refinedstorage2.fuzzy_mode.off.extracting_storage_network_help": "Match the filters when extracting from the storage network without comparing NBT tags.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -167,33 +180,33 @@ "item.refinedstorage2.raw_basic_processor": "Raw Basic Processor", "item.refinedstorage2.raw_improved_processor": "Raw Improved Processor", "item.refinedstorage2.raw_advanced_processor": "Raw Advanced Processor", - "item.refinedstorage2.basic_processor": "Basic Processor", - "item.refinedstorage2.improved_processor": "Improved Processor", - "item.refinedstorage2.advanced_processor": "Advanced Processor", - "item.refinedstorage2.1k_storage_part": "1K Storage Part", - "item.refinedstorage2.4k_storage_part": "4K Storage Part", - "item.refinedstorage2.16k_storage_part": "16K Storage Part", - "item.refinedstorage2.64k_storage_part": "64K Storage Part", - "item.refinedstorage2.1k_storage_disk": "1K Storage Disk", - "item.refinedstorage2.4k_storage_disk": "4K Storage Disk", - "item.refinedstorage2.16k_storage_disk": "16K Storage Disk", - "item.refinedstorage2.64k_storage_disk": "64K Storage Disk", - "item.refinedstorage2.creative_storage_disk": "Creative Storage Disk", - "item.refinedstorage2.64b_fluid_storage_part": "64B Fluid Storage Part", - "item.refinedstorage2.256b_fluid_storage_part": "256B Fluid Storage Part", - "item.refinedstorage2.1024b_fluid_storage_part": "1024B Fluid Storage Part", - "item.refinedstorage2.4096b_fluid_storage_part": "4096B Fluid Storage Part", - "item.refinedstorage2.64b_fluid_storage_disk": "64B Fluid Storage Disk", - "item.refinedstorage2.256b_fluid_storage_disk": "256B Fluid Storage Disk", - "item.refinedstorage2.1024b_fluid_storage_disk": "1024B Fluid Storage Disk", - "item.refinedstorage2.4096b_fluid_storage_disk": "4096B Fluid Storage Disk", - "item.refinedstorage2.creative_fluid_storage_disk": "Creative Fluid Storage Disk", + "item.refinedstorage2.basic_processor": "Базовый процессор", + "item.refinedstorage2.improved_processor": "Улучшенный процессор", + "item.refinedstorage2.advanced_processor": "Продвинутый процессор", + "item.refinedstorage2.1k_storage_part": "Часть хранения на 1 Кбайт", + "item.refinedstorage2.4k_storage_part": "Часть хранения на 4 Кбайт", + "item.refinedstorage2.16k_storage_part": "Часть хранения на 16 Кбайт", + "item.refinedstorage2.64k_storage_part": "Часть хранения на 64 Кбайт", + "item.refinedstorage2.1k_storage_disk": "Диск хранения на 1 Кбайт", + "item.refinedstorage2.4k_storage_disk": "Диск хранения на 4 Кбайт", + "item.refinedstorage2.16k_storage_disk": "Диск хранения на 16 Кбайт", + "item.refinedstorage2.64k_storage_disk": "Диск хранения на 64 Кбайт", + "item.refinedstorage2.creative_storage_disk": "Диск хранения творческого режима", + "item.refinedstorage2.64b_fluid_storage_part": "Часть для хранения жидкости на 64 байт", + "item.refinedstorage2.256b_fluid_storage_part": "Часть для хранения жидкости на 256 байт", + "item.refinedstorage2.1024b_fluid_storage_part": "Часть для хранения жидкости на 1024 байт", + "item.refinedstorage2.4096b_fluid_storage_part": "Часть для хранения жидкости на 4096 байт", + "item.refinedstorage2.64b_fluid_storage_disk": "Диск для хранения жидкости на 64 байт", + "item.refinedstorage2.256b_fluid_storage_disk": "Диск для хранения жидкости на 256 байт", + "item.refinedstorage2.1024b_fluid_storage_disk": "Диск для хранения жидкости на 1024 байт", + "item.refinedstorage2.4096b_fluid_storage_disk": "Диск для хранения жидкости на 4096 байт", + "item.refinedstorage2.creative_fluid_storage_disk": "Диск для хранения жидкости творческого режима", "item.refinedstorage2.storage_housing": "Storage Housing", "item.refinedstorage2.construction_core": "Construction Core", "item.refinedstorage2.destruction_core": "Destruction Core", - "item.refinedstorage2.wrench": "Wrench", + "item.refinedstorage2.wrench": "Гаечный ключ", "item.refinedstorage2.wrench.helper": "Use to rotate blocks or press SHIFT and use to dismantle Refined Storage blocks.", - "item.refinedstorage2.upgrade": "Upgrade", + "item.refinedstorage2.upgrade": "Улучшение", "item.refinedstorage2.speed_upgrade": "Speed Upgrade", "item.refinedstorage2.stack_upgrade": "Stack Upgrade", "item.refinedstorage2.silk_touch_upgrade": "Silk Touch Upgrade", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From 3e4c813cff85a03304768c4936ce6d8a7e0d875f Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:28:00 +0200 Subject: [PATCH 10/29] chore: update translation Chinese Simplified from crowdin --- .../assets/refinedstorage2/lang/zh_cn.json | 132 ++++++++++-------- 1 file changed, 75 insertions(+), 57 deletions(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_cn.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_cn.json index 59cda48de..3a8d24485 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_cn.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_cn.json @@ -1,5 +1,5 @@ { - "mod.refinedstorage2": "Refined Storage 2", + "mod.refinedstorage2": "精致存储 2", "block.refinedstorage2.cable": "线缆", "block.refinedstorage2.quartz_enriched_iron_block": "富石英铁块", "block.refinedstorage2.disk_drive": "磁盘驱动器", @@ -32,8 +32,10 @@ "block.refinedstorage2.network_transmitter": "网络变送器", "block.refinedstorage2.portable_grid": "便携式终端", "block.refinedstorage2.creative_portable_grid": "创造模式便携式终端", - "block.refinedstorage2.security_manager": "Security Manager", - "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.security_manager": "权限管理器", + "block.refinedstorage2.security_manager.help": "当此设备处于激活状态时会默认阻止所有操作来保护网络。添加安全卡以配置特定玩家对于特定操作的权限", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "当此设备处于非激活状态时,存储网络将无法将此设备用作能源来源。", "gui.refinedstorage2.disk_drive.disks": "磁盘", "gui.refinedstorage2.storage.redstone_mode_help": "当此设备处于非激活状态时,其中的存储空间将无法从存储网络内访问。", @@ -61,18 +63,18 @@ "gui.refinedstorage2.grid.synchronizer.rei": "REI", "gui.refinedstorage2.grid.synchronizer.rei.help": "将搜索框文本同步到 REI 过滤器。", "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI 双向", - "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.", + "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "将搜索框文本同步到 REI 过滤器,并将 REI 过滤器同步到搜索框文本。", "gui.refinedstorage2.grid.resource_type": "存储通道", "gui.refinedstorage2.grid.resource_type.all": "全部", "gui.refinedstorage2.grid.resource_type.help": "从特定的存储通道中过滤资源。", "gui.refinedstorage2.crafting_grid.move.network": "将物品移动到网络。", "gui.refinedstorage2.crafting_grid.move.inventory": "将物品移动到物品栏。", - "gui.refinedstorage2.screen_size": "Screen size", - "gui.refinedstorage2.screen_size.stretch": "Stretch", - "gui.refinedstorage2.screen_size.small": "Small", - "gui.refinedstorage2.screen_size.medium": "Medium", - "gui.refinedstorage2.screen_size.large": "Large", - "gui.refinedstorage2.screen_size.extra_large": "Extra large", + "gui.refinedstorage2.screen_size": "界面大小", + "gui.refinedstorage2.screen_size.stretch": "自适应", + "gui.refinedstorage2.screen_size.small": "小", + "gui.refinedstorage2.screen_size.medium": "中", + "gui.refinedstorage2.screen_size.large": "大", + "gui.refinedstorage2.screen_size.extra_large": "特大", "gui.refinedstorage2.detector.mode": "模式", "gui.refinedstorage2.detector.mode.under": "物品数量小于输入数量时输出信号。", "gui.refinedstorage2.detector.mode.equal": "物品数量等于输入数量时输出信号。", @@ -144,11 +146,22 @@ "gui.refinedstorage2.network_transmitter.status.missing_network_card": "缺少网络卡", "gui.refinedstorage2.network_transmitter.status.transmitting": "传输中:%d个方块", "gui.refinedstorage2.network_transmitter.status.receiver_unreachable": "无法访问", - "gui.refinedstorage2.security_card.permission.reset": "Reset", - "gui.refinedstorage2.security_card.permission.modified": "Modified", - "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", - "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", - "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.security_card.permission.reset": "重置", + "gui.refinedstorage2.security_card.permission.modified": "已修改", + "gui.refinedstorage2.security_manager.redstone_mode_help": "当此设备处于未激活状态时,将不能保护网络。", + "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "后备安全卡卡槽", + "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "在此槽位加入后备权限卡来设置没有单独使用权限卡配置的玩家的权限。默认情况下所有操作均被阻止。", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "为存储网络提供能量。一个存储网络中允许包含多个。", "item.refinedstorage2.creative_controller.help": "为存储网络提供无限能源。", "item.refinedstorage2.disk_drive.help": "接受存储磁盘,为存储网络提供存储空间。", @@ -226,14 +239,14 @@ "item.refinedstorage2.network_card.unbound": "未绑定。", "item.refinedstorage2.network_card.bound_help": "插入到网络变送器中。在潜行状态下使用以清除绑定。", "item.refinedstorage2.network_card.bound": "绑定到 %d, %d, %d 在 %s 中。", - "item.refinedstorage2.security_card": "Security Card", - "item.refinedstorage2.security_card.cleared_configuration": "Cleared configuration.", - "item.refinedstorage2.security_card.unbound": "Unbound.", - "item.refinedstorage2.security_card.unbound.help": "Right click to configure and bind to the current player.", - "item.refinedstorage2.security_card.bound": "Bound to %s.", - "item.refinedstorage2.security_card.bound.help": "Right click to configure. Use while crouching to clear configuration and binding.", - "item.refinedstorage2.fallback_security_card": "Fallback Security Card", - "item.refinedstorage2.fallback_security_card.help": "Acts as a fallback if no matching Security Card for a player is found. Right click to configure. Use while crouching to clear configuration.", + "item.refinedstorage2.security_card": "权限卡", + "item.refinedstorage2.security_card.cleared_configuration": "已清除配置。", + "item.refinedstorage2.security_card.unbound": "未绑定。", + "item.refinedstorage2.security_card.unbound.help": "右键使用以配置并绑定到当前玩家", + "item.refinedstorage2.security_card.bound": "绑定至:%s", + "item.refinedstorage2.security_card.bound.help": "右键使用以进行配置,潜行状态下使用以清除当前配置与绑定", + "item.refinedstorage2.fallback_security_card": "后备权限卡", + "item.refinedstorage2.fallback_security_card.help": "如果权限管理器中没有对应玩家的权限卡则将后备权限卡的权限配置应用于该玩家。右键使用以进行配置,潜行状态使用以清除当前配置", "misc.refinedstorage2.stored": "存储:%s", "misc.refinedstorage2.stored_with_capacity": "存储:%s / %s (%d%%)", "misc.refinedstorage2.total": "总数:%d", @@ -253,14 +266,14 @@ "misc.refinedstorage2.resource_type.item": "物品", "misc.refinedstorage2.resource_type.fluid": "流体", "misc.refinedstorage2.press_shift_for_help": "按下 SHIFT 获取帮助", - "misc.refinedstorage2.no_permission": "No permission", - "misc.refinedstorage2.no_permission.open": "You are not allowed to open the %s.", - "misc.refinedstorage2.no_permission.insert": "You are not allowed to insert.", - "misc.refinedstorage2.no_permission.extract": "You are not allowed to extract.", - "misc.refinedstorage2.no_permission.build.place": "You are not allowed to place a %s here.", - "misc.refinedstorage2.no_permission.build.break": "You are not allowed to break the %s.", - "misc.refinedstorage2.no_permission.build.rotate": "You are not allowed to rotate the %s.", - "misc.refinedstorage2.no_permission.build.dismantle": "You are not allowed to dismantle the %s.", + "misc.refinedstorage2.no_permission": "无权限", + "misc.refinedstorage2.no_permission.open": "你没有打开 %s 的权限", + "misc.refinedstorage2.no_permission.insert": "你没有存储物品的权限", + "misc.refinedstorage2.no_permission.extract": "你没有拿取物品的权限", + "misc.refinedstorage2.no_permission.build.place": "你没有在这里放置 %s 的权限", + "misc.refinedstorage2.no_permission.build.break": "你没有破坏 %s 的权限", + "misc.refinedstorage2.no_permission.build.rotate": "你没有旋转 %s 的权限", + "misc.refinedstorage2.no_permission.build.dismantle": "你没有拆除 %s 的权限", "key.refinedstorage2.focus_search_bar": "聚焦搜索栏", "key.refinedstorage2.clear_crafting_grid_matrix_to_network": "清除合成终端矩阵到网络", "key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "清除合成终端矩阵到库存", @@ -268,22 +281,22 @@ "refinedstorage2.subtitle.wrench": "使用扳手", "curios.identifier.refinedstorage2": "精致存储 2", "trinkets.slot.refinedstorage2.wireless": "精致存储 2", - "permission.refinedstorage2.insert": "Insert", - "permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.", - "permission.refinedstorage2.extract": "Extract", - "permission.refinedstorage2.extract.description": "Whether the player can extract resources from a network.", - "permission.refinedstorage2.autocrafting": "Autocrafting", - "permission.refinedstorage2.autocrafting.description": "Whether the player can start, cancel or view an autocrafting task.", - "permission.refinedstorage2.open": "Open", - "permission.refinedstorage2.open.description": "Whether the player can open network device GUIs.", - "permission.refinedstorage2.build": "Build", - "permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.", - "permission.refinedstorage2.security": "Security", - "permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.", + "permission.refinedstorage2.insert": "存入", + "permission.refinedstorage2.insert.description": "玩家是否可以向存储网络中存入资源", + "permission.refinedstorage2.extract": "取出", + "permission.refinedstorage2.extract.description": "玩家是否可以从存储网络中取出物品", + "permission.refinedstorage2.autocrafting": "自动合成", + "permission.refinedstorage2.autocrafting.description": "玩家是否可以开始,取消或者查看自动合成任务", + "permission.refinedstorage2.open": "打开", + "permission.refinedstorage2.open.description": "玩家是否可以打开网络中设备的使用界面", + "permission.refinedstorage2.build": "建造", + "permission.refinedstorage2.build.description": "玩家是否可以在网络中添加或者移除设备", + "permission.refinedstorage2.security": "权限", + "permission.refinedstorage2.security.description": "玩家是否可以管理网络的权限设置", "text.autoconfig.refinedstorage2.title": "精致存储 2", - "text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling", - "text.autoconfig.refinedstorage2.option.screenSize": "Screen size", - "text.autoconfig.refinedstorage2.option.maxRowsStretch": "Maximum amount of rows when screen size is stretched", + "text.autoconfig.refinedstorage2.option.smoothScrolling": "平滑滚动", + "text.autoconfig.refinedstorage2.option.screenSize": "界面大小", + "text.autoconfig.refinedstorage2.option.maxRowsStretch": "截面尺寸拉伸时的最大显示行数", "text.autoconfig.refinedstorage2.option.grid": "终端", "text.autoconfig.refinedstorage2.option.grid.largeFont": "大字体", "text.autoconfig.refinedstorage2.option.grid.preventSortingWhileShiftIsDown": "按住 SHIFT 时阻止排序", @@ -361,13 +374,16 @@ "text.autoconfig.refinedstorage2.option.portableGrid.openEnergyUsage": "打开耗能", "text.autoconfig.refinedstorage2.option.portableGrid.insertEnergyUsage": "插入耗能", "text.autoconfig.refinedstorage2.option.portableGrid.extractEnergyUsage": "取出耗能", - "text.autoconfig.refinedstorage2.option.securityCard": "Security Card", - "text.autoconfig.refinedstorage2.option.securityCard.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage2.option.fallbackSecurityCard": "Fallback Security Card", - "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", - "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", - "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", + "text.autoconfig.refinedstorage2.option.securityCard": "权限卡", + "text.autoconfig.refinedstorage2.option.securityCard.energyUsage": "耗能", + "text.autoconfig.refinedstorage2.option.fallbackSecurityCard": "后备权限卡", + "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "耗能", + "text.autoconfig.refinedstorage2.option.securityManager": "权限管理器", + "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "耗能", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", + "advancements.refinedstorage2.root.description": "在网络中使用一个或多个控制器为其提供能量", "advancements.refinedstorage2.connecting": "连接", "advancements.refinedstorage2.connecting.description": "使用电缆将设备连接在一起,或放置时使设备贴在一起", "advancements.refinedstorage2.drives": "驱动器", @@ -391,19 +407,21 @@ "advancements.refinedstorage2.storing_externally": "外部存储", "advancements.refinedstorage2.storing_externally.description": "使用外部存储总线从外部方块(如箱子)提供网络存储", "advancements.refinedstorage2.detecting": "检测", - "advancements.refinedstorage2.detecting.description": "Use redstone to check resources stored in the storage network", + "advancements.refinedstorage2.detecting.description": "使用红石检测存储网络内的资源", "advancements.refinedstorage2.construction": "成型", "advancements.refinedstorage2.construction.description": "使用构造器将方块从存储网络中放入世界", "advancements.refinedstorage2.destruction": "破坏", "advancements.refinedstorage2.destruction.description": "使用破坏器将世界中的方块放入存储网络", "advancements.refinedstorage2.wireless": "无线", - "advancements.refinedstorage2.wireless.description": "Access your resources wirelessly with a Wireless Grid", + "advancements.refinedstorage2.wireless.description": "使用无线终端远程访问你的资源", "advancements.refinedstorage2.better_than_a_barrel": "比桶更好", "advancements.refinedstorage2.better_than_a_barrel.description": "合成存储监视器以查看、插入或提取存储网络中的资源", "advancements.refinedstorage2.no_cables_required": "无需电缆", - "advancements.refinedstorage2.no_cables_required.description": "Add extra components to your storage network without using cables by using a Network Transmitter, Network Receiver and Network Card", + "advancements.refinedstorage2.no_cables_required.description": "通过使用网络变送器、网络接收器和网络卡,在不使用电缆的情况下添加额外组件到你的存储网络", "advancements.refinedstorage2.portable_storage": "便携式存储", "advancements.refinedstorage2.portable_storage.description": "合成一个便携式终端,在不需要连接到存储网络的情况下也可以访问磁盘内容。", "advancements.refinedstorage2.security": "权限", - "advancements.refinedstorage2.security.description": "用权限管理器和权限卡来保护你的存储网络" + "advancements.refinedstorage2.security.description": "用权限管理器和权限卡来保护你的存储网络", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From bc176880edc738177d5c1ad265a9857231d0a61d Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:28:01 +0200 Subject: [PATCH 11/29] chore: update translation Chinese Traditional from crowdin --- .../assets/refinedstorage2/lang/zh_tw.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_tw.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_tw.json index 36f89262b..6e06c5772 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_tw.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_tw.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Creative Portable Grid", "block.refinedstorage2.security_manager": "Security Manager", "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Disks", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From 127022ffe6bd4336d9777e99d13a26c03c922822 Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:28:02 +0200 Subject: [PATCH 12/29] chore: update translation Portuguese, Brazilian from crowdin --- .../assets/refinedstorage2/lang/pt_br.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pt_br.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pt_br.json index 310eb110a..84900c0f4 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pt_br.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pt_br.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Grade Portátil Criativa", "block.refinedstorage2.security_manager": "Security Manager", "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "Quando este dispositivo estiver inativo, a rede de armazenamento não poderá usar este dispositivo como fonte de energia.", "gui.refinedstorage2.disk_drive.disks": "Discos", "gui.refinedstorage2.storage.redstone_mode_help": "Quando este dispositivo estiver inativo, o armazenamento contido não estará mais acessível a partir da rede de armazenamento.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Portable storage", "advancements.refinedstorage2.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From 7f9fe440a2e85dd2a94bb1ec37f115f0927014f1 Mon Sep 17 00:00:00 2001 From: Raoul Date: Sun, 19 May 2024 11:28:03 +0200 Subject: [PATCH 13/29] chore: update translation Indonesian from crowdin --- .../assets/refinedstorage2/lang/id_id.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/id_id.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/id_id.json index 4a58a7d61..56c888902 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/id_id.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/id_id.json @@ -34,6 +34,8 @@ "block.refinedstorage2.creative_portable_grid": "Kisi Portabel Kreatif", "block.refinedstorage2.security_manager": "Security Manager", "block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.", + "block.refinedstorage2.relay": "Relay", + "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.", "gui.refinedstorage2.controller.redstone_mode_help": "Ketika peranagkat ini nonaktif, jaringan penyimpanan tidak dapat menggunakan perangkat ini sebagai sumber energi.", "gui.refinedstorage2.disk_drive.disks": "Cakram", "gui.refinedstorage2.storage.redstone_mode_help": "Ketika perangkat ini nonaktif, penyimpanan tidak akan dapat diakses dari dalam jaringan penyimpanan.", @@ -149,6 +151,17 @@ "gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.", "gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.", "gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.", + "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.", + "gui.refinedstorage2.relay.pass_through": "Pass-through", + "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.", + "gui.refinedstorage2.relay.pass_energy": "Pass energy", + "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.", + "gui.refinedstorage2.relay.pass_storage": "Pass storage", + "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.", + "gui.refinedstorage2.relay.pass_security": "Pass security", + "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.", + "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.", + "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.", "item.refinedstorage2.controller.help": "Menyediakan energi ke jaringan penyimpanan. dapat digunakan beberapa kali dalam satu jaringan penyimpanan.", "item.refinedstorage2.creative_controller.help": "Menyediakan energi tidak terbatas ke jaringan penyimpanan.", "item.refinedstorage2.disk_drive.help": "Menerima cakram penyimpanan untuk menyediakan ruang penyimpanan kedalam jaringan penyimpanan.", @@ -367,6 +380,9 @@ "text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.securityManager": "Security Manager", "text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.relay": "Relay", + "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage", + "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a storage network to provide your network with energy", "advancements.refinedstorage2.connecting": "Menyambungkan", "advancements.refinedstorage2.connecting.description": "Gunakan Kabel untuk menghubungkan perangkat satu sama lain, atau letakkan perangkat melawan satu sama lain", @@ -405,5 +421,7 @@ "advancements.refinedstorage2.portable_storage": "Penyimpanan portabel", "advancements.refinedstorage2.portable_storage.description": "Rakit Kisi Portabel untuk mengakses isi dari cakram tanpa memerlukan jaringan penyimpanan", "advancements.refinedstorage2.security": "Security", - "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card" + "advancements.refinedstorage2.security.description": "Secure your storage network with a Security Manager and a Security Card", + "advancements.refinedstorage2.conditional_connecting": "Conditional connecting", + "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay" } From c84484f1e348bba0dc644f573a43dfdf89b92bf8 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 25 May 2024 12:41:06 +0200 Subject: [PATCH 14/29] feat: initial gametest setup Stop using Guava RateLimiter as the gametests run ticks faster, and the RateLimiter uses the system clock so RS wouldn't keep up with the faster tick rate. --- .github/CONTRIBUTING.md | 55 ++++++--- .github/workflows/build.yml | 4 +- .github/workflows/draft-release.yml | 2 +- .../issue-for-unsupported-version.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/resolved-issue-locking.yml | 2 +- .github/workflows/validate-branch-name.yml | 2 +- .github/workflows/validate-changelog.yml | 2 +- .../workflows/validate-commit-messages.yml | 2 +- config/checkstyle/checkstyle-suppressions.xml | 1 + gradle/wrapper/gradle-wrapper.properties | 2 +- .../ConstructorBlockEntity.java | 2 +- .../common/exporter/ExporterBlockEntity.java | 2 +- .../support/AbstractDirectionalBlock.java | 4 + ...dulingNetworkNodeContainerBlockEntity.java | 2 +- ...deableNetworkNodeContainerBlockEntity.java | 12 +- .../platform/forge/ConstructorTest.java | 51 +++++++++ .../platform/forge/GameTestUtil.java | 104 ++++++++++++++++++ .../structures/empty_15x15.nbt | Bin 0 -> 8456 bytes settings.gradle | 2 +- 20 files changed, 216 insertions(+), 39 deletions(-) create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java create mode 100644 refinedstorage2-platform-forge/src/test/resources/data/refinedstorage2/structures/empty_15x15.nbt diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 875b35587..345803a49 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -44,7 +44,8 @@ Valid examples are: ## Translations -If you want to contribute to the translations of this project, please use [Crowdin](https://crowdin.com/project/refined-storage-2). +If you want to contribute to the translations of this project, please +use [Crowdin](https://crowdin.com/project/refined-storage-2). ## Versioning @@ -126,8 +127,25 @@ at all times. They ensure that there are no regressions, act as general documentation for the codebase, and ensure that the project can evolve over time. -To avoid brittle tests, tests need to validate behavior. A test cannot rely on the internal code structure, so most -mocking should be avoided. +To avoid brittle tests, tests need to validate behavior. A test cannot rely on the internal code structure, so most use +of mocking should be avoided. + +### Unit testing + +Tests in the API modules are regular unit tests. Don't see a "unit" here as a code unit, but as a unit of behavior. + +> Don't isolate code by using mocking, even in a unit test. + +These tests don't rely on, nor know about, Minecraft. + +Additionally, tests in the `refinedstorage2-network` module use the `refinedstorage2-network-test` JUnit plugin to easily set up networks for testing. + +### Integration testing + +To test the entire chain from Minecraft to the API modules, we use integration tests. These tests are located in the +test source set of the `refinedstorage2-platform-forge` module. + +We write these integration tests as Minecraft gametests using the NeoForge testing framework. ### Test coverage @@ -202,6 +220,7 @@ The build workflow takes care of the following: - Running a Gradle build, running our tests in the process and generating an aggregated code coverage report for the API modules. +- Running Minecraft gametests. - Analyzing the code on SonarQube. > Because of > [limitations with SonarQube](https://portal.productboard.com/sonarsource/1-sonarcloud/c/50-sonarcloud-analyzes-external-pull-request), @@ -249,18 +268,18 @@ Refined Storage 2 is split up into various modules. Most modules aren't dependent on Minecraft or a mod loader. Only modules that start with `refinedstorage2-platform-*` have dependencies on Minecraft. -| Name | Use in addons | Description | -|-----------------------------------|---------------|---------------------------------------------------------------------------------------| -| `refinedstorage2-core-api` | ✔️ | Contains some utility classes and enums. | -| `refinedstorage2-grid-api` | ✔️ | Contains Grid related functionality. | -| `refinedstorage2-network-api` | ✔️ | Contains storage network related functionality. | -| `refinedstorage2-network` | ❌ | Contains implementations of `refinedstorage2-network-api`. | -| `refinedstorage2-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. | -| `refinedstorage2-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. | -| `refinedstorage2-resource-api` | ✔️ | Contains API for handling resources. | -| `refinedstorage2-storage-api` | ✔️ | Contains storage related functionality. | -| `refinedstorage2-platform-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. | -| `refinedstorage2-platform-test` | ✔️ | This module is used in platform tests for various Minecraft related helpers. | -| `refinedstorage2-platform-fabric` | ❌ | The platform module for Fabric. This module contains Fabric specific code. | -| `refinedstorage2-platform-forge` | ❌ | The platform module for Forge. This module contains Forge specific code. | -| `refinedstorage2-platform-common` | ❌ | Common mod code. Most gameplay code is in here. | +| Name | Use in addons | Description | +|-----------------------------------|---------------|----------------------------------------------------------------------------------------------------| +| `refinedstorage2-core-api` | ✔️ | Contains some utility classes and enums. | +| `refinedstorage2-grid-api` | ✔️ | Contains Grid related functionality. | +| `refinedstorage2-network-api` | ✔️ | Contains storage network related functionality. | +| `refinedstorage2-network` | ❌ | Contains implementations of `refinedstorage2-network-api`. | +| `refinedstorage2-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. | +| `refinedstorage2-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. | +| `refinedstorage2-resource-api` | ✔️ | Contains API for handling resources. | +| `refinedstorage2-storage-api` | ✔️ | Contains storage related functionality. | +| `refinedstorage2-platform-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. | +| `refinedstorage2-platform-test` | ✔️ | This module is used in platform tests for various Minecraft related helpers. | +| `refinedstorage2-platform-fabric` | ❌ | The platform module for Fabric. This module contains Fabric specific code. | +| `refinedstorage2-platform-forge` | ❌ | The platform module for Forge. This module contains Forge specific code and the integration tests. | +| `refinedstorage2-platform-common` | ❌ | Common mod code. Most gameplay code is in here. | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfd3a654c..94f94e34b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,5 +8,7 @@ on: types: [ opened, synchronize, reopened ] jobs: build: - uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.11.5 + uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.12.1 + with: + gametests: true secrets: inherit diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index b34ffa667..6fad3ac91 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ on: type: string jobs: draft: - uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.11.5 + uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.12.1 with: release-type: ${{ inputs.release-type }} version-number-override: ${{ inputs.version-number-override }} diff --git a/.github/workflows/issue-for-unsupported-version.yml b/.github/workflows/issue-for-unsupported-version.yml index 7aa68ecb9..1664acf15 100644 --- a/.github/workflows/issue-for-unsupported-version.yml +++ b/.github/workflows/issue-for-unsupported-version.yml @@ -4,4 +4,4 @@ on: types: [ labeled, unlabeled, reopened ] jobs: unsupported-labeler: - uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.11.5 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.12.1 \ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index bd9b29525..cf971feb5 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,7 +7,7 @@ on: - closed jobs: publish-release: - uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.11.5 + uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.12.1 secrets: inherit with: project-name: 'Refined Storage' diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml index cbfb9219d..60236446c 100644 --- a/.github/workflows/resolved-issue-locking.yml +++ b/.github/workflows/resolved-issue-locking.yml @@ -4,4 +4,4 @@ on: - cron: '0 0 * * *' jobs: lock: - uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.11.5 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.12.1 \ No newline at end of file diff --git a/.github/workflows/validate-branch-name.yml b/.github/workflows/validate-branch-name.yml index 7f4ce5e06..c862e1c82 100644 --- a/.github/workflows/validate-branch-name.yml +++ b/.github/workflows/validate-branch-name.yml @@ -2,4 +2,4 @@ name: Validate branch name on: [ pull_request ] jobs: validate-branch-name: - uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.11.5 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.12.1 \ No newline at end of file diff --git a/.github/workflows/validate-changelog.yml b/.github/workflows/validate-changelog.yml index 8b90c5051..8c6b2e8de 100644 --- a/.github/workflows/validate-changelog.yml +++ b/.github/workflows/validate-changelog.yml @@ -4,4 +4,4 @@ on: types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ] jobs: validate-changelog: - uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.11.5 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.12.1 \ No newline at end of file diff --git a/.github/workflows/validate-commit-messages.yml b/.github/workflows/validate-commit-messages.yml index d8d12de6b..306fbb8c3 100644 --- a/.github/workflows/validate-commit-messages.yml +++ b/.github/workflows/validate-commit-messages.yml @@ -2,4 +2,4 @@ name: Validate commit messages on: [ pull_request ] jobs: validate-commit-messages: - uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.11.5 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.12.1 \ No newline at end of file diff --git a/config/checkstyle/checkstyle-suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml index b0d870283..8b6e49245 100644 --- a/config/checkstyle/checkstyle-suppressions.xml +++ b/config/checkstyle/checkstyle-suppressions.xml @@ -10,4 +10,5 @@ + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e0930..b82aa23a4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java index 4c870f75e..45cf2e459 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java @@ -57,7 +57,7 @@ public ConstructorBlockEntity(final BlockPos pos, final BlockState state) { } @Override - protected void setFilters(final List filters) { + public void setFilters(final List filters) { this.tasks.clear(); this.tasks.addAll(filters.stream().map(TaskImpl::new).toList()); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java index 5ea3d2f31..2b911edb6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java @@ -95,7 +95,7 @@ protected void setTaskExecutor(final TaskExecutor filters) { + public void setFilters(final List filters) { mainNode.setFilters(filters); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalBlock.java index b8f86a1c7..b61083c3c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalBlock.java @@ -70,6 +70,10 @@ public Direction extractDirection(@Nullable final BlockState state) { return getDirectionType().extractDirection(direction); } + public BlockState rotated(final T direction) { + return defaultBlockState().setValue(getDirectionType().getProperty(), direction); + } + public static boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, final BlockState newBlockState) { if (!(newBlockState.getBlock() instanceof AbstractDirectionalBlock newDirectionalBlock)) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java index df09b565f..dac1392be 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java @@ -82,5 +82,5 @@ public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByte protected abstract void setTaskExecutor(TaskExecutor taskExecutor); - protected abstract void setFilters(List filters); + public abstract void setFilters(List filters); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java index 6939537ae..27f36f9ed 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java @@ -10,7 +10,6 @@ import java.util.ArrayList; import java.util.List; -import com.google.common.util.concurrent.RateLimiter; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; @@ -33,7 +32,8 @@ public abstract class AbstractUpgradeableNetworkNodeContainerBlockEntity type, @@ -52,7 +52,7 @@ protected AbstractUpgradeableNetworkNodeContainerBlockEntity( @Override public final void doWork() { - if (rateLimiter.tryAcquire()) { + if (workTicks++ % workTickRate == 0) { super.doWork(); postDoWork(); } @@ -105,16 +105,12 @@ public void load(final CompoundTag tag) { private void configureAccordingToUpgrades() { LOGGER.debug("Reconfiguring {} for upgrades", getBlockPos()); final int amountOfSpeedUpgrades = upgradeContainer.getAmount(Items.INSTANCE.getSpeedUpgrade()); - this.rateLimiter = createRateLimiter(amountOfSpeedUpgrades); + this.workTickRate = (amountOfSpeedUpgrades + 1) * 20; this.setEnergyUsage(upgradeContainer.getEnergyUsage()); } protected abstract void setEnergyUsage(long upgradeEnergyUsage); - private static RateLimiter createRateLimiter(final int amountOfSpeedUpgrades) { - return RateLimiter.create((double) amountOfSpeedUpgrades + 1); - } - @Override public NonNullList getDrops() { final NonNullList drops = NonNullList.create(); diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java new file mode 100644 index 000000000..88523fe7d --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java @@ -0,0 +1,51 @@ +package com.refinedmods.refinedstorage2.platform.forge; + +import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; + +import java.util.List; + +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.level.block.Blocks; +import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; + +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.DIRT; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.itemIsInserted; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageMustContainExactly; +import static net.minecraft.core.BlockPos.ZERO; + +@GameTestHolder(IdentifierUtil.MOD_ID) +@PrefixGameTestTemplate(false) +public final class ConstructorTest { + private ConstructorTest() { + } + + @GameTest(template = "empty_15x15") + public static void shouldPlaceBlock(final GameTestHelper helper) { + // Arrange + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getConstructor().getDefault().rotated(Direction.EAST)); + helper.setBlock( + ZERO.above().above().above(), + RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K) + ); + + final var seq = helper.startSequence(); + seq.thenWaitUntil(itemIsInserted(helper, ZERO.above().above(), DIRT, 10)); + + // Act + requireBlockEntity(helper, ZERO.above().above(), ConstructorBlockEntity.class).setFilters(List.of(DIRT)); + + // Assert + seq.thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, ZERO.above().above().east())) + .thenWaitUntil(storageMustContainExactly(helper, ZERO.above().above(), new ResourceAmount(DIRT, 9))) + .thenSucceed(); + } +} diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java new file mode 100644 index 000000000..26ffd3042 --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java @@ -0,0 +1,104 @@ +package com.refinedmods.refinedstorage2.platform.forge; + +import com.refinedmods.refinedstorage2.api.core.Action; +import com.refinedmods.refinedstorage2.api.network.Network; +import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; +import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent; +import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.api.storage.EmptyActor; +import com.refinedmods.refinedstorage2.platform.api.support.network.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.content.Blocks; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResource; + +import java.util.Arrays; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.gametest.framework.GameTestAssertException; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.level.block.entity.BlockEntity; + +public final class GameTestUtil { + public static final ItemResource DIRT = ItemResource.ofItemStack(new ItemStack(Items.DIRT)); + public static final Blocks RSBLOCKS = Blocks.INSTANCE; + + private GameTestUtil() { + } + + @Nullable + public static Network getNetwork(final net.minecraft.gametest.framework.GameTestHelper helper, final BlockPos pos) { + try { + final var be = requireBlockEntity(helper, pos, AbstractNetworkNodeContainerBlockEntity.class); + final var field = AbstractNetworkNodeContainerBlockEntity.class.getDeclaredField("mainNode"); + field.setAccessible(true); + final NetworkNode mainNode = (NetworkNode) field.get(be); + return mainNode.getNetwork(); + } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException e) { + throw new RuntimeException(e); + } + } + + public static Runnable itemIsInserted(final net.minecraft.gametest.framework.GameTestHelper helper, + final BlockPos networkPos, + final ItemResource resource, + final long amount) { + return () -> { + final Network network = getNetwork(helper, networkPos); + helper.assertTrue(network != null && network.getComponent(StorageNetworkComponent.class) + .insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE) == amount, + "Item couldn't be inserted" + ); + }; + } + + @SuppressWarnings("unchecked") + public static T requireBlockEntity( + final GameTestHelper helper, + final BlockPos pos, + final Class clazz + ) { + final BlockEntity blockEntity = helper.getBlockEntity(pos); + if (blockEntity == null) { + throw new GameTestAssertException("Block entity not found at " + pos); + } + if (!clazz.isInstance(blockEntity)) { + throw new GameTestAssertException( + "Expected block entity of type " + clazz + " but was " + blockEntity.getClass() + ); + } + return (T) blockEntity; + } + + public static Runnable storageMustContainExactly(final net.minecraft.gametest.framework.GameTestHelper helper, + final BlockPos networkPos, + final ResourceAmount... expected) { + return () -> { + final Network network = getNetwork(helper, networkPos); + helper.assertTrue(network != null, "Network is not found"); + if (network == null) { + return; + } + final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); + for (final ResourceAmount expectedItem : expected) { + final boolean contains = storage.getAll() + .stream() + .anyMatch(inStorage -> inStorage.getResource().equals(expectedItem.getResource()) + && inStorage.getAmount() == expectedItem.getAmount()); + if (!contains) { + throw new GameTestAssertException("Missing from storage: " + expectedItem); + } + } + for (final ResourceAmount inStorage : storage.getAll()) { + final boolean wasExpected = Arrays.stream(expected).anyMatch( + expectedItem -> expectedItem.getResource().equals(inStorage.getResource()) + && expectedItem.getAmount() == inStorage.getAmount() + ); + if (!wasExpected) { + throw new GameTestAssertException("Unexpected in storage: " + inStorage); + } + } + }; + } +} diff --git a/refinedstorage2-platform-forge/src/test/resources/data/refinedstorage2/structures/empty_15x15.nbt b/refinedstorage2-platform-forge/src/test/resources/data/refinedstorage2/structures/empty_15x15.nbt new file mode 100644 index 0000000000000000000000000000000000000000..bec09916859500fc9ffe7cf2c71f422e5a60cc17 GIT binary patch literal 8456 zcmeHMZ)jRq6wla3yKZY>jFe4?9|jv^Z5(TA7`1Uw;ux$AfsMBLqjPDBElI?#P!kg0 zzHEbugi%=f4+C+K(m~U?P)%xLHlbZ7Rcs43(ME<%6r__E<6bpB-`>3rThpiK3J$iS zU!GjfyXT(Y{oUU=_dKz2a}EA+rhD#he^?k${1KHY?te7;xh#3NyLOMn_};7E&$Jvc zok-r=&s_ZOp;_x{{lNOlmcRBMnHPOB*V$lmyBICS4N}vcp2UPXu$)f%#UaDcdYV1% zd9b=Br&15R9K$XjAK+|(<*e2@96x6;ue-yHSY;Su!@IMeCfwuG9gU1}MeUO{oSkS% zI5d}xD_1nix|^}_fsV$waiv>hc)Pvvl`l?Gjl;pN znRlBu4i>S^WKvd*z#Ky6dix1=KdG&w4BMG9Z0E>r?MiYSf(>1#&yj%31EVa*Rzg1S zQW^6ul`(H~8S{El!TWV4Y5KOtA}4-~nqKc)v$k1GO6jpFpIc#)4lZ2qDI}s@i_sp7 zLNwbO+|heSV<~C(#@VXB843Qv2bJD^m)~M)6WZhWXZ%a-(J9}U&_jq1 z`OxtEf5H&7HEm#2;S7j&*IY2z_1j>ur{Hakz+iX6o^%}u!pBaDKum5pCME2Nz5>U@ zz%dPNhY!WA*f>v%T1*SXC3X*bM?Se2_5LVLCoY<@iP?GHgiHOb_5qTBsYoCl;fVKi z3sN6Lvk|Gy8k)DBmn0t=97K{dLLe*G!Z6ron5wh`20I3O>VNT(d_GAGEGzm$Fo6g> zEfK^t2gfu56X<-R1_dR?dhskG2K6P9;t8HILXVPX14CdZI72K9c0B{SC})SpzJMN8#M+g%7=*z!QPokHRrI2t4({F~#AS z9v*~+?EO}>QP~#|3FWu~c?-QHs2gaoWIc)n^(qWOkf3Bz!w`(X5a`=s2okW6U4lK? z;aWW01IIK8d(sn#^Ew<;Gc3+J&rY08zDC)^i;40YB8p%^$`8)Mr?nr3fFXc@fZ5fu zqgZWESE%gx0-y8)ST7#?D^zk+rK7~@cp9aH=2U0;_WQ0pC{LWuFvyF?<)`CZ_--YXoB1OnaIBVEd za4}Hrb`;GT1m$mqx*g|nPT{to%ZdsW4D35dK)8&&A9Yc^A-YgPs@fsYP()qgFu|Vv z|E?@rtQ{|7?ZD}!DW@Ga1!jl0eMdnFQf+tOo{m6M^l9v)kIG-#hne9*S>+^V##SUG zD4`^@`?vGl7#o{D^eDwtB)3F|Zyd&r)lxaC7S2)nPB=&1hA($!xO=VZf;|!RAtVGb z5qKh?;u0Ja{S%UgqBRiS8@Ko#+9`GuPARxiD#n8H48ys!~lE`_rsooa1VjD!Z8teauCEc496sf*qWw#!YQpP zyPCW{G8tiilla{(YB&}1yVq4tHl6f3sZ>bJ(aV82m&y9M%xc(8Q7pS|3mMpmlL<+< On&)DZ`?dz2sregqsUKGW literal 0 HcmV?d00001 diff --git a/settings.gradle b/settings.gradle index 37d224592..90c2297da 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,4 @@ -gradle.ext.refinedArchitectVersion = "0.11.5" +gradle.ext.refinedArchitectVersion = "0.12.1" dependencyResolutionManagement { repositories { From b6162d5e23aa0ccc0c0346dbef1ead2c3811f64d Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 26 May 2024 10:38:39 +0200 Subject: [PATCH 15/29] refactor: improve constructor gametest --- .../platform/forge/ConstructorTest.java | 58 ++++++++++++------ .../platform/forge/GameTestUtil.java | 59 +++++++++---------- 2 files changed, 70 insertions(+), 47 deletions(-) diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java index 88523fe7d..a8b22f16d 100644 --- a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java @@ -7,45 +7,69 @@ import java.util.List; +import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.gametest.framework.GameTest; import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; import net.minecraft.world.level.block.Blocks; import net.neoforged.neoforge.gametest.GameTestHolder; import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; +import org.apache.commons.lang3.function.TriConsumer; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.DIRT; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; -import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.itemIsInserted; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.STONE; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.insertItem; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.networkIsAvailable; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; -import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageMustContainExactly; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageContainsExactly; import static net.minecraft.core.BlockPos.ZERO; @GameTestHolder(IdentifierUtil.MOD_ID) @PrefixGameTestTemplate(false) public final class ConstructorTest { + private ConstructorTest() { } - @GameTest(template = "empty_15x15") - public static void shouldPlaceBlock(final GameTestHelper helper) { - // Arrange + private static void prepareConstructorPlot(final GameTestHelper helper, + final Direction direction, + final TriConsumer + consumer) { helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); - helper.setBlock(ZERO.above().above(), RSBLOCKS.getConstructor().getDefault().rotated(Direction.EAST)); - helper.setBlock( - ZERO.above().above().above(), - RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K) + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); + final BlockPos constructorPos = ZERO.above().above().above(); + helper.setBlock(constructorPos, RSBLOCKS.getConstructor().getDefault().rotated(direction)); + consumer.accept( + requireBlockEntity(helper, constructorPos, ConstructorBlockEntity.class), + constructorPos, + helper.startSequence() ); + } - final var seq = helper.startSequence(); - seq.thenWaitUntil(itemIsInserted(helper, ZERO.above().above(), DIRT, 10)); + @GameTest(template = "empty_15x15") + public static void shouldPlaceBlock(final GameTestHelper helper) { + prepareConstructorPlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insertItem(helper, network, DIRT, 10); + insertItem(helper, network, STONE, 15); + })); - // Act - requireBlockEntity(helper, ZERO.above().above(), ConstructorBlockEntity.class).setFilters(List.of(DIRT)); + // Act + constructor.setFilters(List.of(DIRT)); - // Assert - seq.thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, ZERO.above().above().east())) - .thenWaitUntil(storageMustContainExactly(helper, ZERO.above().above(), new ResourceAmount(DIRT, 9))) - .thenSucceed(); + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(DIRT, 9), + new ResourceAmount(STONE, 15) + )) + .thenSucceed(); + }); } } diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java index 26ffd3042..7d2ab9fbb 100644 --- a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java @@ -11,6 +11,7 @@ import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResource; import java.util.Arrays; +import java.util.function.Consumer; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -22,13 +23,14 @@ public final class GameTestUtil { public static final ItemResource DIRT = ItemResource.ofItemStack(new ItemStack(Items.DIRT)); + public static final ItemResource STONE = ItemResource.ofItemStack(new ItemStack(Items.STONE)); public static final Blocks RSBLOCKS = Blocks.INSTANCE; private GameTestUtil() { } @Nullable - public static Network getNetwork(final net.minecraft.gametest.framework.GameTestHelper helper, final BlockPos pos) { + private static Network getNetwork(final GameTestHelper helper, final BlockPos pos) { try { final var be = requireBlockEntity(helper, pos, AbstractNetworkNodeContainerBlockEntity.class); final var field = AbstractNetworkNodeContainerBlockEntity.class.getDeclaredField("mainNode"); @@ -40,19 +42,25 @@ public static Network getNetwork(final net.minecraft.gametest.framework.GameTest } } - public static Runnable itemIsInserted(final net.minecraft.gametest.framework.GameTestHelper helper, - final BlockPos networkPos, - final ItemResource resource, - final long amount) { + public static Runnable networkIsAvailable(final GameTestHelper helper, + final BlockPos networkPos, + final Consumer networkConsumer) { return () -> { final Network network = getNetwork(helper, networkPos); - helper.assertTrue(network != null && network.getComponent(StorageNetworkComponent.class) - .insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE) == amount, - "Item couldn't be inserted" - ); + helper.assertTrue(network != null, "Network is not available"); + networkConsumer.accept(network); }; } + public static void insertItem(final GameTestHelper helper, + final Network network, + final ItemResource resource, + final long amount) { + final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); + final long inserted = storage.insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE); + helper.assertTrue(inserted == amount, "Item couldn't be inserted"); + } + @SuppressWarnings("unchecked") public static T requireBlockEntity( final GameTestHelper helper, @@ -71,34 +79,25 @@ public static T requireBlockEntity( return (T) blockEntity; } - public static Runnable storageMustContainExactly(final net.minecraft.gametest.framework.GameTestHelper helper, - final BlockPos networkPos, - final ResourceAmount... expected) { - return () -> { - final Network network = getNetwork(helper, networkPos); - helper.assertTrue(network != null, "Network is not found"); - if (network == null) { - return; - } + public static Runnable storageContainsExactly(final GameTestHelper helper, + final BlockPos networkPos, + final ResourceAmount... expected) { + return networkIsAvailable(helper, networkPos, network -> { final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); - for (final ResourceAmount expectedItem : expected) { + for (final ResourceAmount expectedResource : expected) { final boolean contains = storage.getAll() .stream() - .anyMatch(inStorage -> inStorage.getResource().equals(expectedItem.getResource()) - && inStorage.getAmount() == expectedItem.getAmount()); - if (!contains) { - throw new GameTestAssertException("Missing from storage: " + expectedItem); - } + .anyMatch(inStorage -> inStorage.getResource().equals(expectedResource.getResource()) + && inStorage.getAmount() == expectedResource.getAmount()); + helper.assertTrue(contains, "Expected resource is missing from storage: " + expectedResource); } for (final ResourceAmount inStorage : storage.getAll()) { final boolean wasExpected = Arrays.stream(expected).anyMatch( - expectedItem -> expectedItem.getResource().equals(inStorage.getResource()) - && expectedItem.getAmount() == inStorage.getAmount() + expectedResource -> expectedResource.getResource().equals(inStorage.getResource()) + && expectedResource.getAmount() == inStorage.getAmount() ); - if (!wasExpected) { - throw new GameTestAssertException("Unexpected in storage: " + inStorage); - } + helper.assertTrue(wasExpected, "Unexpected resource found in storage: " + inStorage); } - }; + }); } } From f0ec6ca98f5736978ac545c723c2201543b3c12f Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 26 May 2024 10:42:45 +0200 Subject: [PATCH 16/29] refactor: constructor item drop test --- .../ConstructorBlockEntity.java | 2 +- .../platform/forge/ConstructorTest.java | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java index 45cf2e459..08090a30c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java @@ -117,7 +117,7 @@ boolean isDropItems() { return dropItems; } - void setDropItems(final boolean dropItems) { + public void setDropItems(final boolean dropItems) { this.dropItems = dropItems; setChanged(); if (level instanceof ServerLevel serverLevel) { diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java index a8b22f16d..b5f52b618 100644 --- a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java @@ -12,6 +12,7 @@ import net.minecraft.gametest.framework.GameTest; import net.minecraft.gametest.framework.GameTestHelper; import net.minecraft.gametest.framework.GameTestSequence; +import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; import net.neoforged.neoforge.gametest.GameTestHolder; import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; @@ -72,4 +73,31 @@ public static void shouldPlaceBlock(final GameTestHelper helper) { .thenSucceed(); }); } + + @GameTest(template = "empty_15x15") + public static void shouldDropItem(final GameTestHelper helper) { + prepareConstructorPlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insertItem(helper, network, DIRT, 10); + insertItem(helper, network, STONE, 15); + })); + + // Act + constructor.setDropItems(true); + constructor.setFilters(List.of(DIRT)); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenWaitUntil(() -> helper.assertItemEntityPresent(Items.DIRT, pos.east(), 1)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(DIRT, 9), + new ResourceAmount(STONE, 15) + )) + .thenSucceed(); + }); + } } From 6e43ee1e0489792912a081f889fe6a6f40dc872a Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 26 May 2024 10:59:07 +0200 Subject: [PATCH 17/29] refactor: constructor fluid place test --- .github/CONTRIBUTING.md | 2 +- .../platform/forge/ConstructorTest.java | 47 +++++++++++++++++-- .../platform/forge/GameTestUtil.java | 27 +++++++++-- 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 345803a49..d8476f963 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -145,7 +145,7 @@ Additionally, tests in the `refinedstorage2-network` module use the `refinedstor To test the entire chain from Minecraft to the API modules, we use integration tests. These tests are located in the test source set of the `refinedstorage2-platform-forge` module. -We write these integration tests as Minecraft gametests using the NeoForge testing framework. +We write these integration tests as Minecraft gametests. ### Test coverage diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java index b5f52b618..2a1faeabf 100644 --- a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java @@ -1,7 +1,9 @@ package com.refinedmods.refinedstorage2.platform.forge; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; @@ -14,6 +16,8 @@ import net.minecraft.gametest.framework.GameTestSequence; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.material.FluidState; +import net.minecraft.world.level.material.Fluids; import net.neoforged.neoforge.gametest.GameTestHolder; import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; import org.apache.commons.lang3.function.TriConsumer; @@ -21,7 +25,9 @@ import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.DIRT; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.STONE; -import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.insertItem; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.WATER; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.assertFluidPresent; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.insert; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.networkIsAvailable; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageContainsExactly; @@ -40,6 +46,10 @@ private static void prepareConstructorPlot(final GameTestHelper helper, consumer) { helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) + ); final BlockPos constructorPos = ZERO.above().above().above(); helper.setBlock(constructorPos, RSBLOCKS.getConstructor().getDefault().rotated(direction)); consumer.accept( @@ -54,8 +64,8 @@ public static void shouldPlaceBlock(final GameTestHelper helper) { prepareConstructorPlot(helper, Direction.EAST, (constructor, pos, sequence) -> { // Arrange sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insertItem(helper, network, DIRT, 10); - insertItem(helper, network, STONE, 15); + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); })); // Act @@ -74,13 +84,40 @@ public static void shouldPlaceBlock(final GameTestHelper helper) { }); } + @GameTest(template = "empty_15x15") + public static void shouldPlaceWater(final GameTestHelper helper) { + prepareConstructorPlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, WATER, Platform.INSTANCE.getBucketAmount() * 2); + })); + + // Act + constructor.setFilters(List.of(WATER)); + + // Assert + sequence + .thenWaitUntil(() -> assertFluidPresent(helper, pos.east(), Fluids.WATER, FluidState.AMOUNT_FULL)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(DIRT, 10), + new ResourceAmount(STONE, 15), + new ResourceAmount(WATER, Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } + @GameTest(template = "empty_15x15") public static void shouldDropItem(final GameTestHelper helper) { prepareConstructorPlot(helper, Direction.EAST, (constructor, pos, sequence) -> { // Arrange sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { - insertItem(helper, network, DIRT, 10); - insertItem(helper, network, STONE, 15); + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); })); // Act diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java index 7d2ab9fbb..5c95e0e20 100644 --- a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java @@ -5,9 +5,11 @@ import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.api.resource.ResourceKey; import com.refinedmods.refinedstorage2.api.storage.EmptyActor; import com.refinedmods.refinedstorage2.platform.api.support.network.AbstractNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResource; import java.util.Arrays; @@ -20,10 +22,14 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.material.Fluid; +import net.minecraft.world.level.material.FluidState; +import net.minecraft.world.level.material.Fluids; public final class GameTestUtil { public static final ItemResource DIRT = ItemResource.ofItemStack(new ItemStack(Items.DIRT)); public static final ItemResource STONE = ItemResource.ofItemStack(new ItemStack(Items.STONE)); + public static final FluidResource WATER = new FluidResource(Fluids.WATER, null); public static final Blocks RSBLOCKS = Blocks.INSTANCE; private GameTestUtil() { @@ -52,13 +58,13 @@ public static Runnable networkIsAvailable(final GameTestHelper helper, }; } - public static void insertItem(final GameTestHelper helper, - final Network network, - final ItemResource resource, - final long amount) { + public static void insert(final GameTestHelper helper, + final Network network, + final ResourceKey resource, + final long amount) { final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); final long inserted = storage.insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE); - helper.assertTrue(inserted == amount, "Item couldn't be inserted"); + helper.assertTrue(inserted == amount, "Resource couldn't be inserted"); } @SuppressWarnings("unchecked") @@ -79,6 +85,17 @@ public static T requireBlockEntity( return (T) blockEntity; } + public static void assertFluidPresent(final GameTestHelper helper, + final BlockPos pos, + final Fluid fluid, + final int level) { + final FluidState fluidState = helper.getLevel().getFluidState(helper.absolutePos(pos)); + helper.assertTrue( + fluidState.getType() == fluid && fluidState.getAmount() == level, + "Unexpected " + fluidState.getType() + ", " + fluidState.getAmount() + ); + } + public static Runnable storageContainsExactly(final GameTestHelper helper, final BlockPos networkPos, final ResourceAmount... expected) { From f144bcfc55099b0218ffbe2673d14b03d96c15ea Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 26 May 2024 11:20:12 +0200 Subject: [PATCH 18/29] refactor: have stricter method visibility again by placing test in the same package --- .../ConstructorBlockEntity.java | 4 +- .../common/exporter/ExporterBlockEntity.java | 2 +- ...dulingNetworkNodeContainerBlockEntity.java | 2 +- .../ConstructorTest.java | 99 +++++++++---------- .../ConstructorTestPlots.java | 37 +++++++ .../platform/forge/GameTestUtil.java | 29 ++++-- 6 files changed, 113 insertions(+), 60 deletions(-) rename refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/{forge => common/constructordestructor}/ConstructorTest.java (53%) create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorTestPlots.java diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java index 08090a30c..4c870f75e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java @@ -57,7 +57,7 @@ public ConstructorBlockEntity(final BlockPos pos, final BlockState state) { } @Override - public void setFilters(final List filters) { + protected void setFilters(final List filters) { this.tasks.clear(); this.tasks.addAll(filters.stream().map(TaskImpl::new).toList()); } @@ -117,7 +117,7 @@ boolean isDropItems() { return dropItems; } - public void setDropItems(final boolean dropItems) { + void setDropItems(final boolean dropItems) { this.dropItems = dropItems; setChanged(); if (level instanceof ServerLevel serverLevel) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java index 2b911edb6..5ea3d2f31 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java @@ -95,7 +95,7 @@ protected void setTaskExecutor(final TaskExecutor filters) { + protected void setFilters(final List filters) { mainNode.setFilters(filters); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java index dac1392be..df09b565f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java @@ -82,5 +82,5 @@ public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByte protected abstract void setTaskExecutor(TaskExecutor taskExecutor); - public abstract void setFilters(List filters); + protected abstract void setFilters(List filters); } diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorTest.java similarity index 53% rename from refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java rename to refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorTest.java index 2a1faeabf..994129a19 100644 --- a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/ConstructorTest.java +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorTest.java @@ -1,67 +1,40 @@ -package com.refinedmods.refinedstorage2.platform.forge; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; import java.util.List; -import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.gametest.framework.GameTest; import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.gametest.framework.GameTestSequence; -import net.minecraft.world.item.Items; +import net.minecraft.world.entity.EntityType; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.material.FluidState; -import net.minecraft.world.level.material.Fluids; import net.neoforged.neoforge.gametest.GameTestHolder; import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; -import org.apache.commons.lang3.function.TriConsumer; -import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.DIRT; -import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; -import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.STONE; -import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.WATER; +import static com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorTestPlots.preparePlot; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.asResource; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.assertFluidPresent; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.insert; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.networkIsAvailable; -import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageContainsExactly; -import static net.minecraft.core.BlockPos.ZERO; +import static net.minecraft.world.item.Items.DIRT; +import static net.minecraft.world.item.Items.FIREWORK_ROCKET; +import static net.minecraft.world.item.Items.STONE; +import static net.minecraft.world.level.material.Fluids.WATER; @GameTestHolder(IdentifierUtil.MOD_ID) @PrefixGameTestTemplate(false) public final class ConstructorTest { - private ConstructorTest() { } - private static void prepareConstructorPlot(final GameTestHelper helper, - final Direction direction, - final TriConsumer - consumer) { - helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); - helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); - helper.setBlock( - ZERO.above().above().north(), - RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) - ); - final BlockPos constructorPos = ZERO.above().above().above(); - helper.setBlock(constructorPos, RSBLOCKS.getConstructor().getDefault().rotated(direction)); - consumer.accept( - requireBlockEntity(helper, constructorPos, ConstructorBlockEntity.class), - constructorPos, - helper.startSequence() - ); - } - @GameTest(template = "empty_15x15") public static void shouldPlaceBlock(final GameTestHelper helper) { - prepareConstructorPlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { // Arrange sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { insert(helper, network, DIRT, 10); @@ -69,7 +42,7 @@ public static void shouldPlaceBlock(final GameTestHelper helper) { })); // Act - constructor.setFilters(List.of(DIRT)); + constructor.setFilters(List.of(asResource(DIRT))); // Assert sequence @@ -77,8 +50,8 @@ public static void shouldPlaceBlock(final GameTestHelper helper) { .thenWaitUntil(storageContainsExactly( helper, pos, - new ResourceAmount(DIRT, 9), - new ResourceAmount(STONE, 15) + new ResourceAmount(asResource(DIRT), 9), + new ResourceAmount(asResource(STONE), 15) )) .thenSucceed(); }); @@ -86,7 +59,7 @@ public static void shouldPlaceBlock(final GameTestHelper helper) { @GameTest(template = "empty_15x15") public static void shouldPlaceWater(final GameTestHelper helper) { - prepareConstructorPlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { // Arrange sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { insert(helper, network, DIRT, 10); @@ -95,17 +68,17 @@ public static void shouldPlaceWater(final GameTestHelper helper) { })); // Act - constructor.setFilters(List.of(WATER)); + constructor.setFilters(List.of(asResource(WATER))); // Assert sequence - .thenWaitUntil(() -> assertFluidPresent(helper, pos.east(), Fluids.WATER, FluidState.AMOUNT_FULL)) + .thenWaitUntil(() -> assertFluidPresent(helper, pos.east(), WATER, FluidState.AMOUNT_FULL)) .thenWaitUntil(storageContainsExactly( helper, pos, - new ResourceAmount(DIRT, 10), - new ResourceAmount(STONE, 15), - new ResourceAmount(WATER, Platform.INSTANCE.getBucketAmount()) + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) )) .thenSucceed(); }); @@ -113,7 +86,7 @@ public static void shouldPlaceWater(final GameTestHelper helper) { @GameTest(template = "empty_15x15") public static void shouldDropItem(final GameTestHelper helper) { - prepareConstructorPlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { // Arrange sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { insert(helper, network, DIRT, 10); @@ -122,17 +95,43 @@ public static void shouldDropItem(final GameTestHelper helper) { // Act constructor.setDropItems(true); - constructor.setFilters(List.of(DIRT)); + constructor.setFilters(List.of(asResource(DIRT))); // Assert sequence .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) - .thenWaitUntil(() -> helper.assertItemEntityPresent(Items.DIRT, pos.east(), 1)) + .thenWaitUntil(() -> helper.assertItemEntityPresent(DIRT, pos.east(), 1)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 9), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldPlaceFireworks(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (constructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, FIREWORK_ROCKET, 15); + })); + + // Act + constructor.setFilters(List.of(asResource(FIREWORK_ROCKET))); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.AIR, pos.east())) + .thenWaitUntil(() -> helper.assertEntityPresent(EntityType.FIREWORK_ROCKET, pos.east())) .thenWaitUntil(storageContainsExactly( helper, pos, - new ResourceAmount(DIRT, 9), - new ResourceAmount(STONE, 15) + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(FIREWORK_ROCKET), 14) )) .thenSucceed(); }); diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorTestPlots.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorTestPlots.java new file mode 100644 index 000000000..35ed4ba4f --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorTestPlots.java @@ -0,0 +1,37 @@ +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; + +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; +import org.apache.commons.lang3.function.TriConsumer; + +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; +import static net.minecraft.core.BlockPos.ZERO; + +final class ConstructorTestPlots { + private ConstructorTestPlots() { + } + + static void preparePlot(final GameTestHelper helper, + final Direction direction, + final TriConsumer consumer) { + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) + ); + final BlockPos constructorPos = ZERO.above().above().above(); + helper.setBlock(constructorPos, RSBLOCKS.getConstructor().getDefault().rotated(direction)); + consumer.accept( + requireBlockEntity(helper, constructorPos, ConstructorBlockEntity.class), + constructorPos, + helper.startSequence() + ); + } +} diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java index 5c95e0e20..5485bc5f1 100644 --- a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java @@ -19,17 +19,12 @@ import net.minecraft.core.BlockPos; import net.minecraft.gametest.framework.GameTestAssertException; import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; +import net.minecraft.world.item.Item; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.FluidState; -import net.minecraft.world.level.material.Fluids; public final class GameTestUtil { - public static final ItemResource DIRT = ItemResource.ofItemStack(new ItemStack(Items.DIRT)); - public static final ItemResource STONE = ItemResource.ofItemStack(new ItemStack(Items.STONE)); - public static final FluidResource WATER = new FluidResource(Fluids.WATER, null); public static final Blocks RSBLOCKS = Blocks.INSTANCE; private GameTestUtil() { @@ -58,6 +53,20 @@ public static Runnable networkIsAvailable(final GameTestHelper helper, }; } + public static void insert(final GameTestHelper helper, + final Network network, + final Item resource, + final long amount) { + insert(helper, network, new ItemResource(resource, null), amount); + } + + public static void insert(final GameTestHelper helper, + final Network network, + final Fluid resource, + final long amount) { + insert(helper, network, new FluidResource(resource, null), amount); + } + public static void insert(final GameTestHelper helper, final Network network, final ResourceKey resource, @@ -117,4 +126,12 @@ public static Runnable storageContainsExactly(final GameTestHelper helper, } }); } + + public static ItemResource asResource(final Item item) { + return new ItemResource(item, null); + } + + public static FluidResource asResource(final Fluid fluid) { + return new FluidResource(fluid, null); + } } From e345cfa5972bdf288ef48f44008ea0b47620db86 Mon Sep 17 00:00:00 2001 From: Starforcraft Date: Mon, 27 May 2024 16:19:27 +0200 Subject: [PATCH 19/29] feat: importer and exporter gametest setup --- .../common/importer/ImporterBlockEntity.java | 7 +- .../common/exporter/ExporterTest.java | 129 ++++++++++ .../common/exporter/ExporterTestPlots.java | 40 +++ .../common/importer/ImporterTest.java | 236 ++++++++++++++++++ .../common/importer/ImporterTestPlots.java | 50 ++++ .../platform/forge/GameTestUtil.java | 37 +++ 6 files changed, 498 insertions(+), 1 deletion(-) create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterTest.java create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterTestPlots.java create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterTest.java create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterTestPlots.java diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java index 1945dfab1..fab93c5e5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java @@ -20,6 +20,7 @@ import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.List; +import java.util.Set; import java.util.function.LongSupplier; import javax.annotation.Nullable; @@ -57,7 +58,7 @@ public ImporterBlockEntity(final BlockPos pos, final BlockState state) { this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters( ResourceContainerImpl.createForFilter(), this::setChanged, - mainNode::setFilters + this::setFilters ); this.mainNode.setNormalizer(filter.createNormalizer()); } @@ -96,6 +97,10 @@ public void readConfiguration(final CompoundTag tag) { filter.load(tag); } + void setFilters(final Set filters) { + mainNode.setFilters(filters); + } + boolean isFuzzyMode() { return filter.isFuzzyMode(); } diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterTest.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterTest.java new file mode 100644 index 000000000..d89f99fb4 --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterTest.java @@ -0,0 +1,129 @@ +package com.refinedmods.refinedstorage2.platform.common.exporter; + +import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; + +import java.util.List; + +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.LayeredCauldronBlock; +import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; + +import static com.refinedmods.refinedstorage2.platform.common.exporter.ExporterTestPlots.preparePlot; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.asResource; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.containerContainsExactly; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.insert; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.networkIsAvailable; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageContainsExactly; +import static net.minecraft.world.item.Items.DIAMOND_CHESTPLATE; +import static net.minecraft.world.item.Items.DIRT; +import static net.minecraft.world.item.Items.STONE; +import static net.minecraft.world.level.material.Fluids.WATER; + +@GameTestHolder(IdentifierUtil.MOD_ID) +@PrefixGameTestTemplate(false) +public final class ExporterTest { + private ExporterTest() { + } + + @GameTest(template = "empty_15x15") + public static void shouldExportItem(final GameTestHelper helper) { + preparePlot(helper, true, Direction.EAST, (exporter, pos, sequence) -> { + // Arrange + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, asResource(damagedDiamondChestplate), 1); + })); + + // Act + exporter.setFilters(List.of(asResource(DIRT), asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + + // Assert + sequence + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIRT), 1))) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 9), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldExportItemFuzzy(final GameTestHelper helper) { + preparePlot(helper, true, Direction.EAST, (exporter, pos, sequence) -> { + // Arrange + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, DIAMOND_CHESTPLATE, 1); + insert(helper, network, asResource(damagedDiamondChestplate), 1); + })); + + // Act + exporter.setFuzzyMode(true); + exporter.setFilters(List.of(asResource(DIAMOND_CHESTPLATE))); + + // Assert + sequence + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), + new ResourceAmount(asResource(damagedDiamondChestplate), 1))) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldExportFluid(final GameTestHelper helper) { + preparePlot(helper, false, Direction.EAST, (exporter, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + insert(helper, network, WATER, Platform.INSTANCE.getBucketAmount() * 2); + })); + + // Act + exporter.setFilters(List.of(asResource(WATER))); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockProperty(pos.east(), LayeredCauldronBlock.LEVEL, + LayeredCauldronBlock.MAX_FILL_LEVEL)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } +} diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterTestPlots.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterTestPlots.java new file mode 100644 index 000000000..8cf74448b --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterTestPlots.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage2.platform.common.exporter; + +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; +import net.minecraft.world.level.block.Blocks; +import org.apache.commons.lang3.function.TriConsumer; + +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; +import static net.minecraft.core.BlockPos.ZERO; + +final class ExporterTestPlots { + private ExporterTestPlots() { + } + + static void preparePlot(final GameTestHelper helper, + final boolean itemTest, + final Direction direction, + final TriConsumer consumer) { + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) + ); + final BlockPos exporterPos = ZERO.above().above().above(); + helper.setBlock(exporterPos, RSBLOCKS.getExporter().getDefault().rotated(direction)); + helper.setBlock(exporterPos.east(), itemTest ? Blocks.CHEST : Blocks.CAULDRON); + consumer.accept( + requireBlockEntity(helper, exporterPos, ExporterBlockEntity.class), + exporterPos, + helper.startSequence() + ); + } +} diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterTest.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterTest.java new file mode 100644 index 000000000..ba22f0e24 --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterTest.java @@ -0,0 +1,236 @@ +package com.refinedmods.refinedstorage2.platform.common.importer; + +import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; + +import java.util.Set; + +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.LayeredCauldronBlock; +import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; + +import static com.refinedmods.refinedstorage2.platform.common.importer.ImporterTestPlots.prepareChest; +import static com.refinedmods.refinedstorage2.platform.common.importer.ImporterTestPlots.preparePlot; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.asResource; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.containerContainsExactly; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.insert; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.networkIsAvailable; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageContainsExactly; +import static net.minecraft.world.item.Items.COBBLESTONE; +import static net.minecraft.world.item.Items.DIAMOND_CHESTPLATE; +import static net.minecraft.world.item.Items.DIRT; +import static net.minecraft.world.item.Items.STONE; +import static net.minecraft.world.level.material.Fluids.WATER; + +@GameTestHolder(IdentifierUtil.MOD_ID) +@PrefixGameTestTemplate(false) +public final class ImporterTest { + private ImporterTest() { + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItem(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), + COBBLESTONE.getDefaultInstance().copyWithCount(3)); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertContainerEmpty(pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(COBBLESTONE), 3) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemBlocklist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), + DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate); + + importer.setFuzzyMode(false); + importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + importer.setFilterMode(FilterMode.BLOCK); + + // Assert + sequence + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1))) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemFuzzyBlocklist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), + DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate); + + importer.setFuzzyMode(true); + importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + importer.setFilterMode(FilterMode.BLOCK); + + // Assert + sequence + .thenIdle(10) + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), + new ResourceAmount(asResource(damagedDiamondChestplate), 1))) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemAllowlist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), + DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate); + + importer.setFuzzyMode(false); + importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + importer.setFilterMode(FilterMode.ALLOW); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertContainerContains(pos.east(), DIRT)) + .thenWaitUntil(containerContainsExactly( + helper, + pos.east(), + new ResourceAmount(asResource(DIRT), 1), + new ResourceAmount(asResource(damagedDiamondChestplate), 1))) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportItemFuzzyAllowlist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + final ItemStack damagedDiamondChestplate = DIAMOND_CHESTPLATE.getDefaultInstance(); + damagedDiamondChestplate.setDamageValue(500); + prepareChest(helper, pos.east(), DIRT.getDefaultInstance(), + DIAMOND_CHESTPLATE.getDefaultInstance(), damagedDiamondChestplate); + + importer.setFuzzyMode(true); + importer.setFilters(Set.of(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()))); + importer.setFilterMode(FilterMode.ALLOW); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertContainerContains(pos.east(), DIRT)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(DIAMOND_CHESTPLATE.getDefaultInstance()), 1), + new ResourceAmount(asResource(damagedDiamondChestplate), 1) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldImportFluid(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (importer, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + helper.setBlock(pos.east(), Blocks.WATER_CAULDRON.defaultBlockState() + .setValue(LayeredCauldronBlock.LEVEL, LayeredCauldronBlock.MAX_FILL_LEVEL)); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.CAULDRON, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } +} diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterTestPlots.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterTestPlots.java new file mode 100644 index 000000000..44a9c357c --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterTestPlots.java @@ -0,0 +1,50 @@ +package com.refinedmods.refinedstorage2.platform.common.importer; + +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; +import org.apache.commons.lang3.function.TriConsumer; + +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; +import static net.minecraft.core.BlockPos.ZERO; + +final class ImporterTestPlots { + private ImporterTestPlots() { + } + + static void preparePlot(final GameTestHelper helper, + final Direction direction, + final TriConsumer consumer) { + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) + ); + final BlockPos importerPos = ZERO.above().above().above(); + helper.setBlock(importerPos, RSBLOCKS.getImporter().getDefault().rotated(direction)); + consumer.accept( + requireBlockEntity(helper, importerPos, ImporterBlockEntity.class), + importerPos, + helper.startSequence() + ); + } + + static void prepareChest(final GameTestHelper helper, + final BlockPos pos, + final ItemStack... stacks) { + helper.setBlock(pos, Blocks.CHEST.defaultBlockState()); + final var chestBlockEntity = requireBlockEntity(helper, pos, BaseContainerBlockEntity.class); + for (int i = 0; i < stacks.length; i++) { + chestBlockEntity.setItem(i, stacks[i]); + } + } +} diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java index 5485bc5f1..bdc9b4fe5 100644 --- a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/forge/GameTestUtil.java @@ -14,12 +14,16 @@ import java.util.Arrays; import java.util.function.Consumer; +import java.util.stream.IntStream; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.gametest.framework.GameTestAssertException; import net.minecraft.gametest.framework.GameTestHelper; import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.FluidState; @@ -105,6 +109,35 @@ public static void assertFluidPresent(final GameTestHelper helper, ); } + public static Runnable containerContainsExactly(final GameTestHelper helper, + final BlockPos pos, + final ResourceAmount... expected) { + final var containerBlockEntity = requireBlockEntity(helper, pos, BaseContainerBlockEntity.class); + + return () -> { + for (final ResourceAmount expectedStack : expected) { + final boolean contains = IntStream.range(0, containerBlockEntity.getContainerSize()) + .mapToObj(containerBlockEntity::getItem) + .anyMatch(inContainer -> asResource(inContainer).equals(expectedStack.getResource()) + && inContainer.getCount() == expectedStack.getAmount()); + helper.assertTrue(contains, "Expected resource is missing from storage: " + + expectedStack + " with count: " + expectedStack.getAmount()); + } + for (int i = 0; i < containerBlockEntity.getContainerSize(); i++) { + final ItemStack inContainer = containerBlockEntity.getItem(i); + + if (inContainer.getItem() != Items.AIR) { + final boolean wasExpected = Arrays.stream(expected).anyMatch( + expectedStack -> expectedStack.getResource().equals(asResource(inContainer)) + && expectedStack.getAmount() == inContainer.getCount() + ); + helper.assertTrue(wasExpected, "Unexpected resource found in storage: " + + inContainer.getDescriptionId() + " with count: " + inContainer.getCount()); + } + } + }; + } + public static Runnable storageContainsExactly(final GameTestHelper helper, final BlockPos networkPos, final ResourceAmount... expected) { @@ -131,6 +164,10 @@ public static ItemResource asResource(final Item item) { return new ItemResource(item, null); } + public static ItemResource asResource(final ItemStack itemStack) { + return new ItemResource(itemStack.getItem(), itemStack.getTag()); + } + public static FluidResource asResource(final Fluid fluid) { return new FluidResource(fluid, null); } From 4556982304d763c0a3b85be44854d3700facf6fb Mon Sep 17 00:00:00 2001 From: Starforcraft Date: Tue, 28 May 2024 09:12:09 +0200 Subject: [PATCH 20/29] feat: destructor gametest setup --- .../DestructorBlockEntity.java | 8 +- .../constructordestructor/DestructorTest.java | 247 ++++++++++++++++++ .../DestructorTestPlots.java | 37 +++ 3 files changed, 291 insertions(+), 1 deletion(-) create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorTest.java create mode 100644 refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorTestPlots.java diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java index f75759a49..1792aef9f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java @@ -2,6 +2,7 @@ import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage2.api.network.node.NetworkNodeActor; +import com.refinedmods.refinedstorage2.api.resource.ResourceKey; import com.refinedmods.refinedstorage2.api.resource.filter.Filter; import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage2.api.storage.Actor; @@ -19,6 +20,7 @@ import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.List; +import java.util.Set; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -57,7 +59,7 @@ public DestructorBlockEntity(final BlockPos pos, final BlockState state) { this.filterWithFuzzyMode = FilterWithFuzzyMode.createAndListenForUniqueFilters( ResourceContainerImpl.createForFilter(), this::setChanged, - filter::setFilters + this::setFilters ); } @@ -73,6 +75,10 @@ public void setPickupItems(final boolean pickupItems) { } } + void setFilters(final Set filters) { + filter.setFilters(filters); + } + public FilterMode getFilterMode() { return filter.getMode(); } diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorTest.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorTest.java new file mode 100644 index 000000000..e0cb1f50e --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorTest.java @@ -0,0 +1,247 @@ +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; + +import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; + +import java.util.Set; + +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.level.block.Blocks; +import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; + +import static com.refinedmods.refinedstorage2.platform.common.constructordestructor.DestructorTestPlots.preparePlot; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.asResource; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.insert; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.networkIsAvailable; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.storageContainsExactly; +import static net.minecraft.world.item.Items.DIRT; +import static net.minecraft.world.item.Items.STONE; +import static net.minecraft.world.level.material.Fluids.LAVA; +import static net.minecraft.world.level.material.Fluids.WATER; + +@GameTestHolder(IdentifierUtil.MOD_ID) +@PrefixGameTestTemplate(false) +public final class DestructorTest { + private DestructorTest() { + } + + @GameTest(template = "empty_15x15") + public static void shouldBreakBlock(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + helper.setBlock(pos.east(), Blocks.DIRT); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldBreakBlockAllowlist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.ALLOW); + destructor.setFilters(Set.of(asResource(DIRT))); + + helper.setBlock(pos.east(), Blocks.DIRT); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenExecute(() -> helper.setBlock(pos.east(), Blocks.STONE)) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.STONE, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldBreakBlockBlocklist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.BLOCK); + destructor.setFilters(Set.of(asResource(STONE))); + + helper.setBlock(pos.east(), Blocks.DIRT); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.DIRT, pos.east())) + .thenExecute(() -> helper.setBlock(pos.east(), Blocks.STONE)) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.STONE, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldPickupItemAllowlist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.ALLOW); + destructor.setPickupItems(true); + destructor.setFilters(Set.of(asResource(DIRT))); + + helper.spawnItem(DIRT, pos.east()); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertItemEntityNotPresent(DIRT, pos.east(), 1)) + .thenExecute(() -> helper.spawnItem(STONE, pos.east())) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertItemEntityPresent(STONE, pos.east(), 1)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldPickupItemBlocklist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.BLOCK); + destructor.setPickupItems(true); + destructor.setFilters(Set.of(asResource(STONE))); + + helper.spawnItem(DIRT, pos.east()); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertItemEntityNotPresent(DIRT, pos.east(), 1)) + .thenExecute(() -> helper.spawnItem(STONE, pos.east())) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertItemEntityPresent(STONE, pos.east(), 1)) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 11), + new ResourceAmount(asResource(STONE), 15) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldDrainFluidAllowlist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.ALLOW); + destructor.setFilters(Set.of(asResource(WATER))); + + helper.setBlock(pos.east(), Blocks.WATER); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.WATER, pos.east())) + .thenExecute(() -> helper.setBlock(pos.east(), Blocks.DIRT)) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.DIRT, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } + + @GameTest(template = "empty_15x15") + public static void shouldDrainFluidBlocklist(final GameTestHelper helper) { + preparePlot(helper, Direction.EAST, (destructor, pos, sequence) -> { + // Arrange + sequence.thenWaitUntil(networkIsAvailable(helper, pos, network -> { + insert(helper, network, DIRT, 10); + insert(helper, network, STONE, 15); + })); + + // Act + destructor.setFilterMode(FilterMode.BLOCK); + destructor.setFilters(Set.of(asResource(LAVA))); + + helper.setBlock(pos.east(), Blocks.WATER); + + // Assert + sequence + .thenWaitUntil(() -> helper.assertBlockNotPresent(Blocks.WATER, pos.east())) + .thenExecute(() -> helper.setBlock(pos.east(), Blocks.LAVA)) + .thenIdle(20) + .thenWaitUntil(() -> helper.assertBlockPresent(Blocks.LAVA, pos.east())) + .thenWaitUntil(storageContainsExactly( + helper, + pos, + new ResourceAmount(asResource(DIRT), 10), + new ResourceAmount(asResource(STONE), 15), + new ResourceAmount(asResource(WATER), Platform.INSTANCE.getBucketAmount()) + )) + .thenSucceed(); + }); + } +} diff --git a/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorTestPlots.java b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorTestPlots.java new file mode 100644 index 000000000..49556acd4 --- /dev/null +++ b/refinedstorage2-platform-forge/src/test/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorTestPlots.java @@ -0,0 +1,37 @@ +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; + +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.gametest.framework.GameTestSequence; +import org.apache.commons.lang3.function.TriConsumer; + +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.RSBLOCKS; +import static com.refinedmods.refinedstorage2.platform.forge.GameTestUtil.requireBlockEntity; +import static net.minecraft.core.BlockPos.ZERO; + +final class DestructorTestPlots { + private DestructorTestPlots() { + } + + static void preparePlot(final GameTestHelper helper, + final Direction direction, + final TriConsumer consumer) { + helper.setBlock(ZERO.above(), RSBLOCKS.getCreativeController().getDefault()); + helper.setBlock(ZERO.above().above(), RSBLOCKS.getItemStorageBlock(ItemStorageType.Variant.ONE_K)); + helper.setBlock( + ZERO.above().above().north(), + RSBLOCKS.getFluidStorageBlock(FluidStorageType.Variant.SIXTY_FOUR_B) + ); + final BlockPos destructorPos = ZERO.above().above().above(); + helper.setBlock(destructorPos, RSBLOCKS.getDestructor().getDefault().rotated(direction)); + consumer.accept( + requireBlockEntity(helper, destructorPos, DestructorBlockEntity.class), + destructorPos, + helper.startSequence() + ); + } +} From 3028b552b3bc259eea84e8c3a60689cad8045b82 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 28 May 2024 20:26:56 +0200 Subject: [PATCH 21/29] docs: add adr template --- doc/architecture/decision/000-template.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/architecture/decision/000-template.md diff --git a/doc/architecture/decision/000-template.md b/doc/architecture/decision/000-template.md new file mode 100644 index 000000000..23a45a200 --- /dev/null +++ b/doc/architecture/decision/000-template.md @@ -0,0 +1,13 @@ +# 0. + +Date: + +## Status + +## Context + +## Decision + +## Consequences + +## References From 455b4d0b8cb95a1e9ca4c9e4557270b260dbde22 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 28 May 2024 20:27:05 +0200 Subject: [PATCH 22/29] docs: add adr about versioning, remove from contributing --- .github/CONTRIBUTING.md | 39 +++++++--------- doc/architecture/decision/007-versioning.md | 51 +++++++++++++++++++++ 2 files changed, 68 insertions(+), 22 deletions(-) create mode 100644 doc/architecture/decision/007-versioning.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d8476f963..011843d1f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -4,6 +4,20 @@ When contributing to this repository, please first discuss the change you wish t [GitHub issues](https://github.com/refinedmods/refinedstorage2/issues), [Discord](https://discordapp.com/invite/VYzsydb), or any other method with the owners of this repository before making a change. +## Quickstart + +These are the most important things to know before contributing (also explained in more detail later in this document): + +- Commit messages must adhere to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). +- Branch names must be formatted correctly. The format is `{category}/GH-{issue number}/{lowercase-description}`. + Category must match a + category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). +- We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. It is + recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) file into your + IDE, so that formatting rules are respected. +- Branches are kept up to date by rebasing, not by merging. +- For non-technical changes, adding a changelog entry is required. + ## Pull requests - Keep your pull request (PR) as small as possible, this makes reviewing easier. @@ -51,26 +65,6 @@ use [Crowdin](https://crowdin.com/project/refined-storage-2). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -### Version metadata - -The code doesn't contain version metadata: `build.gradle` specifies a version of `0.0.0` (via Refined Architect). -The versioning information is entirely contained in Git by using tags. - -Per [Semantic Versioning](https://semver.org/spec/v2.0.0.html), the version number being released depends on the changes -in that release. We usually can't predict those -changes at the start of a release cycle, so we can't bump the version at the start of a release cycle. That means that -the version number being released is determined at release time. - -Because the version number is determined at release time, we can't store any versioning metadata in the -code (`build.gradle`). If we did, `build.gradle` would have the version number of the latest released version during the -release cycle of the new version, which isn't correct. - -### Dealing with Minecraft - -Whenever we port to a new Minecraft version, at least the minor version should be incremented. - -This is needed so that we can still support older Minecraft versions without the version numbers conflicting. - ## Changelog The changelog is kept in `CHANGELOG.md`. @@ -93,7 +87,7 @@ Documentation must be kept up to date when adding or changing functionality. ### Javadoc -Javadoc is available after every release on https://refinedmods.com/refinedstorage2/. +Javadoc is available after every release on https://refinedmods.com/javadoc/refinedstorage2/. ### API annotations @@ -138,7 +132,8 @@ Tests in the API modules are regular unit tests. Don't see a "unit" here as a co These tests don't rely on, nor know about, Minecraft. -Additionally, tests in the `refinedstorage2-network` module use the `refinedstorage2-network-test` JUnit plugin to easily set up networks for testing. +Additionally, tests in the `refinedstorage2-network` module use the `refinedstorage2-network-test` JUnit plugin to +easily set up networks for testing. ### Integration testing diff --git a/doc/architecture/decision/007-versioning.md b/doc/architecture/decision/007-versioning.md new file mode 100644 index 000000000..b61c13244 --- /dev/null +++ b/doc/architecture/decision/007-versioning.md @@ -0,0 +1,51 @@ +# 7. Versioning scheme + +Date: 11/01/2023 + +## Status + +Accepted + +## Context + +We must think about: + +- What versioning scheme do we use? +- How do we store versioning information? +- When do we determine the next version number? +- How do we deal with Minecraft? + +## Decision + +### What versioning scheme do we use? + +We choose [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +### How do we store versioning information? + +The code doesn't contain version metadata: `build.gradle` specifies a version of `0.0.0` (via [Refined Architect](https://github.com/refinedmods/refinedarchitect)). +The versioning information is entirely contained in Git by using tags. + +### When do we determine the next version number? + +Per [Semantic Versioning](https://semver.org/spec/v2.0.0.html), the version number being released depends on the changes +in that release. We usually can't predict those +changes at the start of a release cycle, so we can't bump the version at the start of a release cycle. That means that +the version number being released is determined at release time. + +Because the version number is determined at release time, we can't store any versioning metadata in the +code (`build.gradle`). If we did, `build.gradle` would have the version number of the latest released version during the +release cycle of the new version, which isn't correct. + +### How do we deal with Minecraft? + +Whenever we port to a new Minecraft version, at least the minor version should be incremented. + +This is needed so that we can still support older Minecraft versions without the version numbers conflicting. + +## Consequences + +- This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +- The code itself doesn't store versioning information. +- We choose the next version number upon release. +- Whenever we port to a new Minecraft version, at least the minor version should be incremented. \ No newline at end of file From b6a142652469292e9cdc4ccacb09573948cbc83f Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 28 May 2024 20:32:17 +0200 Subject: [PATCH 23/29] docs: add adr about refined architect --- .../decision/007-refined-architect.md | 23 +++++++++++++++++++ .../{007-versioning.md => 008-versioning.md} | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 doc/architecture/decision/007-refined-architect.md rename doc/architecture/decision/{007-versioning.md => 008-versioning.md} (97%) diff --git a/doc/architecture/decision/007-refined-architect.md b/doc/architecture/decision/007-refined-architect.md new file mode 100644 index 000000000..d1afbeab7 --- /dev/null +++ b/doc/architecture/decision/007-refined-architect.md @@ -0,0 +1,23 @@ +# 7. Refined Architect + +Date: 2023-03-07 + +## Status + +Accepted + +## Context + +For Refined Storage, we want to build a large ecosystem of addon mods. However, all those addon mods, and even unrelated mods managed by Refined Mods, have a lot of duplication in terms of build infrastructure, GitHub Actions workflows and Gradle setup code. + +This duplication makes it difficult to maintain the soon-to-be suite of mods as a whole, especially if we have to upgrade Minecraft. + +## Decision + +We introduce [Refined Architect](https://github.com/refinedmods/refinedarchitect): a project that is used by all the mods of Refined Mods. + +It contains GitHub workflows, version management and Gradle helpers to help making (cross-platform) mods easier. + +## Consequences + +- Refined Storage adopts Refined Architect. diff --git a/doc/architecture/decision/007-versioning.md b/doc/architecture/decision/008-versioning.md similarity index 97% rename from doc/architecture/decision/007-versioning.md rename to doc/architecture/decision/008-versioning.md index b61c13244..605af230a 100644 --- a/doc/architecture/decision/007-versioning.md +++ b/doc/architecture/decision/008-versioning.md @@ -1,6 +1,6 @@ -# 7. Versioning scheme +# 8. Versioning scheme -Date: 11/01/2023 +Date: 2023-01-11 ## Status From f99cd5e1e994592d22892433123f3e6f04ba6120 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 28 May 2024 20:40:41 +0200 Subject: [PATCH 24/29] docs: add adr about package by feature --- .../decision/009-package-by-feature.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 doc/architecture/decision/009-package-by-feature.md diff --git a/doc/architecture/decision/009-package-by-feature.md b/doc/architecture/decision/009-package-by-feature.md new file mode 100644 index 000000000..c3b4dd125 --- /dev/null +++ b/doc/architecture/decision/009-package-by-feature.md @@ -0,0 +1,25 @@ +# 9. Package by feature + +Date: 2023-11-01 + +## Status + +Accepted + +## Context + +Refined Storage adds a lot of content. For ease of maintenance, we need to think about how we are going to segment our packages. + +## Decision + +We [package by feature, not by layer](https://wayback-api.archive.org/web/20240000000000*/http://www.javapractices.com/topic/TopicAction.do?Id=205). + +Implementation provided in [[1]](#1). + +## Consequences + +- Code is able to use package-private scope a lot more. + +## References + +- [1] See [implementation](https://github.com/refinedmods/refinedstorage2/commit/d109b09be863c6ea71138091b6ce66c2a573546e) From eae75acfaf10376b4c6ff0e6dc13badfd8d6ce62 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 28 May 2024 20:50:37 +0200 Subject: [PATCH 25/29] docs: add adr about shared storages --- .../decision/007-refined-architect.md | 1 + .../decision/010-shared-storage.md | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 doc/architecture/decision/010-shared-storage.md diff --git a/doc/architecture/decision/007-refined-architect.md b/doc/architecture/decision/007-refined-architect.md index d1afbeab7..032dd55e5 100644 --- a/doc/architecture/decision/007-refined-architect.md +++ b/doc/architecture/decision/007-refined-architect.md @@ -21,3 +21,4 @@ It contains GitHub workflows, version management and Gradle helpers to help maki ## Consequences - Refined Storage adopts Refined Architect. +- Refined Architect must be kept up to date and maintained in order to upgrade Refined Storage. diff --git a/doc/architecture/decision/010-shared-storage.md b/doc/architecture/decision/010-shared-storage.md new file mode 100644 index 000000000..f4843306a --- /dev/null +++ b/doc/architecture/decision/010-shared-storage.md @@ -0,0 +1,43 @@ +# 10. Shared storages + +Date: 2024-03-03 + +## Status + +Accepted + +## Context + +Refined Storage 2 has the concept of a storage channel. A storage channel is the highest-level storage of a network. It +is used by other network devices to interact with the storage network. + +As Refined Storage 2 supports multiple resource types, we must decide how we partition those resource types. + +## Decision + +At the lowest level, we allow mixed resource types within a storage. Since a storage channel is a storage as well, this +means that the highest level, the storage channel, will allow mixed resource types as well. + +We don't partition storages by resource type because: + +- This implies the use of a generic type on the `Storage` class, which becomes cumbersome quickly when we don't know the + resource type at runtime (relying on unchecked and rawtypes operations). +- There's no real technical reason to partition storages by resource type. We can have a single storage channel with + mixed resource types. +- If there is a single storage channel, blocks like the Disk Drive don't need to maintain a storage per storage channel. + They can expose one storage for all the storage channels, making it easier to reason about. + +Implementation provided in [[1]](#1). + +## Consequences + +- We do remove some compile time safety because we won't have a generic on `Storage`. However: + 1) It's a natural consequence if we want to allow mixed storage channels. + 2) The compile time safety was mostly gone anyway already due to all the unchecked and raw types operations. +- We introduce `ResourceKey` to provide some level of safety (not using `Object`). +- We don't need a storage channel type abstraction (there is only a single storage channel) and move some logic + to `ResourceKey`. + +## References + +- [1] See [implementation](https://github.com/refinedmods/refinedstorage2/commit/1fd63d17417e387d427b2e018a93df89e31edc0f) From 63fa2f6044c87b2e28549e23b5edbb24d09386af Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 28 May 2024 20:56:53 +0200 Subject: [PATCH 26/29] docs: add import order to contributing --- .github/CONTRIBUTING.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 011843d1f..377f73eab 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -104,6 +104,19 @@ IDE, so that formatting rules are respected. Moreover, the [CheckStyle-IDEA plugin](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) can be used to check if there are no style violations. +### Import order + +IntellIJ does not import the `import` order rules correctly. Apply following order manually: + +- import `com.refinedmods.*` +- blank line +- import `java.*` +- import `javax.*` +- blank line +- import all other imports +- blank line +- import static all other imports + ## Architecture ### Architecture Decision Records @@ -250,7 +263,7 @@ The workflow takes care of the following: - Running a build. - Publishing on [GitHub packages](https://github.com/refinedmods/refinedstorage2/packages) and CreeperHost Maven. -- Publishing Javadoc on [GitHub pages](https://github.com/refinedmods/refinedstorage2/tree/gh-pages). +- Publishing Javadoc on [GitHub pages](https://github.com/refinedmods/javadoc). - Deploying on [GitHub releases](https://github.com/refinedmods/refinedstorage2/releases). - Announcing the release on Discord and Twitter. - Creating a PR that merges `main` back into `develop` to get the changes to `CHANGELOG.md` and `build.gradle` From 41aac9a54e4286c2171e6dfa1808f5f1e8eb836b Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 28 May 2024 21:20:51 +0200 Subject: [PATCH 27/29] docs: add intellij code style --- .github/CONTRIBUTING.md | 17 ++------- config/intellij-code-style.xml | 64 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 config/intellij-code-style.xml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 377f73eab..86611e2dd 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -13,7 +13,7 @@ These are the most important things to know before contributing (also explained Category must match a category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). - We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. It is - recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) file into your + recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your IDE, so that formatting rules are respected. - Branches are kept up to date by rebasing, not by merging. - For non-technical changes, adding a changelog entry is required. @@ -98,25 +98,12 @@ from [API Guardian](https://github.com/apiguardian-team/apiguardian). We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. -It is recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) file into your +It is recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your IDE, so that formatting rules are respected. Moreover, the [CheckStyle-IDEA plugin](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) can be used to check if there are no style violations. -### Import order - -IntellIJ does not import the `import` order rules correctly. Apply following order manually: - -- import `com.refinedmods.*` -- blank line -- import `java.*` -- import `javax.*` -- blank line -- import all other imports -- blank line -- import static all other imports - ## Architecture ### Architecture Decision Records diff --git a/config/intellij-code-style.xml b/config/intellij-code-style.xml new file mode 100644 index 000000000..9a82b0fd0 --- /dev/null +++ b/config/intellij-code-style.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file From a0f3aa1593d62544d110a8661ed9aff330604a2f Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Mon, 3 Jun 2024 01:50:40 +0200 Subject: [PATCH 28/29] chore: move JEI integration to addon mod --- CHANGELOG.md | 4 + refinedstorage2-platform-common/build.gradle | 8 -- .../platform/common/Platform.java | 2 - .../platform/common/PlatformProxy.java | 5 - .../recipemod/jei/ClickableIngredient.java | 25 ----- .../CraftingGridRecipeTransferHandler.java | 103 ------------------ .../ExclusionZonesGuiContainerHandler.java | 15 --- .../recipemod/jei/GhostIngredientHandler.java | 87 --------------- .../jei/GridGuiContainerHandler.java | 53 --------- .../recipemod/jei/IngredientConvertImpl.java | 47 -------- .../recipemod/jei/JeiGridSynchronizer.java | 51 --------- .../common/recipemod/jei/JeiProxy.java | 20 ---- .../jei/MissingItemRecipeTransferError.java | 58 ---------- .../jei/RefinedStorageJeiModPlugin.java | 92 ---------------- .../jei/ResourceGuiContainerHandler.java | 50 --------- .../common/recipemod/jei/package-info.java | 7 -- .../assets/refinedstorage2/lang/en_us.json | 4 - .../platform/common/TestPlatform.java | 5 - refinedstorage2-platform-fabric/build.gradle | 8 -- .../platform/fabric/PlatformImpl.java | 12 -- .../src/main/resources/fabric.mod.json | 4 - refinedstorage2-platform-forge/build.gradle | 9 -- .../platform/forge/PlatformImpl.java | 8 -- 23 files changed, 4 insertions(+), 673 deletions(-) delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ClickableIngredient.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/CraftingGridRecipeTransferHandler.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ExclusionZonesGuiContainerHandler.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GhostIngredientHandler.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridGuiContainerHandler.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/IngredientConvertImpl.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiGridSynchronizer.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiProxy.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/MissingItemRecipeTransferError.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/RefinedStorageJeiModPlugin.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceGuiContainerHandler.java delete mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/package-info.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ce45fae3..f525a7272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Removed + +- The JEI integration has been removed and will be moved to an addon mod. + ## [2.0.0-milestone.3.6] - 2024-05-18 ### Added diff --git a/refinedstorage2-platform-common/build.gradle b/refinedstorage2-platform-common/build.gradle index 7773745f5..ef6c81907 100644 --- a/refinedstorage2-platform-common/build.gradle +++ b/refinedstorage2-platform-common/build.gradle @@ -1,16 +1,8 @@ archivesBaseName = 'refinedstorage2-platform-common' -repositories { - maven { - name = 'JEI' - url = "https://maven.blamejared.com/" - } -} - commonProject() dependencies { - compileOnly common.jei.api implementation project(':refinedstorage2-platform-api') implementation project(':refinedstorage2-core-api') implementation project(':refinedstorage2-resource-api') diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java index 132868491..81851872f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java @@ -72,8 +72,6 @@ public interface Platform { Optional getContainedFluid(ItemStack stack); - Optional convertJeiIngredientToFluid(Object ingredient); - Optional convertToBucket(FluidResource fluidResource); TransferManager createTransferManager(AbstractContainerMenu containerMenu); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java index 21da8eb65..651d552e5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java @@ -120,11 +120,6 @@ public Optional getContainedFluid(final ItemStack stack) { return ensureLoaded().getContainedFluid(stack); } - @Override - public Optional convertJeiIngredientToFluid(final Object ingredient) { - return ensureLoaded().convertJeiIngredientToFluid(ingredient); - } - @Override public Optional convertToBucket(final FluidResource fluidResource) { return ensureLoaded().convertToBucket(fluidResource); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ClickableIngredient.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ClickableIngredient.java deleted file mode 100644 index b686450c9..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ClickableIngredient.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import mezz.jei.api.ingredients.ITypedIngredient; -import mezz.jei.api.runtime.IClickableIngredient; -import net.minecraft.client.renderer.Rect2i; - -class ClickableIngredient implements IClickableIngredient { - private final ITypedIngredient ingredient; - private final Rect2i area; - - ClickableIngredient(final ITypedIngredient ingredient, final int x, final int y) { - this.ingredient = ingredient; - area = new Rect2i(x, y, 16, 16); - } - - @Override - public ITypedIngredient getTypedIngredient() { - return ingredient; - } - - @Override - public Rect2i getArea() { - return area; - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/CraftingGridRecipeTransferHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/CraftingGridRecipeTransferHandler.java deleted file mode 100644 index e377b7a27..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/CraftingGridRecipeTransferHandler.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResource; - -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -import mezz.jei.api.constants.RecipeTypes; -import mezz.jei.api.gui.ingredient.IRecipeSlotView; -import mezz.jei.api.gui.ingredient.IRecipeSlotsView; -import mezz.jei.api.recipe.RecipeIngredientRole; -import mezz.jei.api.recipe.RecipeType; -import mezz.jei.api.recipe.transfer.IRecipeTransferError; -import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.item.crafting.RecipeHolder; - -class CraftingGridRecipeTransferHandler implements - IRecipeTransferHandler> { - @Override - public Class getContainerClass() { - return CraftingGridContainerMenu.class; - } - - @Override - public Optional> getMenuType() { - return Optional.of(Menus.INSTANCE.getCraftingGrid()); - } - - @Override - public RecipeType> getRecipeType() { - return RecipeTypes.CRAFTING; - } - - @Override - @Nullable - public IRecipeTransferError transferRecipe(final CraftingGridContainerMenu containerMenu, - final RecipeHolder recipe, - final IRecipeSlotsView recipeSlots, - final Player player, - final boolean maxTransfer, - final boolean doTransfer) { - if (doTransfer) { - doTransfer(recipeSlots, containerMenu); - return null; - } - final ResourceList available = containerMenu.getAvailableListForRecipeTransfer(); - final List missingSlots = findMissingSlots(recipeSlots, available); - return missingSlots.isEmpty() ? null : new MissingItemRecipeTransferError(missingSlots); - } - - private void doTransfer(final IRecipeSlotsView recipeSlots, final CraftingGridContainerMenu containerMenu) { - final List> inputs = getInputs(recipeSlots); - containerMenu.transferRecipe(inputs); - } - - private List findMissingSlots(final IRecipeSlotsView recipeSlots, final ResourceList available) { - return recipeSlots.getSlotViews(RecipeIngredientRole.INPUT).stream().filter(slotView -> { - if (slotView.isEmpty()) { - return false; - } - return !isAvailable(available, slotView); - }).toList(); - } - - private boolean isAvailable(final ResourceList available, final IRecipeSlotView slotView) { - final List possibilities = slotView.getItemStacks().toList(); - for (final ItemStack possibility : possibilities) { - final ItemResource possibilityResource = ItemResource.ofItemStack(possibility); - if (available.remove(possibilityResource, 1).isPresent()) { - return true; - } - } - return false; - } - - private List> getInputs(final IRecipeSlotsView recipeSlots) { - return recipeSlots.getSlotViews(RecipeIngredientRole.INPUT).stream().map(slotView -> { - final List stacks = slotView.getItemStacks().collect(Collectors.toList()); - prioritizeDisplayedStack(slotView, stacks); - return stacks.stream().map(ItemResource::ofItemStack).toList(); - }).toList(); - } - - private void prioritizeDisplayedStack(final IRecipeSlotView slotView, final List stacks) { - slotView.getDisplayedItemStack().ifPresent(displayed -> { - final int index = stacks.indexOf(displayed); - if (index > 0) { - return; - } - stacks.remove(index); - stacks.add(0, displayed); - }); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ExclusionZonesGuiContainerHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ExclusionZonesGuiContainerHandler.java deleted file mode 100644 index 4f16d153a..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ExclusionZonesGuiContainerHandler.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; - -import java.util.List; - -import mezz.jei.api.gui.handlers.IGuiContainerHandler; -import net.minecraft.client.renderer.Rect2i; - -class ExclusionZonesGuiContainerHandler implements IGuiContainerHandler> { - @Override - public List getGuiExtraAreas(final AbstractBaseScreen screen) { - return screen.getExclusionZones(); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GhostIngredientHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GhostIngredientHandler.java deleted file mode 100644 index df62f1a8e..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GhostIngredientHandler.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import mezz.jei.api.gui.handlers.IGhostIngredientHandler; -import mezz.jei.api.ingredients.ITypedIngredient; -import net.minecraft.client.renderer.Rect2i; - -@SuppressWarnings("rawtypes") -class GhostIngredientHandler implements IGhostIngredientHandler { - private final IngredientConverter ingredientConverter; - - GhostIngredientHandler(final IngredientConverter ingredientConverter) { - this.ingredientConverter = ingredientConverter; - } - - @Override - public List> getTargetsTyped(final AbstractBaseScreen screen, - final ITypedIngredient ingredient, - final boolean doStart) { - if (screen.getMenu() instanceof AbstractResourceContainerMenu menu) { - return getTargets(screen, ingredient.getIngredient(), menu); - } - return Collections.emptyList(); - } - - private List> getTargets(final AbstractBaseScreen screen, - final I ingredient, - final AbstractResourceContainerMenu menu) { - final List> targets = new ArrayList<>(); - ingredientConverter.convertToResource(ingredient).ifPresent(resource -> { - for (final ResourceSlot slot : menu.getResourceSlots()) { - if (slot.isFilter() && slot.isValid(resource)) { - final Rect2i bounds = getBounds(screen, slot); - targets.add(new TargetImpl<>(bounds, slot.index)); - } - } - }); - return targets; - } - - private Rect2i getBounds(final AbstractBaseScreen screen, final ResourceSlot slot) { - return new Rect2i(screen.getLeftPos() + slot.x, screen.getTopPos() + slot.y, 17, 17); - } - - @Override - public void onComplete() { - // no op - } - - private class TargetImpl implements Target { - private final Rect2i area; - private final int slotIndex; - - TargetImpl(final Rect2i area, final int slotIndex) { - this.area = area; - this.slotIndex = slotIndex; - } - - @Override - public Rect2i getArea() { - return area; - } - - @Override - public void accept(final I ingredient) { - ingredientConverter.convertToResource(ingredient).ifPresent(this::accept); - } - - private void accept(final PlatformResourceKey resource) { - Platform.INSTANCE.getClientToServerCommunications().sendResourceFilterSlotChange( - resource, - slotIndex - ); - } - } -} - diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridGuiContainerHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridGuiContainerHandler.java deleted file mode 100644 index a11f0ce02..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridGuiContainerHandler.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.platform.api.grid.view.PlatformGridResource; -import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen; - -import java.util.Optional; - -import mezz.jei.api.gui.handlers.IGuiContainerHandler; -import mezz.jei.api.ingredients.IIngredientHelper; -import mezz.jei.api.ingredients.ITypedIngredient; -import mezz.jei.api.runtime.IClickableIngredient; -import mezz.jei.api.runtime.IIngredientManager; - -class GridGuiContainerHandler implements IGuiContainerHandler> { - private final IngredientConverter converter; - private final IIngredientManager ingredientManager; - - GridGuiContainerHandler(final IngredientConverter converter, final IIngredientManager ingredientManager) { - this.converter = converter; - this.ingredientManager = ingredientManager; - } - - @Override - public Optional> getClickableIngredientUnderMouse( - final AbstractGridScreen screen, - final double mouseX, - final double mouseY - ) { - final PlatformGridResource resource = screen.getCurrentGridResource(); - if (resource == null) { - return Optional.empty(); - } - final PlatformResourceKey underlyingResource = resource.getUnderlyingResource(); - if (underlyingResource == null) { - return Optional.empty(); - } - return converter.convertToIngredient(underlyingResource).flatMap( - ingredient -> convertToClickableIngredient(mouseX, mouseY, ingredient) - ); - } - - private Optional> convertToClickableIngredient(final double x, - final double y, - final Object ingredient) { - final IIngredientHelper helper = ingredientManager.getIngredientHelper(ingredient); - final Optional> maybeTypedIngredient = - ingredientManager.createTypedIngredient(helper.getIngredientType(), ingredient); - return maybeTypedIngredient - .map(typedIngredient -> new ClickableIngredient<>(typedIngredient, (int) x, (int) y)); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/IngredientConvertImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/IngredientConvertImpl.java deleted file mode 100644 index c9bcc7efd..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/IngredientConvertImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResource; - -import java.util.Optional; - -import mezz.jei.api.helpers.IPlatformFluidHelper; -import net.minecraft.world.item.ItemStack; - -class IngredientConvertImpl implements IngredientConverter { - private final IPlatformFluidHelper fluidHelper; - - IngredientConvertImpl(final IPlatformFluidHelper fluidHelper) { - this.fluidHelper = fluidHelper; - } - - @Override - public Optional convertToResource(final Object ingredient) { - final var fluid = Platform.INSTANCE.convertJeiIngredientToFluid(ingredient); - if (fluid.isPresent()) { - return fluid.map(f -> f); - } - if (ingredient instanceof ItemStack itemStack) { - return Optional.of(ItemResource.ofItemStack(itemStack)); - } - return Optional.empty(); - } - - @Override - public Optional convertToIngredient(final PlatformResourceKey resource) { - if (resource instanceof ItemResource itemResource) { - return Optional.of(itemResource.toItemStack()); - } - if (resource instanceof FluidResource fluidResource) { - return Optional.of(fluidHelper.create( - fluidResource.fluid(), - fluidHelper.bucketVolume(), - fluidResource.tag() - )); - } - return Optional.empty(); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiGridSynchronizer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiGridSynchronizer.java deleted file mode 100644 index 828bf95a6..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiGridSynchronizer.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridSynchronizer; - -import javax.annotation.Nullable; - -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; - -class JeiGridSynchronizer extends AbstractGridSynchronizer { - private static final MutableComponent TITLE = createTranslation("gui", "grid.synchronizer.jei"); - private static final MutableComponent TITLE_TWO_WAY = createTranslation("gui", "grid.synchronizer.jei.two_way"); - private static final Component HELP = createTranslation("gui", "grid.synchronizer.jei.help"); - private static final Component HELP_TWO_WAY = createTranslation("gui", "grid.synchronizer.jei.two_way.help"); - - private final JeiProxy jeiProxy; - private final boolean twoWay; - - JeiGridSynchronizer(final JeiProxy jeiProxy, final boolean twoWay) { - this.jeiProxy = jeiProxy; - this.twoWay = twoWay; - } - - @Override - public MutableComponent getTitle() { - return twoWay ? TITLE_TWO_WAY : TITLE; - } - - @Override - public Component getHelpText() { - return twoWay ? HELP_TWO_WAY : HELP; - } - - @Override - public void synchronizeFromGrid(final String text) { - jeiProxy.setSearchFieldText(text); - } - - @Override - @Nullable - public String getTextToSynchronizeToGrid() { - return twoWay ? jeiProxy.getSearchFieldText() : null; - } - - @Override - public int getXTexture() { - return twoWay ? 32 : 48; - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiProxy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiProxy.java deleted file mode 100644 index fc1f40c9e..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiProxy.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import mezz.jei.api.runtime.IJeiRuntime; - -public class JeiProxy { - public String getSearchFieldText() { - final IJeiRuntime runtime = RefinedStorageJeiModPlugin.getRuntime(); - if (runtime == null) { - return ""; - } - return runtime.getIngredientFilter().getFilterText(); - } - - public void setSearchFieldText(final String text) { - final IJeiRuntime runtime = RefinedStorageJeiModPlugin.getRuntime(); - if (runtime != null) { - runtime.getIngredientFilter().setFilterText(text); - } - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/MissingItemRecipeTransferError.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/MissingItemRecipeTransferError.java deleted file mode 100644 index 698f0a00e..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/MissingItemRecipeTransferError.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import java.awt.Color; -import java.util.List; - -import com.mojang.blaze3d.vertex.PoseStack; -import mezz.jei.api.gui.ingredient.IRecipeSlotView; -import mezz.jei.api.gui.ingredient.IRecipeSlotsView; -import mezz.jei.api.recipe.transfer.IRecipeTransferError; -import net.minecraft.ChatFormatting; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.screens.Screen; -import net.minecraft.network.chat.Component; -import net.minecraft.util.FormattedCharSequence; - -class MissingItemRecipeTransferError implements IRecipeTransferError { - private static final Color COLOR = new Color(1.0f, 0.0f, 0.0f, 0.4f); - private static final List MISSING_MESSAGE = List.of( - Component.translatable("jei.tooltip.transfer").getVisualOrderText(), - Component.translatable("jei.tooltip.error.recipe.transfer.missing").withStyle(ChatFormatting.RED) - .getVisualOrderText() - ); - - private final List slotsWithMissingItems; - - MissingItemRecipeTransferError(final List slotsWithMissingItems) { - this.slotsWithMissingItems = slotsWithMissingItems; - } - - @Override - public Type getType() { - return Type.COSMETIC; - } - - @Override - public int getButtonHighlightColor() { - return COLOR.getRGB(); - } - - @Override - public void showError(final GuiGraphics graphics, - final int mouseX, - final int mouseY, - final IRecipeSlotsView recipeSlotsView, - final int recipeX, - final int recipeY) { - final PoseStack poseStack = graphics.pose(); - poseStack.pushPose(); - poseStack.translate(recipeX, recipeY, 0); - slotsWithMissingItems.forEach(slot -> slot.drawHighlight(graphics, COLOR.getRGB())); - poseStack.popPose(); - final Screen screen = Minecraft.getInstance().screen; - if (screen != null) { - graphics.renderTooltip(Minecraft.getInstance().font, MISSING_MESSAGE, mouseX, mouseY); - } - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/RefinedStorageJeiModPlugin.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/RefinedStorageJeiModPlugin.java deleted file mode 100644 index 5f4657f2f..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/RefinedStorageJeiModPlugin.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; - -import javax.annotation.Nullable; - -import mezz.jei.api.IModPlugin; -import mezz.jei.api.JeiPlugin; -import mezz.jei.api.constants.RecipeTypes; -import mezz.jei.api.helpers.IPlatformFluidHelper; -import mezz.jei.api.registration.IGuiHandlerRegistration; -import mezz.jei.api.registration.IRecipeTransferRegistration; -import mezz.jei.api.runtime.IJeiRuntime; -import net.minecraft.resources.ResourceLocation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; - -@JeiPlugin -public class RefinedStorageJeiModPlugin implements IModPlugin { - private static final ResourceLocation ID = createIdentifier("plugin"); - private static final Logger LOGGER = LoggerFactory.getLogger(RefinedStorageJeiModPlugin.class); - @Nullable - private static IJeiRuntime runtime; - - @Override - public ResourceLocation getPluginUid() { - return ID; - } - - @Override - public void registerRecipeTransferHandlers(final IRecipeTransferRegistration registration) { - registration.addRecipeTransferHandler(new CraftingGridRecipeTransferHandler(), RecipeTypes.CRAFTING); - } - - @Override - public void onRuntimeAvailable(final IJeiRuntime newRuntime) { - if (runtime == null) { - initializePlatform(newRuntime.getJeiHelpers().getPlatformFluidHelper()); - } - RefinedStorageJeiModPlugin.runtime = newRuntime; - } - - @Override - public void registerGuiHandlers(final IGuiHandlerRegistration registration) { - final IngredientConverter converter = PlatformApi.INSTANCE.getIngredientConverter(); - registration.addGenericGuiContainerHandler( - AbstractBaseScreen.class, - new ResourceGuiContainerHandler(converter, registration.getJeiHelpers().getIngredientManager()) - ); - registration.addGenericGuiContainerHandler( - AbstractGridScreen.class, - new GridGuiContainerHandler(converter, registration.getJeiHelpers().getIngredientManager()) - ); - registration.addGenericGuiContainerHandler( - AbstractBaseScreen.class, - new ExclusionZonesGuiContainerHandler() - ); - registration.addGhostIngredientHandler(AbstractBaseScreen.class, new GhostIngredientHandler(converter)); - } - - @Nullable - public static IJeiRuntime getRuntime() { - return runtime; - } - - private void initializePlatform(final IPlatformFluidHelper fluidHelper) { - LOGGER.debug("Enabling JEI integration"); - registerIngredientConverters(fluidHelper); - registerGridSynchronizers(); - } - - private void registerGridSynchronizers() { - final JeiProxy jeiProxy = new JeiProxy(); - PlatformApi.INSTANCE.getGridSynchronizerRegistry().register( - createIdentifier("jei"), - new JeiGridSynchronizer(jeiProxy, false) - ); - PlatformApi.INSTANCE.getGridSynchronizerRegistry().register( - createIdentifier("jei_two_way"), - new JeiGridSynchronizer(jeiProxy, true) - ); - } - - private void registerIngredientConverters(final IPlatformFluidHelper fluidHelper) { - PlatformApi.INSTANCE.registerIngredientConverter(new IngredientConvertImpl(fluidHelper)); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceGuiContainerHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceGuiContainerHandler.java deleted file mode 100644 index a6dc2c7c1..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceGuiContainerHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; - -import java.util.Optional; -import javax.annotation.Nullable; - -import mezz.jei.api.gui.handlers.IGuiContainerHandler; -import mezz.jei.api.ingredients.IIngredientHelper; -import mezz.jei.api.ingredients.ITypedIngredient; -import mezz.jei.api.runtime.IClickableIngredient; -import mezz.jei.api.runtime.IIngredientManager; - -class ResourceGuiContainerHandler implements IGuiContainerHandler> { - private final IngredientConverter converter; - private final IIngredientManager ingredientManager; - - ResourceGuiContainerHandler(final IngredientConverter converter, - final IIngredientManager ingredientManager) { - this.converter = converter; - this.ingredientManager = ingredientManager; - } - - @Override - public Optional> getClickableIngredientUnderMouse( - final AbstractBaseScreen baseScreen, - final double mouseX, - final double mouseY - ) { - return convertToIngredient(baseScreen.getHoveredResource()).flatMap(this::convertToClickableIngredient); - } - - public Optional convertToIngredient(@Nullable final PlatformResourceKey resource) { - if (resource == null) { - return Optional.empty(); - } - return converter.convertToIngredient(resource); - } - - private Optional> convertToClickableIngredient(final Object ingredient) { - final IIngredientHelper helper = ingredientManager.getIngredientHelper(ingredient); - final Optional> maybeTypedIngredient = ingredientManager.createTypedIngredient( - helper.getIngredientType(), - ingredient - ); - return maybeTypedIngredient.map(typedIngredient -> new ClickableIngredient<>(typedIngredient, 16, 16)); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/package-info.java deleted file mode 100644 index 7d9498461..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json index 6e06c5772..6dd9b4194 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json @@ -56,10 +56,6 @@ "gui.refinedstorage2.grid.synchronizer": "Synchronization mode", "gui.refinedstorage2.grid.synchronizer.off": "Off", "gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.", - "gui.refinedstorage2.grid.synchronizer.jei": "JEI", - "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.", - "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI two-way", - "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.", "gui.refinedstorage2.grid.synchronizer.rei": "REI", "gui.refinedstorage2.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.", "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI two-way", diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java index 5f1e86fef..7a0c108bd 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java @@ -115,11 +115,6 @@ public Optional getContainedFluid(final ItemStack stack) { throw new UnsupportedOperationException(); } - @Override - public Optional convertJeiIngredientToFluid(final Object ingredient) { - throw new UnsupportedOperationException(); - } - @Override public Optional convertToBucket(final FluidResource fluidResource) { throw new UnsupportedOperationException(); diff --git a/refinedstorage2-platform-fabric/build.gradle b/refinedstorage2-platform-fabric/build.gradle index 3b0b5bbb4..953c652fb 100644 --- a/refinedstorage2-platform-fabric/build.gradle +++ b/refinedstorage2-platform-fabric/build.gradle @@ -1,10 +1,6 @@ archivesBaseName = 'refinedstorage2-platform-fabric' repositories { - maven { - name = 'JEI' - url = "https://maven.blamejared.com/" - } maven { name = 'ModMenu' url 'https://maven.terraformersmc.com/' @@ -56,10 +52,6 @@ dependencies { modCompileOnly fabric.rei.architectury modRuntimeOnly fabric.rei.impl - modCompileOnly common.jei.api - modCompileOnly fabric.jei.api - // modRuntimeOnly fabric.jei.impl - modRuntimeOnly fabric.wthit // https://www.curseforge.com/minecraft/mc-mods/trinkets/files diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java index 6757008a1..e23f64cc8 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java @@ -29,7 +29,6 @@ import javax.annotation.Nullable; import com.mojang.blaze3d.platform.InputConstants; -import mezz.jei.api.fabric.ingredients.fluids.IJeiFluidIngredient; import net.fabricmc.fabric.api.entity.FakePlayer; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; @@ -165,17 +164,6 @@ public Optional getContainedFluid(final ItemStack stack) { } } - @Override - public Optional convertJeiIngredientToFluid(final Object ingredient) { - if (ingredient instanceof IJeiFluidIngredient fluidIngredient) { - return Optional.of(new FluidResource( - fluidIngredient.getFluid(), - fluidIngredient.getTag().orElse(null) - )); - } - return Optional.empty(); - } - @Override public Optional convertToBucket(final FluidResource fluidResource) { final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); diff --git a/refinedstorage2-platform-fabric/src/main/resources/fabric.mod.json b/refinedstorage2-platform-fabric/src/main/resources/fabric.mod.json index e9adbd5d4..1a27e56b0 100644 --- a/refinedstorage2-platform-fabric/src/main/resources/fabric.mod.json +++ b/refinedstorage2-platform-fabric/src/main/resources/fabric.mod.json @@ -25,9 +25,6 @@ "modmenu": [ "com.refinedmods.refinedstorage2.platform.fabric.modmenu.ModMenuApiImpl" ], - "jei_mod_plugin": [ - "com.refinedmods.refinedstorage2.platform.common.recipemod.jei.RefinedStorageJeiModPlugin" - ], "rei_client": [ "com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei.RefinedStorageREIClientPlugin" ] @@ -52,7 +49,6 @@ }, "suggests": { "roughlyenoughitems": "*", - "jei": "*", "modmenu": "*" } } diff --git a/refinedstorage2-platform-forge/build.gradle b/refinedstorage2-platform-forge/build.gradle index 3e5fc0444..6a5583b47 100644 --- a/refinedstorage2-platform-forge/build.gradle +++ b/refinedstorage2-platform-forge/build.gradle @@ -1,8 +1,4 @@ repositories { - maven { - name = 'JEI' - url = "https://maven.blamejared.com/" - } maven { name = 'REI' url 'https://maven.shedaniel.me/' @@ -17,11 +13,6 @@ forgeProject("refinedstorage2", project(":refinedstorage2-platform-common"), api archivesBaseName = 'refinedstorage2-platform-forge' dependencies { - compileOnly common.jei.api - testCompileOnly common.jei.api - compileOnly forge.jei.api - runtimeOnly forge.jei.impl - compileOnly forge.rei.impl compileOnly forge.rei.architectury compileOnly forge.rei.cloth.math diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java index 7c7f53d80..f5a354da3 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java @@ -159,14 +159,6 @@ public Optional getContainedFluid(final ItemStack stack) { )); } - @Override - public Optional convertJeiIngredientToFluid(final Object ingredient) { - if (ingredient instanceof FluidStack fluidStack) { - return Optional.of(ofFluidStack(fluidStack)); - } - return Optional.empty(); - } - @Override public Optional convertToBucket(final FluidResource fluidResource) { return Optional.ofNullable( From c942fc1d1fbb269c6334cbd329336a08946a5dd4 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Mon, 3 Jun 2024 00:08:41 +0000 Subject: [PATCH 29/29] chore: prepare release v2.0.0-milestone.3.7 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f525a7272..c6fdda420 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [2.0.0-milestone.3.7] - 2024-06-03 + ### Removed - The JEI integration has been removed and will be moved to an addon mod. @@ -576,7 +578,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - The Grid can now use smooth scrolling. - The Grid now has syntax highlighting for the search query. -[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.6...HEAD +[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.7...HEAD + +[2.0.0-milestone.3.7]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.6...v2.0.0-milestone.3.7 [2.0.0-milestone.3.6]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.5...v2.0.0-milestone.3.6