Compare commits

...

17 Commits

Author SHA1 Message Date
Yachie Kicchou 0152c4a780 Fixed asymmetrical eye. 2024-04-16 18:37:12 +00:00
Yachie Kicchou 6e55e457d5 Update README.md 2024-04-16 03:01:22 +00:00
Yachie Kicchou 97798e43db Update CREDITS.md 2024-04-16 01:15:48 +00:00
Yachie Kicchou 4425903a72 Update game.conf 2024-04-15 22:12:52 +00:00
Yachie Kicchou b08f5be928 Upload files to "textures" 2024-04-15 22:11:47 +00:00
Yachie Kicchou 23b5b97154 Upload files to "textures" 2024-04-15 22:11:27 +00:00
Yachie Kicchou 2af5c321f2 Out with the old, in with the new. 2024-04-15 22:10:20 +00:00
Yachie Kicchou 6cae857005 Upload files to "textures" 2024-04-15 22:09:18 +00:00
the-real-herowl 0f20e18e53 Merge pull request 'fix_xp_reload_bug' (#4226) from teknomunk/MineClone2:fix_xp_reload_bug into master
Reviewed-on: MineClone2/MineClone2#4226
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-14 07:10:33 +00:00
the-real-herowl 69d3fa5f85 Merge pull request 'Added a check for the bone meal's applied position.' (#4201) from CyberMango/MineClone2:dev/mango/add_bone_meal_protection_check into master
Reviewed-on: MineClone2/MineClone2#4201
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-14 07:07:21 +00:00
the-real-herowl 5e673b8fee Merge pull request 'Add partial item stack pickup' (#4193) from teknomunk/MineClone2:grouped-item-pickup into master
Reviewed-on: MineClone2/MineClone2#4193
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-14 06:53:37 +00:00
Araca 596c56d31f Add possibility to edit a sign (#4188)
We can edit a sign by right-clicking in it. If in hand you have a color or a glow ink, the behaviour didn't change. Also some refactorization.

Reviewed-on: MineClone2/MineClone2#4188
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Araca <araca.prod@gmail.com>
Co-committed-by: Araca <araca.prod@gmail.com>
2024-04-14 06:50:19 +00:00
teknomunk 13ce4f9092 Additional cleanup, impelemnt partial item stack pickup 2024-03-31 02:32:24 +00:00
teknomunk 0a294c55a1 Move object pickup code to try_object_pickup(...) and refactor to remove most indentation for readability 2024-03-31 02:32:24 +00:00
teknomunk 44bb07507d Cleanup comment, whitespace for readability 2024-03-31 02:28:46 +00:00
cora 3509b85a3e Fix possible crash due to engine bug reloading XP orbs 2024-03-31 02:28:46 +00:00
CyberMango 4a22287eb6 Added a check for the bone meal's applied position.
protection the position above as well to prevent growing high grass on
areas in which you are not allowed to place blocks. Because, if you cant
place a block there, why should you be able to grow grass/flowers there?
2024-02-29 13:36:02 +02:00
16 changed files with 183 additions and 238 deletions

View File

@ -129,6 +129,7 @@
* Bakawun * Bakawun
* JoseDouglas26 * JoseDouglas26
* Zasco * Zasco
* Yachie Kicchou
## Music ## Music
* Jordach for the jukebox music compilation from Big Freaking Dig * Jordach for the jukebox music compilation from Big Freaking Dig

View File

@ -1,4 +1,4 @@
# MineClone2 # VoxeLibre
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
Developed by many people. Not developed or endorsed by Mojang AB. Developed by many people. Not developed or endorsed by Mojang AB.

View File

@ -1,4 +1,4 @@
title = MineClone 2 title = VoxeLibre
description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more. description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more.
disallowed_mapgens = v6 disallowed_mapgens = v6
version=0.87.0-SNAPSHOT version=0.87.0-SNAPSHOT

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -113,6 +113,55 @@ local function disable_physics(object, luaentity, ignore_check, reset_movement)
end end
end end
local function try_object_pickup(player, inv, object, checkpos)
if not inv then return end
local le = object:get_luaentity()
-- Check magnet timer
if not (le._magnet_timer >= 0) then return end
if not (le._magnet_timer < item_drop_settings.magnet_time) then return end
-- Don't try to collect again
if le._removed then return end
-- Ignore if itemstring is not set yet
if le.itemstring == "" then return end
-- Add what we can to the inventory
local itemstack = ItemStack(le.itemstring)
local leftovers = inv:add_item("main", itemstack )
check_pickup_achievements(object, player)
if leftovers:is_empty() then
-- Destroy entity
-- This just prevents this section to be run again because object:remove() doesn't remove the item immediately.
le.target = checkpos
le._removed = true
-- Stop the object
object:set_velocity(vector.zero())
object:set_acceleration(vector.zero())
object:move_to(checkpos)
-- Update sound pool
local name = player:get_player_name()
pool[name] = ( pool[name] or 0 ) + 1
-- Make sure the object gets removed
minetest.after(0.25, function()
--safety check
if object and object:get_luaentity() then
object:remove()
end
end)
else
-- Update entity itemstring
le.itemstring = leftovers:to_string()
end
end
minetest.register_globalstep(function(_) minetest.register_globalstep(function(_)
tick = not tick tick = not tick
@ -147,40 +196,7 @@ minetest.register_globalstep(function(_)
object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and object:get_luaentity()._magnet_timer object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and object:get_luaentity()._magnet_timer
and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then
if object:get_luaentity()._magnet_timer >= 0 and try_object_pickup( player, inv, object, checkpos )
object:get_luaentity()._magnet_timer < item_drop_settings.magnet_time and inv and
inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
-- Collection
if not object:get_luaentity()._removed then
-- Ignore if itemstring is not set yet
if object:get_luaentity().itemstring ~= "" then
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
check_pickup_achievements(object, player)
-- Destroy entity
-- This just prevents this section to be run again because object:remove() doesn't remove the item immediately.
object:get_luaentity().target = checkpos
object:get_luaentity()._removed = true
object:set_velocity(vector.zero())
object:set_acceleration(vector.zero())
object:move_to(checkpos)
pool[name] = pool[name] + 1
minetest.after(0.25, function()
--safety check
if object and object:get_luaentity() then
object:remove()
end
end)
end
end
end
elseif not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "mcl_experience:orb" then elseif not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "mcl_experience:orb" then
local entity = object:get_luaentity() local entity = object:get_luaentity()
entity.collector = player:get_player_name() entity.collector = player:get_player_name()

View File

@ -177,7 +177,6 @@ minetest.register_entity("mcl_experience:orb", {
delete_timer = 0, delete_timer = 0,
radius = 4, radius = 4,
on_activate = function(self, staticdata, dtime_s) on_activate = function(self, staticdata, dtime_s)
self.object:set_velocity(vector.new( self.object:set_velocity(vector.new(
math.random(-2,2)*math.random(), math.random(-2,2)*math.random(),
@ -187,10 +186,14 @@ minetest.register_entity("mcl_experience:orb", {
self.object:set_armor_groups({immortal = 1}) self.object:set_armor_groups({immortal = 1})
self.object:set_velocity({x = 0, y = 2, z = 0}) self.object:set_velocity({x = 0, y = 2, z = 0})
self.object:set_acceleration(gravity) self.object:set_acceleration(gravity)
local xp = tonumber(staticdata)
-- Assign 0 xp in case the entity was persisted even though it should not have been (static_save = false)
-- This was a minetest bug for a while: https://github.com/minetest/minetest/issues/14420
local xp = tonumber(staticdata) or 0
self._xp = xp self._xp = xp
size = xp_to_size(xp) size = xp_to_size(xp)
self.object:set_properties({
self.object:set_properties({
visual_size = {x = size, y = size}, visual_size = {x = size, y = size},
glow = 14, glow = 14,
}) })

View File

@ -182,6 +182,10 @@ local function apply_bone_meal(pointed_thing, user)
local n = minetest.get_node(pos) local n = minetest.get_node(pos)
if n.name == "" then return false end if n.name == "" then return false end
if mcl_util.check_area_protection(pos, pointed_thing.above, user) then
return false
end
for _, func in pairs(mcl_dye.bone_meal_callbacks) do for _, func in pairs(mcl_dye.bone_meal_callbacks) do
if func(pointed_thing, user) then if func(pointed_thing, user) then
return true return true

View File

@ -4,10 +4,7 @@
--- DateTime: 10/14/22 4:05 PM --- DateTime: 10/14/22 4:05 PM
--- ---
--local logging = minetest.settings:get_bool("mcl_logging_mcl_signs",true)
local DEBUG = minetest.settings:get_bool("mcl_logging_mcl_signs", false) -- special debug setting. local DEBUG = minetest.settings:get_bool("mcl_logging_mcl_signs", false) -- special debug setting.
if DEBUG then if DEBUG then
minetest.log("action", "[mcl_signs] Signs API Loading") minetest.log("action", "[mcl_signs] Signs API Loading")
end end
@ -115,9 +112,6 @@ mcl_signs.registered_signs = {}
mcl_signs.registered_signs.wall_signs = {} mcl_signs.registered_signs.wall_signs = {}
mcl_signs.registered_signs.standing_signs = {} mcl_signs.registered_signs.standing_signs = {}
mcl_signs.registered_signs.hanging_signs = {} -- unused. prepping for future use. mcl_signs.registered_signs.hanging_signs = {} -- unused. prepping for future use.
-- DEFINE SIGN BASE TYPES
mcl_signs.wall_standard = {} -- initialize
mcl_signs.standing_standard = {} -- initialize
function mcl_signs.build_signs_info() function mcl_signs.build_signs_info()
local n = 23 / 56 - 1 / 128 -- some required magic number from the original code. local n = 23 / 56 - 1 / 128 -- some required magic number from the original code.
@ -141,37 +135,110 @@ function mcl_signs.build_signs_info()
end end
-- wall signs' & hanging signs' base (definition) -- DEFINE SIGN BASE TYPES
mcl_signs.wall_standard = { local common_definition = {
description = S("Sign"), _mcl_hardness = 1,
_tt_help = S("Can be written"), _mcl_blast_resistance = 1,
_doc_items_longdesc = S("Signs can be written and come in two variants: Wall sign and sign on a sign post. Signs can be placed on the top and the sides of other blocks, but not below them."),
_doc_items_usagehelp = S("After placing the sign, you can write something on it. You have 4 lines of text with up to 15 characters for each line; anything beyond these limits is lost. Not all characters are supported. The text can not be changed once it has been written; you have to break and place the sign again. Can be colored and made to glow."),
inventory_image = "mcl_signs_default_sign.png",
walkable = false,
is_ground_content = false,
wield_image = "mcl_signs_default_sign.png",
node_placement_prediction = "",
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "wallmounted",
drawtype = "mesh",
mesh = "mcl_signs_signonwallmount.obj",
selection_box = { type = "wallmounted", wall_side = { -0.5, -7 / 28, -0.5, -23 / 56, 7 / 28, 0.5 } },
tiles = { "mcl_signs_sign.png" },
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
groups = mcl_signs.sign_groups,
stack_max = 16, stack_max = 16,
sounds = node_sounds, sounds = node_sounds,
groups = mcl_signs.sign_groups,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
drawtype = "mesh",
paramtype = "light",
tiles = { "mcl_signs_sign.png" },
sunlight_propagates = true,
walkable = false,
is_ground_content = false,
on_timer = function(pos) on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Right Click event.")
end
-- make sure player is clicking
if not clicker or not clicker:is_player() then
return
end
local item = clicker:get_wielded_item()
local iname = item:get_name()
local protected = mcl_util.check_position_protection(pos, clicker)
if node and not protected then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Right Click event on valid node.")
end
-- handle glow from glow_ink_sac *first*
if (iname == "mcl_mobitems:glow_ink_sac") then
clicker:set_wielded_item(item)
local success = mcl_signs:glow_sign(pos)
if success then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Glow Success.")
end
itemstack:take_item()
end
return
end
-- check the wielded item to make sure that it is a dye.
local txt_color = mcl_signs:get_color_for_sign(iname)
if txt_color ~= "false" then
clicker:set_wielded_item(item)
local success = mcl_signs:color_sign(pos, txt_color)
-- "mcl_dye:black" is a special case: it makes the sign's lettering black AND removes glow.
if (iname == "mcl_dye:black") then
success = mcl_signs:glow_sign(pos, true)
if success and DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Glow removal Success.")
end
end
if success then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Color Success.")
end
itemstack:take_item()
end
return
end
-- No modifier item in hand, open the sign for edition
local old_text = minetest.get_meta(pos):get_string("text")
mcl_signs:show_formspec(clicker, pos, old_text)
end
end,
on_destruct = function(pos)
mcl_signs:destruct_sign(pos)
end,
-- Not Useless Code. this force updates the sign.
on_punch = function(pos, node, puncher)
mcl_signs:update_sign(pos)
end,
}
-- wall signs' & hanging signs' base (definition)
mcl_signs.wall_standard = table.copy(common_definition)
mcl_signs.wall_standard.description = S("Sign")
mcl_signs.wall_standard._tt_help = S("Can be written")
mcl_signs.wall_standard._doc_items_longdesc = S("Signs can be written and come in two variants: Wall sign and sign on a sign post. Signs can be placed on the top and the sides of other blocks, but not below them.")
mcl_signs.wall_standard._doc_items_usagehelp = S("After placing the sign, you can write something on it. You have 4 lines of text with up to 15 characters for each line; anything beyond these limits is lost. Not all characters are supported. The text can not be changed once it has been written; you have to break and place the sign again. Can be colored and made to glow.")
mcl_signs.wall_standard.inventory_image = "mcl_signs_default_sign.png"
mcl_signs.wall_standard.wield_image = "mcl_signs_default_sign.png"
mcl_signs.wall_standard.node_placement_prediction = ""
mcl_signs.wall_standard.paramtype2 = "wallmounted"
mcl_signs.wall_standard.mesh = "mcl_signs_signonwallmount.obj"
mcl_signs.wall_standard.selection_box = { type = "wallmounted", wall_side = { -0.5, -7 / 28, -0.5, -23 / 56, 7 / 28, 0.5 } }
mcl_signs.wall_standard.on_timer = function(pos)
-- fix for /ClearObjects -- fix for /ClearObjects
mcl_signs:update_sign(pos) mcl_signs:update_sign(pos)
-- note: update_sign decides to keep the timer running based on if there is text. -- note: update_sign decides to keep the timer running based on if there is text.
-- This prevents every sign from having a timer, when not needed. -- This prevents every sign from having a timer, when not needed.
end, end
mcl_signs.wall_standard.on_place = function(itemstack, placer, pointed_thing)
on_place = function(itemstack, placer, pointed_thing)
local above = pointed_thing.above local above = pointed_thing.above
local under = pointed_thing.under local under = pointed_thing.under
@ -192,9 +259,6 @@ mcl_signs.wall_standard = {
end end
local wdir = minetest.dir_to_wallmounted(dir) local wdir = minetest.dir_to_wallmounted(dir)
--local placer_pos = placer:get_pos()
local fdir = minetest.dir_to_facedir(dir) local fdir = minetest.dir_to_facedir(dir)
local sign_info local sign_info
@ -272,18 +336,10 @@ mcl_signs.wall_standard = {
minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true) minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true)
mcl_signs:show_formspec(placer, place_pos) mcl_signs:show_formspec(placer, place_pos, "")
return itemstack return itemstack
end, end
on_destruct = function(pos) mcl_signs.wall_standard.on_rotate = function(pos, node, user, mode)
mcl_signs:destruct_sign(pos)
end,
-- Not Useless Code. force updates the sign.
on_punch = function(pos, node, puncher)
mcl_signs:update_sign(pos)
end,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then if mode == screwdriver.ROTATE_FACE then
local r = screwdriver.rotate.wallmounted(pos, node, mode) local r = screwdriver.rotate.wallmounted(pos, node, mode)
node.param2 = r node.param2 = r
@ -293,105 +349,21 @@ mcl_signs.wall_standard = {
else else
return false return false
end end
end, end
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if DEBUG then
minetest.log("verbose", "[mcl_signs] Wall_Sign Right Click event.")
end
-- make sure player is clicking
if not clicker or not clicker:is_player() then
return
end
local item = clicker:get_wielded_item()
local iname = item:get_name()
local protected = mcl_util.check_position_protection(pos, clicker)
if node and not protected then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Wall_Sign Right Click event on valid node.")
end
-- handle glow from glow_ink_sac *first*
if (iname == "mcl_mobitems:glow_ink_sac") then
clicker:set_wielded_item(item)
local success = mcl_signs:glow_sign(pos)
if success then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Glow Success.")
end
itemstack:take_item()
end
return
end
-- "mcl_dye:black" is a special case: it makes the sign's lettering black AND removes glow.
if (iname == "mcl_dye:black") then
clicker:set_wielded_item(item)
local success = mcl_signs:glow_sign(pos, true)
mcl_signs:color_sign(pos, mcl_colors.BLACK)
if success then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Glow removal Success.")
end
itemstack:take_item()
end
return
end
-- check the wielded item to make sure that it is a dye.
local txt_color = mcl_signs:get_color_for_sign(iname)
if txt_color ~= "false" then
clicker:set_wielded_item(item)
local success = mcl_signs:color_sign(pos, txt_color)
if success then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Color Success.")
end
itemstack:take_item()
end
end
end
end,
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
}
-- standing sign base (definition) -- standing sign base (definition)
mcl_signs.standing_standard = { mcl_signs.standing_standard = table.copy(common_definition)
paramtype = "light", mcl_signs.standing_standard.paramtype2 = "facedir"
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, mcl_signs.standing_standard.mesh = "mcl_signs_sign.obj"
sunlight_propagates = true, mcl_signs.standing_standard.selection_box = { type = "fixed", fixed = { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } }
walkable = false, mcl_signs.standing_standard.drop = "mcl_signs:wall_sign"
is_ground_content = false, mcl_signs.standing_standard.on_timer = function(pos)
paramtype2 = "facedir",
drawtype = "mesh",
mesh = "mcl_signs_sign.obj",
selection_box = { type = "fixed", fixed = { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
tiles = { "mcl_signs_sign.png" },
groups = mcl_signs.sign_groups,
drop = "mcl_signs:wall_sign",
stack_max = 16,
sounds = node_sounds,
on_destruct = function(pos)
mcl_signs:destruct_sign(pos)
end,
on_timer = function(pos)
-- fix for /ClearObjects -- fix for /ClearObjects
mcl_signs:update_sign(pos) mcl_signs:update_sign(pos)
minetest.get_node_timer(pos):start(40.0) minetest.get_node_timer(pos):start(40.0)
end, end
mcl_signs.standing_standard.on_rotate = function(pos, node, user, mode)
-- Not Useless Code. this force updates the sign.
on_punch = function(pos, node, puncher)
mcl_signs:update_sign(pos)
end,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then if mode == screwdriver.ROTATE_FACE then
node.name = "mcl_signs:standing_sign22_5" node.name = "mcl_signs:standing_sign22_5"
minetest.swap_node(pos, node) minetest.swap_node(pos, node)
@ -400,60 +372,7 @@ mcl_signs.standing_standard = {
end end
mcl_signs:update_sign(pos, nil, nil, true) mcl_signs:update_sign(pos, nil, nil, true)
return true return true
end, end
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if DEBUG then
minetest.log("verbose", "[mcl_signs] Standing_Sign Right Click event.")
end
-- make sure player is clicking
if not clicker or not clicker:is_player() then
return
end
local item = clicker:get_wielded_item()
local iname = item:get_name()
local protected = mcl_util.check_position_protection(pos, clicker)
if node and not protected then
-- handle glow from glow_ink_sac *first*
if DEBUG then
minetest.log("verbose", "[mcl_signs] Standing_Sign Right Click event on valid node.")
end
if (iname == "mcl_mobitems:glow_ink_sac") then
clicker:set_wielded_item(item)
local success = mcl_signs:glow_sign(pos)
if success then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Glow Success.")
end
itemstack:take_item()
end
return
end
-- check the wielded item to make sure that it is a dye.
local txt_color = mcl_signs:get_color_for_sign(iname)
if txt_color ~= "false" then
clicker:set_wielded_item(item)
local success = mcl_signs:color_sign(pos, txt_color)
if success then
if DEBUG then
minetest.log("verbose", "[mcl_signs] Sign Color Success.")
end
itemstack:take_item()
end
end
end
end,
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
}
-- HELPER FUNCTIONS' VARIABLES -- HELPER FUNCTIONS' VARIABLES
local sign_glow = 6 local sign_glow = 6
@ -663,7 +582,7 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true) minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true)
mcl_signs:show_formspec(placer, place_pos) mcl_signs:show_formspec(placer, place_pos, "")
return itemstack return itemstack
end end
@ -916,7 +835,7 @@ function mcl_signs.register_sign_custom (modname, _name, tiles, color, inventory
minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true) minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true)
mcl_signs:show_formspec(placer, place_pos) mcl_signs:show_formspec(placer, place_pos, "")
return itemstack return itemstack
end end
minetest.register_node(":mcl_signs:wall_sign" .. _name, new_sign) minetest.register_node(":mcl_signs:wall_sign" .. _name, new_sign)
@ -1152,7 +1071,7 @@ function mcl_signs.reregister_sign (modname, color, _name, ttsign)
minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true) minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true)
mcl_signs:show_formspec(placer, place_pos) mcl_signs:show_formspec(placer, place_pos, "")
return itemstack return itemstack
end end
@ -1401,7 +1320,7 @@ function mcl_signs.reregister_sign_custom (modname, _name, tiles, color, invento
minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true) minetest.sound_play({ name = "default_place_node_hard", gain = 1.0 }, { pos = place_pos }, true)
mcl_signs:show_formspec(placer, place_pos) mcl_signs:show_formspec(placer, place_pos, "")
return itemstack return itemstack
end end
minetest.override_item("mcl_signs:wall_sign" .. _name, new_sign) minetest.override_item("mcl_signs:wall_sign" .. _name, new_sign)
@ -1883,7 +1802,7 @@ function mcl_signs:update_sign(pos, fields, sender, force_remove, text_color)
return false return false
end end
local text = meta:get_string("text", "") local text = meta:get_string("text", "")
if fields and (text == "" and fields.text) then if fields and fields.text then
meta:set_string("text", fields.text) meta:set_string("text", fields.text)
text = fields.text text = fields.text
end end
@ -2040,11 +1959,13 @@ function mcl_signs:update_sign(pos, fields, sender, force_remove, text_color)
end end
function mcl_signs:show_formspec(player, pos) function mcl_signs:show_formspec(player, pos, old_text)
minetest.show_formspec( minetest.show_formspec(
player:get_player_name(), player:get_player_name(),
"mcl_signs:set_text_" .. pos.x .. "_" .. pos.y .. "_" .. pos.z, "mcl_signs:set_text_" .. pos.x .. "_" .. pos.y .. "_" .. pos.z,
"size[6,3]textarea[0.25,0.25;6,1.5;text;" .. F(S("Enter sign text:")) .. ";]label[0,1.5;" .. F(S("Maximum line length: 15")) .. "\n" .. F(S("Maximum lines: 4")) .. "]button_exit[0,2.5;6,1;submit;" .. F(S("Done")) .. "]" "size[6,3]textarea[0.25,0.25;6,1.5;text;" .. F(S("Enter sign text:")) .. ";".. F(old_text) .. "]" ..
"label[0,1.5;" .. F(S("Maximum line length: 15")) ..
"\n" .. F(S("Maximum lines: 4")) .. "]button_exit[0,2.5;6,1;submit;" .. F(S("Done")) .. "]"
) )
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 676 B

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 1.4 KiB