fix-depend-on-mcl_player #7

Closed
cora wants to merge 1 commits from fix-depend-on-mcl_player into master
Member

Verify Bug

  1. Start Mineclonia with mcl_meshnode enabled on commit ab6d4df25f
  2. type /grantme meshnode in chat
  3. Verify error message "Unknown privilege: meshnode"

Verify Patch

  1. Start Mineclonia with mcl_meshnode enabled on thise branch c62018f92af475301555613dd115e8c4f1c5aee7
  2. type /grantme meshnode in chat
  3. Verify you get a list of privileges of your player that includes "meshnode"
#### Verify Bug 1. Start Mineclonia with mcl_meshnode enabled on commit ab6d4df25fe4427ef67a89fb8beebe0dd5bef924 2. type /grantme meshnode in chat 3. Verify error message "Unknown privilege: meshnode" #### Verify Patch 1. Start Mineclonia with mcl_meshnode enabled on thise branch c62018f92af475301555613dd115e8c4f1c5aee7 2. type /grantme meshnode in chat 3. Verify you get a list of privileges of your player that includes "meshnode"
Owner

Please rebase this PR to get rid of the merge commit, then force push the rebased branch.

This is probably just git rebase master && git push -f. Please correct me if I am wrong.

Please rebase this PR to get rid of the merge commit, then force push the rebased branch. This is *probably* just `git rebase master && git push -f`. Please correct me if I am wrong.
cora force-pushed fix-depend-on-mcl_player from 57b3dde5d8 to ce02677e56 2021-08-21 23:31:21 +02:00 Compare
erlehmann requested changes 2021-08-21 23:52:10 +02:00
erlehmann left a comment
Owner

This PR does make it possible to load the mod without the default dependency.

However, the code still depends on default – Minetest just does not know that.

Because of that, this PR in its current state introduces the following new bugs:

  • Textures are not loaded for the meshnode controller.
    The reason is probably the following code in init.lua:
local control_textures = {
	"default_steel_block.png",
	"default_diamond_block.png",
	"default_bronze_block.png",
	"default_obsidian_block.png",
	"default_gold_block.png",
}
  • The meshnode blacklist does not correspond to Mineclonia node names:

    • default:chest_locked should be removed (locked chests do not exist in Mineclonia)
    • default:water_source should be replaced with mcl_core:water_source
    • default:river_water_source should be replaced with mcl_core:mcl_core:water_source
    • default:lava_source should be replaced with both mcl_core:lava_source and mcl_nether:nether_lava_source
	meshnode.blacklist["default:chest_locked"] = true
	meshnode.blacklist["default:water_source"] = true
	meshnode.blacklist["default:river_water_source"] = true
	meshnode.blacklist["default:lava_source"] = true
  • The formspec will crash on being opened:
		default.gui_bg..
		default.gui_bg_img..
		default.gui_slots..
		default.get_hotbar_bg(0,4)..

  • The crafting recipe is not possible to satisfy:
	minetest.register_craft({
		output = "meshnode:controller",
		recipe = {
			{"default:bronzeblock", "default:diamondblock", "default:bronzeblock"},
			{"default:obsidian_block", "default:steelblock", "default:goldblock"},
			{"default:bronzeblock", "default:steelblock", "default:bronzeblock"},
		}
	})
  • The attachment function references the default mod still and would lead to a crash on attaching to the meshnode controller in this state. References to default.player_attached[name] should probably be replaced to references to mcl_player.player_attached[name].
			player:set_attach(entity.object, "", {x=0, y=5, z=0}, {x=0, y=0, z=0})
			entity.player = player
			entity.object:set_animation({x=0, y=0}, 15)
			default.player_attached[name] = true
		elseif fields.detach and entity.player == player then
			player:set_detach()
			entity.player = nil
			entity.animation = "stand"
			entity.object:set_animation({x=20, y=100}, 15)
			default.player_attached[name] = false
			local p = player:getpos()
			minetest.after(0.1, function()
				player:setpos({x=p.x, y=p.y + 1, z=p.z})
			end)
		elseif fields.animation_sit then
			default.player_set_animation(player, "sit", 30)
			entity.animation = "sit"
		elseif fields.animation_stand then
			default.player_set_animation(player, "stand", 30)
			entity.animation = "stand"

That last point can be fixed using the code in issue #1:

default = {}
default.player_attached = mcl_player.player_attached
default.player_set_animation = mcl_player.player_set_animation

I would prefer the references to default were just replaced though.

This PR does make it possible to load the mod without the `default` dependency. However, the code still depends on `default` – Minetest just does not know that. Because of that, this PR in its current state introduces the following new bugs: * Textures are not loaded for the meshnode controller. The reason is probably the following code in init.lua: ``` local control_textures = { "default_steel_block.png", "default_diamond_block.png", "default_bronze_block.png", "default_obsidian_block.png", "default_gold_block.png", } ``` * The meshnode blacklist does not correspond to Mineclonia node names: * `default:chest_locked` should be removed (locked chests do not exist in Mineclonia) * `default:water_source` should be replaced with `mcl_core:water_source` * `default:river_water_source` should be replaced with `mcl_core:mcl_core:water_source` * `default:lava_source` should be replaced with both `mcl_core:lava_source` and `mcl_nether:nether_lava_source` ``` meshnode.blacklist["default:chest_locked"] = true meshnode.blacklist["default:water_source"] = true meshnode.blacklist["default:river_water_source"] = true meshnode.blacklist["default:lava_source"] = true ``` * The formspec will crash on being opened: ``` default.gui_bg.. default.gui_bg_img.. default.gui_slots.. default.get_hotbar_bg(0,4).. ``` * The crafting recipe is not possible to satisfy: ``` minetest.register_craft({ output = "meshnode:controller", recipe = { {"default:bronzeblock", "default:diamondblock", "default:bronzeblock"}, {"default:obsidian_block", "default:steelblock", "default:goldblock"}, {"default:bronzeblock", "default:steelblock", "default:bronzeblock"}, } }) ``` * The attachment function references the default mod still and would lead to a crash on attaching to the meshnode controller in this state. References to `default.player_attached[name]` should probably be replaced to references to `mcl_player.player_attached[name]`. ``` player:set_attach(entity.object, "", {x=0, y=5, z=0}, {x=0, y=0, z=0}) entity.player = player entity.object:set_animation({x=0, y=0}, 15) default.player_attached[name] = true elseif fields.detach and entity.player == player then player:set_detach() entity.player = nil entity.animation = "stand" entity.object:set_animation({x=20, y=100}, 15) default.player_attached[name] = false local p = player:getpos() minetest.after(0.1, function() player:setpos({x=p.x, y=p.y + 1, z=p.z}) end) elseif fields.animation_sit then default.player_set_animation(player, "sit", 30) entity.animation = "sit" elseif fields.animation_stand then default.player_set_animation(player, "stand", 30) entity.animation = "stand" ``` That last point can be fixed using the code in issue #1: ``` default = {} default.player_attached = mcl_player.player_attached default.player_set_animation = mcl_player.player_set_animation ``` I would prefer the references to `default` were just replaced though.
cora closed this pull request 2021-08-23 17:31:22 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 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: Mineclonia/mcl_meshnode#7
No description provided.