Fix crasher and more
This commit is contained in:
parent
47097b48ba
commit
c1db9de3a4
20
init.lua
20
init.lua
@ -9,7 +9,15 @@ local F = minetest.formspec_escape
|
||||
local current_perlin = {}
|
||||
-- holds the current PerlinNoise object
|
||||
current_perlin.noise = nil
|
||||
current_perlin.noiseparams = {}
|
||||
current_perlin.noiseparams = {
|
||||
offset = 0.0,
|
||||
scale = 1.0,
|
||||
spread = vector.new(10, 10, 10),
|
||||
seed = 0,
|
||||
octaves = 2,
|
||||
persistence = 0.7,
|
||||
lacunarity = 2.0,
|
||||
}
|
||||
-- Side length of calculated perlin area
|
||||
current_perlin.size = nil
|
||||
-- Theoretical min and max values for Perlin noise (for colorization)
|
||||
@ -46,6 +54,8 @@ if COLORIZE_NODES then
|
||||
end
|
||||
minetest.register_node("perlin_explorer:node", {
|
||||
description = S("Perlin Test Node"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = paramtype2,
|
||||
tiles = {"perlin_explorer_node.png"},
|
||||
palette = "perlin_explorer_node_palette.png",
|
||||
@ -55,6 +65,8 @@ minetest.register_node("perlin_explorer:node", {
|
||||
})
|
||||
minetest.register_node("perlin_explorer:node_negative", {
|
||||
description = S("Negative Perlin Test Node"),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = paramtype2,
|
||||
tiles = {"perlin_explorer_node_neg.png"},
|
||||
palette = "perlin_explorer_node_palette_neg.png",
|
||||
@ -74,7 +86,8 @@ minetest.register_tool("perlin_explorer:getter", {
|
||||
end
|
||||
local privs = minetest.get_player_privs(user:get_player_name())
|
||||
if not privs.server then
|
||||
minetset.chat_send_player(user:get_player_name(), S("Insufficient privileges! You need the @1 privilege to use this tool.", "server"))
|
||||
minetest.chat_send_player(user:get_player_name(), S("Insufficient privileges! You need the @1 privilege to use this tool.", "server"))
|
||||
return
|
||||
end
|
||||
if current_perlin.noise then
|
||||
if pointed_thing.type ~= "node" then
|
||||
@ -442,7 +455,8 @@ minetest.register_tool("perlin_explorer:creator", {
|
||||
end
|
||||
local privs = minetest.get_player_privs(user:get_player_name())
|
||||
if not privs.server then
|
||||
minetset.chat_send_player(user:get_player_name(), S("Insufficient privileges! You need the @1 privilege to use this tool.", "server"))
|
||||
minetest.chat_send_player(user:get_player_name(), S("Insufficient privileges! You need the @1 privilege to use this tool.", "server"))
|
||||
return
|
||||
end
|
||||
show_formspec(user)
|
||||
end,
|
||||
|
Loading…
x
Reference in New Issue
Block a user