Initial commit
11
mods/wisgame/init.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
local modname = minetest.get_current_modname()
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
|
||||
-- DIR_DELIM 2345 < is 5 chars shorter, and I hate it!
|
||||
c.dofolder(modpath .. modpath:match("[\\/]") .. "open", function(filePath)
|
||||
if filePath:match("^.+%.(.+)$") == "lua" then
|
||||
dofile(modpath .. modpath:match("[\\/]") .. "open"..modpath:match("[\\/]")..filePath)
|
||||
end
|
||||
--print(filePath)
|
||||
end)
|
||||
|
3
mods/wisgame/mod.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
#name is a uid that only allows characters [a-z0-9_]
|
||||
name = wisgame
|
||||
depends = wislib
|
52
mods/wisgame/open/disabled/open_air.lua
Normal file
|
@ -0,0 +1,52 @@
|
|||
local print = c.log
|
||||
local max_light=math.floor(minetest.LIGHT_MAX/2)
|
||||
print(max_light)
|
||||
local breakskybox = function()
|
||||
minetest.override_item(minetest.get_name_from_content_id(minetest.get_content_id(minetest.get_name_from_content_id(minetest.CONTENT_AIR))), {
|
||||
drawtype = "nodebox",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
is_ground_content = false,
|
||||
light_source = max_light, --this breaks everything!
|
||||
|
||||
|
||||
use_texture_alpha = "opaque",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
})
|
||||
end
|
||||
--print(minetest.LIGHT_MAX, max_light,0)
|
||||
local fixskybox = function()
|
||||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
core.fix_light(vector.new(-31000, -31000, -31000), vector.new(31000, 31000, 31000))
|
||||
end)
|
||||
local chunkSize = tonumber(minetest.settings:get("chunksize")) or 16
|
||||
local maxBlockSendDistance = tonumber(minetest.settings:get("max_block_send_distance")) or 10
|
||||
local maxRenderDistance = (chunkSize * ((maxBlockSendDistance * 2) * .25) )
|
||||
local deltaCount = 0
|
||||
local deltaLimit = 3
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
deltaCount = deltaCount + dtime
|
||||
print(deltaCount)
|
||||
if not (deltaCount >= deltaLimit) then
|
||||
return nil
|
||||
end
|
||||
deltaCount=deltaCount-deltaLimit
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
local username = player:get_player_name()
|
||||
local userpos = player:get_pos()
|
||||
local currentuserchunk = vector.floor(vector.divide(userpos, maxRenderDistance))
|
||||
|
||||
local minp = vector.multiply(currentuserchunk, maxRenderDistance)
|
||||
local maxp = vector.add(minp, maxRenderDistance - 1)
|
||||
core.fix_light(vector.new(minp.x, minp.y, minp.z), vector.new(maxp.x, maxp.y, maxp.z))
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
breakskybox()
|
||||
fixskybox()
|
29
mods/wisgame/open/disabled/open_spread_abm.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
-- Function to spread grass to nearby dirt
|
||||
local function spread_grass(pos)
|
||||
-- Define the positions to check around the current position
|
||||
local positions = {
|
||||
{x = pos.x + 1, y = pos.y, z = pos.z},
|
||||
{x = pos.x - 1, y = pos.y, z = pos.z},
|
||||
{x = pos.x, y = pos.y, z = pos.z + 1},
|
||||
{x = pos.x, y = pos.y, z = pos.z - 1},
|
||||
{x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{x = pos.x, y = pos.y - 1, z = pos.z},
|
||||
}
|
||||
|
||||
for _, new_pos in ipairs(positions) do
|
||||
local node = minetest.get_node(new_pos)
|
||||
if node.name == "default:dirt" then
|
||||
minetest.set_node(new_pos, {name = "default:dirt_with_grass"})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ABM (Active Block Modifier) to spread grass
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:dirt_with_grass"},
|
||||
interval = 10, -- Time in seconds between ABM execution
|
||||
chance = 50, -- 1 in 50 chance for the ABM to run
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
spread_grass(pos)
|
||||
end,
|
||||
})
|
56
mods/wisgame/open/open_conf.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
-- Initialize mod storage
|
||||
-- ASLP (Anti Stupid Lua Polyfill)
|
||||
local DIR_DELIM = DIR_DELIM or "/"
|
||||
-- Engine headers
|
||||
local MODPACK = debug.getinfo(1, "S").source:match("mods[/\\][/\\]?[^/\\]*"):match("[/\\].*$"):sub(2)
|
||||
local MODNAME = minetest and minetest.get_current_modname() or MODPACK
|
||||
local MODPATH = minetest and minetest.get_modpath(MODPACK) or debug.getinfo(1, "S").source:match("^(.+)[/\\]"):sub(2)
|
||||
--locals
|
||||
--Avoid Using $.get() to get null instead of sane defaults.
|
||||
local function nilget(key, default)
|
||||
if not minetest.settings:has(key) then
|
||||
minetest.settings:set("noclip")
|
||||
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
--Avoid Using $.get() to get null instead of sane defaults.
|
||||
local function nilset(key, default)
|
||||
if not minetest.settings:has(key) then
|
||||
--Race Condition?
|
||||
minetest.settings:set(key, default)
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
-- Nooo! "Attempted to set secure setting."
|
||||
-- nilset("secure.trusted_mods", "formspec_edit,")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- At this distance the server will aggressively optimize which blocks are sent to
|
||||
-- clients.
|
||||
-- Small values potentially improve performance a lot, at the expense of visible
|
||||
-- rendering glitches (some blocks will not be rendered under water and in caves,
|
||||
-- as well as sometimes on land).
|
||||
-- Setting this to a value greater than max_block_send_distance disables this
|
||||
-- optimization.
|
||||
-- Stated in mapblocks (16 nodes).
|
||||
-- type: int min: 2 max: 32767
|
||||
--nilset(" block_send_optimize_distance", 32767)
|
||||
|
||||
|
||||
|
||||
|
||||
-- If enabled, the server will perform map block occlusion culling based on
|
||||
-- on the eye position of the player. This can reduce the number of blocks
|
||||
-- sent to the client by 50-80%. Clients will no longer receive most
|
||||
-- invisible blocks, so that the utility of noclip mode is reduced.
|
||||
-- type: bool
|
||||
--nilset(" server_side_occlusion_culling", "true")
|
54
mods/wisgame/open/open_hand.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
local image08='blank.png^[noalpha^[resize:8x8^[colorize:#000000:255'
|
||||
local image16='blank.png^[noalpha^[resize:16x16^[colorize:#ffffff:255'
|
||||
local modname = minetest.get_current_modname()
|
||||
--why is : the hand, is it legacy support thing or what?
|
||||
local hardtimes={[1] = 0.00, [2] = 2.00, [3] = 3.0}
|
||||
|
||||
minetest.register_item(minetest.get_current_modname()..':hand', {
|
||||
type = 'none',
|
||||
wield_image ='wieldhand.png',
|
||||
--[colorize:#000000:255:0,16=wis_black.png',
|
||||
wield_scale = {x = 0.5, y = 1, z = 4},
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.5,
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
crumbly = {
|
||||
times = hardtimes,
|
||||
uses = 0,
|
||||
maxlevel = 1,
|
||||
},
|
||||
snappy = {
|
||||
times = hardtimes,
|
||||
uses = 0,
|
||||
maxlevel = 1,
|
||||
},
|
||||
oddly_breakable_by_hand = {
|
||||
times = hardtimes,
|
||||
uses = 0,
|
||||
},
|
||||
},
|
||||
damage_groups = {fleshy = 1},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function(player, last_login)
|
||||
if not player then return end
|
||||
local inv = player:get_inventory()
|
||||
inv:set_size("hand",1)
|
||||
inv:add_item("hand", ItemStack(modname..":hand"))
|
||||
--minetest.log(dump(inv:get_lists()))
|
||||
end)
|
||||
|
||||
|
||||
|
||||
local old_handle_node_drops = core.handle_node_drops
|
||||
core.handle_node_drops = function(...)
|
||||
-- flag all drops
|
||||
old_handle_node_drops(...)
|
||||
--- minetest.log('old_handle_node_drops')
|
||||
end
|
||||
|
||||
local old_item_drop = core.item_drop
|
||||
--core.item_drop = function(...) old_item_drop(...) --minetest.log('old_item_drop') end
|
||||
|
81
mods/wisgame/open/open_heart.lua
Normal file
|
@ -0,0 +1,81 @@
|
|||
--Code that modifies information about player including: health totals, movement speeds, and more.
|
||||
--movment world combat building
|
||||
--player combat world
|
||||
|
||||
|
||||
|
||||
|
||||
local physics_override = {
|
||||
gravity=1, -- default is 1.0
|
||||
jump=1, -- default is 1.0
|
||||
speed=1.5, -- default is 2.0
|
||||
speed_sprint = 2,
|
||||
speed_climb=2, -- default is 1.0
|
||||
speed_crouch=2, -- default is 1.0
|
||||
acceleration_air=1, -- default is 1.0
|
||||
acceleration_default=1, -- default is 1.0
|
||||
liquid_fluidity=1, -- default is 1.0
|
||||
liquid_fluidity_smooth=1, -- default is 1.0
|
||||
liquid_sink=1, -- default is 1.0
|
||||
new_move=true, -- default is true
|
||||
sneak=true, -- default is true
|
||||
sneak_glitch=true, -- default is false
|
||||
}
|
||||
-- Register a globalstep callback to check for sprinting, and sneaking, and regen health
|
||||
local function for_each_player(dtime)
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
player:set_physics_override(physics_override)
|
||||
local controls = player:get_player_control()
|
||||
if not controls.aux1 then -- 'aux1' is the default sprint key
|
||||
--c.log("slow", physics_override.speed)
|
||||
player:set_physics_override({speed = physics_override.speed}) -- Normal speed
|
||||
else
|
||||
--c.log("fast", physics_override.sprint)
|
||||
player:set_physics_override({speed = physics_override.speed_sprint}) -- Increased speed
|
||||
end
|
||||
if not controls.sneak then -- but 'sneak' can have a normal name... you know what whatever!
|
||||
else
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_globalstep(for_each_player)
|
||||
|
||||
|
||||
--[[
|
||||
local function remove_fall_damage()
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
player:set_armor_groups({fall_damage= 0})
|
||||
end
|
||||
|
||||
end
|
||||
--]]
|
||||
|
||||
local print_physics_command ={
|
||||
description = "Prints the player's physics override settings to the log",
|
||||
func = function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
local physics = player:get_physics_override()
|
||||
for key, value in pairs(physics) do
|
||||
minetest.log(tostring(key).."="..tostring(value))
|
||||
end
|
||||
else
|
||||
return false, "Player not found."
|
||||
end
|
||||
end
|
||||
}
|
||||
--minetest.register_chatcommand("print_physics", print_physics_command)
|
||||
minetest.register_chatcommand("dodmg",
|
||||
|
||||
{
|
||||
description = "Does damage to the player",
|
||||
func = function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
|
||||
|
||||
end
|
||||
}
|
||||
|
||||
)
|
||||
|
22
mods/wisgame/open/open_net.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
local disable_fall_damage = function(player)
|
||||
-- it makes puppys, and unicorns -_-
|
||||
--Editors note: Fuck you, comments are important.
|
||||
player:set_armor_groups({ fall_damage_add_percent = -100 }) --
|
||||
--Editors note: you can just use -1, see bellow
|
||||
--save more bytes by not adding comments.
|
||||
--Editors note: can convert to emoji 🖕!
|
||||
end
|
||||
minetest.register_on_joinplayer(disable_fall_damage)
|
||||
minetest.register_on_respawnplayer(disable_fall_damage)
|
||||
--[[
|
||||
* `fall_damage_add_percent`: modifies the fall damage suffered when hitting
|
||||
the top of this node. There's also an armor group with the same name.
|
||||
The final player damage is determined by the following formula:
|
||||
damage =
|
||||
collision speed
|
||||
* ((node_fall_damage_add_percent + 100) / 100) -- node group
|
||||
* ((player_fall_damage_add_percent + 100) / 100) -- player armor group
|
||||
- (14) -- constant tolerance
|
||||
Negative damage values are discarded as no damage.
|
||||
|
||||
--]]
|
13
mods/wisgame/open/open_registration.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
local DIR_DELIM = debug.getinfo(1, "S").source:match("[\\/]")
|
||||
local modname = core.get_current_modname()
|
||||
local modpath = core.get_modpath(modname)
|
||||
local print = c.log
|
||||
c.dofolder(modpath .. modpath:match("[\\/]") .. "open".. modpath:match("[\\/]").. "open_registration", function(filePath)
|
||||
if filePath:match("^.+%.(.+)$") == "ini" then
|
||||
--print(filePath:match("^.+%.(.+)$"))
|
||||
c.registrate_from_file(table.concat({modpath, "open", "open_registration",filePath}, DIR_DELIM ))
|
||||
--print("end")
|
||||
end
|
||||
end)
|
||||
|
||||
|
24
mods/wisgame/open/open_registration/open_field.ini
Normal file
|
@ -0,0 +1,24 @@
|
|||
[biome_plains]
|
||||
type="biome"
|
||||
name="plains"
|
||||
heat_point = 50
|
||||
humidity_point = 50
|
||||
;
|
||||
node_top = "mapgen_dirt_with_grass"
|
||||
node_top_depth = 1
|
||||
;depth_top
|
||||
node_filler = "mapgen_dirt"
|
||||
node_filler_depth = 5
|
||||
;depth_filler
|
||||
node_riverbed = "mapgen_sand"
|
||||
node_riverbed_depth = 3
|
||||
;depth_riverbed
|
||||
;node_substratum="mapgen_sandstone"
|
||||
;node_substratum_depth=1
|
||||
;custom
|
||||
vertical_blend = 0
|
||||
;y_max = yMax
|
||||
;y_min = seaLevel+1
|
||||
dune_line=1
|
||||
;sea_level=1
|
||||
|
19
mods/wisgame/open/open_registration/open_hand.ini
Normal file
|
@ -0,0 +1,19 @@
|
|||
;'[colorize:#000000:255:0,16=wis_black.png'
|
||||
[item_hand]
|
||||
name = ":"
|
||||
type = "item"
|
||||
description = "Open Hand"
|
||||
description = "Way Of The!"
|
||||
|
||||
inventory_image = "wieldhand.png"
|
||||
wield_image = "wieldhand.png"
|
||||
|
||||
;x=horizontal, y=vertical, z=depth
|
||||
wield_scale = {"x" : 0.5, "y" : 1.5, "z" : 1.0}
|
||||
tool_capabilities = { "full_punch_interval" : 0.5, "max_drop_level" : 0 }
|
||||
tool_dig_groups = [ "crumbly", "snappy", "oddly_breakable_by_hand" ]
|
||||
; = { times = hardtimes, uses = 0, maxlevel = 1 },
|
||||
tool_dig_times = [1.00, 2.00, 3.00, null]
|
||||
tool_dig_uses = 0
|
||||
tool_dig_maxlevel = 1
|
||||
tool_damage_groups = {"fleshy" : 1}
|
123
mods/wisgame/open/open_registration/open_terrain.ini
Normal file
|
@ -0,0 +1,123 @@
|
|||
;dune-line
|
||||
[mapgen_water]
|
||||
type="node"
|
||||
name="water_source"
|
||||
tiles = ["open_water_source.png^[opacity:127"]
|
||||
;tiles ={{name :'open_water_source.png^[opacity:127', backface_culling : false}}
|
||||
;tiles=["open_water_source.png^[mask:open_clump_mask.png^[noalpha^[makealpha:0,0,0^(open_water_source.png^[mask:open_clump_mask.png^[makealpha:0,0,0^[colorize:#000000:70)"]
|
||||
;^[mask:open_clump_mask.png^[noalpha^[makealpha:0,0,0^(open_dirt.png^[mask:open_clump_mask.png^[makealpha:0,0,0^[colorize:#000000:70)"]
|
||||
;tiles=["open_clump_mask.png^(wis_green.png^(wis_green.png^[mask:open_clump_mask.png))^[makealpha:0,0,0" ]
|
||||
alias=["mapgen_water_source", "void_essential:water_source", "8"]
|
||||
description = "This is a secret message, don't read it"
|
||||
groups = { "oddly_breakable_by_hand":1}
|
||||
is_ground_content = false
|
||||
walkable = false
|
||||
liquid_move_physics = true
|
||||
move_resistance = 1
|
||||
pointable = false
|
||||
diggable = false
|
||||
buildable_to = true
|
||||
liquid_viscosity = 0
|
||||
liquid_renewable = false
|
||||
liquid_range = 8
|
||||
|
||||
use_texture_alpha = "blend"
|
||||
drawtype = "liquid"
|
||||
paramtype = "light"
|
||||
light_source = 12
|
||||
|
||||
[mapgen_river_water]
|
||||
type="node"
|
||||
name="river_water_source"
|
||||
tiles = ["open_water_source.png"]
|
||||
alias=["mapgen_river_water_source", "void_essential:river_water_source", "9"]
|
||||
groups = { "oddly_breakable_by_hand":1}
|
||||
description = "This is secret water, you don't need it"
|
||||
is_ground_content = false
|
||||
|
||||
walkable = false
|
||||
liquid_move_physics = true
|
||||
move_resistance = 1
|
||||
pointable = false
|
||||
diggable = false
|
||||
buildable_to = true
|
||||
liquid_viscosity = 0
|
||||
liquid_renewable = false
|
||||
liquid_range = 8
|
||||
|
||||
[mapgen_stone]
|
||||
type="node"
|
||||
name="stone"
|
||||
tiles=["open_stone.png"]
|
||||
tiles=["open_stone.png^wis_beading.png"]
|
||||
tiles=["open_stone.png"]
|
||||
|
||||
alias=["mapgen_stone", "void_essential:stone", "1"]
|
||||
description="abundant, ubiquitous, and yet fundamentaly essential"
|
||||
groups = {}
|
||||
is_ground_content=true
|
||||
|
||||
[mapgen_grass]
|
||||
type="node"
|
||||
name="grass"
|
||||
tiles=["open_grass.png","open_dirt.png", "open_dirt.png^(open_grass.png^[mask:open_grass_mask_big.png^[makealpha:0,0,0)" ]
|
||||
alias=["mapgen_dirt_with_grass","grass", "2"]
|
||||
description="天叢雲剣"
|
||||
groups = { "oddly_breakable_by_hand":1, "dirt": 1 }
|
||||
is_ground_content=true
|
||||
|
||||
[mapgen_dirt]
|
||||
type="node"
|
||||
name="dirt"
|
||||
tiles=["open_dirt.png"]
|
||||
alias=["mapgen_dirt","3"]
|
||||
groups = { "oddly_breakable_by_hand":1}
|
||||
|
||||
|
||||
[mapgen_sand]
|
||||
type="node"
|
||||
name="sand"
|
||||
tiles=[ "open_sand.png"]
|
||||
alias=["mapgen_sand","12"]
|
||||
groups = { "oddly_breakable_by_hand":1}
|
||||
macros = ["clump", "craftables"]
|
||||
|
||||
[mapgen_sandstone]
|
||||
type="node"
|
||||
name="sandstone"
|
||||
tiles=["open_sandstone.png"]
|
||||
alias=["mapgen_sandstone","24"]
|
||||
groups = {}
|
||||
|
||||
|
||||
[node_log]
|
||||
type="node"
|
||||
name="log"
|
||||
tiles=["open_oak_log.png","open_oak_log.png", "open_oak_bark.png"]
|
||||
alias=["log","oak_log"]
|
||||
groups = { "oddly_breakable_by_hand":1, "tree":1 }
|
||||
|
||||
[node_leaves]
|
||||
type="node"
|
||||
name="leaves"
|
||||
tiles=["open_oak_leaf.png"]
|
||||
alias=["leaves","oak_leaves"]
|
||||
groups = { "oddly_breakable_by_hand":1}
|
||||
|
||||
drawtype = "allfaces_optional"
|
||||
;Allows transparency
|
||||
waving = 1
|
||||
; is go wosh!
|
||||
paramtype = "light"
|
||||
sunlight_propagates = true
|
||||
walkable = true
|
||||
groups = { "oddly_breakable_by_hand":1, "leafdecay" : 1, "flammable" : 1}
|
||||
|
||||
; drop = { max_items = 1, items = { {items = {"sapling"}, rarity = 20}, {items = {"leaves"}} } }
|
||||
|
||||
|
||||
;-- mapgen_water_source mapgen_river_water_source mapgen_stone mapgen_dirt_with_grass mapgen_dirt mapgen_sand
|
||||
;-- mapgen_sandstone
|
||||
; mapgen_gravel
|
||||
|
||||
|
26
mods/wisgame/open/open_skin.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
-- Define player sikin
|
||||
local frontTexture = "player.png"
|
||||
local backTexture = "player_back.png"
|
||||
|
||||
-- Number of required textures depends on visual.
|
||||
-- "sprite" uses 1 texture.
|
||||
-- "upright_sprite" uses 2 textures: {front, back}.
|
||||
|
||||
-- set the player's skin when they join
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
player:set_properties({
|
||||
visual = "upright_sprite",
|
||||
spritediv = {x = 1, y = 1}, -- declare as a single texture divided into 1x1 sections
|
||||
initial_sprite_basepos = {x = 0, y = 0}, -- Start at the top-left corner
|
||||
visual_size = {x = 1, y = 1},
|
||||
--Thanks to wwwq for fixing this part for me! 0/
|
||||
eye_height = 0.85,
|
||||
textures = { frontTexture, backTexture },
|
||||
visual_size = {x = 1, y = 1, z = 1},
|
||||
collisionbox = { -0.3, 0, -0.3, 0.3, 0.9, 0.3 },
|
||||
selectionbox = { -0.5, 0, -0.5, 0.5, 1, 0.5, rotate = false },
|
||||
});
|
||||
end)
|
||||
|
||||
|
||||
|
31
mods/wisgame/open/open_skys.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
local noon = 0.5
|
||||
local midnight = 1.0
|
||||
local fixedTime = noon
|
||||
minetest.register_globalstep(function(dtime)
|
||||
minetest.set_timeofday(fixedTime)
|
||||
end)
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
player:set_sky({
|
||||
base_color = "#87CEEB", --"#87CEEB", -- Explicitly set color to skyblue
|
||||
type = "plain",
|
||||
clouds = false,
|
||||
})
|
||||
-- please go away sun
|
||||
player:set_sun({
|
||||
visible = false, -- set sun visibility
|
||||
sunrise = nil, -- god damn sunrisebg.png is still visibe!
|
||||
sunset = nil, -- "sunset.png", -- sunset texture
|
||||
texture = "sun.png", -- take a wild guess -__-
|
||||
})
|
||||
|
||||
player:set_moon({
|
||||
visible = false,
|
||||
texture = "moon.png",
|
||||
})
|
||||
|
||||
player:set_stars({
|
||||
visible = false, -- Explicitly setting stars visibility
|
||||
count = 1000, -- Custom number of stars (if needed)
|
||||
star_color = "#FFFFFF", -- Custom star color (if needed)
|
||||
})
|
||||
end)
|
89
mods/wisgame/open/open_trees.lua
Normal file
|
@ -0,0 +1,89 @@
|
|||
|
||||
local modname = minetest.get_current_modname()
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
-- hard coding this is a failure of the game design
|
||||
local schemapath = modpath .. "/schema/smoltree.mts"
|
||||
--//mtschemcreate smoltree
|
||||
|
||||
|
||||
--registrate tree spawn params
|
||||
minetest.register_on_mods_loaded(function()
|
||||
local postpendstr = "_subterranean"
|
||||
for name, _ in pairs(minetest.registered_biomes) do
|
||||
if name:sub(-#postpendstr) ~= postpendstr then
|
||||
--c.log("Biome name: " .. name)
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"group:dirt"},
|
||||
sidelen = 80,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.05,
|
||||
spread = {x = 1024, y = 10, z = 1024},
|
||||
seed = minetest.get_mapgen_setting("seed"),
|
||||
octaves = 4,
|
||||
persistence = 0.5,
|
||||
lacunarity = 1.0,
|
||||
},
|
||||
y_max = minetest.registered_biomes.y_max,
|
||||
y_min = minetest.registered_biomes.y_min,
|
||||
schematic = schemapath,
|
||||
flags = "place_center_x, place_center_z",
|
||||
rotation = "random",
|
||||
biomes = {name},
|
||||
})
|
||||
end
|
||||
end
|
||||
-- leaf decay is a failure of the game design
|
||||
-- compat: https://forum.minetest.net/viewtopic.php?t=18023
|
||||
|
||||
local leafdecaynodes = {}
|
||||
for name, def in pairs(minetest.registered_nodes) do
|
||||
if def.groups and def.groups.leafdecay then
|
||||
table.insert(leafdecaynodes, name)
|
||||
end
|
||||
end
|
||||
|
||||
local treenodes = {}
|
||||
for name, def in pairs(minetest.registered_nodes) do
|
||||
if def.groups and def.groups.tree then
|
||||
table.insert(treenodes, name)
|
||||
end
|
||||
end
|
||||
--c.log(#treenodes)
|
||||
local leafdecayradius = 1
|
||||
minetest.register_abm({
|
||||
nodenames = leafdecaynodes,
|
||||
neighbors = {"air"},
|
||||
interval = 1, -- Time in seconds between ABM execution
|
||||
chance = 1, -- 1 in $% chance for the ABM to run
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local foundtree = false
|
||||
for dx = -leafdecayradius, leafdecayradius do
|
||||
for dy = -leafdecayradius, leafdecayradius do
|
||||
for dz = -leafdecayradius, leafdecayradius do
|
||||
local p = {x = pos.x + dx, y = pos.y + dy, z = pos.z + dz}
|
||||
local n = minetest.get_node(p)
|
||||
if minetest.registered_nodes[n.name].groups and minetest.registered_nodes[n.name].groups.tree then
|
||||
foundtree = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if foundtree then
|
||||
break
|
||||
end
|
||||
end
|
||||
if foundtree then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not foundtree then
|
||||
local spawnableitem = minetest.get_node(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.spawn_item(pos, spawnableitem)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
end)
|
BIN
mods/wisgame/schema/smoltree.mts
Normal file
|
@ -0,0 +1 @@
|
|||
|
BIN
mods/wisgame/textures/Christian Elbrianno/open_acorn.png
Normal file
After Width: | Height: | Size: 427 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_acorn_sprout.png
Normal file
After Width: | Height: | Size: 419 B |
After Width: | Height: | Size: 527 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_cobble.png
Normal file
After Width: | Height: | Size: 585 B |
After Width: | Height: | Size: 379 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_dirt.png
Normal file
After Width: | Height: | Size: 717 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_feather.png
Normal file
After Width: | Height: | Size: 382 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_fire.gif
Normal file
After Width: | Height: | Size: 697 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_gold_overlay.png
Normal file
After Width: | Height: | Size: 343 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_grass.png
Normal file
After Width: | Height: | Size: 476 B |
After Width: | Height: | Size: 129 B |
After Width: | Height: | Size: 131 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_gravel.png
Normal file
After Width: | Height: | Size: 240 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_iron_overlay.png
Normal file
After Width: | Height: | Size: 531 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_magma.png
Normal file
After Width: | Height: | Size: 541 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_mud.png
Normal file
After Width: | Height: | Size: 738 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_oak_bark.png
Normal file
After Width: | Height: | Size: 358 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_oak_leaf.png
Normal file
After Width: | Height: | Size: 421 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_oak_log.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_oak_plank.png
Normal file
After Width: | Height: | Size: 375 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_obsidian.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_orb_glass.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_rapier.png
Normal file
After Width: | Height: | Size: 198 B |
After Width: | Height: | Size: 409 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_sand.png
Normal file
After Width: | Height: | Size: 528 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_sandstone.png
Normal file
After Width: | Height: | Size: 507 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_stick.png
Normal file
After Width: | Height: | Size: 175 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_stone.png
Normal file
After Width: | Height: | Size: 351 B |
BIN
mods/wisgame/textures/Christian Elbrianno/open_water_source.png
Normal file
After Width: | Height: | Size: 500 B |
After Width: | Height: | Size: 293 B |
After Width: | Height: | Size: 448 B |
After Width: | Height: | Size: 425 B |
After Width: | Height: | Size: 436 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 407 B |
After Width: | Height: | Size: 336 B |
After Width: | Height: | Size: 280 B |
After Width: | Height: | Size: 412 B |
After Width: | Height: | Size: 153 B |
After Width: | Height: | Size: 687 B |
After Width: | Height: | Size: 291 B |
After Width: | Height: | Size: 913 B |
After Width: | Height: | Size: 1 KiB |
After Width: | Height: | Size: 3.3 KiB |
BIN
mods/wisgame/textures/RedAndFoxy/heart.png
Normal file
After Width: | Height: | Size: 569 B |
BIN
mods/wisgame/textures/RedAndFoxy/useless/BloodBlock+button.png
Normal file
After Width: | Height: | Size: 852 B |
BIN
mods/wisgame/textures/RedAndFoxy/useless/Bloodblockbase.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/wisgame/textures/RedAndFoxy/useless/Bloodon stone.png
Normal file
After Width: | Height: | Size: 768 B |
BIN
mods/wisgame/textures/RedAndFoxy/useless/Dirt_block.png
Normal file
After Width: | Height: | Size: 410 B |
BIN
mods/wisgame/textures/RedAndFoxy/useless/Furnace_side.png
Normal file
After Width: | Height: | Size: 582 B |
BIN
mods/wisgame/textures/RedAndFoxy/useless/Grass_block_side.png
Normal file
After Width: | Height: | Size: 534 B |
BIN
mods/wisgame/textures/RedAndFoxy/useless/Grass_side.png
Normal file
After Width: | Height: | Size: 298 B |
BIN
mods/wisgame/textures/RedAndFoxy/useless/Grass_top.png
Normal file
After Width: | Height: | Size: 621 B |
BIN
mods/wisgame/textures/RedAndFoxy/useless/Steel_door_bottom.png
Normal file
After Width: | Height: | Size: 4.3 KiB |