From 6656da58770887a30fc2617ceb236d3dadfc21c4 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Wed, 25 Oct 2023 08:59:55 +0100 Subject: [PATCH] Remove disable_lua51_features config option In practice, we're never going to change this to true by default. The old Tekkit Legends pack enabled this[^1], and that caused a lot of problems, though admittedly back in 2016 so things might be better now. If people do want this functionality, it should be fairly easy to replicate with a datapack, adding a file to rom/autorun. [^1]: See https://www.computercraft.info/forums2/index.php?/topic/27663- Hate that I remember this, why is this still in my brain? --- illuaminate.sexp | 1 - .../computercraft/data/LanguageProvider.java | 1 - .../shared/config/ConfigSpec.java | 8 ----- .../assets/computercraft/lang/cs_cz.json | 2 -- .../assets/computercraft/lang/de_de.json | 8 ++--- .../assets/computercraft/lang/es_es.json | 1 - .../assets/computercraft/lang/fr_fr.json | 10 +++--- .../assets/computercraft/lang/it_it.json | 2 -- .../assets/computercraft/lang/ko_kr.json | 1 - .../assets/computercraft/lang/pt_br.json | 1 - .../assets/computercraft/lang/ru_ru.json | 2 -- .../assets/computercraft/lang/sv_se.json | 1 - .../assets/computercraft/lang/tok.json | 1 - .../assets/computercraft/lang/uk_ua.json | 2 -- .../assets/computercraft/lang/zh_cn.json | 1 - .../dan200/computercraft/core/CoreConfig.java | 1 - .../core/lua/CobaltLuaMachine.java | 1 - .../resources/data/computercraft/lua/bios.lua | 35 +++++++------------ .../assets/computercraft/lang/en_us.json | 2 -- .../assets/computercraft/lang/en_us.json | 2 -- .../computercraft/core/TCoreConfig.java | 1 - 21 files changed, 19 insertions(+), 65 deletions(-) diff --git a/illuaminate.sexp b/illuaminate.sexp index 517a1a6f3..f3f0eaa8c 100644 --- a/illuaminate.sexp +++ b/illuaminate.sexp @@ -77,7 +77,6 @@ (globals :max _CC_DEFAULT_SETTINGS - _CC_DISABLE_LUA51_FEATURES _HOST ;; Ideally we'd pick these up from bios.lua, but illuaminate currently ;; isn't smart enough. diff --git a/projects/common/src/main/java/dan200/computercraft/data/LanguageProvider.java b/projects/common/src/main/java/dan200/computercraft/data/LanguageProvider.java index 28d01e0d3..c24eaa1e4 100644 --- a/projects/common/src/main/java/dan200/computercraft/data/LanguageProvider.java +++ b/projects/common/src/main/java/dan200/computercraft/data/LanguageProvider.java @@ -213,7 +213,6 @@ public final class LanguageProvider implements DataProvider { addConfigEntry(ConfigSpec.floppySpaceLimit, "Floppy Disk space limit (bytes)"); addConfigEntry(ConfigSpec.uploadMaxSize, "File upload size limit (bytes)"); addConfigEntry(ConfigSpec.maximumFilesOpen, "Maximum files open per computer"); - addConfigEntry(ConfigSpec.disableLua51Features, "Disable Lua 5.1 features"); addConfigEntry(ConfigSpec.defaultComputerSettings, "Default Computer settings"); addConfigEntry(ConfigSpec.logComputerErrors, "Log computer errors"); addConfigEntry(ConfigSpec.commandRequireCreative, "Command computers require creative"); diff --git a/projects/common/src/main/java/dan200/computercraft/shared/config/ConfigSpec.java b/projects/common/src/main/java/dan200/computercraft/shared/config/ConfigSpec.java index 205b10310..1369a770d 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/config/ConfigSpec.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/config/ConfigSpec.java @@ -30,7 +30,6 @@ public final class ConfigSpec { public static final ConfigFile.Value computerSpaceLimit; public static final ConfigFile.Value floppySpaceLimit; public static final ConfigFile.Value maximumFilesOpen; - public static final ConfigFile.Value disableLua51Features; public static final ConfigFile.Value defaultComputerSettings; public static final ConfigFile.Value logComputerErrors; public static final ConfigFile.Value commandRequireCreative; @@ -115,12 +114,6 @@ public final class ConfigSpec { .comment("Set how many files a computer can have open at the same time. Set to 0 for unlimited.") .defineInRange("maximum_open_files", CoreConfig.maximumFilesOpen, 0, Integer.MAX_VALUE); - disableLua51Features = builder - .comment(""" - Set this to true to disable Lua 5.1 functions that will be removed in a future - update. Useful for ensuring forward compatibility of your programs now.""") - .define("disable_lua51_features", CoreConfig.disableLua51Features); - defaultComputerSettings = builder .comment(""" A comma separated list of default system settings to set on new computers. @@ -395,7 +388,6 @@ public final class ConfigSpec { Config.floppySpaceLimit = floppySpaceLimit.get(); Config.uploadMaxSize = uploadMaxSize.get(); CoreConfig.maximumFilesOpen = maximumFilesOpen.get(); - CoreConfig.disableLua51Features = disableLua51Features.get(); CoreConfig.defaultComputerSettings = defaultComputerSettings.get(); Config.commandRequireCreative = commandRequireCreative.get(); diff --git a/projects/common/src/main/resources/assets/computercraft/lang/cs_cz.json b/projects/common/src/main/resources/assets/computercraft/lang/cs_cz.json index 87c3a1dc5..6d0c4899b 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/cs_cz.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/cs_cz.json @@ -74,8 +74,6 @@ "gui.computercraft.config.computer_space_limit.tooltip": "Limit diskového místa pro počítače a roboty, v bytech.", "gui.computercraft.config.default_computer_settings": "Vychozí nastavení počítače", "gui.computercraft.config.default_computer_settings.tooltip": "Čárkami oddělený seznam základních systémových nastavení pro nastavení na nových počítačích.\nPříklad: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\"\nvypne všechno automatické vyplňování.", - "gui.computercraft.config.disable_lua51_features": "Vypnout Lua 5.1 funkce", - "gui.computercraft.config.disable_lua51_features.tooltip": "Nastav toto na pravdivou hodnotu pro vypnutí Lua 5.1 funkcí které budou odstraněny v budoucí\naktualizaci. Dobré pro ověření kompatibilty tvých programů nyní a předem.", "gui.computercraft.config.disabled_generic_methods": "Vypnuté obecné metody", "gui.computercraft.config.execution": "Spuštení", "gui.computercraft.config.execution.computer_threads": "Počítačová vlákna", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/de_de.json b/projects/common/src/main/resources/assets/computercraft/lang/de_de.json index ac8de2b49..ba4405f21 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/de_de.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/de_de.json @@ -27,6 +27,7 @@ "commands.computercraft.desc": "Der /computercraft Befehl enthält verschiedene Werkzeuge um Computer zu debuggen, kontrollieren oder mit ihnen zu interagieren.", "commands.computercraft.dump.action": "Zeigt mehr Informationen über einen Computer", "commands.computercraft.dump.desc": "Zeigt den Status aller Computer oder genauere Informationen über einen angegebenen Computer. Der Computer kann entweder über seine Instanz ID (z.B. 123), seine Computer ID (z.B. #123) oder seinen Namen (z.B. \"@Mein Computer\") angegeben werden.", + "commands.computercraft.dump.open_path": "Siehe die Dateien dieses Computers.", "commands.computercraft.dump.synopsis": "Zeigt den Status eines Computers.", "commands.computercraft.generic.additional_rows": "%d zusätzliche Zeilen…", "commands.computercraft.generic.exception": "Unbehandelte Ausnahme (%s)", @@ -68,12 +69,11 @@ "commands.computercraft.view.not_player": "Konnte Terminal für Nicht-Spieler nicht öffnen", "commands.computercraft.view.synopsis": "Zeigt das Terminal eines Computers.", "gui.computercraft.config.command_require_creative": "Kommando-Computer benötigen den Kreativ-Modus", + "gui.computercraft.config.command_require_creative.tooltip": "Benötigt Spieler sowohl im Kreativ-Spielmodus, als auch ein Operator zu sein,\num mit Kommando-Computern zu interagieren. Dies entspricht dem standardmäßigen Verhalten von Befehlsblöcken.", "gui.computercraft.config.computer_space_limit": "Speicherplatz von Computern (Bytes)", "gui.computercraft.config.computer_space_limit.tooltip": "Das Speicherplatzlimit für Computer und Turtles in Bytes.", "gui.computercraft.config.default_computer_settings": "Computer-Standardeinstellungen", "gui.computercraft.config.default_computer_settings.tooltip": "eine mit Komma separierte Liste an standardmäßige Systemeinstellungen für neuen Computern.\nBeispiel: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\"\nwürde jegliche Autovervollständigung deaktivieren.", - "gui.computercraft.config.disable_lua51_features": "Lua 5.1-Funktionen deaktivieren", - "gui.computercraft.config.disable_lua51_features.tooltip": "Beim aktivieren werden die Lua 5.1 Funktionieren deaktiviert, die in zukünftigen\nUpdates sowieso entfernt werden. Auf dieser Weise kann vorwärts Kompatibilität für Programme sichergestellt werden.", "gui.computercraft.config.disabled_generic_methods": "Generische Methoden deaktiviert.", "gui.computercraft.config.disabled_generic_methods.tooltip": "Eine Liste an generischen Methoden oder Methodenquellen zum deaktivieren.\nGenerische Methoden sind Methoden die zu einem block/block entity hinzugefügt werden, insofern kein expliziter Peripheral Provider\ngefunden wurde. Mitbetroffen sind Inventarmethoden (d.h. inventory.getItemDetail,\ninventory.pushItems) und, wenn in Forge gespielt wird, die fluid_storage und energy_storage\nMethoden.\nMethoden in dieser Liste können entweder Gruppen von Methoden (wie computercraft:inventory)\noder einzelne Methoden (wie computercraft:inventory#pushItems) sein.\n", "gui.computercraft.config.execution": "Ausführung", @@ -130,7 +130,5 @@ "upgrade.minecraft.diamond_hoe.adjective": "Ackerbau", "upgrade.minecraft.diamond_pickaxe.adjective": "Bergbau", "upgrade.minecraft.diamond_shovel.adjective": "Graben", - "upgrade.minecraft.diamond_sword.adjective": "Nahkampf", - "commands.computercraft.dump.open_path": "Siehe die Dateien dieses Computers.", - "gui.computercraft.config.command_require_creative.tooltip": "Benötigt Spieler sowohl im Kreativ-Spielmodus, als auch ein Operator zu sein,\num mit Kommando-Computern zu interagieren. Dies entspricht dem standardmäßigen Verhalten von Befehlsblöcken." + "upgrade.minecraft.diamond_sword.adjective": "Nahkampf" } diff --git a/projects/common/src/main/resources/assets/computercraft/lang/es_es.json b/projects/common/src/main/resources/assets/computercraft/lang/es_es.json index 67b2c5cea..2620152ef 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/es_es.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/es_es.json @@ -33,7 +33,6 @@ "commands.computercraft.shutdown.synopsis": "Apague las computadoras de forma remota.", "gui.computercraft.config.computer_space_limit": "Límite de memoria de ordenadores (en bytes)", "gui.computercraft.config.default_computer_settings": "Configuración de Ordenador por defecto", - "gui.computercraft.config.disable_lua51_features": "Deshabilitar funciones de Lua 5.1", "gui.computercraft.config.floppy_space_limit": "Límite de memoria de disquetes (en bytes)", "gui.computercraft.config.http.enabled": "Habilitar API de HTTP", "gui.computercraft.config.log_computer_errors": "Grabar errores periféricos", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/fr_fr.json b/projects/common/src/main/resources/assets/computercraft/lang/fr_fr.json index e6438475f..f719fcc61 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/fr_fr.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/fr_fr.json @@ -74,9 +74,8 @@ "gui.computercraft.config.computer_space_limit.tooltip": "La limite d'espace du disque pour les ordinateurs et les tortues, en octets.", "gui.computercraft.config.default_computer_settings": "Configuration d'Ordinateur par défaut", "gui.computercraft.config.default_computer_settings.tooltip": "Une liste séparée par des virgules des paramètres système par défaut à définir sur les nouveaux ordinateurs.\nExemple : \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\"\ndésactivera toute saisie semi-automatique.", - "gui.computercraft.config.disable_lua51_features": "Désactiver les particularités de Lua 5.1", - "gui.computercraft.config.disable_lua51_features.tooltip": "Définir sur true pour désactiver les fonctions Lua 5.1 qui seront supprimées dans une future mise à jour.\nUtile pour assurer la compatibilité ascendante de vos programmes actuels.", "gui.computercraft.config.disabled_generic_methods": "Méthodes génériques désactivées", + "gui.computercraft.config.disabled_generic_methods.tooltip": "Une liste de méthodes génériques ou de méthodes source à désactiver.\nLes méthodes génériques sont ajoutées à un bloc ou bloc-entité lorsque aucune implémentation explicite de périphérique n'est disponible. Cela inclut les méthodes liées à l'inventaire (ex. inventory.getItemDetail, inventory.pushItems) et, avec Forge, les méthodes fluid_storage et energy_storage.\nLes méthodes de cette liste peuvent être groupées (computercraft:inventory) ou individuelles (computercraft:inventory#pushItems).\n", "gui.computercraft.config.execution": "Exécution", "gui.computercraft.config.execution.computer_threads": "Threads d'ordinateur", "gui.computercraft.config.execution.computer_threads.tooltip": "Définissez le nombre de threads sur lesquels les ordinateurs peuvent s'exécuter. Un nombre plus élevé signifie\nque plus d'ordinateurs peuvent fonctionner à la fois, mais peut induire un décalage. Veuillez noter que\ncertains mods peuvent ne pas fonctionner avec un nombre de threads supérieur à 1. À utiliser avec prudence.\nPlage : > 1", @@ -200,6 +199,8 @@ "item.computercraft.printed_pages": "Pages imprimées", "item.computercraft.treasure_disk": "Disquette", "itemGroup.computercraft": "ComputerCraft", + "tag.item.computercraft.computer": "Ordinateurs", + "tag.item.computercraft.wired_modem": "Modems câblés", "tracking_field.computercraft.avg": "%s (moyenne)", "tracking_field.computercraft.computer_tasks.name": "Tâches", "tracking_field.computercraft.count": "%s (compte)", @@ -221,8 +222,5 @@ "upgrade.minecraft.diamond_hoe.adjective": "Fermière", "upgrade.minecraft.diamond_pickaxe.adjective": "Mineuse", "upgrade.minecraft.diamond_shovel.adjective": "Excavatrice", - "upgrade.minecraft.diamond_sword.adjective": "De Combat", - "gui.computercraft.config.disabled_generic_methods.tooltip": "Une liste de méthodes génériques ou de méthodes source à désactiver.\nLes méthodes génériques sont ajoutées à un bloc ou bloc-entité lorsque aucune implémentation explicite de périphérique n'est disponible. Cela inclut les méthodes liées à l'inventaire (ex. inventory.getItemDetail, inventory.pushItems) et, avec Forge, les méthodes fluid_storage et energy_storage.\nLes méthodes de cette liste peuvent être groupées (computercraft:inventory) ou individuelles (computercraft:inventory#pushItems).\n", - "tag.item.computercraft.computer": "Ordinateurs", - "tag.item.computercraft.wired_modem": "Modems câblés" + "upgrade.minecraft.diamond_sword.adjective": "De Combat" } diff --git a/projects/common/src/main/resources/assets/computercraft/lang/it_it.json b/projects/common/src/main/resources/assets/computercraft/lang/it_it.json index 3ad229f41..68f7db998 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/it_it.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/it_it.json @@ -74,8 +74,6 @@ "gui.computercraft.config.computer_space_limit.tooltip": "Limite di spazio di archiviazione per i computer e le tartarughe, in byte.", "gui.computercraft.config.default_computer_settings": "Impostazioni Computer predefinite", "gui.computercraft.config.default_computer_settings.tooltip": "Una lista di impostazioni predefinite per i nuovi computer, separate da virgola.\nEsempio: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\"\ndisattiverà tutti gli autocompletamenti.", - "gui.computercraft.config.disable_lua51_features": "Disattiva features Lua 5.1", - "gui.computercraft.config.disable_lua51_features.tooltip": "Imposta a \"true\" per disattivare le funzionalità di Lua 5.1 che saranno rimosse in un\naggiornamento futuro. Utile per assicurare futura compatibilità con i tuoi programmi.", "gui.computercraft.config.execution": "Esecuzione", "gui.computercraft.config.execution.computer_threads": "Threads computer", "gui.computercraft.config.execution.computer_threads.tooltip": "Imposta la quantità di thread che possono eseguire i computer. Un numero più alto significa\nche più computer possono essere eseguiti alla volta, ma può indurre a lag. Alcune mod potrebbero\nnon funzionare con numeri di thread maggiore a 1. Usare con cautela.\nRange: > 1", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/ko_kr.json b/projects/common/src/main/resources/assets/computercraft/lang/ko_kr.json index 0078abd9b..db2c5071f 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/ko_kr.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/ko_kr.json @@ -70,7 +70,6 @@ "commands.computercraft.view.synopsis": "컴퓨터의 터미널을 보기", "gui.computercraft.config.computer_space_limit": "컴퓨터 공간 제한 (바이트)", "gui.computercraft.config.default_computer_settings": "기본 컴퓨터 설정", - "gui.computercraft.config.disable_lua51_features": "Lua 5.1 기능 미사용", "gui.computercraft.config.execution": "실행", "gui.computercraft.config.execution.computer_threads": "컴퓨터 쓰레드", "gui.computercraft.config.execution.max_main_computer_time": "컴퓨터 시간 당 서버 제한", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/pt_br.json b/projects/common/src/main/resources/assets/computercraft/lang/pt_br.json index a9ef28436..15ae05a88 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/pt_br.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/pt_br.json @@ -38,7 +38,6 @@ "commands.computercraft.turn_on.synopsis": "Liga computadores remotamente.", "gui.computercraft.config.computer_space_limit": "Limite de espaço dos Computadores (bytes)", "gui.computercraft.config.default_computer_settings": "Configurações padrão para Computadores", - "gui.computercraft.config.disable_lua51_features": "Desabilitar funcionalidade da Lua 5.1", "gui.computercraft.config.execution.computer_threads": "Threads por computador", "gui.computercraft.config.floppy_space_limit": "Limite de espaço dos Disquetes (bytes)", "gui.computercraft.config.http": "HTTP", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/ru_ru.json b/projects/common/src/main/resources/assets/computercraft/lang/ru_ru.json index 737b42134..c777127cf 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/ru_ru.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/ru_ru.json @@ -74,8 +74,6 @@ "gui.computercraft.config.computer_space_limit.tooltip": "Лимит места на дисках компьютеров и черепашек, в байтах.", "gui.computercraft.config.default_computer_settings": "Настройки Компьютера по умолчанию", "gui.computercraft.config.default_computer_settings.tooltip": "Разделенный запятыми список системных настроек по умолчанию на новых компьютерах.\nНапример: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\"\nотключит всё автодополнение.", - "gui.computercraft.config.disable_lua51_features": "Отключить функции Lua 5.1", - "gui.computercraft.config.disable_lua51_features.tooltip": "Поставьте, чтобы отключить функции из Lua 5.1, которые будут убраны в будущих\nобновлениях. Полезно для того, чтобы улучшить совместимость вперед ваших программ.", "gui.computercraft.config.execution": "Выполнение", "gui.computercraft.config.execution.computer_threads": "Потоки компьютера", "gui.computercraft.config.execution.computer_threads.tooltip": "Устанавливает количество потоков, на которых работают компьютеры. Большее число\nозначает, что больше компьютеров сможет работать одновременно, но может привести к лагу.\nОбратите внимание, что некоторые моды могут не работать с более чем одним потоком. Используйте с осторожностью.\nОграничение: > 1", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/sv_se.json b/projects/common/src/main/resources/assets/computercraft/lang/sv_se.json index d25702e78..94c9583ff 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/sv_se.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/sv_se.json @@ -70,7 +70,6 @@ "commands.computercraft.view.synopsis": "Titta på datorns terminal.", "gui.computercraft.config.computer_space_limit": "Dator maximalt utrymme (bytes)", "gui.computercraft.config.default_computer_settings": "Standard Datorinställningar", - "gui.computercraft.config.disable_lua51_features": "Avaktivera Lua 5.1 funktioner", "gui.computercraft.config.execution.computer_threads": "Dator trådar", "gui.computercraft.config.floppy_space_limit": "Diskett maximalt utrymme (bytes)", "gui.computercraft.config.http": "HTTP", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/tok.json b/projects/common/src/main/resources/assets/computercraft/lang/tok.json index e171d126a..8d32734ae 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/tok.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/tok.json @@ -66,7 +66,6 @@ "commands.computercraft.view.not_player": "jan ala la, mi ken ala open e sitelen pi ilo sona", "commands.computercraft.view.synopsis": "o lukin e sitelen pi ilo sona.", "gui.computercraft.config.command_require_creative": "ilo sona pi toki wawa li wile e jan sewi", - "gui.computercraft.config.disable_lua51_features": "ijo pona pi ilo Lua 5.1 li weka", "gui.computercraft.config.execution": "pali", "gui.computercraft.config.execution.computer_threads": "linja pi ilo sona", "gui.computercraft.config.http": "ijo HTTP", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/uk_ua.json b/projects/common/src/main/resources/assets/computercraft/lang/uk_ua.json index cb3abd7d1..efea67c23 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/uk_ua.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/uk_ua.json @@ -74,8 +74,6 @@ "gui.computercraft.config.computer_space_limit.tooltip": "Обмеження на займаєме місце на диску комп'ютерами та черепахами, в байтах.", "gui.computercraft.config.default_computer_settings": "Налаштування комп'ютера за замовчуванням", "gui.computercraft.config.default_computer_settings.tooltip": "Список лашатувань за замовчуванням, розділених комою, що будуть нашалтовані на нових комп'ютерах\nНаприклад: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\"\nвідключить усі автодоповнення.", - "gui.computercraft.config.disable_lua51_features": "Відключити підтримку Lua 5.1", - "gui.computercraft.config.disable_lua51_features.tooltip": "Включить це налаштування, якщо хочете відключити функціональність, пов'язану з Lua 5.1, яка буде вилучен в наступних оновленнях.\nТаким чином ви можете впевнитись, що ваші програми не зламаються від подальших оновлень.", "gui.computercraft.config.execution": "Виконання", "gui.computercraft.config.execution.computer_threads": "Потоки для комп'ютерів", "gui.computercraft.config.execution.computer_threads.tooltip": "Встановлює кількість потоків, на яких запускаються комп'ютери. Більше число\nозначає більшу кількість комп'ютерів, які працюють паралельно, але може призвести до проблем із продуктивністю.\nЗауважте, що деякі модифікації можуть не працювати із кількістю потоків більше за 1. Використовуйте з обережністю.\nОбмеження: > 1", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/zh_cn.json b/projects/common/src/main/resources/assets/computercraft/lang/zh_cn.json index 923c8756b..2deddd331 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/zh_cn.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/zh_cn.json @@ -68,7 +68,6 @@ "commands.computercraft.view.synopsis": "查看计算机的终端.", "gui.computercraft.config.computer_space_limit": "计算机空间限制(字节)", "gui.computercraft.config.default_computer_settings": "默认计算机设置", - "gui.computercraft.config.disable_lua51_features": "禁用Lua 5.1功能", "gui.computercraft.config.execution": "执行", "gui.computercraft.config.execution.computer_threads": "计算机线程数", "gui.computercraft.config.execution.max_main_computer_time": "服务器计算机tick时间限制", diff --git a/projects/core/src/main/java/dan200/computercraft/core/CoreConfig.java b/projects/core/src/main/java/dan200/computercraft/core/CoreConfig.java index 46cff11c7..01cb76588 100644 --- a/projects/core/src/main/java/dan200/computercraft/core/CoreConfig.java +++ b/projects/core/src/main/java/dan200/computercraft/core/CoreConfig.java @@ -22,7 +22,6 @@ public final class CoreConfig { } public static int maximumFilesOpen = 128; - public static boolean disableLua51Features = false; public static String defaultComputerSettings = ""; public static boolean httpEnabled = true; diff --git a/projects/core/src/main/java/dan200/computercraft/core/lua/CobaltLuaMachine.java b/projects/core/src/main/java/dan200/computercraft/core/lua/CobaltLuaMachine.java index 7d181d5fb..3510c8956 100644 --- a/projects/core/src/main/java/dan200/computercraft/core/lua/CobaltLuaMachine.java +++ b/projects/core/src/main/java/dan200/computercraft/core/lua/CobaltLuaMachine.java @@ -78,7 +78,6 @@ public class CobaltLuaMachine implements ILuaMachine { Bit32Lib.add(state, globals); globals.rawset("_HOST", ValueFactory.valueOf(environment.hostString())); globals.rawset("_CC_DEFAULT_SETTINGS", ValueFactory.valueOf(CoreConfig.defaultComputerSettings)); - if (CoreConfig.disableLua51Features) globals.rawset("_CC_DISABLE_LUA51_FEATURES", Constants.TRUE); // Add default APIs for (var api : environment.apis()) addAPI(globals, api); diff --git a/projects/core/src/main/resources/data/computercraft/lua/bios.lua b/projects/core/src/main/resources/data/computercraft/lua/bios.lua index eab182375..2f3493dd7 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/bios.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/bios.lua @@ -42,31 +42,20 @@ if _VERSION == "Lua 5.1" then end end - if _CC_DISABLE_LUA51_FEATURES then - -- Remove the Lua 5.1 features that will be removed when we update to Lua 5.2, for compatibility testing. - -- See "disable_lua51_functions" in ComputerCraft.cfg - setfenv = nil - getfenv = nil - loadstring = nil - unpack = nil - math.log10 = nil - table.maxn = nil - else - loadstring = function(string, chunkname) return nativeload(string, chunkname) end - - -- Inject a stub for the old bit library - _G.bit = { - bnot = bit32.bnot, - band = bit32.band, - bor = bit32.bor, - bxor = bit32.bxor, - brshift = bit32.arshift, - blshift = bit32.lshift, - blogic_rshift = bit32.rshift, - } - end + loadstring = function(string, chunkname) return nativeload(string, chunkname) end end +-- Inject a stub for the old bit library +_G.bit = { + bnot = bit32.bnot, + band = bit32.band, + bor = bit32.bor, + bxor = bit32.bxor, + brshift = bit32.arshift, + blshift = bit32.lshift, + blogic_rshift = bit32.rshift, +} + -- Install lua parts of the os api function os.version() return "CraftOS 1.8" diff --git a/projects/fabric/src/generated/resources/assets/computercraft/lang/en_us.json b/projects/fabric/src/generated/resources/assets/computercraft/lang/en_us.json index b5fc22875..377ab7c8e 100644 --- a/projects/fabric/src/generated/resources/assets/computercraft/lang/en_us.json +++ b/projects/fabric/src/generated/resources/assets/computercraft/lang/en_us.json @@ -74,8 +74,6 @@ "gui.computercraft.config.computer_space_limit.tooltip": "The disk space limit for computers and turtles, in bytes.", "gui.computercraft.config.default_computer_settings": "Default Computer settings", "gui.computercraft.config.default_computer_settings.tooltip": "A comma separated list of default system settings to set on new computers.\nExample: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\"\nwill disable all autocompletion.", - "gui.computercraft.config.disable_lua51_features": "Disable Lua 5.1 features", - "gui.computercraft.config.disable_lua51_features.tooltip": "Set this to true to disable Lua 5.1 functions that will be removed in a future\nupdate. Useful for ensuring forward compatibility of your programs now.", "gui.computercraft.config.disabled_generic_methods": "Disabled generic methods", "gui.computercraft.config.disabled_generic_methods.tooltip": "A list of generic methods or method sources to disable. Generic methods are\nmethods added to a block/block entity when there is no explicit peripheral\nprovider. This includes inventory methods (i.e. inventory.getItemDetail,\ninventory.pushItems), and (if on Forge), the fluid_storage and energy_storage\nmethods.\nMethods in this list can either be a whole group of methods (computercraft:inventory)\nor a single method (computercraft:inventory#pushItems).\n", "gui.computercraft.config.execution": "Execution", diff --git a/projects/forge/src/generated/resources/assets/computercraft/lang/en_us.json b/projects/forge/src/generated/resources/assets/computercraft/lang/en_us.json index b5fc22875..377ab7c8e 100644 --- a/projects/forge/src/generated/resources/assets/computercraft/lang/en_us.json +++ b/projects/forge/src/generated/resources/assets/computercraft/lang/en_us.json @@ -74,8 +74,6 @@ "gui.computercraft.config.computer_space_limit.tooltip": "The disk space limit for computers and turtles, in bytes.", "gui.computercraft.config.default_computer_settings": "Default Computer settings", "gui.computercraft.config.default_computer_settings.tooltip": "A comma separated list of default system settings to set on new computers.\nExample: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\"\nwill disable all autocompletion.", - "gui.computercraft.config.disable_lua51_features": "Disable Lua 5.1 features", - "gui.computercraft.config.disable_lua51_features.tooltip": "Set this to true to disable Lua 5.1 functions that will be removed in a future\nupdate. Useful for ensuring forward compatibility of your programs now.", "gui.computercraft.config.disabled_generic_methods": "Disabled generic methods", "gui.computercraft.config.disabled_generic_methods.tooltip": "A list of generic methods or method sources to disable. Generic methods are\nmethods added to a block/block entity when there is no explicit peripheral\nprovider. This includes inventory methods (i.e. inventory.getItemDetail,\ninventory.pushItems), and (if on Forge), the fluid_storage and energy_storage\nmethods.\nMethods in this list can either be a whole group of methods (computercraft:inventory)\nor a single method (computercraft:inventory#pushItems).\n", "gui.computercraft.config.execution": "Execution", diff --git a/projects/web/src/main/java/dan200/computercraft/core/TCoreConfig.java b/projects/web/src/main/java/dan200/computercraft/core/TCoreConfig.java index 28e8ad635..fd3947bbf 100644 --- a/projects/web/src/main/java/dan200/computercraft/core/TCoreConfig.java +++ b/projects/web/src/main/java/dan200/computercraft/core/TCoreConfig.java @@ -16,7 +16,6 @@ public final class TCoreConfig { } public static int maximumFilesOpen = 128; - public static boolean disableLua51Features = false; public static String defaultComputerSettings = ""; public static boolean httpEnabled = true;