Fix controller formspec #8

Closed
cora wants to merge 5 commits from fix-controller-formspec into master
3 changed files with 26 additions and 22 deletions

View File

@ -1,12 +1,12 @@
meshnode = {}
meshnode.config = {
max_speed = 2,
max_speed = 8,
max_lift = 1,
yaw_amount = 0.017,
max_radius = 8,
show_in_creative = false,
enable_crafting = false,
max_radius = 16,
show_in_creative = true,
enable_crafting = true,
disable_privilege = false,
fake_shading = false,
autoconf = false,

View File

@ -1,3 +1,4 @@
default
mcl_player
mcl_formspec
wordedit?
intllib?

View File

@ -25,10 +25,14 @@ if is_singleplayer then
meshnode.config.fake_shading = true
meshnode.config.autoconf = true
else
meshnode.blacklist["default:chest_locked"] = true
meshnode.blacklist["default:water_source"] = true
meshnode.blacklist["mcl_core:bedrock"] = true
meshnode.blacklist["mcl_chests:chest"] = true
meshnode.blacklist["mcl_chests:chest_left"] = true
meshnode.blacklist["mcl_chests:chest_right"] = true
meshnode.blacklist["mcl_core:water_source"] = true
meshnode.blacklist["default:river_water_source"] = true
meshnode.blacklist["default:lava_source"] = true
meshnode.blacklist["mcl_core:lava_source"] = true
meshnode.blacklist["mcl_nether:nether_lava_source"] = true
end
for name, config in pairs(meshnode.config) do
@ -68,13 +72,12 @@ local function show_meshnode_formspec(pos, player)
local id = minetest.pos_to_string(pos)
local entity = meshnode.get_luaentity(id)
local spos = pos.x..","..pos.y..","..pos.z
local formspec = "size[8,8]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
default.get_hotbar_bg(0,4)..
"list[current_player;main;0,4;8,1;]"..
"list[current_player;main;0,5.25;8,3;8]"..
local formspec = "size[9,8.75]"..
mcl_formspec.get_itemslot_bg(0.5,1.5,1,1)..
"list[current_player;main;0,4.5;9,3;9]"..
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
"list[current_player;main;0,7.74;9,1;]"..
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
"list[nodemeta:"..spos..";tool;0.5,1.5;1,1;]"
local buttons = {}
if entity and #entity.nodes > 0 then
@ -122,9 +125,9 @@ if meshnode.config.enable_crafting == true then
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"},
{"mcl_farming:hay_block", "mcl_core:ironblock", "mcl_farming:hay_block"},
{"mcl_core:obsidian", "mcl_core:ironblock", "mcl_wool:green"},
{"mcl_farming:hay_block", "mcl_core:ironblock", "mcl_farming:hay_block"},
}
})
end
@ -480,22 +483,22 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
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
mcl_player.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
mcl_player.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)
--mcl_player:player_set_animation(player, "sit", 30)
entity.animation = "sit"
elseif fields.animation_stand then
default.player_set_animation(player, "stand", 30)
mcl_player.player_set_animation(player, "stand", 30)
entity.animation = "stand"
elseif fields.align then
entity:set_alignment()