forked from minetest/minetest
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from rk1a/clientmod-config
Clientmod config
- Loading branch information
Showing
7 changed files
with
48 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
load_mod_rewards = false | ||
load_mod_rewards = true | ||
load_mod_random = false | ||
load_mod_treechop = false | ||
load_mod_preview = false | ||
load_mod_rewards_client = false | ||
load_mod_treechop = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- set random reward at every step | ||
minetest.register_globalstep(function(dtime) | ||
reward = math.random() | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name = random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,7 @@ | ||
-- https://github.com/minetest/minetest/issues/10682 | ||
local function register_globalstep_on_mods_loaded(func) | ||
local function wrapper_func(dtime) | ||
if not minetest.localplayer then return end | ||
func(dtime) | ||
for i, globalstep in pairs(minetest.registered_globalsteps) do | ||
if globalstep == wrapper_func then | ||
minetest.registered_globalsteps[i] = func | ||
end | ||
end | ||
end | ||
minetest.register_globalstep(wrapper_func) | ||
end | ||
-- define global reward variable | ||
reward = 0.0 | ||
-- local loaded = false | ||
register_globalstep_on_mods_loaded(function() | ||
-- if(loaded) then return end | ||
-- loaded = true | ||
-- local channel_name = "rewards_"..minetest.localplayer:get_name() | ||
-- minetest.mod_channel_join(channel_name) | ||
-- minetest.register_on_modchannel_message(function(channel_name, sender, message) end) | ||
reward = math.random() | ||
|
||
-- reset reward every step | ||
minetest.register_globalstep(function(dtime) | ||
reward = 0.0 | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters