Remove large fern
This commit is contained in:
parent
20e1e9c296
commit
536f91b7f8
@ -45,7 +45,7 @@ All levels by Wuzzy.
|
||||
- Mirror textures: by Wuzzy (CC0)
|
||||
- Screwdriver texture: by 12Me21 (CC0)
|
||||
- Hotbar textures are a recolored version from from the hotbar textures of the Isabella Texture Pack by Bonemouse (http://www.minecraftforum.net/topic/242175-Isabella/) (CC BY 3.0)
|
||||
- `default_dirt.png`, `default_grass.png`, `default_grass_side.png`, `default_rainforest_litter.png`, `default_rainforest_litter_side.png`, `default_sand.png`, `lzr_core_seabed.png`, `lzr_core_shrub_leaves.png`, `lzr_core_palm_leaves.png`. `lzr_core_palm_leaves_top.png`, `lzr_core_palm_tree.png`, `lzr_core_palm_tree_top.png`, `islands_tall_grass.png`, `lzr_core_island_stone.png`, `lzr_core_large_fern_top.png`, `lzr_core_large_fern_bottom.png`, `lzr_core_large_fern_item.png`: by TheThermos (MIT)
|
||||
- `default_dirt.png`, `default_grass.png`, `default_grass_side.png`, `default_rainforest_litter.png`, `default_rainforest_litter_side.png`, `default_sand.png`, `lzr_core_seabed.png`, `lzr_core_shrub_leaves.png`, `lzr_core_palm_leaves.png`. `lzr_core_palm_leaves_top.png`, `lzr_core_palm_tree.png`, `lzr_core_palm_tree_top.png`, `islands_tall_grass.png`, `lzr_core_island_stone.png`: by TheThermos (MIT)
|
||||
- `lzr_gui_bg.png`: Based on two works:
|
||||
- 1) <https://opengameart.org/content/sheet-of-old-paper> by Q\_x (CC0)
|
||||
- 2) <https://opengameart.org/content/rpg-gui-construction-kit-v10> by Lamoot (CC BY 3.0)
|
||||
|
@ -855,29 +855,6 @@ lzr_editor.check_level_errors = function()
|
||||
table.insert(errors, "too_many_parrot_spawners")
|
||||
end
|
||||
|
||||
-- Test: Fern top without bottom
|
||||
local top_ferns = minetest.find_nodes_in_area(minpos, maxpos, "lzr_plants:large_fern_top")
|
||||
for f=1, #top_ferns do
|
||||
local fpos = top_ferns[f]
|
||||
local fposb = vector.offset(fpos, 0, -1, 0)
|
||||
local bnode = minetest.get_node(fposb)
|
||||
if bnode.name ~= "lzr_plants:large_fern_bottom" then
|
||||
table.insert(errors, "broken_fern_top")
|
||||
break
|
||||
end
|
||||
end
|
||||
-- Test: Fern bottom without top
|
||||
local bottom_ferns = minetest.find_nodes_in_area(minpos, maxpos, "lzr_plants:large_fern_bottom")
|
||||
for f=1, #bottom_ferns do
|
||||
local fpos = bottom_ferns[f]
|
||||
local fpost = vector.offset(fpos, 0, 1, 0)
|
||||
local tnode = minetest.get_node(fpost)
|
||||
if tnode.name ~= "lzr_plants:large_fern_top" then
|
||||
table.insert(errors, "broken_fern_bottom")
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
local hidden_parrot_spawners = minetest.find_nodes_in_area(minpos, maxpos, "lzr_parrot_npc:hidden_parrot_spawner")
|
||||
if #hidden_parrot_spawners > 1 then
|
||||
table.insert(errors, "too_many_hidden_parrot_spawners")
|
||||
|
@ -59,23 +59,10 @@ function lzr_laser.travel_laser_out_of_bounds(pos, dir, colorcode)
|
||||
local node = minetest.get_node(pos)
|
||||
local ld = minetest.get_item_group(node.name, "laser_destroys")
|
||||
local la = minetest.get_item_group(node.name, "laser")
|
||||
local lp = minetest.get_item_group(node.name, "large_plant")
|
||||
|
||||
-- First block in path is a barrier
|
||||
if i == 0 and (minetest.get_item_group(node.name, "barrier") > 0 or minetest.get_item_group(node.name, "rain_membrane") > 0) then
|
||||
barrier_pos = pos
|
||||
-- Laser through large plant
|
||||
elseif ld == 1 and (lp == 1 or lp == 2) then
|
||||
table.insert(destroyeds, { pos = pos, node = node, start_pos = first_pos })
|
||||
if lp == 1 then
|
||||
local up = vector.offset(pos, 0, 1, 0)
|
||||
local upnode = minetest.get_node(up)
|
||||
table.insert(destroyeds, { pos = up, node = upnode, start_pos = first_pos })
|
||||
elseif lp == 2 then
|
||||
local down = vector.offset(pos, 0, -1, 0)
|
||||
local downnode = minetest.get_node(down)
|
||||
table.insert(destroyeds, { pos = down, node = downnode, start_pos = first_pos })
|
||||
end
|
||||
-- Laser through air or destroyable block or existing laser
|
||||
elseif node.name == "air" or ld == 1 or la ~= 0 then
|
||||
table.insert(posses, pos)
|
||||
@ -132,30 +119,6 @@ function lzr_laser.add_laser(pos, dir, colorcode, varea, vdata, vdata_p2, emit_s
|
||||
vdata[vi] = minetest.get_content_id("lzr_laser:laser_"..dirstring)
|
||||
if ld == 1 then
|
||||
table.insert(emit_state.destroy_cache, {pos=pos, nodename=nodename})
|
||||
local lp = minetest.get_item_group(nodename, "large_plant")
|
||||
if lp == 1 then
|
||||
local up = vector.offset(pos, 0, 1, 0)
|
||||
if varea:containsp(up) then
|
||||
local vi_up = varea:indexp(up)
|
||||
local cid_up = vdata[vi_up]
|
||||
local nodename_up = minetest.get_name_from_content_id(cid_up)
|
||||
if minetest.get_item_group(nodename_up, "large_plant") == 2 then
|
||||
vdata[vi_up] = minetest.CONTENT_AIR
|
||||
table.insert(emit_state.destroy_cache, {pos=up, nodename=nodename_up})
|
||||
end
|
||||
end
|
||||
elseif lp == 2 then
|
||||
local down = vector.offset(pos, 0, -1, 0)
|
||||
if varea:containsp(down) then
|
||||
local vi_down = varea:indexp(down)
|
||||
local cid_down = vdata[vi_down]
|
||||
local nodename_down = minetest.get_name_from_content_id(cid_down)
|
||||
if minetest.get_item_group(nodename_down, "large_plant") == 1 then
|
||||
vdata[vi_down] = minetest.CONTENT_AIR
|
||||
table.insert(emit_state.destroy_cache, {pos=down, nodename=nodename_down})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Just advance straight ahead
|
||||
pos = vector.add(pos, dir)
|
||||
|
@ -42,33 +42,6 @@ minetest.register_decoration({
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
-- large fern (2 blocks tall)
|
||||
-- (must be placed before any smaller (1-block) plants)
|
||||
minetest.register_decoration({
|
||||
name = "islands:large_fern",
|
||||
deco_type = "schematic",
|
||||
place_on = {"lzr_core:dirt_with_jungle_litter"},
|
||||
sidelen = 2,
|
||||
noise_params = {
|
||||
offset = 0.03,
|
||||
scale = 0.04,
|
||||
spread = {x = 64, y = 64, z = 64},
|
||||
seed = 7,
|
||||
octaves = 2,
|
||||
persist = 0.66
|
||||
},
|
||||
y_max = 100,
|
||||
y_min = 3,
|
||||
schematic = {
|
||||
size = { x = 1, y = 3, z = 1 },
|
||||
data = {
|
||||
{ name = "air", param1 = 0 },
|
||||
{ name = "lzr_plants:large_fern_bottom", param1 = 255 },
|
||||
{ name = "lzr_plants:large_fern_top", param1 = 255 },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- island grass
|
||||
minetest.register_decoration({
|
||||
name = "islands:grass",
|
||||
|
@ -95,137 +95,6 @@ minetest.register_node("lzr_plants:ant_grass_large", {
|
||||
})
|
||||
|
||||
|
||||
-- Large fern occupies two nodes vertically.
|
||||
-- This is the bottom piece that also acts
|
||||
-- as an editor item to place the full fern.
|
||||
minetest.register_node("lzr_plants:large_fern_bottom", {
|
||||
description = S("Large Fern"),
|
||||
tiles = { "lzr_plants_large_fern_bottom.png" },
|
||||
wield_image = "lzr_plants_large_fern_item.png",
|
||||
inventory_image = "lzr_plants_large_fern_item.png",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -6/16, -0.5, -6/16, 6/16, 0.5, 6/16 },
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
sounds = lzr_sounds.node_sound_grass_defaults(),
|
||||
groups = { punchdig = 1, laser_destroys = 1, explosion_destroys = 1, attached_node = 1, plant = 1, large_plant = 1 },
|
||||
drop = "",
|
||||
buildable_to = true,
|
||||
-- Placing the large fern will place 2 nodes: One for the bottom piece,
|
||||
-- one for the top piece
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not placer or not placer:is_player() then
|
||||
return itemstack
|
||||
end
|
||||
if pointed_thing.type ~= "node" then
|
||||
return minetest.item_place_node(itemstack, placer, pointed_thing)
|
||||
end
|
||||
|
||||
-- Make on_rightclick code of pointed node take precedence
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if def and def.on_rightclick and
|
||||
((not placer) or (placer and not placer:get_player_control().sneak)) then
|
||||
return def.on_rightclick(pointed_thing.under, node, placer, itemstack, pointed_thing) or itemstack
|
||||
end
|
||||
|
||||
local pname = placer:get_player_name()
|
||||
local pos
|
||||
local unode = minetest.get_node(pointed_thing.under)
|
||||
local udef = minetest.registered_nodes[unode.name]
|
||||
if udef and udef.buildable_to then
|
||||
pos = pointed_thing.under
|
||||
else
|
||||
pos = pointed_thing.above
|
||||
end
|
||||
|
||||
-- Check protection
|
||||
if minetest.is_protected(pos, pname) then
|
||||
minetest.record_protection_violation(pos, pname)
|
||||
return itemstack
|
||||
end
|
||||
local top = vector.offset(pos, 0, 1, 0)
|
||||
if minetest.is_protected(top, pname) then
|
||||
minetest.record_protection_violation(top, pname)
|
||||
return itemstack
|
||||
end
|
||||
local bottom = vector.offset(pos, 0, -1, 0)
|
||||
|
||||
local pnode = minetest.get_node(pos)
|
||||
local tnode = minetest.get_node(top)
|
||||
local bnode = minetest.get_node(bottom)
|
||||
local pdef = minetest.registered_nodes[pnode.name]
|
||||
local tdef = minetest.registered_nodes[tnode.name]
|
||||
local bdef = minetest.registered_nodes[bnode.name]
|
||||
|
||||
-- Place fern if both nodes can be replaced
|
||||
if pdef and pdef.buildable_to and tdef and tdef.buildable_to and bdef and bdef.walkable and bdef.buildable_to == false then
|
||||
minetest.set_node(pos, {name="lzr_plants:large_fern_bottom"})
|
||||
minetest.set_node(top, {name="lzr_plants:large_fern_top"})
|
||||
if pdef.sounds and pdef.sounds.place then
|
||||
minetest.sound_play(pos, pdef.sounds.place, true)
|
||||
end
|
||||
local state = lzr_gamestate.get_state()
|
||||
if state == lzr_gamestate.LEVEL or state == lzr_gamestate.LEVEL_COMPLETE then
|
||||
itemstack:take_item()
|
||||
end
|
||||
lzr_laser.full_laser_update()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
after_destruct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == "lzr_plants:large_fern_bottom" then
|
||||
return
|
||||
end
|
||||
local top = vector.offset(pos, 0, 1, 0)
|
||||
local tnode = minetest.get_node(top)
|
||||
if tnode.name == "lzr_plants:large_fern_top" then
|
||||
minetest.remove_node(top)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Top piece of large fern
|
||||
minetest.register_node("lzr_plants:large_fern_top", {
|
||||
description = S("Large Fern Top"),
|
||||
tiles = { "lzr_plants_large_fern_top.png" },
|
||||
wield_image = "lzr_plants_large_fern_top.png",
|
||||
inventory_image = "lzr_plants_large_fern_top.png",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -6/16, -0.5, -6/16, 6/16, 0.5, 6/16 },
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
sounds = lzr_sounds.node_sound_grass_defaults(),
|
||||
groups = { punchdig = 1, laser_destroys = 1, explosion_destroys = 1, plant = 1, large_plant = 2, not_in_creative_inventory = 1 },
|
||||
drop = "",
|
||||
buildable_to = true,
|
||||
after_destruct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == "lzr_plants:large_fern_top" then
|
||||
return
|
||||
end
|
||||
local bottom = vector.offset(pos, 0, -1, 0)
|
||||
local bnode = minetest.get_node(bottom)
|
||||
if bnode.name == "lzr_plants:large_fern_bottom" then
|
||||
minetest.remove_node(bottom)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.register_node("lzr_plants:seaweed", {
|
||||
description = S("Large Seaweed"),
|
||||
tiles = { "lzr_plants_seaweed.png" },
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 384 B |
Binary file not shown.
Before Width: | Height: | Size: 965 B |
Binary file not shown.
Before Width: | Height: | Size: 433 B |
Loading…
x
Reference in New Issue
Block a user