Merge branch 'screwdriver'

This commit is contained in:
Wuzzy 2019-12-11 04:47:53 +01:00
commit 231493cb1b
62 changed files with 591 additions and 98 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -96,4 +96,4 @@ mobs:register_arrow("mobs_mc:dragon_fireball", {
end
})
mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0)
mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0, true)

View File

@ -85,7 +85,7 @@ mobs:register_mob("mobs_mc:parrot", {
--mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 30000, 1, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0)
mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0, true)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Parrot loaded")

View File

@ -101,7 +101,7 @@ mobs:register_arrow("mobs_mc:potion_arrow", {
--mobs:spawn_specific("mobs_mc:witch", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX-6, 12, 20000, 2, mobs_mc.spawn_height.water-6, mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:witch", S("Witch"), "mobs_mc_spawn_icon_witch.png", 0)
mobs:register_egg("mobs_mc:witch", S("Witch"), "mobs_mc_spawn_icon_witch.png", 0, true)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC mobs loaded")

View File

@ -99,5 +99,5 @@ mobs:register_arrow("mobs_mc:wither_skull", {
-- TODO: Add blue wither skull
--Spawn egg
mobs:register_egg("mobs_mc:wither", S("Wither"), "mobs_mc_spawn_icon_wither.png", 0)
mobs:register_egg("mobs_mc:wither", S("Wither"), "mobs_mc_spawn_icon_wither.png", 0, true)

View File

@ -175,11 +175,6 @@ local pistonspec_normal = {
local usagehelp_piston = S("This block can have one of 6 possible orientations.")
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
-- offstate
minetest.register_node("mesecons_pistons:piston_normal_off", {
description = S("Piston"),
@ -206,7 +201,12 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_up_normal_off"})
return true
end
end,
})
-- onstate
@ -236,7 +236,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = false,
})
-- pusher
@ -261,7 +261,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", {
node_box = piston_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
on_rotate = false,
})
-- Sticky ones
@ -303,7 +303,12 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_up_sticky_off"})
return true
end
end,
})
-- onstate
@ -333,7 +338,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = false,
})
-- pusher
@ -358,7 +363,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", {
node_box = piston_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
on_rotate = false,
})
--
@ -416,7 +421,13 @@ minetest.register_node("mesecons_pistons:piston_up_normal_off", {
}),
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_down_normal_off"})
return true
end
return false
end,
})
-- onstate
@ -446,7 +457,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = false,
})
-- pusher
@ -471,7 +482,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_normal", {
node_box = piston_up_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
on_rotate = false,
})
@ -512,7 +523,13 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_down_sticky_off"})
return true
end
return false
end,
})
-- onstate
@ -542,7 +559,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = false,
})
-- pusher
@ -567,7 +584,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_sticky", {
node_box = piston_up_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
on_rotate = false,
})
--
@ -625,7 +642,13 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_normal_off"})
return true
end
return false
end,
})
-- onstate
@ -655,7 +678,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = false,
})
-- pusher
@ -680,7 +703,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_normal", {
node_box = piston_down_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
on_rotate = false,
})
-- Sticky
@ -716,7 +739,13 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_sticky_off"})
return true
end
return false
end,
})
-- onstate
@ -746,7 +775,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
on_rotate = false,
})
-- pusher
@ -771,7 +800,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_sticky", {
node_box = piston_down_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
on_rotate = false,
})

View File

@ -2,6 +2,30 @@ local S = minetest.get_translator("mesecons_wallever")
local lever_get_output_rules = mesecon.rules.buttonlike_get
local on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then
if node.param2 == 10 then
node.param2 = 13
minetest.swap_node(pos, node)
return true
elseif node.param2 == 13 then
node.param2 = 10
minetest.swap_node(pos, node)
return true
elseif node.param2 == 8 then
node.param2 = 15
minetest.swap_node(pos, node)
return true
elseif node.param2 == 15 then
node.param2 = 8
minetest.swap_node(pos, node)
return true
end
end
-- TODO: Rotate axis
return false
end
-- LEVER
minetest.register_node("mesecons_walllever:wall_lever_off", {
drawtype = "mesh",
@ -102,7 +126,7 @@ minetest.register_node("mesecons_walllever:wall_lever_off", {
rules = lever_get_output_rules,
state = mesecon.state.off
}},
on_rotate = false,
on_rotate = on_rotate,
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
})
@ -134,7 +158,7 @@ minetest.register_node("mesecons_walllever:wall_lever_on", {
rules = lever_get_output_rules,
state = mesecon.state.on
}},
on_rotate = false,
on_rotate = on_rotate,
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
})

View File

@ -50,6 +50,10 @@ local layer_ratio = 255
local standing_banner_entity_offset = { x=0, y=-0.499, z=0 }
local hanging_banner_entity_offset = { x=0, y=-1.7, z=0 }
local rotation_level_to_yaw = function(rotation_level)
return (rotation_level * (math.pi/8)) + math.pi
end
local on_dig_banner = function(pos, node, digger)
-- Check protection
local name = digger:get_player_name()
@ -151,7 +155,7 @@ local spawn_banner_entity = function(pos, hanging, itemstack)
return banner
end
local respawn_banner_entity = function(pos, node)
local respawn_banner_entity = function(pos, node, force)
local hanging = node.name == "mcl_banners:hanging_banner"
local offset
if hanging then
@ -165,26 +169,24 @@ local respawn_banner_entity = function(pos, node)
for _, v in ipairs(objects) do
local ent = v:get_luaentity()
if ent and (ent.name == "mcl_banners:standing_banner" or ent.name == "mcl_banners:hanging_banner") then
if force then
v:remove()
else
return
end
end
end
-- Spawn new entity
local meta = minetest.get_meta(pos)
local banner_item = meta:get_inventory():get_stack("banner", 1)
local banner_entity = spawn_banner_entity(bpos, hanging, banner_item)
-- Set rotation
local final_yaw
local rotation_level = meta:get_int("rotation_level")
final_yaw = (rotation_level * (math.pi/8)) + math.pi
local final_yaw = rotation_level_to_yaw(rotation_level)
banner_entity:set_yaw(final_yaw)
end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
-- Banner nodes.
-- These are an invisible nodes which are only used to destroy the banner entity.
-- All the important banner information (such as color) is stored in the entity.
@ -229,6 +231,18 @@ S("You can copy the pattern of a banner by placing two banners of the same color
end,
_mcl_hardness = 1,
_mcl_blast_resistance = 5,
on_rotate = function(pos, node, user, mode, param2)
if mode == screwdriver.ROTATE_FACE then
local meta = minetest.get_meta(pos)
local rot = meta:get_int("rotation_level")
rot = (rot - 1) % 16
meta:set_int("rotation_level", rot)
respawn_banner_entity(pos, node, true)
return true
else
return false
end
end,
})
-- Hanging banner node
@ -261,7 +275,29 @@ minetest.register_node("mcl_banners:hanging_banner", {
end,
_mcl_hardness = 1,
_mcl_blast_resistance = 5,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode, param2)
if mode == screwdriver.ROTATE_FACE then
local r = screwdriver.rotate.wallmounted(pos, node, mode)
node.param2 = r
minetest.swap_node(pos, node)
local meta = minetest.get_meta(pos)
local rot = 0
if node.param2 == 2 then
rot = 12
elseif node.param2 == 3 then
rot = 4
elseif node.param2 == 4 then
rot = 0
elseif node.param2 == 5 then
rot = 8
end
meta:set_int("rotation_level", rot)
respawn_banner_entity(pos, node, true)
return true
else
return false
end
end,
})
for colorid, colortab in pairs(mcl_banners.colors) do
@ -410,7 +446,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do
if rotation_level >= 16 then
rotation_level = 0
end
final_yaw = (rotation_level * (math.pi/8)) + math.pi
final_yaw = rotation_level_to_yaw(rotation_level)
end
meta:set_int("rotation_level", rotation_level)

View File

@ -142,8 +142,7 @@ Lit Redstone Ore=Leuchtendes Redstoneerz
Magenta Stained Glass=Magenta Buntglas
Molten gold. It is used to craft armor, tools, and whatnot.=Geschmolzenes Gold. Es wird benutzt, um Rüstungen, Werkzeuge, und anderes herzustellen.
Molten iron. It is used to craft armor, tools, and whatnot.=Geschmolzenes Eisen. Es wird benutzt, um Rüstungen, Werkzeuge, und vieles mehr herzustellen.
Moss Stone=Moosstein
Mossy Cobblestone=Moosiges Kopfsteinpflaster
Mossy Stone Bricks=Moosige Steinziegel
Mycelium=Myzel
Mycelium is a type of dirt and the ideal soil for mushrooms. Unlike other dirt-type blocks, it can not be turned into farmland with a hoe. In light, mycelium slowly spreads over nearby dirt. Under an opaque block or a liquid, it eventually turns back into dirt.=Myzel ist eine Art Erde und der perfekte Nährboden für Pilze. Anders als bei anderen erdähnlichen Blöcken kann es mit einer Hacke nicht zu Ackerboden verwandelt werden. Im Licht wird sich Myzel langsam auf benachbarte Erde ausbreiten. Unter einem lichtundurchlässigen Block oder einer Flüssigkeit wird es sich früher oder später zurück zu Erde verwandeln.

View File

@ -142,7 +142,7 @@ Lit Redstone Ore=
Magenta Stained Glass=
Molten gold. It is used to craft armor, tools, and whatnot.=
Molten iron. It is used to craft armor, tools, and whatnot.=
Moss Stone=
Mossy Cobblestone=
Mossy Stone Bricks=
Mycelium=
Mycelium is a type of dirt and the ideal soil for mushrooms. Unlike other dirt-type blocks, it can not be turned into farmland with a hoe. In light, mycelium slowly spreads over nearby dirt. Under an opaque block or a liquid, it eventually turns back into dirt.=

View File

@ -672,7 +672,7 @@ minetest.register_node("mcl_core:cobble", {
})
minetest.register_node("mcl_core:mossycobble", {
description = S("Moss Stone"),
description = S("Mossy Cobblestone"),
_doc_items_longdesc = doc.sub.items.temp.build,
tiles = {"default_mossycobble.png"},
is_ground_content = false,

View File

@ -1,6 +1,16 @@
-- Climbable nodes
local S = minetest.get_translator("mcl_core")
local rotate_climbable = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then
local r = screwdriver.rotate.wallmounted(pos, node, mode)
node.param2 = r
minetest.swap_node(pos, node)
return true
end
return false
end
minetest.register_node("mcl_core:ladder", {
description = S("Ladder"),
_doc_items_longdesc = S("A piece of ladder which allows you to climb vertically. Ladders can only be placed on the side of solid blocks and not on glass, leaves, ice, slabs, glowstone, nor sea lanterns."),
@ -73,7 +83,7 @@ minetest.register_node("mcl_core:ladder", {
_mcl_blast_resistance = 2,
_mcl_hardness = 0.4,
on_rotate = function() return false end,
on_rotate = rotate_climbable,
})
@ -156,5 +166,5 @@ minetest.register_node("mcl_core:vine", {
_mcl_blast_resistance = 1,
_mcl_hardness = 0.2,
on_rotate = function() return false end,
on_rotate = false,
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 B

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 B

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 318 B

View File

@ -19,7 +19,31 @@ end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.rotate_simple
on_rotate = function(pos, node, user, mode, param2)
-- Flip trapdoor vertically
if mode == screwdriver.ROTATE_AXIS then
local minor = node.param2
if node.param2 >= 20 then
minor = node.param2 - 20
if minor == 3 then
minor = 1
elseif minor == 1 then
minor = 3
end
node.param2 = minor
else
if minor == 3 then
minor = 1
elseif minor == 1 then
minor = 3
end
node.param2 = minor
node.param2 = node.param2 + 20
end
minetest.set_node(pos, node)
return true
end
end
end
function mcl_doors:register_trapdoor(name, def)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 447 B

View File

@ -56,14 +56,17 @@ local remove_item_entity = function(pos, node)
end
end
local update_item_entity = function(pos, node)
local update_item_entity = function(pos, node, param2)
remove_item_entity(pos, node)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local item = inv:get_stack("main", 1)
if not item:is_empty() then
if not param2 then
param2 = node.param2
end
if node.name == "mcl_itemframes:item_frame" then
local posad = facedir[node.param2]
local posad = facedir[param2]
pos.x = pos.x + posad.x*6.5/16
pos.y = pos.y + posad.y*6.5/16
pos.z = pos.z + posad.z*6.5/16
@ -78,7 +81,7 @@ local update_item_entity = function(pos, node)
end
lua:_update_texture()
if node.name == "mcl_itemframes:item_frame" then
local yaw = math.pi*2 - node.param2 * math.pi/2
local yaw = math.pi*2 - param2 * math.pi/2
e:set_yaw(yaw)
end
end
@ -96,11 +99,6 @@ local drop_item = function(pos, node, meta)
remove_item_entity(pos, node)
end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
minetest.register_node("mcl_itemframes:item_frame",{
description = S("Item Frame"),
_doc_items_longdesc = S("Item frames are decorative blocks in which items can be placed."),
@ -189,7 +187,31 @@ minetest.register_node("mcl_itemframes:item_frame",{
local node = minetest.get_node(pos)
drop_item(pos, node, meta)
end,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode, param2)
if mode == screwdriver.ROTATE_FACE then
-- Rotate face
local meta = minetest.get_meta(pos)
local node = minetest.get_node(pos)
local objs = nil
if node.name == "mcl_itemframes:item_frame" then
objs = minetest.get_objects_inside_radius(pos, .5)
end
if objs then
for _, obj in ipairs(objs) do
if obj and obj:get_luaentity() and obj:get_luaentity().name == "mcl_itemframes:item" then
update_item_entity(pos, node, (node.param2+1) % 4)
break
end
end
end
return
elseif mode == screwdriver.ROTATE_AXIS then
-- Place screwdriver into itemframe
minetest.registered_nodes["mcl_itemframes:item_frame"].on_rightclick(pos, node, user, ItemStack("screwdriver:screwdriver"))
return false
end
end,
})
minetest.register_craft({

View File

@ -201,7 +201,7 @@ local destruct_sign = function(pos)
end
end
local update_sign = function(pos, fields, sender)
local update_sign = function(pos, fields, sender, force_remove)
local meta = minetest.get_meta(pos)
if not meta then
return
@ -214,16 +214,7 @@ local update_sign = function(pos, fields, sender)
if text == nil then
text = ""
end
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
local ent = v:get_luaentity()
if ent and ent.name == "mcl_signs:text" then
v:set_properties({textures={generate_texture(create_lines(text), ent._signnodename)}})
return
end
end
-- if there is no entity
local sign_info
local n = minetest.get_node(pos)
local nn = n.name
@ -233,12 +224,30 @@ local update_sign = function(pos, fields, sender)
sign_info = signtext_info_wall[get_wall_signtext_info(n.param2)]
end
if sign_info == nil then
minetest.log("error", "[mcl_signs] Missing sign_info!")
return
end
local text_entity = minetest.add_entity({
local objects = minetest.get_objects_inside_radius(pos, 0.5)
local text_entity
for _, v in ipairs(objects) do
local ent = v:get_luaentity()
if ent and ent.name == "mcl_signs:text" then
if force_remove then
v:remove()
else
text_entity = v
break
end
end
end
if not text_entity then
text_entity = minetest.add_entity({
x = pos.x + sign_info.delta.x,
y = pos.y + sign_info.delta.y,
z = pos.z + sign_info.delta.z}, "mcl_signs:text")
end
text_entity:get_luaentity()._signnodename = nn
text_entity:set_properties({textures={generate_texture(create_lines(text), nn)}})
@ -390,15 +399,21 @@ minetest.register_node("mcl_signs:wall_sign", {
on_punch = function(pos, node, puncher)
update_sign(pos)
end,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then
local r = screwdriver.rotate.wallmounted(pos, node, mode)
node.param2 = r
minetest.swap_node(pos, node)
update_sign(pos, nil, nil, true)
return true
else
return false
end
end,
_mcl_hardness = 1,
_mcl_blast_resistance = 5,
})
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
-- Standing sign nodes.
-- 4 rotations at 0°, 22.5°, 45° and 67.5°.
-- These are 4 out of 16 possible rotations.
@ -424,27 +439,68 @@ local ssign = {
on_punch = function(pos, node, puncher)
update_sign(pos)
end,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then
node.name = "mcl_signs:standing_sign22_5"
minetest.swap_node(pos, node)
elseif mode == screwdriver.ROTATE_AXIS then
return false
end
update_sign(pos, nil, nil, true)
return true
end,
on_rotate = on_rotate,
_mcl_hardness = 1,
_mcl_blast_resistance = 5,
}
-- 22.5°
minetest.register_node("mcl_signs:standing_sign", ssign)
-- 22.5°
local ssign22_5 = table.copy(ssign)
ssign22_5.mesh = "mcl_signs_sign22.5.obj"
ssign22_5.on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then
node.name = "mcl_signs:standing_sign45"
minetest.swap_node(pos, node)
elseif mode == screwdriver.ROTATE_AXIS then
return false
end
update_sign(pos, nil, nil, true)
return true
end
minetest.register_node("mcl_signs:standing_sign22_5", ssign22_5)
-- 45°
minetest.register_node("mcl_signs:standing_sign22_5", ssign22_5)
local ssign45 = table.copy(ssign)
ssign45.mesh = "mcl_signs_sign45.obj"
ssign45.on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then
node.name = "mcl_signs:standing_sign67_5"
minetest.swap_node(pos, node)
elseif mode == screwdriver.ROTATE_AXIS then
return false
end
update_sign(pos, nil, nil, true)
return true
end
minetest.register_node("mcl_signs:standing_sign45", ssign45)
-- 67.5°
local ssign67 = table.copy(ssign)
ssign67.mesh = "mcl_signs_sign67.5.obj"
minetest.register_node("mcl_signs:standing_sign67_5", ssign67)
local ssign67_5 = table.copy(ssign)
ssign67_5.mesh = "mcl_signs_sign67.5.obj"
ssign67_5.on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then
node.name = "mcl_signs:standing_sign"
node.param2 = (node.param2 + 1) % 4
minetest.swap_node(pos, node)
elseif mode == screwdriver.ROTATE_AXIS then
return false
end
update_sign(pos, nil, nil, true)
return true
end
minetest.register_node("mcl_signs:standing_sign67_5", ssign67_5)
-- FIXME: Prevent entity destruction by /clearobjects
minetest.register_entity("mcl_signs:text", {

View File

@ -121,6 +121,31 @@ function mcl_stairs.register_stair(subname, recipeitem, groups, images, descript
return place_stair(itemstack, placer, pointed_thing)
end,
on_rotate = function(pos, node, user, mode, param2)
-- Flip stairs vertically
if mode == screwdriver.ROTATE_AXIS then
local minor = node.param2
if node.param2 >= 20 then
minor = node.param2 - 20
if minor == 3 then
minor = 1
elseif minor == 1 then
minor = 3
end
node.param2 = minor
else
if minor == 3 then
minor = 1
elseif minor == 1 then
minor = 3
end
node.param2 = minor
node.param2 = node.param2 + 20
end
minetest.set_node(pos, node)
return true
end
end,
_mcl_hardness = hardness,
})
@ -237,6 +262,15 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti
end,
_mcl_hardness = hardness,
_mcl_other_slab_half = upper_slab,
on_rotate = function(pos, node, user, mode, param2)
-- Flip slab
if mode == screwdriver.ROTATE_AXIS then
node.name = upper_slab
minetest.set_node(pos, node)
return true
end
return false
end,
}
minetest.register_node(":"..lower_slab, slabdef)
@ -255,6 +289,15 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti
topdef._doc_items_usagehelp = nil
topdef.drop = lower_slab
topdef._mcl_other_slab_half = lower_slab
topdef.on_rotate = function(pos, node, user, mode, param2)
-- Flip slab
if mode == screwdriver.ROTATE_AXIS then
node.name = lower_slab
minetest.set_node(pos, node)
return true
end
return false
end
topdef.node_box = {
type = "fixed",
fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},

View File

@ -664,6 +664,7 @@ function mcl_stairs.cornerstair.add(name, stairtiles)
stairs = {name, name.."_outer", name.."_inner"},
after_dig_node = function(pos, oldnode) after_dig_node(pos, oldnode) end,
_mcl_hardness = node_def._mcl_hardness,
on_rotate = false,
})
minetest.register_node(":"..name.."_inner", {
description = node_def.description,
@ -687,6 +688,7 @@ function mcl_stairs.cornerstair.add(name, stairtiles)
stairs = {name, name.."_outer", name.."_inner"},
after_dig_node = function(pos, oldnode) after_dig_node(pos, oldnode) end,
_mcl_hardness = node_def._mcl_hardness,
on_rotate = false,
})
if minetest.get_modpath("doc") then

View File

@ -39,9 +39,9 @@ Double Diorite Slab=Doppeldioritplatte
Cobblestone Stairs=Kopfsteinpflastertreppe
Cobblestone Slab=Kopfsteinpflasterplatte
Double Cobblestone Slab=Doppelkopfsteinpflasterplatte
Moss Stone Stairs=Moossteintreppe
Moss Stone Slab=Moossteinplatte
Double Moss Stone Slab=Doppelmoossteinplatte
Mossy Cobblestone Slab=Moosige Kopfsteinpflasterplatte
Mossy Cobblestone Stairs=Moosige Kopfsteinpflastertreppe
Double Mossy Cobblestone Slab=Doppelte moosige Kopfsteinpflasterplatte
Brick Stairs=Ziegeltreppe
Brick Slab=Ziegelplatte
Double Brick Slab=Doppelziegelplatte
@ -98,4 +98,4 @@ Double Polished Diorite Slab=Doppelte polierte Dioritplatte
Polished Diorite Stairs=Polierte Diorittreppe
Mossy Stone Brick Stairs=Moosige Steinziegeltreppe
Mossy Stone Brick Slab=Moosige Steinziegelplatte
Double Mossy Stone Brick Slab=Doppelte Steinziegelplatte
Double Mossy Stone Brick Slab=Doppelte moosige Steinziegelplatte

View File

@ -39,9 +39,9 @@ Double Diorite Slab=
Cobblestone Stairs=
Cobblestone Slab=
Double Cobblestone Slab=
Moss Stone Stairs=
Moss Stone Slab=
Double Moss Stone Slab=
Mossy Cobblestone Stairs=
Mossy Cobblestone Slab=
Double Mossy Cobblestone Slab=
Brick Stairs=
Brick Slab=
Double Brick Slab=

View File

@ -45,7 +45,7 @@ mcl_stairs.register_stair_and_slab_simple("granite", "mcl_core:granite", S("Gran
mcl_stairs.register_stair_and_slab_simple("diorite", "mcl_core:diorite", S("Diorite Stairs"), S("Diorite Slab"), S("Double Diorite Slab"))
mcl_stairs.register_stair_and_slab_simple("cobble", "mcl_core:cobble", S("Cobblestone Stairs"), S("Cobblestone Slab"), S("Double Cobblestone Slab"))
mcl_stairs.register_stair_and_slab_simple("mossycobble", "mcl_core:mossycobble", S("Moss Stone Stairs"), S("Moss Stone Slab"), S("Double Moss Stone Slab"))
mcl_stairs.register_stair_and_slab_simple("mossycobble", "mcl_core:mossycobble", S("Mossy Cobblestone Stairs"), S("Mossy Cobblestone Slab"), S("Double Mossy Cobblestone Slab"))
mcl_stairs.register_stair_and_slab_simple("brick_block", "mcl_core:brick_block", S("Brick Stairs"), S("Brick Slab"), S("Double Brick Slab"))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 380 B

View File

@ -153,6 +153,7 @@ mcl_torches.register_torch = function(substring, description, doc_items_longdesc
wall_side = {-0.5, -0.5, -0.1, -0.2, 0.1, 0.1},
},
sounds = sounds,
on_rotate = false,
}
if moredef ~= nil then
for k,v in pairs(moredef) do

View File

@ -1,7 +1,7 @@
local S = minetest.get_translator("mcl_walls")
mcl_walls.register_wall("mcl_walls:cobble", S("Cobblestone Wall"), "mcl_core:cobble")
mcl_walls.register_wall("mcl_walls:mossycobble", S("Mossy Cobblestone Wall"), "mcl_core:mossycobble")
mcl_walls.register_wall("mcl_walls:cobble", S("Cobblestone Wall"), "mcl_core:cobble", {"mcl_walls_cobble_wall_top.png", "default_cobble.png", "mcl_walls_cobble_wall_side.png"})
mcl_walls.register_wall("mcl_walls:mossycobble", S("Mossy Cobblestone Wall"), "mcl_core:mossycobble", {"mcl_walls_cobble_mossy_wall_top.png", "default_mossycobble.png", "mcl_walls_cobble_mossy_wall_side.png"})
mcl_walls.register_wall("mcl_walls:andesite", S("Andesite Wall"), "mcl_core:andesite")
mcl_walls.register_wall("mcl_walls:granite", S("Granite Wall"), "mcl_core:granite")
mcl_walls.register_wall("mcl_walls:diorite", S("Diorite Wall"), "mcl_core:diorite")

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

View File

@ -83,11 +83,6 @@ local drop_armor = function(pos)
end
end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
-- TODO: The armor stand should be an entity
minetest.register_node("3d_armor_stand:armor_stand", {
description = S("Armor Stand"),
@ -231,7 +226,15 @@ minetest.register_node("3d_armor_stand:armor_stand", {
update_entity(pos)
end, pos)
end,
on_rotate = on_rotate,
on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then
node.param2 = (node.param2 + 1) % 4
minetest.swap_node(pos, node)
update_entity(pos)
return true
end
return false
end,
})
minetest.register_entity("3d_armor_stand:armor_entity", {

View File

@ -0,0 +1,13 @@
Minetest Game mod: screwdriver
==============================
See license.txt for license information.
License of source code
----------------------
Originally by RealBadAngel, Maciej Kasatkin (LGPL 2.1)
Various Minetest developers and contributors (LGPL 2.1)
License of media (textures)
---------------------------
Created by Gambit (CC BY-SA 3.0):
screwdriver.png

View File

@ -0,0 +1,173 @@
local S = minetest.get_translator("screwdriver")
screwdriver = {}
screwdriver.ROTATE_FACE = 1
screwdriver.ROTATE_AXIS = 2
screwdriver.disallow = function(pos, node, user, mode, new_param2)
return false
end
screwdriver.rotate_simple = function(pos, node, user, mode, new_param2)
if mode ~= screwdriver.ROTATE_FACE then
return false
end
end
-- For attached wallmounted nodes: returns true if rotation is valid
-- simplified version of minetest:builtin/game/falling.lua#L148.
local function check_attached_node(pos, rotation)
local d = minetest.wallmounted_to_dir(rotation)
local p2 = vector.add(pos, d)
local n = minetest.get_node(p2).name
local def2 = minetest.registered_nodes[n]
if def2 and not def2.walkable then
return false
end
return true
end
screwdriver.rotate = {}
local facedir_tbl = {
[screwdriver.ROTATE_FACE] = {
[0] = 1, [1] = 2, [2] = 3, [3] = 0,
[4] = 5, [5] = 6, [6] = 7, [7] = 4,
[8] = 9, [9] = 10, [10] = 11, [11] = 8,
[12] = 13, [13] = 14, [14] = 15, [15] = 12,
[16] = 17, [17] = 18, [18] = 19, [19] = 16,
[20] = 21, [21] = 22, [22] = 23, [23] = 20,
},
[screwdriver.ROTATE_AXIS] = {
[0] = 4, [1] = 4, [2] = 4, [3] = 4,
[4] = 8, [5] = 8, [6] = 8, [7] = 8,
[8] = 12, [9] = 12, [10] = 12, [11] = 12,
[12] = 16, [13] = 16, [14] = 16, [15] = 16,
[16] = 20, [17] = 20, [18] = 20, [19] = 20,
[20] = 0, [21] = 0, [22] = 0, [23] = 0,
},
}
screwdriver.rotate.facedir = function(pos, node, mode)
local rotation = node.param2 % 32 -- get first 5 bits
local other = node.param2 - rotation
rotation = facedir_tbl[mode][rotation] or 0
return rotation + other
end
screwdriver.rotate.colorfacedir = screwdriver.rotate.facedir
local wallmounted_tbl = {
[screwdriver.ROTATE_FACE] = {[2] = 5, [3] = 4, [4] = 2, [5] = 3, [1] = 0, [0] = 1},
[screwdriver.ROTATE_AXIS] = {[2] = 5, [3] = 4, [4] = 2, [5] = 1, [1] = 0, [0] = 3}
}
screwdriver.rotate.wallmounted = function(pos, node, mode)
local rotation = node.param2 % 8 -- get first 3 bits
local other = node.param2 - rotation
rotation = wallmounted_tbl[mode][rotation] or 0
if minetest.get_item_group(node.name, "attached_node") ~= 0 then
-- find an acceptable orientation
for i = 1, 5 do
if not check_attached_node(pos, rotation) then
rotation = wallmounted_tbl[mode][rotation] or 0
else
break
end
end
end
return rotation + other
end
screwdriver.rotate.colorwallmounted = screwdriver.rotate.wallmounted
-- Handles rotation
screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses)
if pointed_thing.type ~= "node" then
return
end
local pos = pointed_thing.under
local player_name = user and user:get_player_name() or ""
if minetest.is_protected(pos, player_name) then
minetest.record_protection_violation(pos, player_name)
return
end
local node = minetest.get_node(pos)
local ndef = minetest.registered_nodes[node.name]
if not ndef then
return itemstack
end
-- can we rotate this paramtype2?
local fn = screwdriver.rotate[ndef.paramtype2]
if not fn and not ndef.on_rotate then
return itemstack
end
local should_rotate = true
local new_param2
if fn then
new_param2 = fn(pos, node, mode)
else
new_param2 = node.param2
end
-- Node provides a handler, so let the handler decide instead if the node can be rotated
if ndef.on_rotate then
-- Copy pos and node because callback can modify it
local result = ndef.on_rotate(vector.new(pos),
{name = node.name, param1 = node.param1, param2 = node.param2},
user, mode, new_param2)
if result == false then -- Disallow rotation
return itemstack
elseif result == true then
should_rotate = false
end
elseif ndef.on_rotate == false then
return itemstack
elseif ndef.can_dig and not ndef.can_dig(pos, user) then
return itemstack
end
if should_rotate and new_param2 ~= node.param2 then
node.param2 = new_param2
minetest.swap_node(pos, node)
minetest.check_for_falling(pos)
end
if not (minetest.settings:get_bool("creative_mode")) then
itemstack:add_wear(65535 / ((uses or 200) - 1))
end
return itemstack
end
-- Screwdriver
minetest.register_tool("screwdriver:screwdriver", {
description = S("Screwdriver"),
inventory_image = "screwdriver.png",
groups = { tool = 1 },
on_use = function(itemstack, user, pointed_thing)
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 200)
return itemstack
end,
on_place = function(itemstack, user, pointed_thing)
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS, 200)
return itemstack
end,
})
minetest.register_craft({
output = "screwdriver:screwdriver",
recipe = {
{"mcl_core:iron_ingot"},
{"mcl_core:stick"}
}
})
minetest.register_alias("screwdriver:screwdriver1", "screwdriver:screwdriver")
minetest.register_alias("screwdriver:screwdriver2", "screwdriver:screwdriver")
minetest.register_alias("screwdriver:screwdriver3", "screwdriver:screwdriver")
minetest.register_alias("screwdriver:screwdriver4", "screwdriver:screwdriver")

View File

@ -0,0 +1,50 @@
License of source code
----------------------
GNU Lesser General Public License, version 2.1
Copyright (C) 2013-2016 RealBadAngel, Maciej Kasatkin
Copyright (C) 2013-2016 Various Minetest developers and contributors
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software Foundation;
either version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details:
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
Licenses of media (textures)
----------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2013-2016 Gambit
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/

View File

@ -0,0 +1,2 @@
# textdomain: screwdriver
Screwdriver=Schraubendreher

View File

@ -0,0 +1,2 @@
#textdomain: screwdriver
Screwdriver=

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

View File

@ -2765,7 +2765,7 @@ local function register_decorations()
rotation = "0",
})
-- Moss stone boulder (3×3)
-- Mossy cobblestone boulder (3×3)
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_core:podzol", "mcl_core:dirt", "mcl_core:coarse_dirt"},
@ -2785,7 +2785,7 @@ local function register_decorations()
flags = "place_center_x, place_center_z",
})
-- Small moss stone boulder (2×2)
-- Small mossy cobblestone boulder (2×2)
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_core:podzol", "mcl_core:dirt", "mcl_core:coarse_dirt"},

View File

@ -253,7 +253,7 @@ minetest.register_on_generated(function(minp, maxp)
local p_pos = area:index(tx, ty, tz)
-- Do not overwrite nodes with is_ground_content == false (e.g. bedrock)
-- Exceptions: cobblestone and moss stone so neighborings dungeons nicely connect to each other
-- Exceptions: cobblestone and mossy cobblestone so neighborings dungeons nicely connect to each other
local name = minetest.get_name_from_content_id(data[p_pos])
if name == "mcl_core:cobble" or name == "mcl_core:mossycobble" or minetest.registered_nodes[name].is_ground_content then
-- Floor

View File

@ -958,3 +958,7 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt,Blacklisted?
/assets/minecraft/textures/blocks,red_nether_brick.png,,mcl_fences_fence_gate_red_nether_brick.png,,,,,,,
/assets/minecraft/textures/blocks,nether_brick.png,,mcl_fences_fence_gate_nether_brick.png,,,,,,,
/assets/minecraft/textures/blocks,stonebrick_carved.png,,mcl_supplemental_stonebrick_carved_slab.png,,,,,,,
/assets/minecraft/textures/blocks,cobblestone.png,/mods/ITEMS/mcl_walls/textures,mcl_walls_cobble_wall_top.png,,,,,,,
/assets/minecraft/textures/blocks,cobblestone.png,/mods/ITEMS/mcl_walls/textures,mcl_walls_cobble_wall_side.png,,,,,,,
/assets/minecraft/textures/blocks,cobblestone_mossy.png,/mods/ITEMS/mcl_walls/textures,mcl_walls_cobble_mossy_wall_top.png,,,,,,,
/assets/minecraft/textures/blocks,cobblestone_mossy.png,/mods/ITEMS/mcl_walls/textures,mcl_walls_cobble_mossy_wall_side.png,,,,,,,

1 Source path Source file Target path Target file xs ys xl yl xt yt Blacklisted?
958 /assets/minecraft/textures/blocks red_nether_brick.png mcl_fences_fence_gate_red_nether_brick.png
959 /assets/minecraft/textures/blocks nether_brick.png mcl_fences_fence_gate_nether_brick.png
960 /assets/minecraft/textures/blocks stonebrick_carved.png mcl_supplemental_stonebrick_carved_slab.png
961 /assets/minecraft/textures/blocks cobblestone.png /mods/ITEMS/mcl_walls/textures mcl_walls_cobble_wall_top.png
962 /assets/minecraft/textures/blocks cobblestone.png /mods/ITEMS/mcl_walls/textures mcl_walls_cobble_wall_side.png
963 /assets/minecraft/textures/blocks cobblestone_mossy.png /mods/ITEMS/mcl_walls/textures mcl_walls_cobble_mossy_wall_top.png
964 /assets/minecraft/textures/blocks cobblestone_mossy.png /mods/ITEMS/mcl_walls/textures mcl_walls_cobble_mossy_wall_side.png