flux reports: if i break the node below a fl ... #3248

Closed
opened 2022-12-16 01:42:59 +00:00 by yourland-report · 10 comments

flux reports a bug:

if i break the node below a flowerpot w/ a mycena mushroom, the mushroom drops but the flowerpot disappears

Player position:

{
	x = 1289,
	y = 47.700000762939,
	z = 624
}

Player look:

{
	x = -0.81045943498611,
	y = -0.58226490020752,
	z = 0.064211472868919
}

Player information:

{
	major = 5,
	minor = 6,
	version_string = "5.6.1",
	formspec_version = 6,
	ip_version = 6,
	min_rtt = 0.1630000025034,
	avg_rtt = 0.20000000298023,
	min_jitter = 0,
	max_jitter = 4.8809995651245,
	avg_jitter = 0.025000005960464,
	connection_uptime = 5627,
	serialization_version = 29,
	patch = 1,
	max_rtt = 5.0500001907349,
	protocol_version = 41,
	state = "Active",
	lang_code = ""
}

Player meta:

{
	fields = {
		crafted = "47977",
		["stamina:level"] = "4",
		xp = "1378887",
		["petz:lycanthropy"] = "1",
		["petz:old_override_table"] = "return {[\"new_move\"] = true, [\"sneak\"] = true, [\"sneak_glitch\"] = false, [\"jump\"] = 1.5, [\"speed\"] = 2, [\"gravity\"] = 1}",
		hud_state = "on",
		["3d_armor_inventory"] = "return {\"3d_armor:helmet_rainbow 1 1622\", \"3d_armor:leggings_rainbow 1 1622\", \"3d_armor:boots_crystal 1 1660\", \"shields:shield_rainbow 1 1582\", \"3d_armor:chestplate_rainbow 1 1622\", \"\"}",
		["petz:werewolf_vignette_id"] = "20",
		["signslib:pos"] = "(1975,19,1178)",
		partychat = "party",
		yl_commons_player_created = "1615351173",
		["petz:werewolf_clan_idx"] = "1",
		yl_church = "return {[\"last_death\"] = {[\"z\"] = 1582, [\"x\"] = 1833, [\"y\"] = -27684}, [\"last_death_portal\"] = 1670728451, [\"last_heal\"] = 1615504208}",
		yl_commons_player_joined = "1671149381",
		repellant = "0",
		yl_commons_thankyou = "185",
		bitten = "0",
		jointime = "1615351173",
		punch_count = "126938",
		["unified_inventory:bags"] = "return {\"water_life:croc_bag\", \"water_life:croc_bag\", \"water_life:croc_bag\", \"water_life:croc_bag\"}",
		inflicted_damage = "2263418",
		["stamina:exhaustion"] = "114.5",
		arenalib_infobox_arenaID = "0",
		["petz:werewolf"] = "0",
		["stamina:poisoned"] = "no",
		played_time = "28208528",
		digged_nodes = "1151722",
		placed_nodes = "365218",
		died = "74"
	}
}

Log identifier


[MOD] yl_report log identifier = qP0XIMNHeh4KPAnqtEfXGWmM9kaRdyyY

Profiler save:

profile-20221216T014259.json_prettyEE

Status:

# Server: version: 5.6.1-yl | game: Minetest Game | uptime: 17h 8min 16s | max lag: 2.43s | clients (19/42): 9T9, AliasAlreadyTaken, Aliza, Bailiff, DanielBoone, darealbang, daydream, DragonWrangler1, Ernesto, flux, jackofthebean000, Jeese, Laylem, Minetest13, MrClean, Redshirt, Service, shanish2, sherkhan30452

Teleport command:

/teleport xyz 1289 48 624

Compass command:

/give_compass Construction qP0XIMNHeh4KPAnqtEfXGWmM9kaRdyyY D2691E 1289 48 624
flux reports a bug: > if i break the node below a flowerpot w/ a mycena mushroom, the mushroom drops but the flowerpot disappears Player position: ``` { x = 1289, y = 47.700000762939, z = 624 } ``` Player look: ``` { x = -0.81045943498611, y = -0.58226490020752, z = 0.064211472868919 } ``` Player information: ``` { major = 5, minor = 6, version_string = "5.6.1", formspec_version = 6, ip_version = 6, min_rtt = 0.1630000025034, avg_rtt = 0.20000000298023, min_jitter = 0, max_jitter = 4.8809995651245, avg_jitter = 0.025000005960464, connection_uptime = 5627, serialization_version = 29, patch = 1, max_rtt = 5.0500001907349, protocol_version = 41, state = "Active", lang_code = "" } ``` Player meta: ``` { fields = { crafted = "47977", ["stamina:level"] = "4", xp = "1378887", ["petz:lycanthropy"] = "1", ["petz:old_override_table"] = "return {[\"new_move\"] = true, [\"sneak\"] = true, [\"sneak_glitch\"] = false, [\"jump\"] = 1.5, [\"speed\"] = 2, [\"gravity\"] = 1}", hud_state = "on", ["3d_armor_inventory"] = "return {\"3d_armor:helmet_rainbow 1 1622\", \"3d_armor:leggings_rainbow 1 1622\", \"3d_armor:boots_crystal 1 1660\", \"shields:shield_rainbow 1 1582\", \"3d_armor:chestplate_rainbow 1 1622\", \"\"}", ["petz:werewolf_vignette_id"] = "20", ["signslib:pos"] = "(1975,19,1178)", partychat = "party", yl_commons_player_created = "1615351173", ["petz:werewolf_clan_idx"] = "1", yl_church = "return {[\"last_death\"] = {[\"z\"] = 1582, [\"x\"] = 1833, [\"y\"] = -27684}, [\"last_death_portal\"] = 1670728451, [\"last_heal\"] = 1615504208}", yl_commons_player_joined = "1671149381", repellant = "0", yl_commons_thankyou = "185", bitten = "0", jointime = "1615351173", punch_count = "126938", ["unified_inventory:bags"] = "return {\"water_life:croc_bag\", \"water_life:croc_bag\", \"water_life:croc_bag\", \"water_life:croc_bag\"}", inflicted_damage = "2263418", ["stamina:exhaustion"] = "114.5", arenalib_infobox_arenaID = "0", ["petz:werewolf"] = "0", ["stamina:poisoned"] = "no", played_time = "28208528", digged_nodes = "1151722", placed_nodes = "365218", died = "74" } } ``` Log identifier ``` [MOD] yl_report log identifier = qP0XIMNHeh4KPAnqtEfXGWmM9kaRdyyY ``` Profiler save: ``` profile-20221216T014259.json_prettyEE ``` Status: ``` # Server: version: 5.6.1-yl | game: Minetest Game | uptime: 17h 8min 16s | max lag: 2.43s | clients (19/42): 9T9, AliasAlreadyTaken, Aliza, Bailiff, DanielBoone, darealbang, daydream, DragonWrangler1, Ernesto, flux, jackofthebean000, Jeese, Laylem, Minetest13, MrClean, Redshirt, Service, shanish2, sherkhan30452 ``` Teleport command: ``` /teleport xyz 1289 48 624 ``` Compass command: ``` /give_compass Construction qP0XIMNHeh4KPAnqtEfXGWmM9kaRdyyY D2691E 1289 48 624 ```
AliasAlreadyTaken was assigned by yourland-report 2022-12-16 01:42:59 +00:00
flux added the
1. kind/bug
label 2022-12-16 01:48:45 +00:00
flux added this to the flux's TODO list project 2022-12-16 01:48:48 +00:00
AliasAlreadyTaken was unassigned by flux 2022-12-16 01:48:52 +00:00
flux self-assigned this 2022-12-16 01:48:52 +00:00
Member

not sure if this is just the mycena flowerpot, need to test more.

not sure if this is just the mycena flowerpot, need to test more.

Had it happen the other day, too. I think with the viola?
And with the other issue from Laylem I would guess that it's general behavior with the flowerpot.

Had it happen the other day, too. I think with the viola? And with the other issue from Laylem I would guess that it's general behavior with the flowerpot.
whosit added the
3. source/mod upstream
label 2023-07-03 17:30:49 +00:00
Member

Flower pot with flowers never drops empty pot. When you dig it by hand, the filled pot gets replaced by an empty one. But when it's destroyed because it got detached, only flower drops get processed.
One way to solve that is to make flower pot behave kinda like an item frame and allow removing flowers from it just by punching:

diff --git a/init.lua b/init.lua
index 4186494..b7b813d 100644
--- a/init.lua
+++ b/init.lua
@@ -68,7 +68,13 @@ function minetest.get_node_drops(node, toolname)
        if node_name then
                local flower_item = flower_items_by_pot[node_name]
                if flower_item then
-                       return old_get_node_drops(flower_item, toolname)
+                       local drops = old_get_node_drops(flower_item, toolname)
+                       if drops then
+                               table.insert(drops, "flowerpot:empty")
+                               return drops
+                       else
+                               return { "flowerpot:empty" }
+                       end
                end
        end
 
@@ -123,7 +129,18 @@ function flowerpot.register_node(nodename)
                groups = {attached_node = 1, oddly_breakable_by_hand = 1, snappy = 3, not_in_creative_inventory = 1},
                flowerpot_plantname = nodename,
                node_dig_prediction = "flowerpot:empty",
-               after_dig_node = function(pos, oldnode, oldmetadata, digger)
+               on_punch = function(pos, node, puncher, pointed_thing)
+                       if not (puncher and puncher:is_player()) then
+                               return
+                       end
+                       local toolname = puncher:get_wielded_item()
+                       if node.name then
+                               local flower_item = flower_items_by_pot[node.name]
+                               if flower_item then
+                                       local drops = old_get_node_drops(flower_item, toolname)
+                                       minetest.handle_node_drops(pos, drops, puncher)
+                               end
+                       end
                        minetest.swap_node(pos, {name = "flowerpot:empty"})
                end,
        })

Flower pot with flowers never drops empty pot. When you dig it by hand, the filled pot gets replaced by an empty one. But when it's destroyed because it got detached, only flower drops get processed. One way to solve that is to make flower pot behave kinda like an item frame and allow removing flowers from it just by punching: ```diff diff --git a/init.lua b/init.lua index 4186494..b7b813d 100644 --- a/init.lua +++ b/init.lua @@ -68,7 +68,13 @@ function minetest.get_node_drops(node, toolname) if node_name then local flower_item = flower_items_by_pot[node_name] if flower_item then - return old_get_node_drops(flower_item, toolname) + local drops = old_get_node_drops(flower_item, toolname) + if drops then + table.insert(drops, "flowerpot:empty") + return drops + else + return { "flowerpot:empty" } + end end end @@ -123,7 +129,18 @@ function flowerpot.register_node(nodename) groups = {attached_node = 1, oddly_breakable_by_hand = 1, snappy = 3, not_in_creative_inventory = 1}, flowerpot_plantname = nodename, node_dig_prediction = "flowerpot:empty", - after_dig_node = function(pos, oldnode, oldmetadata, digger) + on_punch = function(pos, node, puncher, pointed_thing) + if not (puncher and puncher:is_player()) then + return + end + local toolname = puncher:get_wielded_item() + if node.name then + local flower_item = flower_items_by_pot[node.name] + if flower_item then + local drops = old_get_node_drops(flower_item, toolname) + minetest.handle_node_drops(pos, drops, puncher) + end + end minetest.swap_node(pos, {name = "flowerpot:empty"}) end, }) ```
Member

One way to solve that is to make flower pot behave kinda like an item frame and allow removing flowers from it just by punching:

cf. #3033

> One way to solve that is to make flower pot behave kinda like an item frame and allow removing flowers from it just by punching: cf. #3033

IMO a lot of things need to be substituted by entities. That could lower the node count by a lot. But then some crazy people add 513 flowerpots to a mapblock. yl_exhibition would also benefit, we could have a single "picture" frame as block, but the image dispalyed via entity.

If only entities were not that ... meh.

IMO a lot of things need to be substituted by entities. That could lower the node count by a lot. But then some crazy people add 513 flowerpots to a mapblock. yl_exhibition would also benefit, we could have a single "picture" frame as block, but the image dispalyed via entity. If only entities were not that ... meh.
Member
whosit opened a PR: https://github.com/minetest-mods/flowerpot/pull/18
Member

disappeared mahogany sapling.

disappeared mahogany sapling.
Member

I sent JeCel and Historia some flower pot replacements in their mailboxes.

I sent JeCel and Historia some flower pot replacements in their mailboxes.
Member

upstream got merged

upstream got merged
whosit added the
4. step/ready to QA test
label 2024-03-10 19:09:16 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2024-03-29 23:36:10 +00:00
flux removed this from the flux's TODO list project 2024-03-29 23:36:13 +00:00
flux removed their assignment 2024-03-29 23:36:15 +00:00
Member

this is live

this is live
flux closed this issue 2024-03-29 23:51:44 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#3248
No description provided.