Compare commits

..

2 Commits

Author SHA1 Message Date
SmokeyDope e661de13f1 upload weathered stone texture 2024-05-01 00:11:44 +00:00
SmokeyDope c33f583276 Upload files to "mods/ITEMS/mcl_weathered_nodes" 2024-05-01 00:10:54 +00:00
50 changed files with 172 additions and 542 deletions

View File

@ -6,6 +6,9 @@ local pool = {}
local tick = false
minetest.register_on_joinplayer(function(player)
pool[player:get_player_name()] = 0
end)
@ -169,17 +172,17 @@ minetest.register_globalstep(function(_)
local pos = player:get_pos()
if tick == true and (pool[name] or 0) > 0 then
if tick == true and pool[name] > 0 then
minetest.sound_play("item_drop_pickup", {
pos = pos,
gain = 0.3,
max_hear_distance = 16,
pitch = math.random(70, 110) / 100
})
if (pool[name] or 0) > 6 then
if pool[name] > 6 then
pool[name] = 6
else
pool[name] = (pool[name] or 1) - 1
pool[name] = pool[name] - 1
end
end

View File

@ -374,7 +374,7 @@ function mcl_mobs.register_arrow(name, def)
rotate = def.rotate,
on_punch = def.on_punch or function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)
local vel = self.object:get_velocity():length()
self.object:set_velocity(dir * vel)
self.object:set_velocity({x=dir.x * vel, y=dir.y * vel, z=dir.z * vel})
self._puncher = puncher
end,
collisionbox = def.collisionbox or {0, 0, 0, 0, 0, 0},

View File

@ -87,8 +87,7 @@ function mob_class:check_item_pickup()
end
if self.pick_up then
for k,v in pairs(self.pick_up) do
local itemstack = ItemStack(l.itemstring)
if not player_near(p) and self.on_pick_up and itemstack:get_name():find(v) then
if not player_near(p) and self.on_pick_up and l.itemstring:find(v) then
local r = self.on_pick_up(self,l)
if r and r.is_empty and not r:is_empty() then
l.itemstring = r:to_string()

View File

@ -126,14 +126,13 @@ mcl_mobs.register_arrow("mobs_mc:fireball", {
end,
hit_mob = function(self, mob)
local name = mob:get_luaentity().name
mob:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 6},
}, nil)
mcl_mobs.mob_class.boom(self,self.object:get_pos(), 1, true)
local ent = mob:get_luaentity()
if (not ent or ent.health <= 0) and self._puncher and name == "mobs_mc:ghast" then
if not ent or ent.health <= 0 then
awards.unlock(self._puncher:get_player_name(), "mcl:fireball_redir_serv")
end
end,

View File

@ -122,10 +122,10 @@ local horse = {
stand_speed = 25,
stand_start = 0,
stand_end = 0,
walk_speed = 100,
walk_speed = 25,
walk_start = 0,
walk_end = 40,
run_speed = 200,
run_speed = 60,
run_start = 0,
run_end = 40,
},
@ -543,6 +543,11 @@ donkey.description = S("Donkey")
donkey.textures = {{"blank.png", "mobs_mc_donkey.png", "blank.png"}}
donkey.spawn_in_group = 3
donkey.spawn_in_group_min = 1
donkey.animation = {
speed_normal = 25,
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40,
}
donkey.sounds = {
random = "mobs_mc_donkey_random",
damage = "mobs_mc_donkey_hurt",

View File

@ -106,31 +106,6 @@ local item_lists = {
"craftpreview",
}
local function init_data(name)
player_data[name] = {
filter = "",
pagenum = 1,
iX = sfinv_only and 8 or DEFAULT_SIZE,
items = init_items,
items_raw = init_items,
lang_code = M.get_player_information(name).lang_code or 'en',
}
end
local function get_player_data(name)
-- If the data alrady exists, use it
local data = player_data[name]
if data then return data end
-- Initialize player data if it doesn't exist
init_data(name)
local player = minetest.get_player_by_name(name)
local meta = player:get_meta()
local data = player_data[name]
data.inv_items = deserialize(meta:get_string("inv_items")) or {}
return data
end
local function table_merge(t, t2)
t, t2 = t or {}, t2 or {}
local c = #t
@ -649,7 +624,7 @@ local function get_recipe_fs(data, iY)
end
local function make_formspec(name)
local data = get_player_data(name)
local data = player_data[name]
local iY = sfinv_only and 4 or data.iX - 5
local ipp = data.iX * iY
@ -856,6 +831,17 @@ local function get_inv_items(player)
return inv_items
end
local function init_data(name)
player_data[name] = {
filter = "",
pagenum = 1,
iX = sfinv_only and 8 or DEFAULT_SIZE,
items = init_items,
items_raw = init_items,
lang_code = M.get_player_information(name).lang_code or 'en',
}
end
local function reset_data(data)
data.filter = ""
data.pagenum = 1
@ -891,7 +877,7 @@ end
local function on_receive_fields(player, fields)
local name = player:get_player_name()
local data = get_player_data(name)
local data = player_data[name]
for elem_name, def in pairs(formspec_elements) do
if fields[elem_name] and def.action then
@ -995,7 +981,7 @@ if sfinv_only then
on_enter = function(self, player, context)
if next(recipe_filters) then
local name = player:get_player_name()
local data = get_player_data(name)
local data = player_data[name]
data.items_raw = get_filtered_items(player)
search(data)
@ -1019,7 +1005,7 @@ else
local name = user:get_player_name()
if next(recipe_filters) then
local data = get_player_data(name)
local data = player_data[name]
data.items_raw = get_filtered_items(user)
search(data)
end
@ -1065,7 +1051,7 @@ if progressive_mode then
local function progressive_filter(recipes, player)
local name = player:get_player_name()
local data = get_player_data(name)
local data = player_data[name]
if #data.inv_items == 0 then
return {}
@ -1090,7 +1076,7 @@ if progressive_mode then
for i = 1, #players do
local player = players[i]
local name = player:get_player_name()
local data = get_player_data(name)
local data = player_data[name]
local inv_items = get_inv_items(player)
local diff = table_diff(inv_items, data.inv_items)
@ -1109,7 +1095,12 @@ if progressive_mode then
mcl_craftguide.add_recipe_filter("Default progressive filter", progressive_filter)
M.register_on_joinplayer(function(player)
get_player_data(player:get_player_name())
local name = player:get_player_name()
init_data(name)
local meta = player:get_meta()
local data = player_data[name]
data.inv_items = deserialize(meta:get_string("inv_items")) or {}
end)
local function save_meta(player)
@ -1154,7 +1145,7 @@ end
function mcl_craftguide.show(name)
local player = get_player_by_name(name)
if next(recipe_filters) then
local data = get_player_data(name)
local data = player_data[name]
data.items_raw = get_filtered_items(player)
search(data)
end

View File

@ -36,14 +36,9 @@ function mcl_inventory.register_survival_inventory_tab(def)
end
local player_current_tab = {}
function get_player_tab(player)
local tab = player_current_tab[player] or "main"
player_current_tab[player] = tab
return tab
end
minetest.register_on_joinplayer(function(player, last_login)
get_player_tab(player)
player_current_tab[player] = "main"
end)
minetest.register_on_leaveplayer(function(player, timed_out)
@ -189,7 +184,7 @@ function mcl_inventory.build_survival_formspec(player)
inv:set_width("craft", 2)
inv:set_size("craft", 4)
local tab = get_player_tab(player)
local tab = player_current_tab[player]
local tab_def = nil
@ -218,7 +213,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
for _, d in ipairs(mcl_inventory.registered_survival_inventory_tabs) do
if get_player_tab(player) == d.id and d.access(player) then
if player_current_tab[player] == d.id and d.access(player) then
d.handle(player, fields)
return
end

View File

@ -16,31 +16,19 @@ local function offhand_get_count(player)
return mcl_offhand.get_offhand(player):get_count()
end
local function get_offhand(player)
-- Get offhand data if it already exists
local offhand = mcl_offhand[player]
if offhand then return offhand end
-- Otherwise initialize it
offhand = {
minetest.register_on_joinplayer(function(player, last_login)
mcl_offhand[player] = {
hud = {},
last_wear = offhand_get_wear(player),
last_count = offhand_get_count(player),
}
mcl_offhand[player] = offhand
return offhand
end
minetest.register_on_joinplayer(function(player, last_login)
get_offhand(player)
end)
local function remove_hud(player, hud)
local offhand = get_offhand(player)
local offhand_hud = offhand.hud[hud]
local offhand_hud = mcl_offhand[player].hud[hud]
if offhand_hud then
player:hud_remove(offhand_hud)
offhand.hud[hud] = nil
mcl_offhand[player].hud[hud] = nil
end
end
@ -60,8 +48,7 @@ local function update_wear_bar(player, itemstack)
else
color = {255, 511 - wear_i, 0}
end
local offhand = get_offhand(player)
local wear_bar = offhand.hud.wear_bar
local wear_bar = mcl_offhand[player].hud.wear_bar
player:hud_change(wear_bar, "text", "mcl_wear_bar.png^[colorize:#" .. rgb_to_hex(color[1], color[2], color[3]))
player:hud_change(wear_bar, "scale", {x = 40 * wear_bar_percent, y = 3})
player:hud_change(wear_bar, "offset", {x = -320 - (20 - player:hud_get(wear_bar).scale.x / 2), y = -13})
@ -71,8 +58,7 @@ minetest.register_globalstep(function(dtime)
for _, player in pairs(minetest.get_connected_players()) do
local itemstack = mcl_offhand.get_offhand(player)
local offhand_item = itemstack:get_name()
local offhand = get_offhand(player)
local offhand_hud = offhand.hud
local offhand_hud = mcl_offhand[player].hud
local item = minetest.registered_items[offhand_item]
if offhand_item ~= "" and item then
local item_texture = item.inventory_image .. "^[resize:" .. max_offhand_px .. "x" .. max_offhand_px
@ -159,8 +145,7 @@ minetest.register_globalstep(function(dtime)
end
elseif offhand_hud.slot then
local offhand = get_offhand(player)
for index, _ in pairs(offhand.hud) do
for index, _ in pairs(mcl_offhand[player].hud) do
remove_hud(player, index)
end
end

View File

@ -8,7 +8,7 @@ local is_sp = minetest.is_singleplayer()
local weather_mod = minetest.get_modpath("mcl_weather")
local explosions_mod = minetest.get_modpath("mcl_explosions")
local spawn_mod = minetest.get_modpath("mcl_spawn")
local pos_to_dim = minetest.get_modpath("mcl_worlds") and mcl_worlds.pos_to_dimension or function(pos) return "overworld" end
local worlds_mod = minetest.get_modpath("mcl_worlds")
local function mcl_log (message)
mcl_util.mcl_log (message, "[Beds]")
@ -38,16 +38,6 @@ local function is_night_skip_enabled()
return players_in_bed_setting() <= 100
end
local function players_in_overworld(players)
local count = 0
for _, player in pairs(players) do
if player and pos_to_dim(player:get_pos()) == "overworld" then
count = count +1
end
end
return count
end
local function check_in_beds(players)
if not players then
players = minetest.get_connected_players()
@ -55,7 +45,7 @@ local function check_in_beds(players)
if player_in_bed <= 0 then
return false
end
return players_in_bed_setting() <= (player_in_bed * 100) / players_in_overworld(players)
return players_in_bed_setting() <= (player_in_bed * 100) / #players
end
-- These monsters do not prevent sleep
@ -216,10 +206,10 @@ local function lay_down(player, pos, bed_pos, state, skip)
return true
end
local function update_formspecs(finished, players)
local ges = players_in_overworld(players or minetest.get_connected_players())
local function update_formspecs(finished, ges)
local ges = ges or #minetest.get_connected_players()
local form_n = "size[12,5;true]"
local all_in_bed = ges and players_in_bed_setting() <= (player_in_bed * 100) / ges or 0
local all_in_bed = players_in_bed_setting() <= (player_in_bed * 100) / ges
local night_skip = is_night_skip_enabled()
local button_leave = "button_exit[4,3;4,0.75;leave;"..F(S("Leave bed")).."]"
local button_abort = "button_exit[4,3;4,0.75;leave;"..F(S("Abort sleep")).."]"
@ -359,36 +349,25 @@ function mcl_beds.get_bed_bottom (pos)
return bed_bottom
end
local function recheck_in_beds()
if check_in_beds() then
update_formspecs(is_night_skip_enabled())
mcl_beds.sleep()
end
-- check again (a player can change the dimension)
if player_in_bed > 0 then
update_formspecs(false)
minetest.after(5, recheck_in_beds)
end
end
function mcl_beds.on_rightclick(pos, player, is_top)
-- Anti-Inception: Don't allow to sleep while you're sleeping
if player:get_meta():get_string("mcl_beds:sleeping") == "true" then
return
end
local dim = pos_to_dim(pos)
if dim == "nether" or dim == "end" then
-- Bed goes BOOM in the Nether or End.
local node = minetest.get_node(pos)
local dir = minetest.facedir_to_dir(node.param2)
if worlds_mod then
local dim = mcl_worlds.pos_to_dimension(pos)
if dim == "nether" or dim == "end" then
-- Bed goes BOOM in the Nether or End.
local node = minetest.get_node(pos)
local dir = minetest.facedir_to_dir(node.param2)
minetest.remove_node(pos)
minetest.remove_node(string.sub(node.name, -4) == "_top" and vector.subtract(pos, dir) or vector.add(pos, dir))
if explosions_mod then
mcl_explosions.explode(pos, 5, {drop_chance = 1.0, fire = true})
minetest.remove_node(pos)
minetest.remove_node(string.sub(node.name, -4) == "_top" and vector.subtract(pos, dir) or vector.add(pos, dir))
if explosions_mod then
mcl_explosions.explode(pos, 5, {drop_chance = 1.0, fire = true})
end
return
end
return
end
local name = player:get_player_name()
local ppos = player:get_pos()
@ -406,13 +385,10 @@ function mcl_beds.on_rightclick(pos, player, is_top)
mcl_title.set(player, "actionbar", {text=message, color="white", stay=60})
else -- someone just successfully entered a bed
local connected_players = minetest.get_connected_players()
local ges = players_in_overworld(connected_players)
local sleep_hud_message = S("@1/@2 players currently in bed.", player_in_bed, math.ceil(players_in_bed_setting() * ges / 100))
local sleep_hud_message = S("@1/@2 players currently in bed.", player_in_bed, math.ceil(players_in_bed_setting() * #connected_players / 100))
for _, player in pairs(connected_players) do
-- only send message to players not sleeping and in the "overworld"
if not mcl_beds.player[player:get_player_name()] and pos_to_dim(player:get_pos()) == "overworld" then
-- clear, old message is still being displayed
if mcl_title.params_get(player) then mcl_title.clear(player) end
if not mcl_beds.player[player:get_player_name()] then -- only send message to players not sleeping.
if mcl_title.params_get(player) then mcl_title.clear(player) end -- clear, old message is still being displayed
mcl_title.set(player, "actionbar", {text=sleep_hud_message, color="white", stay=60})
end
end
@ -424,8 +400,13 @@ function mcl_beds.on_rightclick(pos, player, is_top)
update_formspecs(false)
-- skip the night and let all players stand up
if player_in_bed > 0 then
minetest.after(5, recheck_in_beds)
if check_in_beds() then
minetest.after(5, function()
if check_in_beds() then
update_formspecs(is_night_skip_enabled())
mcl_beds.sleep()
end
end)
end
end
@ -452,10 +433,15 @@ minetest.register_on_leaveplayer(function(player)
break
end
end
if player_in_bed > 0 then
minetest.after(5, recheck_in_beds)
if check_in_beds(players) then
minetest.after(5, function()
if check_in_beds() then
update_formspecs(is_night_skip_enabled())
mcl_beds.sleep()
end
end)
end
update_formspecs(false, players)
update_formspecs(false, #players)
end)
local message_rate_limit = tonumber(minetest.settings:get("chat_message_limit_per_10sec")) or 8 --NEVER change this! if this was java, i would've declared it as final

View File

@ -8,60 +8,36 @@ local S = minetest.get_translator(minetest.get_current_modname())
-- Function to allow harvesting honey and honeycomb from the beehive and bee nest.
local honey_harvest = function(pos, node, player, itemstack, pointed_thing)
local inv = player:get_inventory()
local item = player:get_wielded_item()
local shears = minetest.get_item_group(player:get_wielded_item():get_name(), "shears") > 0
local bottle = player:get_wielded_item():get_name() == "mcl_potions:glass_bottle"
local beehive = "mcl_beehives:beehive"
local is_creative = minetest.is_creative_enabled(player:get_player_name())
-- Determine the node name to replace the beehive with if harvest is successful
local beehive = "mcl_beehives:beehive"
if node.name == "mcl_beehives:beehive_5" then
beehive = "mcl_beehives:beehive"
elseif node.name == "mcl_beehives:bee_nest_5" then
beehive = "mcl_beehives:bee_nest"
end
-- Check for a campfire within 5 blocks below the beehive
local campfire_area = vector.offset(pos, 0, -5, 0)
local campfire = minetest.find_nodes_in_area(pos, campfire_area, "group:lit_campfire")
-- Player used a bottle
if item:get_name() == "mcl_potions:glass_bottle" then
if bottle then
local honey = "mcl_honey:honey_bottle"
if inv:room_for_item("main", honey) then
-- Replace the beehive with the version without honey or comb
node.name = beehive
minetest.set_node(pos, node)
-- Give honey bottle and take the empty bottle if survival mode
inv:add_item("main", "mcl_honey:honey_bottle")
if not is_creative then
itemstack:take_item()
end
-- Hurt the player if there was no campfire, or give award if there was
if not campfire[1] then
mcl_util.deal_damage(player, 10)
else
awards.unlock(player:get_player_name(), "mcl:bee_our_guest")
end
if not campfire[1] then mcl_util.deal_damage(player, 10) else awards.unlock(player:get_player_name(), "mcl:bee_our_guest") end
end
-- Player used shears
elseif minetest.get_item_group(item:get_name(), "shears") > 0 then
-- Give honeycomb
elseif shears then
minetest.add_item(pos, "mcl_honey:honeycomb 3")
-- Replace the beehive with the version without honey or comb
node.name = beehive
minetest.set_node(pos, node)
-- Hurt the player if there was no campfire
if not campfire[1] then mcl_util.deal_damage(player, 10) end
-- Add wear to the shears
if not is_creative then
mcl_util.use_item_durability(item, 1)
return item
end
end
end

View File

@ -638,7 +638,7 @@ function mcl_itemframes.create_base_definitions()
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = { dig_immediate = 3, deco_block = 1, dig_by_piston = 1, container = 1, attached_node_facedir = 1 },
groups = { dig_immediate = 3, deco_block = 1, dig_by_piston = 1, container = 1, }, -- attached_node_facedir = 1 }, -- allows for more placement options.
sounds = mcl_sounds.node_sound_defaults(),
node_placement_prediction = "",

View File

@ -251,15 +251,6 @@ local function remove_shield_entity(player, i)
end
end
local function is_node_stack(itemstack)
return itemstack:get_definition().drawtype -- only node's definition table contains element "drawtype"
end
local function is_rmb_conflicting_node(nodename)
local nodedef = minetest.registered_nodes[nodename]
return nodedef.on_rightclick
end
local function handle_blocking(player)
local player_shield = mcl_shields.players[player]
local rmb = player:get_player_control().RMB
@ -275,7 +266,7 @@ local function handle_blocking(player)
local pos = player:get_pos()
if shield_in_hand then
if not_blocking then
minetest.after(0.05, function()
minetest.after(0.25, function()
if (not_blocking or not shield_in_offhand) and shield_in_hand and rmb then
player_shield.blocking = 2
set_shield(player, true, 2)
@ -286,16 +277,11 @@ local function handle_blocking(player)
end
elseif shield_in_offhand then
local pointed_thing = mcl_util.get_pointed_thing(player, true)
local wielded_stack = player:get_wielded_item()
local offhand_can_block = (minetest.get_item_group(wielded_item(player), "bow") ~= 1
and minetest.get_item_group(wielded_item(player), "crossbow") ~= 1)
local offhand_can_block = (wielded_item(player) == "" or not pointed_thing)
and (minetest.get_item_group(wielded_item(player), "bow") ~= 1 and minetest.get_item_group(wielded_item(player), "crossbow") ~= 1)
if pointed_thing and pointed_thing.type == "node" then
local pointed_node = minetest.get_node(pointed_thing.under)
if minetest.get_item_group(pointed_node.name, "container") > 1
or is_rmb_conflicting_node(pointed_node.name)
or is_node_stack(wielded_stack)
then
if minetest.get_item_group(minetest.get_node(pointed_thing.under).name, "container") > 1 then
return
end
end
@ -304,7 +290,7 @@ local function handle_blocking(player)
return
end
if not_blocking then
minetest.after(0.05, function()
minetest.after(0.25, function()
if (not_blocking or not shield_in_hand) and shield_in_offhand and rmb and offhand_can_block then
player_shield.blocking = 1
set_shield(player, true, 1)

View File

@ -0,0 +1,18 @@
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--Weathered Stone
minetest.register_node("mcl_weathered_nodes:weathered_stone", {
description = "Weathered stone",
_doc_items_longdesc = ("Weathered stone is a decorative block that eventually turns into mossy cobblestone"),
_doc_items_hidden = false,
tiles = {"mcl_weathered_nodes_weathered_stone.png"},
is_ground_content = true,
stack_max = 64,
groups = {pickaxey=1, stone=1, building_block=1, oxidizable = 1},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
_mcl_oxidized_variant = "mcl_core:mossycobble",
_mcl_waxed_variant = "mcl_core:stone",
})

View File

@ -0,0 +1,5 @@
name = mcl_weathered_nodes
depends = mcl_core, mcl_copper
description = Adds Weathered nodes
author = SmokeyDope
title = Weathered nodes

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

View File

@ -1,28 +0,0 @@
# ```vl_hollow_logs```
This mod registers hollow logs derived from normal logs.
Hollow logs mostly have a decorative function, but some of them can be used in recipes. Changes may appear soon.
## Functions:
### ```vl_hollow_logs.register_hollow_log(defs)```
This is the function that registers the hollow trunk.
For a hollow log to be registered, the <span style="color:firebrick"> defs </span> parameter must be a table that contains up to 5 values, which are, in this order, the <span style="color:firebrick"> itemstring </span> of the hollow log, the <span style="color:firebrick"> itemstring </span> of the stripped hollow log, the <span style="color:firebrick"> description </span> of the hollow log, the <span style="color:firebrick"> description </span> of the stripped hollow log and, optionally, a <span style="color:turquoise"> boolean </span> to inform whether this trunk is NOT flammable. If the hollow log is defined as flammable, it becomes part of the <span style="color:springgreen"> hollow_log_flammable </span> group, which allows the log to be used as fuel for furnaces and also allows it to be an ingredient for chacoal.
Examples:
```lua
-- Flammable
{"tree", "stripped_oak", "Hollow Oak Log", "Stripped Hollow Oak Log"}
-- Not flammable
{"crimson_hyphae", "stripped_crimson_hyphae", "Hollow Crimson Stem", "Stripped Hollow Crimson Stem", true}
```
### ```vl_hollow_logs.register_craft(material, result)```
This function records the crafting recipe for a hollow log based on its non-hollow variant.
This function also defines a recipe for the stonecutter. The <span style="color:firebrick"> material </span> and <span style="color:firebrick"> result </span> parameters must be, respectively, the <span style="color:firebrick"> complete itemstring </span> of the source material and the (partial) <span style="color:firebrick"> itemstring </span> of the result. See the following examples:
```lua
vl_hollow_logs.register_craft("mcl_core:tree", "tree")
vl_hollow_logs.register_craft("mcl_crimson:stripped_crimson_hyphae", "stripped_crimson_hyphae")
```

View File

@ -1,112 +0,0 @@
local modpath = minetest.get_modpath(minetest.get_current_modname())
local S = minetest.get_translator(minetest.get_current_modname())
vl_hollow_logs = {}
--- Function to register a hollow log. See API.md to learn how to use this function.
---@param defs table {name:string, stripped_name>string, desc:string, stripped_desc:string, not_flammable:boolean|nil}
function vl_hollow_logs.register_hollow_log(defs)
if not defs or #defs < 4 then
error("Incomplete definition provided")
end
for i = 1, 4 do
if type(defs[i]) ~= "string" then
error("defs["..i.."] must be a string")
end
end
if defs[5] and type(defs[5]) ~= "boolean" then
error("defs[5] must be a boolean if present")
end
local modname = minetest.get_current_modname()
if #defs > 5 then
minetest.log("warning", "[vl_hollow_logs] unused vars passed, dumping the table")
minetest.log("warning", "from mod " .. modname .. ": " .. dump(defs))
end
local name = defs[1]
local stripped_name = defs[2]
local desc = defs[3]
local stripped_desc = defs[4]
local collisionbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.375},
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5},
{0.375, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, 0.375, 0.5, 0.5, 0.5},
}
}
local groups = {axey = 1, building_block = 1, handy = 1, hollow_log = 1}
if not defs[5] then
groups = table.insert(groups, {fire_encouragement = 5, fire_flammability = 5, flammable = 2, hollow_log_burnable = 1})
end
minetest.register_node(modname .. ":"..name.."_hollow", {
collision_box = collisionbox,
description = S(desc),
drawtype = "mesh",
groups = groups,
mesh = "vl_hollow_logs_log.obj",
on_place = mcl_util.rotate_axis,
paramtype = "light",
paramtype2 = "facedir",
use_texture_alpha = "clip",
sounds = mcl_sounds.node_sound_wood_defaults(),
sunlight_propagates = true,
tiles = {modname .. "_"..name..".png"},
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = modname .. ":stripped_"..name.."_hollow"
})
minetest.register_node(modname .. ":"..stripped_name.."_hollow", {
collision_box = collisionbox,
description = S(stripped_desc),
drawtype = "mesh",
groups = groups,
mesh = "vl_hollow_logs_log.obj",
on_place = mcl_util.rotate_axis,
paramtype = "light",
paramtype2 = "facedir",
use_texture_alpha = "clip",
sounds = mcl_sounds.node_sound_wood_defaults(),
sunlight_propagates = true,
tiles = {modname .. "_stripped_"..name..".png"},
_mcl_blast_resistance = 2,
_mcl_hardness = 2
})
end
vl_hollow_logs.logs = {
{"acaciatree", "stripped_acacia", "Hollow Acacia Log", "Stripped Hollow Acacia Log"},
{"birchtree", "stripped_birch", "Hollow Birch Log", "Stripped Hollow Birch Log"},
{"darktree", "stripped_dark_oak", "Hollow Dark Oak Log", "Stripped Hollow Dark Oak Log"},
{"jungletree", "stripped_jungle", "Hollow Jungle Log", "Stripped Hollow Jungle Log"},
{"sprucetree", "stripped_spruce", "Hollow Spruce Log", "Stripped Hollow Spruce Log"},
{"tree", "stripped_oak", "Hollow Oak Log", "Stripped Hollow Oak Log"}
}
if minetest.get_modpath("mcl_cherry_blossom") then
table.insert(vl_hollow_logs.logs, {"cherrytree", "stripped_cherrytree", "Hollow Cherry Log", "Stripped Hollow Cherry Log"})
end
if minetest.get_modpath("mcl_mangrove") then
table.insert(vl_hollow_logs.logs, {"mangrove_tree", "mangrove_stripped", "Hollow Mangrove Log", "Stripped Hollow Mangrove Log"})
end
if minetest.get_modpath("mcl_crimson") then
table.insert(vl_hollow_logs.logs, {"crimson_hyphae", "stripped_crimson_hyphae", "Hollow Crimson Stem", "Stripped Hollow Crimson Stem", true})
table.insert(vl_hollow_logs.logs, {"warped_hyphae", "stripped_warped_hyphae", "Hollow Warped Stem", "Stripped Hollow Warped Stem", true})
end
for _, defs in pairs(vl_hollow_logs.logs) do
vl_hollow_logs.register_hollow_log(defs)
end
dofile(modpath.."/recipes.lua")

View File

@ -1,21 +0,0 @@
# textdomain: mcl_hollow_logs
Hollow Acacia Log=
Hollow Birch Log=
Hollow Cherry Log=
Hollow Dark Oak Log=
Hollow Jungle Log=
Hollow Mangrove Log=
Hollow Oak Log=
Hollow Spruce Log=
Hollow Crimson Stem=
Hollow Warped Stem=
Stripped Hollow Acacia Log=
Stripped Hollow Birch Log=
Stripped Hollow Cherry Log=
Stripped Hollow Dark Oak Log=
Stripped Hollow Jungle Log=
Stripped Hollow Mangrove Log=
Stripped Hollow Oak Log=
Stripped Hollow Spruce Log=
Stripped Hollow Crimson Stem=
Stripped Hollow Warped Stem=

View File

@ -1,21 +0,0 @@
# textdomain: mcl_hollow_logs
Hollow Acacia Log=Tronco Oco de Acácia
Hollow Birch Log=Tronco Oco de Bétula
Hollow Cherry Log=Tronco Oco de Cerejeira
Hollow Dark Oak Log=Tronco Oco de Carvalho Escuro
Hollow Jungle Log=Tronco Oco da Selva
Hollow Mangrove Log=Tronco Oco de Mangue
Hollow Oak Log=Tronco Oco de Carvalho
Hollow Spruce Log=Tronco Oco de Pinheiro
Hollow Crimson Stem=Caule Oco Carmesim
Hollow Warped Stem=Caule Oco Distorcido
Stripped Hollow Acacia Log=Tronco Oco Descascado de Acácia
Stripped Hollow Birch Log=Tronco Oco Descascado de Bétula
Stripped Hollow Cherry Log=Tronco Oco Descascado de Cerejeira
Stripped Hollow Dark Oak Log=Tronco Oco Descascado de Carvalho Escuro
Stripped Hollow Jungle Log=Tronco Oco Descascado da Selva
Stripped Hollow Mangrove Log=Tronco Oco Descascado de Mangue
Stripped Hollow Oak Log=Tronco Oco Descascado de Carvalho
Stripped Hollow Spruce Log=Tronco Oco Descascado de Pinheiro
Stripped Hollow Crimson Stem=Caule Oco Descascado Carmesim
Stripped Hollow Warped Stem=Caule Oco Descascado Distorcido

View File

@ -1,4 +0,0 @@
name = vl_hollow_logs
depends = mcl_core, mcl_sounds, mcl_util
optional_depends = mcl_cherry_blossom, mcl_crimson, mcl_mangrove
author = JoseDouglas26

View File

@ -1,54 +0,0 @@
# Blender 3.6.7
# www.blender.org
o hollow_log
v -0.312500 -0.500000 0.312500
v -0.312500 0.500000 0.312500
v -0.312500 -0.500000 -0.312500
v -0.312500 0.500000 -0.312500
v 0.312500 -0.500000 0.312500
v 0.312500 0.500000 0.312500
v 0.312500 -0.500000 -0.312500
v 0.312500 0.500000 -0.312500
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.500000 0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v 0.500000 0.500000 0.500000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 1.0000 -0.0000
vt 0.380952 0.000000
vt 0.380952 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.619048 0.000000
vt 0.619048 1.000000
vt 0.928571 0.187500
vt 0.928571 0.812500
vt 1.000000 1.000000
vt 1.000000 -0.000000
vt 0.690476 0.187500
vt 0.690476 0.812500
s 0
f 10/1/1 11/2/1 12/3/1 9/4/1
f 9/1/2 12/2/2 14/3/2 13/4/2
f 13/1/3 14/2/3 16/3/3 15/4/3
f 15/1/4 16/2/4 11/3/4 10/4/4
f 7/5/4 8/6/4 4/2/4 3/1/4
f 5/5/1 6/6/1 8/2/1 7/1/1
f 3/7/5 1/8/5 10/9/5 9/10/5
f 2/8/6 4/7/6 12/10/6 11/9/6
f 7/11/5 3/7/5 9/10/5 13/5/5
f 4/7/6 8/11/6 14/5/6 12/10/6
f 5/12/5 7/11/5 13/5/5 15/6/5
f 8/11/6 6/12/6 16/6/6 14/5/6
f 1/8/5 5/12/5 15/6/5 10/9/5
f 6/12/6 2/8/6 11/9/6 16/6/6
f 3/5/3 4/6/3 2/2/3 1/1/3
f 1/5/2 2/6/2 6/2/2 5/1/2

View File

@ -1,48 +0,0 @@
function vl_hollow_logs.register_craft(material, result)
minetest.register_craft({
output = "vl_hollow_logs:"..result.."_hollow 4",
recipe = {
{"", material, ""},
{material, "", material},
{"", material, ""}
},
type = "shaped"
})
mcl_stonecutter.register_recipe(material, "vl_hollow_logs:"..result.."_hollow", 1)
end
for _, defs in pairs(vl_hollow_logs.logs) do
local mod, material, stripped_material
local name = defs[1]
local stripped_name = defs[2]
if name:find("cherry") then
mod = "mcl_cherry_blossom:"
elseif name:find("mangrove") then
mod = "mcl_mangrove:"
elseif name:find("hyphae") then
mod = "mcl_crimson:"
else
mod = "mcl_core:"
end
material = mod..name
stripped_material = mod..stripped_name
vl_hollow_logs.register_craft(material, name)
vl_hollow_logs.register_craft(stripped_material, stripped_name)
end
minetest.register_craft({
burntime = 10,
recipe = "group:hollow_log_burnable",
type = "fuel",
})
minetest.register_craft({
cooktime = 5,
output = "mcl_core:charcoal_lump",
recipe = "group:hollow_log_burnable",
type = "cooking"
})

View File

@ -406,16 +406,13 @@ local function dungeons_nodes(minp, maxp, blockseed)
local pr = PseudoRandom(blockseed)
for a=1, attempts do
local dim = dungeonsizes[pr:next(1, #dungeonsizes)]
if ymin <= ymax - dim.y - 1 then
local x = pr:next(minp.x, maxp.x-dim.x-1)
local y = pr:next(ymin , ymax -dim.y-1)
local z = pr:next(minp.z, maxp.z-dim.z-1)
local p1 = {x=x,y=y,z=z}
local p2 = {x = x+dim.x+1, y = y+dim.y+1, z = z+dim.z+1}
minetest.log("verbose","[mcl_dungeons] size=" ..minetest.pos_to_string(dim) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2))
emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr})
end
local x = pr:next(minp.x, maxp.x-dim.x-1)
local y = pr:next(ymin , ymax -dim.y-1)
local z = pr:next(minp.z, maxp.z-dim.z-1)
local p1 = {x=x,y=y,z=z}
local p2 = {x = x+dim.x+1, y = y+dim.y+1, z = z+dim.z+1}
minetest.log("verbose","[mcl_dungeons] size=" ..minetest.pos_to_string(dim) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2))
emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr})
end
end

View File

@ -38,19 +38,9 @@ local player_sneak = {}
local player_visible = {}
mcl_player.player_attached = {}
local function get_player_textures(name)
local textures = player_textures[name]
if textures then return textures end
local textures = { "character.png", "blank.png", "blank.png" }
player_textures[name] = textures
return textures
end
function mcl_player.player_get_animation(player)
local name = player:get_player_name()
local textures = get_player_textures(name)
local textures = player_textures[name]
if not player_visible[name] then
textures = table.copy(textures)
@ -73,7 +63,7 @@ end
local function update_player_textures(player)
local name = player:get_player_name()
local textures = get_player_textures(name)
local textures = player_textures[name]
if not player_visible[name] then
textures = table.copy(textures)
@ -135,21 +125,18 @@ end
function mcl_player.player_set_skin(player, texture)
local name = player:get_player_name()
local textures = get_player_textures(name)
textures[1] = texture
player_textures[name][1] = texture
update_player_textures(player)
end
function mcl_player.player_get_skin(player)
local name = player:get_player_name()
local textures = get_player_textures(name)
return textures[1]
return player_textures[name][1]
end
function mcl_player.player_set_armor(player, texture)
local name = player:get_player_name()
local textures = get_player_textures(name)
textures[2] = texture
player_textures[name][2] = texture
update_player_textures(player)
end
@ -164,7 +151,7 @@ function mcl_player.get_player_formspec_model(player, x, y, w, h, fsname)
local name = player:get_player_name()
local model = player_model[name]
local anim = models[model].animations[player_anim[name]]
local textures = get_player_textures(name)
local textures = player_textures[name]
if not player_visible[name] then
textures = table.copy(textures)
textures[1] = "blank.png"
@ -192,7 +179,7 @@ minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
mcl_player.player_attached[name] = false
player_visible[name] = true
get_player_textures(name)
player_textures[name] = { "character.png", "blank.png", "blank.png" }
--player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
-- player:set_fov(86.1) -- see <https://minecraft.gamepedia.com/Options#Video_settings>>>>

View File

@ -59,50 +59,6 @@ mcl_skins = {
player_formspecs = {},
}
local player_skins = mcl_skins.player_skins
local function get_player_skins(player)
local player_skins = player_skins[player]
if player_skins then return player_skins end
local skin = player:get_meta():get_string("mcl_skins:skin")
if skin then
skin = minetest.deserialize(skin)
end
if skin then
if not mcl_skins.texture_to_simple_skin[skin.simple_skins_id] then
skin.simple_skins_id = nil
end
mcl_skins.player_skins[player] = skin
else
if math.random() > 0.5 then
skin = table.copy(mcl_skins.template1)
else
skin = table.copy(mcl_skins.template2)
end
mcl_skins.player_skins[player] = skin
end
mcl_skins.player_formspecs[player] = {
active_tab = "skin",
page_num = 1
}
if #mcl_skins.simple_skins > 0 then
local skin_id = tonumber(player:get_meta():get_string("mcl_skins:skin_id"))
if skin_id and mcl_skins.simple_skins[skin_id] then
local texture = mcl_skins.simple_skins[skin_id].texture
local player_skins = get_player_skins(player)
player_skins.simple_skins_id = texture
end
end
mcl_skins.save(player)
mcl_skins.update_player_skin(player)
return mcl_skins.player_skins[player]
end
function mcl_skins.register_item(item)
assert(mcl_skins[item.type], "Skin item type " .. item.type .. " does not exist.")
@ -204,7 +160,7 @@ function mcl_skins.update_player_skin(player)
return
end
local skin = get_player_skins(player)
local skin = mcl_skins.player_skins[player]
local skinval = mcl_skins.compile_skin(skin)
if not skin.cape then skin.cape = "blank.png" end
@ -230,7 +186,39 @@ end
-- Load player skin on join
minetest.register_on_joinplayer(function(player)
get_player_skins(player)
local skin = player:get_meta():get_string("mcl_skins:skin")
if skin then
skin = minetest.deserialize(skin)
end
if skin then
if not mcl_skins.texture_to_simple_skin[skin.simple_skins_id] then
skin.simple_skins_id = nil
end
mcl_skins.player_skins[player] = skin
else
if math.random() > 0.5 then
skin = table.copy(mcl_skins.template1)
else
skin = table.copy(mcl_skins.template2)
end
mcl_skins.player_skins[player] = skin
end
mcl_skins.player_formspecs[player] = {
active_tab = "skin",
page_num = 1
}
if #mcl_skins.simple_skins > 0 then
local skin_id = tonumber(player:get_meta():get_string("mcl_skins:skin_id"))
if skin_id and mcl_skins.simple_skins[skin_id] then
local texture = mcl_skins.simple_skins[skin_id].texture
mcl_skins.player_skins[player].simple_skins_id = texture
end
end
mcl_skins.save(player)
mcl_skins.update_player_skin(player)
end)
minetest.register_on_leaveplayer(function(player)
@ -257,7 +245,7 @@ end
function mcl_skins.show_formspec(player, active_tab, page_num)
local formspec_data = mcl_skins.player_formspecs[player]
local skin = get_player_skins(player)
local skin = mcl_skins.player_skins[player]
formspec_data.active_tab = active_tab
local page_count = calculate_page_count(active_tab, player)
@ -567,8 +555,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
mcl_skins.show_formspec(player, active_tab, page_num)
return true
elseif fields.nocape then
local player_skins = get_player_skins(player)
player_skins.cape = "blank.png"
mcl_skins.player_skins[player].cape = "blank.png"
mcl_skins.update_player_skin(player)
mcl_armor.update(player) --update elytra cape
mcl_skins.show_formspec(player, active_tab, page_num)
@ -577,8 +564,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
for cape_index = ((page_num - 1) * 5) + 1, math.min(#mcl_skins.cape, page_num * 5) do
local cape = mcl_skins.cape[cape_index]
if fields[cape.name] then
local player_skins = get_player_skins(player)
player_skins.cape = cape.mask -- the actual overlay image
mcl_skins.player_skins[player].cape = cape.mask -- the actual overlay image
mcl_skins.update_player_skin(player)
mcl_armor.update(player) --update elytra cape
mcl_skins.show_formspec(player, active_tab, page_num)
@ -594,7 +580,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end
local skin = get_player_skins(player)
local skin = mcl_skins.player_skins[player]
if not skin then return true end
if fields.next_page then

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B