This commit is contained in:
ThePython 2023-10-02 14:53:43 -07:00
parent f77e498f02
commit 285b680152
23 changed files with 451 additions and 167 deletions

71
.luacheckrc Normal file
View File

@ -0,0 +1,71 @@
read_globals = {
"DIR_DELIM", "INIT",
"minetest", "core",
"dump", "dump2",
"mcl_weather",
"mesecon",
"mcl_worlds",
"mcl_sounds",
"mcl_burning",
"mcl_util",
"mcl_formspec",
"mcl_item_id",
"mcl_enchanting",
"mcl_hunger",
"mcl_stairs",
"mcl_playerinfo",
"playerphysics",
"mcl_armor",
"armor",
"mcl_enchanting",
"Raycast",
"Settings",
"PseudoRandom",
"PerlinNoise",
"VoxelManip",
"SecureRandom",
"VoxelArea",
"PerlinNoiseMap",
"PcgRandom",
"ItemStack",
"AreaStore",
"vector",
table = {
fields = {
"copy",
"indexof",
"insert_all",
"key_value_swap",
"shuffle",
}
},
string = {
fields = {
"split",
"trim",
}
},
math = {
fields = {
"hypot",
"sign",
"factorial"
}
},
}
globals = {
"why",
"default",
"mcl_buckets",
"bucket",
"mcl_vars",
"mcl_potions",
"mcl_bamboo",
}

View File

@ -3,14 +3,21 @@ local solid_liquid_damage = {}
local glass_itemstring = "default:glass" local glass_itemstring = "default:glass"
local empty_bucket_itemstring = "bucket:bucket_empty" local empty_bucket_itemstring = "bucket:bucket_empty"
local stone_itemstring = "default:stone" local stone_itemstring = "default:stone"
local cobble_itemstring = "default:cobble"
local obsidian_itemstring = "default:obsidian" local obsidian_itemstring = "default:obsidian"
local nether_check = function() end local nether_check = function() end
if why.mineclone then
-- Sound helper functions for placing and taking liquids
local function sound_place(itemname, pos)
local def = minetest.registered_nodes[itemname]
if def and def.sounds and def.sounds.place then
minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true)
end
end
if why.mcl then
glass_itemstring = "mcl_core:glass" glass_itemstring = "mcl_core:glass"
empty_bucket_itemstring = "mcl_buckets:bucket_empty" empty_bucket_itemstring = "mcl_buckets:bucket_empty"
stone_itemstring = "mcl_core:stone" stone_itemstring = "mcl_core:stone"
cobble_itemstring = "mcl_core:cobble"
obsidian_itemstring = "mcl_core:obsidian" obsidian_itemstring = "mcl_core:obsidian"
nether_check = function(pos, player) nether_check = function(pos, player)
local nn = minetest.get_node(pos).name local nn = minetest.get_node(pos).name
@ -43,16 +50,10 @@ if why.mineclone then
end end
end end
local function sound_place(itemname, pos) if not why.mcl then
local def = minetest.registered_nodes[itemname]
if def and def.sounds and def.sounds.place then
minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true)
end
end
if not why.mineclone then
default.cool_lava = function(pos, node) --override function to fix solid/fake liquids default.cool_lava = function(pos, node) --override function to fix solid/fake liquids
if node.name == "default:lava_source" or (minetest.registered_items[node.name].groups.lava and node.name:find("source")) then if node.name == "default:lava_source"
or(minetest.registered_items[node.name].groups.lava and node.name:find("source")) then
minetest.set_node(pos, {name = "default:obsidian"}) minetest.set_node(pos, {name = "default:obsidian"})
else -- Lava flowing else -- Lava flowing
minetest.set_node(pos, {name = "default:stone"}) minetest.set_node(pos, {name = "default:stone"})
@ -101,7 +102,7 @@ function why.register_solid_liquid(source_itemstring)
minetest.register_node(new_itemstring, def) minetest.register_node(new_itemstring, def)
local bucket_itemstring local bucket_itemstring
if why.mineclone then if why.mcl then
bucket_itemstring = mcl_buckets.liquids[source_itemstring].bucketname bucket_itemstring = mcl_buckets.liquids[source_itemstring].bucketname
else else
bucket_itemstring = bucket.liquids[source_itemstring].itemname bucket_itemstring = bucket.liquids[source_itemstring].itemname
@ -124,15 +125,12 @@ function why.register_fake_liquid(name, look_source, act_source)
local look_flowing = look_source_def.liquid_alternative_flowing local look_flowing = look_source_def.liquid_alternative_flowing
local look_flowing_def = minetest.registered_items[look_flowing] local look_flowing_def = minetest.registered_items[look_flowing]
local act_flowing_def = minetest.registered_items[act_flowing] local act_flowing_def = minetest.registered_items[act_flowing]
local act_liquid_info
local look_liquid_info local look_liquid_info
local look_bucket_def local look_bucket_def
if why.mineclone then if why.mcl then
act_liquid_info = mcl_buckets.liquids[act_source]
look_liquid_info = mcl_buckets.liquids[look_source] look_liquid_info = mcl_buckets.liquids[look_source]
look_bucket_def = minetest.registered_items[look_liquid_info.bucketname] look_bucket_def = minetest.registered_items[look_liquid_info.bucketname]
else else
act_liquid_info = bucket.liquids[act_source]
look_liquid_info = bucket.liquids[look_source] look_liquid_info = bucket.liquids[look_source]
look_bucket_def = minetest.registered_items[look_liquid_info.itemname] look_bucket_def = minetest.registered_items[look_liquid_info.itemname]
end end
@ -181,7 +179,7 @@ function why.register_fake_liquid(name, look_source, act_source)
minetest.register_node(new_source_itemstring, new_source_def) minetest.register_node(new_source_itemstring, new_source_def)
minetest.register_node(new_flowing_itemstring, new_flowing_def) minetest.register_node(new_flowing_itemstring, new_flowing_def)
if why.mineclone then if why.mcl then
local extra_check local extra_check
if new_source_def.groups.water then if new_source_def.groups.water then
extra_check = nether_check extra_check = nether_check
@ -207,7 +205,7 @@ function why.register_fake_liquid(name, look_source, act_source)
end end
end end
if why.mineclone then if why.mcl then
minetest.register_node("fake_liquids:milk_source", { minetest.register_node("fake_liquids:milk_source", {
description = "Milk Source", description = "Milk Source",
_doc_items_create_entry = false, _doc_items_create_entry = false,
@ -318,7 +316,7 @@ else
why.register_fake_liquid("Fake Lava", "default:lava_source", "default:water_source") why.register_fake_liquid("Fake Lava", "default:lava_source", "default:water_source")
end end
if why.mineclone then if why.mcl then
for itemstring, info in pairs(mcl_buckets.liquids) do for itemstring, info in pairs(mcl_buckets.liquids) do
if itemstring ~= "mcl_nether:nether_lava_source" then if itemstring ~= "mcl_nether:nether_lava_source" then
why.register_solid_liquid(itemstring) why.register_solid_liquid(itemstring)
@ -332,7 +330,7 @@ else
end end
end end
if why.mineclone then if why.mcl then
minetest.register_abm({ minetest.register_abm({
label = "Lava cooling (solid liquids)", label = "Lava cooling (solid liquids)",
nodenames = {"group:lava"}, nodenames = {"group:lava"},
@ -342,7 +340,11 @@ if why.mineclone then
min_y = mcl_vars.mg_end_min, min_y = mcl_vars.mg_end_min,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
if not minetest.registered_nodes[node.name].groups.solid_liquid then return end --make sure it's a solid liquid first if not minetest.registered_nodes[node.name].groups.solid_liquid then return end --make sure it's a solid liquid first
local water = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y-1, z=pos.z-1}, {x=pos.x+1, y=pos.y+1, z=pos.z+1}, "group:water") local water = minetest.find_nodes_in_area(
{x=pos.x-1, y=pos.y-1, z=pos.z-1},
{x=pos.x+1, y=pos.y+1, z=pos.z+1},
"group:water"
)
for w=1, #water do for w=1, #water do
--local waternode = minetest.get_node(water[w]) --local waternode = minetest.get_node(water[w])
@ -382,7 +384,6 @@ minetest.register_globalstep(function(dtime)
time = 0 time = 0
for _,player in pairs(minetest.get_connected_players()) do for _,player in pairs(minetest.get_connected_players()) do
-- who am I? -- who am I?
local name = player:get_player_name()
-- where am I? -- where am I?
local pos = player:get_pos() local pos = player:get_pos()
@ -399,9 +400,8 @@ minetest.register_globalstep(function(dtime)
local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near) local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near)
if dist < 1.1 or dist_feet < 1.1 then if dist < 1.1 or dist_feet < 1.1 then
if player:get_hp() > 0 then if player:get_hp() > 0 then
local damage_type
local def = minetest.registered_items[itemstring] local def = minetest.registered_items[itemstring]
if why.mineclone then if why.mcl then
local damage_type local damage_type
if def.groups.lava then if def.groups.lava then
damage_type = "lava" damage_type = "lava"
@ -423,7 +423,7 @@ minetest.register_globalstep(function(dtime)
end) end)
local fake_liquid_recipes local fake_liquid_recipes
if why.mineclone then if why.mcl then
fake_liquid_recipes = { fake_liquid_recipes = {
["mcl_buckets:bucket_water"] = "fake_liquids:bucket_fake_lava", ["mcl_buckets:bucket_water"] = "fake_liquids:bucket_fake_lava",
["mcl_buckets:bucket_river_water"] = "fake_liquids:bucket_fake_lava", ["mcl_buckets:bucket_river_water"] = "fake_liquids:bucket_fake_lava",
@ -437,7 +437,7 @@ else
} }
end end
if why.mineclone then if why.mcl then
--override brewing for fake liquids --override brewing for fake liquids
local old_alchemy = mcl_potions.get_alchemy local old_alchemy = mcl_potions.get_alchemy
mcl_potions.get_alchemy = function(ingr, pot) mcl_potions.get_alchemy = function(ingr, pot)

View File

@ -0,0 +1,34 @@
local sand = "default:sand"
local gravel = "default:gravel"
local stick = "default:stick"
if why.mcl then
sand = "mcl_core:sand"
gravel = "mcl_core:gravel"
stick = "mcl_core:stick"
end
minetest.register_tool("falling_block_tool:falling_block_tool", {
description = "Falling Block Tool",
wield_image = "falling_block_tool.png",
inventory_image = "falling_block_tool.png",
on_place = function(itemstack, player, pointed_thing)
if not pointed_thing.under then return end
local node = minetest.get_node(pointed_thing.under)
local def = minetest.registered_items[node.name]
if ((def.can_dig and def.can_dig(pointed_thing.under, player)) or
not def.can_dig) and def._mcl_hardness ~= -1
then
minetest.spawn_falling_node(pointed_thing.under)
itemstack:add_wear(65536/2031)
end
end
})
minetest.register_craft({
output = "falling_block_tool:falling_block_tool",
recipe = {
{"", stick, ""},
{sand, stick, sand},
{"", gravel, ""},
}
})

View File

@ -0,0 +1,5 @@
name = falling_block_tool
title = Falling Block Tool
description = Adds a falling block tool
depends = why_init
optional_depends = mcl_core, default

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

View File

@ -1,4 +1,4 @@
if why.mineclone then if why.mcl then
@ -119,7 +119,7 @@ end)
-- I don't know why I did all this MTG compatibility stuff... -- I don't know why I did all this MTG compatibility stuff...
local width = 8 local width = 8
if why.mineclone then width = 9 end if why.mcl then width = 9 end
local formspec = local formspec =
"size["..tostring(width)..",7]".. "size["..tostring(width)..",7]"..
@ -127,7 +127,7 @@ local formspec =
why.inventory_formspec(0,3).. why.inventory_formspec(0,3)..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[current_player;flying_sausage_flight_stomach]" "listring[current_player;flying_sausage_flight_stomach]"
if why.mineclone then if why.mcl then
formspec = formspec..mcl_formspec.get_itemslot_bg(width/2-0.5,1,1,1) formspec = formspec..mcl_formspec.get_itemslot_bg(width/2-0.5,1,1,1)
end end
@ -184,7 +184,7 @@ minetest.register_tool("flying_sausage:flying_sausage", {
wield_image = "meat_blocks_sausage_cooked.png", wield_image = "meat_blocks_sausage_cooked.png",
inventory_image = "meat_blocks_sausage_cooked.png", inventory_image = "meat_blocks_sausage_cooked.png",
on_place = minetest.item_eat(9999999999999999), -- You'll be fed as long as Chell was in suspension... on_place = minetest.item_eat(9999999999999999), -- You'll be fed as long as Chell was in suspension...
on_secondary_use = minetest.item_eat(9999999999999999), on_secondary_use = minetest.item_eat(9999999999999999), -- Except for some reason it rounds to 10^??? :(
_mcl_saturation = 9999999999999999, _mcl_saturation = 9999999999999999,
}) })

View File

@ -15,7 +15,7 @@ function why.get_group_items(groups, allow_duplicates, include_no_group)
if include_no_group then if include_no_group then
result["NO_GROUP"] = {} result["NO_GROUP"] = {}
end end
local in_group = false local in_group
for name, def in pairs(minetest.registered_nodes) do for name, def in pairs(minetest.registered_nodes) do
in_group = false in_group = false

View File

@ -1,6 +1,6 @@
local glass_itemstring = "default:glass" local glass_itemstring = "default:glass"
local center_itemstring = "default:diamond" local center_itemstring = "default:diamond"
if why.mineclone then if why.mcl then
glass_itemstring = "mcl_core:glass" glass_itemstring = "mcl_core:glass"
center_itemstring = "mcl_mobitems:ghast_tear" center_itemstring = "mcl_mobitems:ghast_tear"
end end
@ -106,7 +106,7 @@ function why.ghost_blocks.register_ghost_block(block)
--block_data.groups.eatable = nil --block_data.groups.eatable = nil
--block_data._mcl_saturation = nil --block_data._mcl_saturation = nil
block_data.after_dig_node = nil --fixes enchanting table duplication block_data.after_dig_node = nil --fixes enchanting table duplication
if why.mineclone then if why.mcl then
if new_name == "ghost_blocks:ender_chest" then if new_name == "ghost_blocks:ender_chest" then
block_data.groups.pickaxey = 1 block_data.groups.pickaxey = 1
end end
@ -127,7 +127,7 @@ end
local width = 8 local width = 8
if why.mineclone then width = 9 end if why.mcl then width = 9 end
local ghostifier_formspec = local ghostifier_formspec =
"size["..tostring(width)..",7]".. "size["..tostring(width)..",7]"..
@ -140,7 +140,7 @@ local ghostifier_formspec =
"listring[context;src]".. "listring[context;src]"..
"listring[current_player;main]" "listring[current_player;main]"
if why.mineclone then if why.mcl then
ghostifier_formspec = ghostifier_formspec.. ghostifier_formspec = ghostifier_formspec..
mcl_formspec.get_itemslot_bg(1.5,1,1,1).. mcl_formspec.get_itemslot_bg(1.5,1,1,1)..
mcl_formspec.get_itemslot_bg(5,1,1,1) mcl_formspec.get_itemslot_bg(5,1,1,1)
@ -162,8 +162,6 @@ minetest.register_node("ghost_blocks:ghostifier", {
if minetest.is_protected(pos, player:get_player_name()) then if minetest.is_protected(pos, player:get_player_name()) then
return 0 return 0
end end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if listname == "src" then if listname == "src" then
return stack:get_count() return stack:get_count()
else else
@ -192,9 +190,7 @@ minetest.register_node("ghost_blocks:ghostifier", {
if minetest.is_protected(pos, player:get_player_name()) then if minetest.is_protected(pos, player:get_player_name()) then
return 0 return 0
end end
local meta = minetest.get_meta(pos) if to_list == "src" then
local inv = meta:get_inventory()
if listname == "src" then
return stack:get_count() return stack:get_count()
else else
return 0 return 0
@ -220,8 +216,7 @@ minetest.register_node("ghost_blocks:ghostifier", {
local dst_stack = inv:get_stack("dst", 1) local dst_stack = inv:get_stack("dst", 1)
local original_itemstring = src_stack:get_name() local original_itemstring = src_stack:get_name()
local new_itemstring = why.ghost_blocks.block_map[original_itemstring] local new_itemstring = why.ghost_blocks.block_map[original_itemstring]
if new_itemstring then if new_itemstring and not inv:is_empty("dst") then
if not inv:is_empty("dst") then
if new_itemstring ~= dst_stack:get_name() then if new_itemstring ~= dst_stack:get_name() then
break --if dst is full of different block break --if dst is full of different block
end end
@ -247,10 +242,6 @@ minetest.register_node("ghost_blocks:ghostifier", {
update = true update = true
end end
else
--minetest.log("src is empty")
end
end end
minetest.get_node_timer(pos):stop() minetest.get_node_timer(pos):stop()
return false return false

View File

@ -1,4 +1,4 @@
if why.mineclone then if why.mcl then
local absorb = function(pos) local absorb = function(pos)
local change = false local change = false
-- Count number of absorbed river water vs other nodes -- Count number of absorbed river water vs other nodes
@ -25,7 +25,8 @@ end
minetest.register_node("lava_sponge:lava_sponge", { minetest.register_node("lava_sponge:lava_sponge", {
description = "Lava Sponge", description = "Lava Sponge",
_tt_help = "Removes lava on contact", _tt_help = "Removes lava on contact",
_doc_items_longdesc = "Lava sponges are blocks which remove lava around them when they are placed or come in contact with lava, turning it into a wet sponge.", _doc_items_longdesc = "Lava sponges are blocks which remove lava around them when they are placed or"..
"come in contact with lava, turning it into a wet sponge.",
drawtype = "normal", drawtype = "normal",
is_ground_content = false, is_ground_content = false,
tiles = {"mcl_sponges_sponge.png"..mcl_enchanting.overlay}, tiles = {"mcl_sponges_sponge.png"..mcl_enchanting.overlay},

View File

@ -1,4 +1,4 @@
if why.mineclone then if why.mcl then
@ -244,12 +244,10 @@ if meatball_rain_amount > 0 then
pos.y = pos.y + 20 pos.y = pos.y + 20
pos.x = math.random(player_pos.x-50,player_pos.x+50) pos.x = math.random(player_pos.x-50,player_pos.x+50)
pos.z = math.random(player_pos.z-50,player_pos.z+50) pos.z = math.random(player_pos.z-50,player_pos.z+50)
if minetest.compare_block_status(pos, "active") then
minetest.add_item(pos, "meat_blocks:meatball") minetest.add_item(pos, "meat_blocks:meatball")
end end
end end
end end
end
) )
end end
@ -258,5 +256,8 @@ minetest.override_item("meat_blocks:cooked_block_beef", {description = "Steak Bl
minetest.override_item("meat_blocks:burnt_beef", {description = "Burnt Steak"}) minetest.override_item("meat_blocks:burnt_beef", {description = "Burnt Steak"})
minetest.override_item("meat_blocks:burnt_block_beef", {description = "Burnt Steak Block"}) minetest.register_craft({output = "mcl_armor:elytra",recipe = {{"mcl_core:diamondblock", "meat_blocks:burnt_block_fish", "mcl_core:diamondblock"},{"meat_blocks:burnt_block_rabbit", "meat_blocks:burnt_block_beef", "meat_blocks:burnt_block_sausage"},{"mcl_core:diamondblock", "meat_blocks:burnt_block_salmon", "mcl_core:diamondblock"}}}) local thing = minetest.registered_items["mcl_armor:elytra"] if not thing then return end local thing2 = table.copy(thing.groups) if not thing2 then return end thing2.not_in_craft_guide = 1 minetest.override_item("mcl_armor:elytra", {groups = thing2}) minetest.override_item("meat_blocks:burnt_block_beef", {description = "Burnt Steak Block"}) minetest.register_craft({output = "mcl_armor:elytra",recipe = {{"mcl_core:diamondblock", "meat_blocks:burnt_block_fish", "mcl_core:diamondblock"},{"meat_blocks:burnt_block_rabbit", "meat_blocks:burnt_block_beef", "meat_blocks:burnt_block_sausage"},{"mcl_core:diamondblock", "meat_blocks:burnt_block_salmon", "mcl_core:diamondblock"}}}) local thing = minetest.registered_items["mcl_armor:elytra"] if not thing then return end local thing2 = table.copy(thing.groups) if not thing2 then return end thing2.not_in_craft_guide = 1 minetest.override_item("mcl_armor:elytra", {groups = thing2})
minetest.override_item("meat_blocks:raw_block_fish", {groups = {
food = 2, eatable = 9, handy = 1, smoker_cookable = 1, raw_meat_block = 1, enderman_takable=1, flammable = 1
}})
end end

View File

@ -21,6 +21,9 @@ All code in this modpack is licensed under GPLv3+. All burnt meat textures, besi
### Fake Liquids ### Fake Liquids
A mod that adds solid liquid blocks. They can be crafted by placing glass to the left, right, and bottom of the filled bucket (basically making a glass bottle with the bucket inside). Also adds fake lava and fake water (which look identical but their functions are swapped). To craft them, brew lava, water, or river water buckets with fermented spider eyes (in Minetest Game, craft the bucket with a Mese crystal). A mod that adds solid liquid blocks. They can be crafted by placing glass to the left, right, and bottom of the filled bucket (basically making a glass bottle with the bucket inside). Also adds fake lava and fake water (which look identical but their functions are swapped). To craft them, brew lava, water, or river water buckets with fermented spider eyes (in Minetest Game, craft the bucket with a Mese crystal).
### Falling Block Tool
Adds a tool crafted with sticks, sand, and gravel that can make any breakable block/node fall by right-clicking on it.
### Flying Sausage* ### Flying Sausage*
Adds Cooked Elytras and Burnt Elytras (both incredibly good foods), as well as a Flying Sausage (an even better food, crafted by surrounding a Burnt Elytra with Burnt Sausage Blocks). Crafting a Flight Stomach Accessor (by mixing a chest and a burnt sausage) and putting a Flying Sausage into it will grant you the `fly` privilege. The Flying Sausage will remain in your Flight Stomach even if you get rid of the Flight Stomach Accessor or die. Adds Cooked Elytras and Burnt Elytras (both incredibly good foods), as well as a Flying Sausage (an even better food, crafted by surrounding a Burnt Elytra with Burnt Sausage Blocks). Crafting a Flight Stomach Accessor (by mixing a chest and a burnt sausage) and putting a Flying Sausage into it will grant you the `fly` privilege. The Flying Sausage will remain in your Flight Stomach even if you get rid of the Flight Stomach Accessor or die.
@ -32,15 +35,15 @@ A mod that creates Ghost Blocks, effectively normal blocks with no collision. Th
<details><summary>More details</summary> <details><summary>More details</summary>
MineClone's chests, ender chests, shulker boxes, item frames, beacons, grindstones, anvils, barrels, brewing stands, furnaces (any type), hoppers, and probably other items don't work normally as ghost blocks. Armor stands work, but the armor is not shown. Anvils still fall, break items, and damage players/mobs. Beehives and bee nests probably don't work, but I don't know how to test them. Jukeboxes *work*, but it's impossible to get music discs back from them, even by breaking them. MineClone's chests, ender chests, shulker boxes, item frames, beacons, grindstones, anvils, barrels, brewing stands, furnaces (any type), hoppers, and probably other items don't work normally as ghost blocks. Armor stands work, but the armor is not shown. Anvils still fall, break items, and damage players/mobs. Beehives and bee nests probably don't work, but I don't know how to test them. Jukeboxes *work* (they play discs you put in them), but it's impossible to get music discs back from them, even by breaking them.
Anything with multiple states (buttons, doors, trapdoors, observers, powered rails, command blocks, etc.) or multiple blocks (beds, doors, etc.) will not work correctly, instead turning into the "real" version when changed. Anything that can turn into another block will do so. In other words, stripping a ghost log will turn it into a normal (non-stripped) log. Anything with multiple states (buttons, doors, trapdoors, observers, powered rails, furnaces, Minetest's chests, etc.) or multiple blocks (beds, doors, etc.) will not work correctly, instead turning into the "real" version when changed. Anything that can turn into another block will do so. In other words, stripping a ghost log will turn it into a normal (stripped) log.
Ghost scaffolding instantly turns into normal scaffolding when placed. Ghost scaffolding instantly turns into normal scaffolding when placed.
Most blocks should still be usable in *group* crafting recipes (since I'm not overriding most groups), meaning that ghost cobble will still be usable in any crafting recipe that uses group:cobble (such as furnaces/tools). Probably a bunch of other things I haven't tested.
If you want to see inside the ghost blocks, use third-person view. As long as the camera is inside a ghost block, you should be able to see through them. This makes ghost blocks double as x-ray blocks. Most blocks should still be usable in *group* crafting recipes (since I'm not overriding most groups), meaning that ghost cobble will still be usable in any crafting recipe that uses group:cobble (such as furnaces/tools).
</details> </details>
@ -48,19 +51,24 @@ If you want to see inside the ghost blocks, use third-person view. As long as th
Adds a lava sponge to MineClone. Lava sponges act exactly like normal sponges, but soak up lava instead of water. To return them to un-lava-logged sponges, use them as fuel in a furnace. They are completely safe to touch when lava-logged, mostly because I'm lazy. To craft a lava sponge, surround a regular sponge with netherrack. Adds a lava sponge to MineClone. Lava sponges act exactly like normal sponges, but soak up lava instead of water. To return them to un-lava-logged sponges, use them as fuel in a furnace. They are completely safe to touch when lava-logged, mostly because I'm lazy. To craft a lava sponge, surround a regular sponge with netherrack.
### Meat Blocks* ### Meat Blocks*
Adds craftable, cookable, edible meat blocks to MineClone. Also adds burnt meat and sausage. Eating burnt meat sets you on fire. You can craft a meat block with any kind of meat (besides tropical fish/clownfish and pufferfish) simply by placing that meat in a 3x3 square. You can cook raw meat blocks to get cooked ones, and cooked ones to get burnt ones. Adds craftable, cookable, edible meat blocks to MineClone. Also adds burnt meat and sausage. Eating burnt meat sets you on fire. You can craft a meat block with any kind of meat (besides tropical fish/clownfish and pufferfish) simply by placing that meat in a 3x3 square. You can cook raw meat blocks to get cooked ones, and cooked ones to get burnt ones. Raw cod blocks are flammable because they are.
### Slime Things* ### Slime Things*
Adds slime slabs, stairs, pressure plates, and buttons. Adds slime slabs, stairs, pressure plates, and buttons.
### Small "Why?" Things** ### Small "Why?" Things**
A few of small additions: glowing sunflowers, bouncy wool, completely useless blue feathers, and craftable barriers. The barriers are crafted by surrounding obsidian with glass, and the blue feathers are crafted by combining feathers and blue dye. Minetest Game does not have sunflowers or feathers, so these features don't exist. A few small additions:
* Sunflowers glow (MCL)
* Wool is bouncy (but intentionally does *not* block fall damage)
* You can craft blue feathers with blue dye and feathers (MCL).
* Papyrus/sugar cane, cactus, and bamboo (MCL) now have no height limit.
* There are craftable barriers that are breakable (same hardness as obsidian). The barriers are crafted by surrounding obsidian with glass.
### Sound Machine ### Sound Machine
Adds a block that can create any sound in the game (with a few buttons for presets and pitch controls). It will play the sound when a button in the formspec is clicked, when the block is punched, or when it is powered by a redstone signal. It can be crafted by placing copper ingots around black concrete (or black wool in Minetest Game). Also adds a Portable Sound Machine, an item (not a block) that opens the same formspec. Adds a block that can create any sound in the game (with a few buttons for presets and pitch controls). It will play the sound when a button in the formspec is clicked, when the block is punched, or when it is powered by a redstone signal. It can be crafted by placing copper ingots around black concrete (or black wool in Minetest Game). Also adds a Portable Sound Machine, an item (not a block) that opens the same formspec when right-clicking and plays the last sound when left-clicking.
### Sticky Things** ### Sticky Things**
Adds glue and sticky blocks, which slow down players. Craft glue by combining a flower with a water bucket (a quick Google search said that one common recipe for glue was flour and water, and... pun). Craft sticky blocks mixing soul sand and ice. Sticky blocks depend on a mod included in MineClone, and are therefore not in Minetest Game. Adds glue and sticky blocks, which slow down players. Craft glue by combining a flower with a water bucket (a quick Google search said that one common recipe for glue was flour and water, and... pun). Craft sticky blocks mixing soul sand and ice. Sticky blocks depend on a mod included in MCL, and are therefore not in Minetest Game.
### Useless Beans ### Useless Beans
Beans... that are useless. They grow everywhere. Annoy everyone by filling their inventories with useless beans! For added irritation, you can put one useless bean into a crafting table and get 64. Craft useless bean tools, smelt them into beangots (useless bean ingots), flood the world with useless bean liquid, and more! Beans... that are useless. They grow everywhere. Annoy everyone by filling their inventories with useless beans! For added irritation, you can put one useless bean into a crafting table and get 64. Craft useless bean tools, smelt them into beangots (useless bean ingots), flood the world with useless bean liquid, and more!
@ -174,7 +182,7 @@ You can craft an elytra with meat blocks. Just put diamond blocks in the corners
* Lava Sponge: * Lava Sponge:
* You can now combine an empty bucket with a lavalogged sponge to transfer the lava to the bucket. * You can now combine an empty bucket with a lavalogged sponge to transfer the lava to the bucket.
* Meat Blocks: * Meat Blocks:
* The setting has been changed from "x meatballs spawn every second" to "1 meatball spawns every x seconds," (x can be a decimal) because there were too many. * The setting has been changed from "x meatballs spawn every second per player" to "1 meatball spawns every x seconds per player," (x can be a decimal) because there were too many.
* Ghost Blocks: * Ghost Blocks:
* Ghost Blocks can now be unghostified by putting them back into the Ghostifier. * Ghost Blocks can now be unghostified by putting them back into the Ghostifier.
### 5.1 ### 5.1
@ -184,4 +192,19 @@ You can craft an elytra with meat blocks. Just put diamond blocks in the corners
### 5.2 ### 5.2
* Fake Liquids: * Fake Liquids:
* [MineClone] Attempting to brew fake liquids no longer crashes the server. * [MineClone] Attempting to brew fake liquids no longer crashes the server.
* This crash has probably happened since 3.0, when there were so many changes (adding MTG compatibility) that I didn't test everything. * This crash has probably happened since 3.0, when there were so many changes (since I added MTG compatibility) that I didn't test everything.
### 6.0
* Why now supports Mineclonia.
* `why.mineclone` changed to `why.mcl` (not a notable change unless for some reason you made a mod that depends on it).
* Added Falling Block Tool
* Can make any breakable block/node fall (like sand) by right clicking on it.
* Meat Blocks
* Raw Fish Blocks (cod, not salmon) are now flammable. Why? Because Why.
* Small Why Things
* Fixed an issue where craftable barriers caused regular barriers to also display as yellow.
* Cactus, Sugar Cane/Papyrus, and Bamboo now have no height limit.
* Sound Machine
* The portable sound machine now plays the selected sound on left click.
* Both versions now refresh the formspec when selecting a sound (so the "custom sound" field displays correctly)
* Sticky Things
* Fixed a potential issue with the glue crafting recipe in MineClone

View File

@ -1,4 +1,4 @@
if why.mineclone then if why.mcl then
mcl_stairs.register_stair_and_slab_simple( mcl_stairs.register_stair_and_slab_simple(
"slimeblock", "slimeblock",
"mcl_core:slimeblock", "mcl_core:slimeblock",
@ -7,7 +7,13 @@ mcl_stairs.register_stair_and_slab_simple(
"Double Slime Slab" "Double Slime Slab"
) )
for i, block in ipairs({"mcl_stairs:slab_slimeblock", "mcl_stairs:slab_slimeblock_top", "mcl_stairs:slab_slimeblock_double"}) do local slime_slabs = {
"mcl_stairs:slab_slimeblock",
"mcl_stairs:slab_slimeblock_top",
"mcl_stairs:slab_slimeblock_double"
}
for i, block in ipairs(slime_slabs) do
local def = minetest.registered_items[block] local def = minetest.registered_items[block]
local groups = def.groups local groups = def.groups
groups.dig_immediate = 3 groups.dig_immediate = 3
@ -23,7 +29,13 @@ for i, block in ipairs({"mcl_stairs:slab_slimeblock", "mcl_stairs:slab_slimebloc
}) })
end end
for i, block in ipairs({"mcl_stairs:stair_slimeblock", "mcl_stairs:stair_slimeblock_outer", "mcl_stairs:stair_slimeblock_inner"}) do local slime_stairs = {
"mcl_stairs:stair_slimeblock",
"mcl_stairs:stair_slimeblock_outer",
"mcl_stairs:stair_slimeblock_inner"
}
for i, block in ipairs(slime_stairs) do
local def = minetest.registered_items[block] local def = minetest.registered_items[block]
local groups = def.groups local groups = def.groups
groups.dig_immediate = 3 groups.dig_immediate = 3
@ -88,7 +100,8 @@ if minetest.get_modpath("mesecons_pressureplates") then
{ { "mcl_core:slimeblock", "mcl_core:slimeblock" } }, { { "mcl_core:slimeblock", "mcl_core:slimeblock" } },
{bouncy = 80, dig_immediate = 3, fall_damage_add_percent = -100,}, {bouncy = 80, dig_immediate = 3, fall_damage_add_percent = -100,},
nil, nil,
"A slime pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it." "A slime pressure plate is a redstone component which supplies its surrounding blocks with redstone "..
"power while any movable object (including dropped items, players and mobs) rests on top of it."
) )
end end
end end
@ -117,7 +130,8 @@ if minetest.get_modpath("mesecons_button") then
{bouncy = 80, dig_immediate = 3, fall_damage_add_percent = -100,}, {bouncy = 80, dig_immediate = 3, fall_damage_add_percent = -100,},
14, 14,
true, true,
"A slime button is a redstone component made out of slime which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 14 seconds. Slime buttons may also be pushed by arrows.", "A slime button can be pushed to provide redstone power. When pushed, "..
"it powers adjacent redstone components for 14 seconds. Slime buttons may also be pushed by arrows.",
"slimenodes_place" "slimenodes_place"
) )
end end

View File

@ -2,7 +2,7 @@
local glass_itemstring = "default:glass" local glass_itemstring = "default:glass"
local obsidian_itemstring = "default:obsidian" local obsidian_itemstring = "default:obsidian"
if why.mineclone then if why.mcl then
glass_itemstring = "mcl_core:glass" glass_itemstring = "mcl_core:glass"
obsidian_itemstring = "mcl_core:obsidian" obsidian_itemstring = "mcl_core:obsidian"
end end
@ -15,7 +15,7 @@ for i, itemstring in ipairs(wool_list.wool) do
minetest.override_item(itemstring, {groups = groups}) minetest.override_item(itemstring, {groups = groups})
end -- Intentionally not making it prevent fall damage :D end -- Intentionally not making it prevent fall damage :D
if why.mineclone then if why.mcl then
-------Sunnier sunflowers------- -------Sunnier sunflowers-------
minetest.override_item("mcl_flowers:sunflower_top", { minetest.override_item("mcl_flowers:sunflower_top", {
light_source = 14 light_source = 14
@ -41,8 +41,6 @@ end
-------Craftable barriers------- -------Craftable barriers-------
minetest.register_node("small_why_things:craftable_barrier", { minetest.register_node("small_why_things:craftable_barrier", {
description = "Craftable Barrier", description = "Craftable Barrier",
_doc_items_longdesc = "Barriers are invisible walkable blocks. They are used to create boundaries of adventure maps and the like. Monsters and animals won't appear on barriers, and fences do not connect to barriers. Other blocks can be built on barriers like on any other block.",
_doc_items_usagehelp = "When you hold a barrier in hand, you reveal all placed barriers in a short distance around you.",
drawtype = "airlike", drawtype = "airlike",
paramtype = "light", paramtype = "light",
inventory_image = "small_why_things_craftable_barrier.png^[colorize:#FFFF00:127", inventory_image = "small_why_things_craftable_barrier.png^[colorize:#FFFF00:127",
@ -80,7 +78,9 @@ minetest.register_craft({
minetest.register_globalstep(function() --I wish there was a way to unregister the MineClone function. minetest.register_globalstep(function() --I wish there was a way to unregister the MineClone function.
for _,player in pairs(minetest.get_connected_players()) do for _,player in pairs(minetest.get_connected_players()) do
local wi = player:get_wielded_item():get_name() local wi = player:get_wielded_item():get_name()
if wi == "mcl_core:barrier" or wi == "mcl_core:realm_barrier" or wi == "small_why_things:craftable_barrier" or minetest.get_item_group(wi, "light_block") ~= 0 then if wi == "mcl_core:barrier" or wi == "mcl_core:realm_barrier"
or wi == "small_why_things:craftable_barrier"
or minetest.get_item_group(wi, "light_block") ~= 0 then
local pos = vector.round(player:get_pos()) local pos = vector.round(player:get_pos())
local r = 8 local r = 8
local vm = minetest.get_voxel_manip() local vm = minetest.get_voxel_manip()
@ -98,7 +98,9 @@ minetest.register_globalstep(function() --I wish there was a way to unregister t
local light_block_group = minetest.get_item_group(nodename, "light_block") local light_block_group = minetest.get_item_group(nodename, "light_block")
local tex local tex
if nodename == "mcl_core:barrier" or nodename == "small_why_things:craftable_barrier" then if nodename == "mcl_core:barrier" then
tex = "small_why_things_craftable_barrier.png"
elseif nodename == "small_why_things:craftable_barrier" then
tex = "small_why_things_craftable_barrier.png^[colorize:#FFFF00:127" tex = "small_why_things_craftable_barrier.png^[colorize:#FFFF00:127"
elseif nodename == "mcl_core:realm_barrier" then elseif nodename == "mcl_core:realm_barrier" then
tex = "small_why_things_craftable_barrier.png^[colorize:#FF00FF:127" tex = "small_why_things_craftable_barrier.png^[colorize:#FF00FF:127"
@ -121,3 +123,104 @@ minetest.register_globalstep(function() --I wish there was a way to unregister t
end end
end end
end) end)
if why.mcl and mcl_core then
function mcl_core.grow_cactus(pos, node)
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if minetest.get_item_group(name, "sand") ~= 0 then
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "mcl_core:cactus" --[[and height < 4]] do
height = height+1
pos.y = pos.y+1
end
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="mcl_core:cactus"})
end
end
end
function mcl_core.grow_reeds(pos, node)
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if minetest.get_item_group(name, "soil_sugarcane") ~= 0 then
if minetest.find_node_near(pos, 1, {"group:water"}) == nil
and minetest.find_node_near(pos, 1, {"group:frosted_ice"}) == nil then
return
end
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "mcl_core:reeds" --[[and height < 3]] do
height = height+1
pos.y = pos.y+1
end
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="mcl_core:reeds"})
end
end
end
if mcl_bamboo then
function mcl_bamboo.grow(pos)
local bottom = mcl_util.traverse_tower(pos,-1)
local top, _ = mcl_util.traverse_tower(bottom,1)
local node = minetest.get_node(pos)
if minetest.get_node(vector.offset(top,0,1,0)).name ~= "air" then return end
minetest.set_node(vector.offset(top,0,1,0),node)
end
end
else
function default.grow_cactus(pos, node)
if node.param2 >= 4 then
return
end
pos.y = pos.y - 1
if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then
return
end
pos.y = pos.y + 1
local height = 0
while node.name == "default:cactus" do
height = height + 1
pos.y = pos.y + 1
node = minetest.get_node(pos)
end
if node.name ~= "air" then
return
end
if minetest.get_node_light(pos) < 13 then
return
end
minetest.set_node(pos, {name = "default:cactus"})
return true
end
function default.grow_papyrus(pos, node)
pos.y = pos.y - 1
local name = minetest.get_node(pos).name
if name ~= "default:dirt" and
name ~= "default:dirt_with_grass" and
name ~= "default:dirt_with_dry_grass" and
name ~= "default:dirt_with_rainforest_litter" and
name ~= "default:dry_dirt" and
name ~= "default:dry_dirt_with_dry_grass" then
return
end
if not minetest.find_node_near(pos, 3, {"group:water"}) then
return
end
pos.y = pos.y + 1
local height = 0
while node.name == "default:papyrus" do
height = height + 1
pos.y = pos.y + 1
node = minetest.get_node(pos)
end
if node.name ~= "air" then
return
end
if minetest.get_node_light(pos) < 13 then
return
end
minetest.set_node(pos, {name = "default:papyrus"})
return true
end
end

View File

@ -2,4 +2,4 @@ name = small_why_things
title = Small "Why?" Things title = Small "Why?" Things
description = A few small things (bouncy wool, sunnier sunflowers, and craftable barriers) description = A few small things (bouncy wool, sunnier sunflowers, and craftable barriers)
depends = why_init, get_group_items depends = why_init, get_group_items
optional_depends = default, wool, flowers, mcl_core, mcl_wool, mcl_flowers optional_depends = default, wool, flowers, mcl_core, mcl_wool, mcl_flowers, mcl_bamboo

View File

@ -1,7 +1,7 @@
local sound_mod = default local sound_mod = default
local center_itemstring = "wool:black" local center_itemstring = "wool:black"
local copper_itemstring = "default:copper_ingot" local copper_itemstring = "default:copper_ingot"
if why.mineclone then if why.mcl then
sound_mod = mcl_sounds sound_mod = mcl_sounds
center_itemstring = "mcl_colorblocks:concrete_black" center_itemstring = "mcl_colorblocks:concrete_black"
copper_itemstring = "mcl_copper:copper_ingot" copper_itemstring = "mcl_copper:copper_ingot"
@ -10,7 +10,7 @@ end
local sound_machine_context = {} local sound_machine_context = {}
local sound_machine_buttons local sound_machine_buttons
if why.mineclone then if why.mcl then
sound_machine_buttons = { sound_machine_buttons = {
{{sound = "tnt_ignite", name = "Ignite TNT"}, {sound = "tnt_explode", name = "Explosion"}, {sound = "mcl_bows_bow_shoot", name = "Bow Shot",}}, {{sound = "tnt_ignite", name = "Ignite TNT"}, {sound = "tnt_explode", name = "Explosion"}, {sound = "mcl_bows_bow_shoot", name = "Bow Shot",}},
{{sound = "mcl_experience_level_up", name = "XP Level Up", gain = 0.6}, {sound = "player_damage", name = "Player Damage"}, {sound = "awards_got_generic", name = "Achievement",}}, {{sound = "mcl_experience_level_up", name = "XP Level Up", gain = 0.6}, {sound = "player_damage", name = "Player Damage"}, {sound = "awards_got_generic", name = "Achievement",}},
@ -62,8 +62,8 @@ local function show_portable_formspec(itemstack, player, pointed_thing)
end end
end end
end end
local custom_sound = player:get_attribute("sound_machine_custom_sound") or "tnt_ignite" local custom_sound = player:get_meta():get_string("sound_machine_custom_sound") or "tnt_ignite"
local pitch = player:get_attribute("sound_machine_pitch") or 1.0 local pitch = player:get_meta():get_string("sound_machine_pitch") or 1.0
local formspec = generate_formspec(custom_sound, pitch) local formspec = generate_formspec(custom_sound, pitch)
minetest.show_formspec(player:get_player_name(), "sound_machine_portable_sound_machine", formspec) minetest.show_formspec(player:get_player_name(), "sound_machine_portable_sound_machine", formspec)
@ -81,12 +81,18 @@ end
local function sound_machine_play(pos) local function sound_machine_play(pos)
local last_sound = minetest.get_meta(pos):get_string("sound_machine_last_sound") local last_sound = minetest.get_meta(pos):get_string("sound_machine_last_sound")
--minetest.log(last_sound) --minetest.log(last_sound)
local pitch = tonumber(minetest.get_meta(pos):get_string("sound_machine_pitch")) local pitch = tonumber(minetest.get_meta(pos):get_string("sound_machine_pitch") or 1)
minetest.sound_play({name = last_sound, pitch = pitch}, { pos = pos, max_hear_distance = 20}) minetest.sound_play({name = last_sound, pitch = pitch}, { pos = pos, max_hear_distance = 20})
end end
minetest.register_tool("sound_machine:portable_sound_machine", { minetest.register_tool("sound_machine:portable_sound_machine", {
description = "Portable Sound Machine", description = "Portable Sound Machine",
on_use = function(itemstack, player, pointed_thing)
local pitch = tonumber(player:get_meta():get_string("sound_machine_pitch") or 1)
local sound = player:get_meta():get_string("sound_machine_custom_sound") or "tnt_ignite"
minetest.sound_play({name = sound, pitch = pitch}, {pos = player:get_pos(), max_hear_distance = 20})
player:get_meta():set_string("sound_machine_custom_sound", sound)
end,
on_place = show_portable_formspec, on_place = show_portable_formspec,
on_secondary_use = show_portable_formspec, on_secondary_use = show_portable_formspec,
inventory_image = "sound_machine_sound_machine.png", inventory_image = "sound_machine_sound_machine.png",
@ -133,21 +139,24 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if (fields.key_enter_field == "pitch" or fields.pitch_button) and fields.pitch then if (fields.key_enter_field == "pitch" or fields.pitch_button) and fields.pitch then
if tonumber(fields.pitch) then if tonumber(fields.pitch) then
player:set_attribute("sound_machine_pitch", fields.pitch) player:get_meta():set_string("sound_machine_pitch", fields.pitch)
end end
end end
if (fields.key_enter_field == "custom_sound" or fields.custom_sound_button) and fields.custom_sound then if (fields.key_enter_field == "custom_sound" or fields.custom_sound_button) and fields.custom_sound then
local pitch = tonumber(player:get_attribute("sound_machine_pitch")) or 1 local pitch = tonumber(player:get_meta():get_string("sound_machine_pitch") or 1)
minetest.sound_play({name = fields.custom_sound, pitch = pitch}, {pos = player_pos, max_hear_distance = 20}) minetest.sound_play({name = fields.custom_sound, pitch = pitch}, {pos = player_pos, max_hear_distance = 20})
player:set_attribute("sound_machine_custom_sound", fields.custom_sound) player:get_meta():set_string("sound_machine_custom_sound", fields.custom_sound)
show_portable_formspec(nil, player)
end end
for field, data in pairs(fields) do for field, data in pairs(fields) do
local _, _, row, column = string.find(field, "^(%d+)_(%d+)$") local _, _, row, column = string.find(field, "^(%d+)_(%d+)$") -- 2 numbers separated by an underscore (and nothing else)
if row and column then if row and column then
local sound_data = sound_machine_buttons[tonumber(row)][tonumber(column)] local sound_data = sound_machine_buttons[tonumber(row)][tonumber(column)]
local pitch = tonumber(player:get_attribute("sound_machine_pitch")) or 1 local pitch = tonumber(player:get_meta():get_string("sound_machine_pitch") or 1)
minetest.sound_play({name = sound_data.sound, gain = sound_data.gain, pitch = pitch}, { pos = player_pos, max_hear_distance = 20}) minetest.sound_play({name = sound_data.sound, gain = sound_data.gain, pitch = pitch}, { pos = player_pos, max_hear_distance = 20})
player:get_meta():set_string("sound_machine_custom_sound", sound_data.sound)
show_portable_formspec(nil, player)
return return
end end
end end
@ -171,14 +180,15 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
minetest.get_meta(pos):set_string("sound_machine_last_sound", fields.custom_sound) minetest.get_meta(pos):set_string("sound_machine_last_sound", fields.custom_sound)
end end
sound_machine_play(pos) sound_machine_play(pos)
show_sound_machine_formspec(pos, nil, player)
end end
for field, data in pairs(fields) do for field, data in pairs(fields) do
local _, _, row, column = string.find(field, "^(%d+)_(%d+)$") local _, _, row, column = string.find(field, "^(%d+)_(%d+)$") -- 2 numbers separated by an underscore (and nothing else)
if row and column then if row and column then
local sound_data = sound_machine_buttons[tonumber(row)][tonumber(column)] local sound_data = sound_machine_buttons[tonumber(row)][tonumber(column)]
local pitch = tonumber(minetest.get_meta(pos):get_string("sound_machine_pitch")) or 1
minetest.get_meta(pos):set_string("sound_machine_last_sound", sound_data.sound) minetest.get_meta(pos):set_string("sound_machine_last_sound", sound_data.sound)
sound_machine_play(pos) sound_machine_play(pos)
show_sound_machine_formspec(pos, nil, player)
return return
end end
end end

View File

@ -1,9 +1,9 @@
local sound_mod = default local sound_mod = default
local water_itemstring = "bucket:bucket_water" local water_itemstring = "bucket:bucket_water"
local sticky_block_sounds local sticky_block_sounds
if why.mineclone then if why.mcl then
sound_mod = mcl_sounds sound_mod = mcl_sounds
local water_itemstring = "mcl_buckets:bucket_water" water_itemstring = "mcl_buckets:bucket_water"
sticky_block_sounds = { sticky_block_sounds = {
dug = {name = "slimenodes_dug", gain = 0.6}, dug = {name = "slimenodes_dug", gain = 0.6},
place = {name = "slimenodes_place", gain = 0.6}, place = {name = "slimenodes_place", gain = 0.6},
@ -103,7 +103,7 @@ minetest.register_node("sticky_things:glue_source", {
_mcl_hardness = -1, _mcl_hardness = -1,
}) })
if why.mineclone then if why.mcl then
mcl_buckets.register_liquid({ mcl_buckets.register_liquid({
source_place = "sticky_things:glue_source", source_place = "sticky_things:glue_source",
source_take = {"sticky_things:glue_source"}, source_take = {"sticky_things:glue_source"},
@ -125,7 +125,7 @@ minetest.register_craft({
recipe = {"group:flower", water_itemstring}, recipe = {"group:flower", water_itemstring},
}) })
if why.mineclone then if why.mcl then
minetest.register_node("sticky_things:sticky_block", { minetest.register_node("sticky_things:sticky_block", {
description = "Sticky Block", description = "Sticky Block",
_mcl_hardness = 3, _mcl_hardness = 3,
@ -138,21 +138,19 @@ if why.mineclone then
-- who am I? -- who am I?
local name = player:get_player_name() local name = player:get_player_name()
-- where am I?
local pos = player:get_pos()
-- what is around me? -- what is around me?
local node_stand = mcl_playerinfo[name].node_stand local node_stand = mcl_playerinfo[name].node_stand
local node_stand_below = mcl_playerinfo[name].node_stand_below local node_stand_below = mcl_playerinfo[name].node_stand_below
-- Standing on sticky block? If so, walk slower -- Standing on sticky block? If so, walk slower
if node_stand == "sticky_things:sticky_block" or (node_stand == "air" and node_stand_below == "sticky_things:sticky_block") then if node_stand == "sticky_things:sticky_block"
or (node_stand == "air" and node_stand_below == "sticky_things:sticky_block") then
playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:surface", 0.05) playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:surface", 0.05)
end end
end end
end) end)
-- if why.mineclone then -- if why.mcl then
minetest.register_craft({ minetest.register_craft({
output = "sticky_things:sticky_block", output = "sticky_things:sticky_block",
type = "shapeless", type = "shapeless",

View File

@ -2,7 +2,7 @@ local sound_mod = default
local gold_itemstring = "default:gold_ingot" local gold_itemstring = "default:gold_ingot"
local water_itemstring = "bucket:bucket_water" local water_itemstring = "bucket:bucket_water"
local stick_itemstring = "default:stick" local stick_itemstring = "default:stick"
if why.mineclone then if why.mcl then
sound_mod = mcl_sounds sound_mod = mcl_sounds
gold_itemstring = "mcl_core:gold_ingot" gold_itemstring = "mcl_core:gold_ingot"
water_itemstring = "mcl_buckets:bucket_water" water_itemstring = "mcl_buckets:bucket_water"
@ -25,7 +25,7 @@ minetest.register_node("useful_green_potatoes:useful_green_potato", {
}) })
local y_max = 31000 local y_max = 31000
if why.mineclone then y_max = mcl_vars.mg_overworld_max end if why.mcl then y_max = mcl_vars.mg_overworld_max end
minetest.register_decoration({ minetest.register_decoration({
decoration = "useful_green_potatoes:useful_green_potato", decoration = "useful_green_potatoes:useful_green_potato",
@ -124,8 +124,6 @@ minetest.register_globalstep(function(dtime)
if time < 0.5 then return end if time < 0.5 then return end
time = 0 time = 0
for _, player in pairs(minetest.get_connected_players()) do for _, player in pairs(minetest.get_connected_players()) do
-- who am I?
local name = player:get_player_name()
-- where am I? -- where am I?
local pos = player:get_pos() local pos = player:get_pos()
@ -137,12 +135,12 @@ minetest.register_globalstep(function(dtime)
near = minetest.find_node_near({x=pos.x, y=pos.y-1, z=pos.z}, 1, itemstring) near = minetest.find_node_near({x=pos.x, y=pos.y-1, z=pos.z}, 1, itemstring)
end end
if near then if near then
-- Am I touching the solid liquid source? If so, it hurts -- Am I touching the useful green potato ingot block? If so, it hurts
local dist = vector.distance(pos, near) local dist = vector.distance(pos, near)
local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near) local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near)
if dist < 1.1 or dist_feet < 1.1 then if dist < 1.1 or dist_feet < 1.1 then
if player:get_hp() > 0 then if player:get_hp() > 0 then
if why.mineclone then if why.mcl then
mcl_util.deal_damage(player, 3, {type = "generic"}) mcl_util.deal_damage(player, 3, {type = "generic"})
else else
player:set_hp(player:get_hp() - 3) player:set_hp(player:get_hp() - 3)
@ -165,7 +163,7 @@ minetest.register_craft({
local gapple_hunger_restore = minetest.item_eat(6) local gapple_hunger_restore = minetest.item_eat(6)
local function eat_gapple(itemstack, player, pointed_thing) local function eat_gapple(itemstack, player, pointed_thing)
if why.mineclone then if why.mcl then
local regen_duration, absorbtion_factor = 5, 1 local regen_duration, absorbtion_factor = 5, 1
--TODO: Absorbtion --TODO: Absorbtion
mcl_potions.regeneration_func(player, 2, regen_duration) mcl_potions.regeneration_func(player, 2, regen_duration)
@ -253,14 +251,6 @@ minetest.register_node("useful_green_potatoes:useful_green_potato_liquid_flowing
minetest.register_node("useful_green_potatoes:useful_green_potato_liquid_source", { minetest.register_node("useful_green_potatoes:useful_green_potato_liquid_source", {
description = "Useful Green Potato Liquid Source", description = "Useful Green Potato Liquid Source",
_doc_items_entry_name = "Useful Green Potato Liquid",
_doc_items_longdesc =
"Water is abundant in oceans and also appears in a few springs in the ground. You can swim easily in water, but you need to catch your breath from time to time.".."\n\n"..
"Water interacts with lava in various ways:".."\n"..
"• When water is directly above or horizontally next to a lava source, the lava turns into obsidian.".."\n"..
"• When flowing water touches flowing lava either from above or horizontally, the lava turns into cobblestone.".."\n"..
"• When water is directly below lava, the water turns into stone.".."\n",
_doc_items_hidden = false,
drawtype = "liquid", drawtype = "liquid",
waving = 3, waving = 3,
tiles = { tiles = {
@ -297,7 +287,7 @@ minetest.register_node("useful_green_potatoes:useful_green_potato_liquid_source"
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1, _mcl_hardness = -1,
}) })
if why.mineclone then if why.mcl then
mcl_buckets.register_liquid({ mcl_buckets.register_liquid({
source_place = "useful_green_potatoes:useful_green_potato_liquid_source", source_place = "useful_green_potatoes:useful_green_potato_liquid_source",
source_take = {"useful_green_potatoes:useful_green_potato_liquid_source"}, source_take = {"useful_green_potatoes:useful_green_potato_liquid_source"},
@ -321,11 +311,17 @@ minetest.register_craft({
}) })
---------------------USELESS BEAN TOOLS/ARMOR------------------------ ---------------------USELESS BEAN TOOLS/ARMOR------------------------
if why.mineclone or minetest.get_modpath("3d_armor") then if why.mcl or minetest.get_modpath("3d_armor") then
if why.mineclone then if why.mcl then
mcl_armor.register_set({ mcl_armor.register_set({
name = "useful_green_potato", name = "useful_green_potato",
description = "Useful Green Potato", description = "Useful Green Potato",
descriptions = why.mineclonia and {
head = "Useful Green Potato Helmet",
torso = "Useful Green Potato Chestplate",
legs = "Useful Green Potato Leggings",
feet = "Useful Green Potato Boots",
},
durability = 240, durability = 240,
points = { points = {
head = 2, head = 2,
@ -352,7 +348,7 @@ if why.mineclone or minetest.get_modpath("3d_armor") then
end end
else else
-- I'm lazy; they're identical. -- I'm lazy; they're identical.
for type, name in pairs({head = "Helmet", torso = "Chestplate", legs = "Leggings", feet = "Boots"}) do for type, name in pairs({head = "Helmet", torso = "Chestplate", legs = "Leggings", feet = "Boots", shield = "Shield"}) do
armor:register_armor("useful_green_potatoes:"..name:lower().."_useful_green_potato", { armor:register_armor("useful_green_potatoes:"..name:lower().."_useful_green_potato", {
description = "Useful Green Potato "..name, description = "Useful Green Potato "..name,
texture = "useless_beans_"..name:lower().."_useless_bean.png", texture = "useless_beans_"..name:lower().."_useless_bean.png",
@ -393,12 +389,20 @@ if why.mineclone or minetest.get_modpath("3d_armor") then
{p, "",p} {p, "",p}
} }
}) })
minetest.register_craft({
output = "useful_green_potatoes:shield_useful_green_potato",
recipe = {
{p, p,p},
{p, p,p},
{"", p,""},
}
})
end end
end end
for name, long_name in pairs({pick = "Pickaxe", axe = "Axe", hoe = "Hoe", sword = "Sword", shovel = "Shovel"}) do for name, long_name in pairs({pick = "Pickaxe", axe = "Axe", hoe = "Hoe", sword = "Sword", shovel = "Shovel"}) do
local def local def
if why.mineclone then if why.mcl then
local mod = "mcl_tools" local mod = "mcl_tools"
if name == "hoe" then mod = "mcl_farming" end if name == "hoe" then mod = "mcl_farming" end
def = table.copy(minetest.registered_items[mod..":"..name.."_iron"]) def = table.copy(minetest.registered_items[mod..":"..name.."_iron"])

View File

@ -2,7 +2,7 @@ local sound_mod = default
local gold_itemstring = "default:gold_ingot" local gold_itemstring = "default:gold_ingot"
local water_itemstring = "bucket:bucket_water" local water_itemstring = "bucket:bucket_water"
local stick_itemstring = "default:stick" local stick_itemstring = "default:stick"
if why.mineclone then if why.mcl then
sound_mod = mcl_sounds sound_mod = mcl_sounds
gold_itemstring = "mcl_core:gold_ingot" gold_itemstring = "mcl_core:gold_ingot"
water_itemstring = "mcl_buckets:bucket_water" water_itemstring = "mcl_buckets:bucket_water"
@ -120,7 +120,7 @@ minetest.register_craft({
} }
}) })
if why.mineclone then if why.mcl then
minetest.register_node("useless_beans:useless_bean_gold_enchanted", { minetest.register_node("useless_beans:useless_bean_gold_enchanted", {
description = "Enchanted Golden Useless Bean", description = "Enchanted Golden Useless Bean",
drawtype = "plantlike", drawtype = "plantlike",
@ -242,7 +242,7 @@ minetest.register_node("useless_beans:useless_bean_liquid_source", {
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1, _mcl_hardness = -1,
}) })
if why.mineclone then if why.mcl then
mcl_buckets.register_liquid({ mcl_buckets.register_liquid({
source_place = "useless_beans:useless_bean_liquid_source", source_place = "useless_beans:useless_bean_liquid_source",
source_take = {"useless_beans:useless_bean_liquid_source"}, source_take = {"useless_beans:useless_bean_liquid_source"},
@ -266,11 +266,17 @@ minetest.register_craft({
}) })
---------------------USELESS BEAN TOOLS/ARMOR------------------------ ---------------------USELESS BEAN TOOLS/ARMOR------------------------
if why.mineclone or minetest.get_modpath("3d_armor") then if why.mcl or minetest.get_modpath("3d_armor") then
if why.mineclone then if why.mcl then
mcl_armor.register_set({ mcl_armor.register_set({
name = "useless_bean", name = "useless_bean",
description = "Useless Bean", description = "Useless Bean",
descriptions = why.mineclonia and {
head = "Useless Bean Helmet",
torso = "Useless Bean Chestplate",
legs = "Useless Bean Leggings",
feet = "Useless Bean Boots",
},
durability = 0, durability = 0,
points = { points = {
head = 0, head = 0,
@ -310,7 +316,6 @@ if why.mineclone or minetest.get_modpath("3d_armor") then
{b, b, b}, {b, b, b},
} }
}) })
local b = "useless_beans:useless_bean"
minetest.register_craft({ minetest.register_craft({
output = "useless_beans:leggings_useless_bean", output = "useless_beans:leggings_useless_bean",
recipe = { recipe = {
@ -319,7 +324,6 @@ if why.mineclone or minetest.get_modpath("3d_armor") then
{b, "",b}, {b, "",b},
} }
}) })
local b = "useless_beans:useless_bean"
minetest.register_craft({ minetest.register_craft({
output = "useless_beans:boots_useless_bean", output = "useless_beans:boots_useless_bean",
recipe = { recipe = {
@ -349,7 +353,7 @@ if why.mineclone or minetest.get_modpath("3d_armor") then
end end
local bean_helmet_base_def = {} local bean_helmet_base_def = {}
if why.mineclone then if why.mcl then
--bean_helmet_base_def.on_secondary_use = mcl_armor.equip_on_use --bean_helmet_base_def.on_secondary_use = mcl_armor.equip_on_use
bean_helmet_base_def._on_equip = add_bean_hud bean_helmet_base_def._on_equip = add_bean_hud
bean_helmet_base_def._on_unequip = remove_bean_hud bean_helmet_base_def._on_unequip = remove_bean_hud
@ -361,7 +365,7 @@ if why.mineclone or minetest.get_modpath("3d_armor") then
minetest.override_item("useless_beans:helmet_useless_bean", bean_helmet_base_def) minetest.override_item("useless_beans:helmet_useless_bean", bean_helmet_base_def)
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
if why.mineclone then if why.mcl then
if player:get_inventory():get_stack("armor", 2):get_name() == "useless_beans:helmet_useless_bean" then if player:get_inventory():get_stack("armor", 2):get_name() == "useless_beans:helmet_useless_bean" then
add_bean_hud(player) add_bean_hud(player)
end end
@ -378,7 +382,7 @@ if why.mineclone or minetest.get_modpath("3d_armor") then
end end
end) end)
minetest.register_on_dieplayer(function(player) minetest.register_on_dieplayer(function(player)
if why.mineclone then if why.mcl then
if not minetest.settings:get_bool("mcl_keepInventory") then if not minetest.settings:get_bool("mcl_keepInventory") then
remove_bean_hud(player) remove_bean_hud(player)
end end

View File

@ -1,7 +1,9 @@
why = {} why = {}
why.mineclone = minetest.get_modpath("mcl_core") why.mcl = minetest.get_modpath("mcl_core")
why.mineclonia = minetest.get_game_info().id == "mineclonia"
-- All Why mods that add items/nodes should be in this list.
local mod_list = { local mod_list = {
"fake_liquids", "fake_liquids",
"flying_sausage", "flying_sausage",
@ -18,8 +20,8 @@ local mod_list = {
} }
function why.inventory_formspec(x,y) function why.inventory_formspec(x,y)
local formspec = "" local formspec
if why.mineclone then if why.mcl then
formspec = "list[current_player;main;"..tostring(x)..","..tostring(y)..";9,3;9]".. formspec = "list[current_player;main;"..tostring(x)..","..tostring(y)..";9,3;9]"..
mcl_formspec.get_itemslot_bg(x,y,9,3).. mcl_formspec.get_itemslot_bg(x,y,9,3)..
"list[current_player;main;"..tostring(x)..","..tostring(y+3.25)..";9,1]".. "list[current_player;main;"..tostring(x)..","..tostring(y+3.25)..";9,1]"..
@ -31,7 +33,7 @@ function why.inventory_formspec(x,y)
return formspec return formspec
end end
if why.mineclone then if why.mcl then
for _, mod in ipairs(mod_list) do for _, mod in ipairs(mod_list) do
mcl_item_id.set_mod_namespace(mod, "why") mcl_item_id.set_mod_namespace(mod, "why")
end end

View File

@ -1,3 +1,3 @@
name = why_init name = why_init
description = Creates `why` global table and `why.mineclone`, a boolean set based on whether MineClone2 is used. description = Creates `why` global table and `why.mcl`, a boolean set based on whether MineClone2 is used.
optional_depends = mcl_item_id, mcl_core, default optional_depends = mcl_item_id, mcl_core, default

BIN
why_schematic/Why.mts Normal file

Binary file not shown.

20
why_schematic/init.lua Normal file
View File

@ -0,0 +1,20 @@
minetest.register_decoration({minetest.register_decoration({
deco_type = "schematic",
place_on = {"group:sand", "group:soil", "mcl_mud:mud"},
sidelen = 16,
noise_params = {
offset = 0.0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 2020,
octaves = 3,
persist = 0.6
},
y_min = -1,
y_max = 30000,
schematic = minetest.get_modpath("why_schematic").."/why.mts",
rotation = "random",
height = 1,
flags = "all_floors, liquid_surface, force_placement"
})
})

3
why_schematic/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = why_schematic
title = Why Schematic
depends = why_init, useless_beans