From bfbb32cc93c71233b765b4e9cb6421019440936c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 9 Sep 2016 21:57:31 +0200 Subject: [PATCH] Start conversion only with explicit setting --- README.md | 15 +++++++++------ easyvend.lua | 4 ++-- settingtypes.txt | 13 +++++++++++++ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 352deaa..6d86c2a 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,18 @@ and turn them into the new machines from `easyvend`. This is useful if you want to switch a world from `vendor` to `easyvend`. **WARNING**: This feature is experimental! It is advised to backup your world -before doing this. This feature is also incomplete; +before doing this. This feature is also incomplete; items are currently +**not** transformed in the process. ### Conversion process -To transform all nodes from the `vendor` mod, enable the `easyvend` mod -and disable the `vendor` mod, then load the world. Now all nodes from -the vendor mod will be replaced by the new machines from `easyvend`. +To transform all nodes from the `vendor` mod, disable the `vendor` mod (if +it is not already disabled), enable the setting `easyvend_convert_vendor` +and start or restart the game. -If you run a server, inform players of the change after loading the world with -the new nodes. +Now all nodes from the `vendor` mod will be replaced with `easyvend` ones. + +If you run a server, you should inform players of this change because a few +machines might need a reconfiguration. ### Details The machine configuration will be kept in the process and the machines will diff --git a/easyvend.lua b/easyvend.lua index ebf2637..c0df417 100644 --- a/easyvend.lua +++ b/easyvend.lua @@ -1030,8 +1030,8 @@ minetest.register_abm({ -- Legacy support for vendor mod: -- Transform the world and items to use the easyvend nodes/items --- For safety reasons, vendor mod must be disabled before legacy mode goes on -if minetest.get_modpath("vendor") == nil then +-- For safety reasons, only do this when player requested so +if minetest.setting_getbool("easyvend_convert_vendor") == true then -- Replace vendor nodes minetest.register_lbm({ name = "easyvend:replace_vendor", diff --git a/settingtypes.txt b/settingtypes.txt index 88d3fe6..d4f0ecb 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -3,3 +3,16 @@ # depositing machines give this item in return for items. # Default: Gold Ingot. easyvend_currency (Currency item for vending and depositing machines) string default:gold_ingot + +[Experimental settings] +# This setting is EXPERIMENTAL! +# Enable this option if you want to switch a world from using Bad_Command_'s +# Vending Machines [vendor] mod to using the Easy Vending Machines [easyvend] +# mod. +# When you load the world the next time, this will replace all vending and +# depositing machines from [vendor] with the [easyvend] machines while keeping +# their configuration. +# Since this option is experimental, it is recommended that you backup your +# world before converting it. +easyvend_convert_vendor (Convert machines from Vending Machines mod) bool false +