diff --git a/README.md b/README.md index 84c63c2..292f300 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # ccompass -This minetest mod adds a calibratable compass to the minetest. +This minetest mod adds a calibratable compass to the minetest. Original mod [here](https://forum.minetest.net/viewtopic.php?f=11&t=3785) - - License - as the original mod (https://forum.minetest.net/viewtopic.php?f=11&t=3785): Code: WTFPL, textures: CC BY-SA + - License: Code: WTFPL, textures: CC BY-SA, sound: CC0. - Dependencies to other mods: none - Forum: https://forum.minetest.net/viewtopic.php?f=9&t=17881 - + ## For Players: - - + + 1. Craft the compass as before using the crafting recipe. The new compass points to the origin / Zero point and is already usable. 2. Punch the compass to a compatible node (all by default) and enter the target name @@ -51,7 +51,7 @@ The mod support the next settings: 4. Each time the compass is updated, a hook is called, if defined in other mod. The hook is usefull to implement wear or any other compass manipulation logic. ``` - function ccompass.usage_hook(compass_stack, player) + function ccompass.usage_hook(compass_stack, player) --do anything with compasS_stack return modified_compass_stack end diff --git a/init.lua b/init.lua index f93ab4a..462892a 100644 --- a/init.lua +++ b/init.lua @@ -120,6 +120,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local stack=player:get_wielded_item() local meta=stack:get_meta() local pos_string = meta:get_string("tmp_target_pos") + local pos = player:getpos() meta:set_string("target_pos", pos_string) meta:set_string("tmp_target_pos", "") if fields.name == "" then @@ -129,6 +130,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end player:set_wielded_item(stack) minetest.chat_send_player(player:get_player_name(), "Calibration done to "..fields.name.." "..pos_string) + minetest.sound_play({ name = "ccompass_calibrate", gain = 1 }, { pos = pos, max_hear_distance = 3 }) end end) diff --git a/sounds/ccompass_calibrate.ogg b/sounds/ccompass_calibrate.ogg new file mode 100644 index 0000000..a092af8 Binary files /dev/null and b/sounds/ccompass_calibrate.ogg differ diff --git a/textures/ccompass_0.png b/textures/ccompass_0.png index bb33a80..a263c97 100644 Binary files a/textures/ccompass_0.png and b/textures/ccompass_0.png differ diff --git a/textures/ccompass_1.png b/textures/ccompass_1.png index f764682..853c032 100644 Binary files a/textures/ccompass_1.png and b/textures/ccompass_1.png differ diff --git a/textures/ccompass_10.png b/textures/ccompass_10.png index 7b44a28..72dadcf 100644 Binary files a/textures/ccompass_10.png and b/textures/ccompass_10.png differ diff --git a/textures/ccompass_11.png b/textures/ccompass_11.png index 2cf7fc0..95029f0 100644 Binary files a/textures/ccompass_11.png and b/textures/ccompass_11.png differ diff --git a/textures/ccompass_2.png b/textures/ccompass_2.png index a4712f0..8446100 100644 Binary files a/textures/ccompass_2.png and b/textures/ccompass_2.png differ diff --git a/textures/ccompass_3.png b/textures/ccompass_3.png index 3b07e41..0298b88 100644 Binary files a/textures/ccompass_3.png and b/textures/ccompass_3.png differ diff --git a/textures/ccompass_4.png b/textures/ccompass_4.png index 511497a..1b4e619 100644 Binary files a/textures/ccompass_4.png and b/textures/ccompass_4.png differ diff --git a/textures/ccompass_5.png b/textures/ccompass_5.png index 8ea4db9..b80e349 100644 Binary files a/textures/ccompass_5.png and b/textures/ccompass_5.png differ diff --git a/textures/ccompass_6.png b/textures/ccompass_6.png index 85b09ff..4659755 100644 Binary files a/textures/ccompass_6.png and b/textures/ccompass_6.png differ diff --git a/textures/ccompass_7.png b/textures/ccompass_7.png index 6479781..d4760dd 100644 Binary files a/textures/ccompass_7.png and b/textures/ccompass_7.png differ diff --git a/textures/ccompass_8.png b/textures/ccompass_8.png index 6b5a711..60e7142 100644 Binary files a/textures/ccompass_8.png and b/textures/ccompass_8.png differ diff --git a/textures/ccompass_9.png b/textures/ccompass_9.png index 5243b79..a3ad85f 100644 Binary files a/textures/ccompass_9.png and b/textures/ccompass_9.png differ