mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-01 23:33:46 +01:00
Merge branch 'master' of ssh://git.minetest.land:29418/MineClone2/MineClone2
commit
228759e49b
@ -212,7 +212,7 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher)
|
||||
npos_x - emin_x + 1
|
||||
|
||||
local cid = data[idx]
|
||||
local br = node_blastres[cid]
|
||||
local br = node_blastres[cid] or INDESTRUCT_BLASTRES
|
||||
if br < INDESTRUCT_BLASTRES and br > max_blast_resistance then
|
||||
br = max_blast_resistance
|
||||
end
|
||||
|
@ -188,7 +188,7 @@ function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, d
|
||||
end
|
||||
|
||||
function boat.on_step(self, dtime, moveresult)
|
||||
mcl_burning.tick(self.object, dtime)
|
||||
mcl_burning.tick(self.object, dtime, self)
|
||||
|
||||
self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
|
||||
local v_factor = 1
|
||||
|
@ -1,132 +1,52 @@
|
||||
local S = minetest.get_translator("mcl_burning")
|
||||
|
||||
function mcl_burning.get_default(datatype)
|
||||
local default_table = {string = "", float = 0.0, int = 0, bool = false}
|
||||
return default_table[datatype]
|
||||
end
|
||||
|
||||
function mcl_burning.get(obj, datatype, name)
|
||||
local key
|
||||
if obj:is_player() then
|
||||
local meta = obj:get_meta()
|
||||
return meta["get_" .. datatype](meta, "mcl_burning:" .. name)
|
||||
else
|
||||
local luaentity = obj:get_luaentity()
|
||||
return luaentity and luaentity["mcl_burning_" .. name] or mcl_burning.get_default(datatype)
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_burning.set(obj, datatype, name, value)
|
||||
if obj:is_player() then
|
||||
local meta = obj:get_meta()
|
||||
meta["set_" .. datatype](meta, "mcl_burning:" .. name, value or mcl_burning.get_default(datatype))
|
||||
else
|
||||
local luaentity = obj:get_luaentity()
|
||||
if mcl_burning.get_default(datatype) == value then
|
||||
value = nil
|
||||
end
|
||||
luaentity["mcl_burning_" .. name] = value
|
||||
end
|
||||
function mcl_burning.get_storage(obj)
|
||||
return obj:is_player() and mcl_burning.storage[obj] or obj:get_luaentity()
|
||||
end
|
||||
|
||||
function mcl_burning.is_burning(obj)
|
||||
return mcl_burning.get(obj, "float", "burn_time") > 0
|
||||
return mcl_burning.get_storage(obj).burn_time
|
||||
end
|
||||
|
||||
function mcl_burning.is_affected_by_rain(obj)
|
||||
return mcl_weather and mcl_weather.get_weather() == "rain" and mcl_weather.is_outdoor(obj:get_pos())
|
||||
return mcl_weather.get_weather() == "rain" and mcl_weather.is_outdoor(obj:get_pos())
|
||||
end
|
||||
|
||||
function mcl_burning.get_collisionbox(obj, smaller)
|
||||
local box = obj:get_properties().collisionbox
|
||||
local minp, maxp = vector.new(box[1], box[2], box[3]), vector.new(box[4], box[5], box[6])
|
||||
if smaller then
|
||||
function mcl_burning.get_collisionbox(obj, smaller, storage)
|
||||
local cache = storage.collisionbox_cache
|
||||
if cache then
|
||||
local box = cache[smaller and 2 or 1]
|
||||
return box[1], box[2]
|
||||
else
|
||||
local box = obj:get_properties().collisionbox
|
||||
local minp, maxp = vector.new(box[1], box[2], box[3]), vector.new(box[4], box[5], box[6])
|
||||
local s_vec = vector.new(0.1, 0.1, 0.1)
|
||||
minp = vector.add(minp, s_vec)
|
||||
maxp = vector.subtract(maxp, s_vec)
|
||||
local s_minp = vector.add(minp, s_vec)
|
||||
local s_maxp = vector.subtract(maxp, s_vec)
|
||||
storage.collisionbox_cache = {{minp, maxp}, {s_minp, s_maxp}}
|
||||
return minp, maxp
|
||||
end
|
||||
return minp, maxp
|
||||
end
|
||||
|
||||
function mcl_burning.get_touching_nodes(obj, nodenames)
|
||||
function mcl_burning.get_touching_nodes(obj, nodenames, storage)
|
||||
local pos = obj:get_pos()
|
||||
local box = obj:get_properties().collisionbox
|
||||
local minp, maxp = mcl_burning.get_collisionbox(obj, true)
|
||||
local minp, maxp = mcl_burning.get_collisionbox(obj, true, storage)
|
||||
local nodes = minetest.find_nodes_in_area(vector.add(pos, minp), vector.add(pos, maxp), nodenames)
|
||||
return nodes
|
||||
end
|
||||
|
||||
function mcl_burning.get_highest_group_value(obj, groupname)
|
||||
local nodes = mcl_burning.get_touching_nodes(obj, "group:" .. groupname, true)
|
||||
local highest_group_value = 0
|
||||
|
||||
for _, pos in pairs(nodes) do
|
||||
local node = minetest.get_node(pos)
|
||||
local group_value = minetest.get_item_group(node.name, groupname)
|
||||
if group_value > highest_group_value then
|
||||
highest_group_value = group_value
|
||||
end
|
||||
end
|
||||
|
||||
return highest_group_value
|
||||
end
|
||||
|
||||
function mcl_burning.damage(obj)
|
||||
local luaentity = obj:get_luaentity()
|
||||
local health
|
||||
|
||||
if luaentity then
|
||||
health = luaentity.health
|
||||
end
|
||||
|
||||
local hp = health or obj:get_hp()
|
||||
|
||||
if hp <= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
local do_damage = true
|
||||
|
||||
if obj:is_player() then
|
||||
if mcl_potions.player_has_effect(obj, "fire_proof") then
|
||||
do_damage = false
|
||||
else
|
||||
local name = obj:get_player_name()
|
||||
armor.last_damage_types[name] = "fire"
|
||||
local deathmsg = S("@1 burned to death.", name)
|
||||
local reason = mcl_burning.get(obj, "string", "reason")
|
||||
if reason ~= "" then
|
||||
deathmsg = S("@1 was burned by @2.", name, reason)
|
||||
end
|
||||
mcl_death_messages.player_damage(obj, deathmsg)
|
||||
end
|
||||
else
|
||||
if luaentity.fire_damage_resistant then
|
||||
do_damage = false
|
||||
end
|
||||
end
|
||||
|
||||
if do_damage then
|
||||
local new_hp = hp - 1
|
||||
if health then
|
||||
luaentity.health = new_hp
|
||||
else
|
||||
obj:set_hp(new_hp)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_burning.set_on_fire(obj, burn_time, reason)
|
||||
if obj:get_hp() < 0 then
|
||||
return
|
||||
end
|
||||
|
||||
local storage = mcl_burning.get_storage(obj)
|
||||
|
||||
local luaentity = obj:get_luaentity()
|
||||
if luaentity and luaentity.fire_resistant then
|
||||
return
|
||||
end
|
||||
|
||||
local old_burn_time = mcl_burning.get(obj, "float", "burn_time")
|
||||
local max_fire_prot_lvl = 0
|
||||
|
||||
if obj:is_player() then
|
||||
@ -148,37 +68,22 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
|
||||
burn_time = burn_time - math.floor(burn_time * max_fire_prot_lvl * 0.15)
|
||||
end
|
||||
|
||||
if old_burn_time <= burn_time then
|
||||
--[[local sound_id = mcl_burning.get(obj, "int", "sound_id")
|
||||
if sound_id == 0 then
|
||||
sound_id = minetest.sound_play("fire_fire", {
|
||||
object = obj,
|
||||
gain = 0.18,
|
||||
max_hear_distance = 16,
|
||||
loop = true,
|
||||
}) + 1
|
||||
end]]--
|
||||
|
||||
local hud_id
|
||||
if obj:is_player() then
|
||||
hud_id = mcl_burning.get(obj, "int", "hud_id")
|
||||
if hud_id == 0 then
|
||||
hud_id = obj:hud_add({
|
||||
hud_elem_type = "image",
|
||||
position = {x = 0.5, y = 0.5},
|
||||
scale = {x = -100, y = -100},
|
||||
text = "mcl_burning_entity_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. 1,
|
||||
z_index = 1000,
|
||||
}) + 1
|
||||
end
|
||||
if not storage.burn_time or burn_time >= storage.burn_time then
|
||||
if obj:is_player() and not storage.fire_hud_id then
|
||||
storage.fire_hud_id = obj:hud_add({
|
||||
hud_elem_type = "image",
|
||||
position = {x = 0.5, y = 0.5},
|
||||
scale = {x = -100, y = -100},
|
||||
text = "mcl_burning_entity_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. 1,
|
||||
z_index = 1000,
|
||||
})
|
||||
end
|
||||
mcl_burning.set(obj, "float", "burn_time", burn_time)
|
||||
mcl_burning.set(obj, "string", "reason", reason)
|
||||
mcl_burning.set(obj, "int", "hud_id", hud_id)
|
||||
--mcl_burning.set(obj, "int", "sound_id", sound_id)
|
||||
storage.burn_time = burn_time
|
||||
storage.burn_reason = reason
|
||||
storage.fire_damage_timer = 0
|
||||
|
||||
local fire_entity = minetest.add_entity(obj:get_pos(), "mcl_burning:fire")
|
||||
local minp, maxp = mcl_burning.get_collisionbox(obj)
|
||||
local minp, maxp = mcl_burning.get_collisionbox(obj, false, storage)
|
||||
local obj_size = obj:get_properties().visual_size
|
||||
|
||||
local vertical_grow_factor = 1.2
|
||||
@ -192,111 +97,81 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
|
||||
|
||||
fire_entity:set_properties({visual_size = size})
|
||||
fire_entity:set_attach(obj, "", offset, {x = 0, y = 0, z = 0})
|
||||
mcl_burning.update_animation_frame(obj, fire_entity, 0)
|
||||
local fire_luaentity = fire_entity:get_luaentity()
|
||||
fire_luaentity:update_frame(obj, storage)
|
||||
|
||||
for _, other in pairs(minetest.get_objects_inside_radius(fire_entity:get_pos(), 0)) do
|
||||
local other_luaentity = other:get_luaentity()
|
||||
if other_luaentity and other_luaentity.name == "mcl_burning:fire" and other_luaentity ~= fire_luaentity then
|
||||
other:remove()
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_burning.extinguish(obj)
|
||||
if mcl_burning.is_burning(obj) then
|
||||
--local sound_id = mcl_burning.get(obj, "int", "sound_id") - 1
|
||||
--minetest.sound_stop(sound_id)
|
||||
|
||||
local storage = mcl_burning.get_storage(obj)
|
||||
if obj:is_player() then
|
||||
local hud_id = mcl_burning.get(obj, "int", "hud_id") - 1
|
||||
obj:hud_remove(hud_id)
|
||||
end
|
||||
|
||||
mcl_burning.set(obj, "string", "reason")
|
||||
mcl_burning.set(obj, "float", "burn_time")
|
||||
mcl_burning.set(obj, "float", "damage_timer")
|
||||
mcl_burning.set(obj, "int", "hud_id")
|
||||
--mcl_burning.set(obj, "int", "sound_id")
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_burning.catch_fire_tick(obj, dtime)
|
||||
if mcl_burning.is_affected_by_rain(obj) or #mcl_burning.get_touching_nodes(obj, "group:puts_out_fire") > 0 then
|
||||
mcl_burning.extinguish(obj)
|
||||
else
|
||||
local set_on_fire_value = mcl_burning.get_highest_group_value(obj, "set_on_fire")
|
||||
|
||||
if set_on_fire_value > 0 then
|
||||
mcl_burning.set_on_fire(obj, set_on_fire_value)
|
||||
if storage.fire_hud_id then
|
||||
obj:hud_remove(storage.fire_hud_id)
|
||||
end
|
||||
mcl_burning.storage[obj] = {}
|
||||
else
|
||||
storage.burn_time = nil
|
||||
storage.burn_reason = nil
|
||||
storage.fire_damage_timer = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_burning.tick(obj, dtime)
|
||||
local burn_time = mcl_burning.get(obj, "float", "burn_time") - dtime
|
||||
function mcl_burning.tick(obj, dtime, storage)
|
||||
if storage.burn_time then
|
||||
storage.burn_time = storage.burn_time - dtime
|
||||
|
||||
if burn_time <= 0 then
|
||||
mcl_burning.extinguish(obj)
|
||||
else
|
||||
mcl_burning.set(obj, "float", "burn_time", burn_time)
|
||||
if storage.burn_time <= 0 or mcl_burning.is_affected_by_rain(obj) or #mcl_burning.get_touching_nodes(obj, "group:puts_out_fire", storage) > 0 then
|
||||
mcl_burning.extinguish(obj)
|
||||
return true
|
||||
else
|
||||
storage.fire_damage_timer = storage.fire_damage_timer + dtime
|
||||
|
||||
local damage_timer = mcl_burning.get(obj, "float", "damage_timer") + dtime
|
||||
if storage.fire_damage_timer >= 1 then
|
||||
storage.fire_damage_timer = 0
|
||||
|
||||
if damage_timer >= 1 then
|
||||
damage_timer = 0
|
||||
mcl_burning.damage(obj)
|
||||
end
|
||||
local luaentity = obj:get_luaentity()
|
||||
local is_mob = luaentity and luaentity._cmi_is_mob
|
||||
local hp = is_mob and luaentity.health or obj:get_hp()
|
||||
|
||||
mcl_burning.set(obj, "float", "damage_timer", damage_timer)
|
||||
end
|
||||
if hp > 0 then
|
||||
local do_damage = true
|
||||
|
||||
mcl_burning.catch_fire_tick(obj, dtime)
|
||||
end
|
||||
if obj:is_player() then
|
||||
if mcl_potions.player_has_effect(obj, "fire_proof") then
|
||||
do_damage = false
|
||||
else
|
||||
local name = obj:get_player_name()
|
||||
armor.last_damage_types[name] = "fire"
|
||||
local deathmsg = S("@1 burned to death.", name)
|
||||
if storage.reason then
|
||||
deathmsg = S("@1 was burned by @2.", name, storage.reason)
|
||||
end
|
||||
mcl_death_messages.player_damage(obj, deathmsg)
|
||||
end
|
||||
elseif luaentity.fire_damage_resistant then
|
||||
do_damage = false
|
||||
end
|
||||
|
||||
function mcl_burning.update_animation_frame(obj, fire_entity, animation_frame)
|
||||
local fire_texture = "mcl_burning_entity_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. animation_frame
|
||||
local fire_HUD_texture = "mcl_burning_hud_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. animation_frame
|
||||
fire_entity:set_properties({textures = {"blank.png", "blank.png", fire_texture, fire_texture, fire_texture, fire_texture}})
|
||||
if obj:is_player() then
|
||||
local hud_id = mcl_burning.get(obj, "int", "hud_id") - 1
|
||||
obj:hud_change(hud_id, "text", fire_HUD_texture)
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_burning.fire_entity_step(self, dtime)
|
||||
if self.removed then
|
||||
return
|
||||
end
|
||||
|
||||
local obj = self.object
|
||||
local parent = obj:get_attach()
|
||||
local do_remove
|
||||
|
||||
self.doing_step = true
|
||||
|
||||
if not parent or not mcl_burning.is_burning(parent) then
|
||||
do_remove = true
|
||||
else
|
||||
for _, other in pairs(minetest.get_objects_inside_radius(obj:get_pos(), 0)) do
|
||||
local luaentity = obj:get_luaentity()
|
||||
if luaentity and luaentity.name == "mcl_burning:fire" and not luaentity.doing_step and not luaentity.removed then
|
||||
do_remove = true
|
||||
break
|
||||
if do_damage then
|
||||
local new_hp = hp - 1
|
||||
if is_mob then
|
||||
luaentity.health = new_hp
|
||||
else
|
||||
obj:set_hp(new_hp)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.doing_step = false
|
||||
|
||||
if do_remove then
|
||||
self.removed = true
|
||||
obj:remove()
|
||||
return
|
||||
end
|
||||
|
||||
local animation_timer = self.animation_timer + dtime
|
||||
if animation_timer >= 0.015 then
|
||||
animation_timer = 0
|
||||
local animation_frame = self.animation_frame + 1
|
||||
if animation_frame > mcl_burning.animation_frames - 1 then
|
||||
animation_frame = 0
|
||||
end
|
||||
mcl_burning.update_animation_frame(parent, obj, animation_frame)
|
||||
self.animation_frame = animation_frame
|
||||
end
|
||||
self.animation_timer = animation_timer
|
||||
end
|
||||
|
@ -2,11 +2,65 @@ local S = minetest.get_translator("mcl_burning")
|
||||
local modpath = minetest.get_modpath("mcl_burning")
|
||||
|
||||
mcl_burning = {
|
||||
storage = {},
|
||||
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8
|
||||
}
|
||||
|
||||
dofile(modpath .. "/api.lua")
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
local storage = mcl_burning.storage[player]
|
||||
if not mcl_burning.tick(player, dtime, storage) and not mcl_burning.is_affected_by_rain(player) then
|
||||
local nodes = mcl_burning.get_touching_nodes(player, {"group:puts_out_fire", "group:set_on_fire"}, storage)
|
||||
local burn_time = 0
|
||||
|
||||
for _, pos in pairs(nodes) do
|
||||
local node = minetest.get_node(pos)
|
||||
if minetest.get_item_group(node.name, "puts_out_fire") > 0 then
|
||||
burn_time = 0
|
||||
break
|
||||
end
|
||||
|
||||
local value = minetest.get_item_group(node.name, "set_on_fire")
|
||||
if value > burn_time then
|
||||
burn_time = value
|
||||
end
|
||||
end
|
||||
|
||||
if burn_time > 0 then
|
||||
mcl_burning.set_on_fire(player, burn_time)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_respawnplayer(function(player)
|
||||
mcl_burning.extinguish(player)
|
||||
end)
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local storage
|
||||
|
||||
local burn_data = player:get_meta():get_string("mcl_burning:data")
|
||||
if burn_data == "" then
|
||||
storage = {}
|
||||
else
|
||||
storage = minetest.deserialize(burn_data)
|
||||
end
|
||||
|
||||
mcl_burning.storage[player] = storage
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local storage = mcl_burning.storage[player]
|
||||
storage.fire_hud_id = nil
|
||||
player:get_meta():set_string("mcl_burning:data", minetest.serialize(storage))
|
||||
|
||||
mcl_burning.storage[player] = nil
|
||||
end)
|
||||
|
||||
|
||||
minetest.register_entity("mcl_burning:fire", {
|
||||
initial_properties = {
|
||||
physical = false,
|
||||
@ -18,21 +72,45 @@ minetest.register_entity("mcl_burning:fire", {
|
||||
|
||||
animation_frame = 0,
|
||||
animation_timer = 0,
|
||||
on_step = mcl_burning.fire_entity_step,
|
||||
})
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
if player:get_meta():get_float("mcl_burning:burn_time") > 0 then
|
||||
mcl_burning.tick(player, dtime)
|
||||
on_step = function(self, dtime)
|
||||
local parent, storage = self:sanity_check()
|
||||
|
||||
if parent then
|
||||
self.animation_timer = self.animation_timer + dtime
|
||||
if self.animation_timer >= 0.1 then
|
||||
self.animation_timer = 0
|
||||
self.animation_frame = self.animation_frame + 1
|
||||
if self.animation_frame > mcl_burning.animation_frames - 1 then
|
||||
self.animation_frame = 0
|
||||
end
|
||||
self:update_frame(parent, storage)
|
||||
end
|
||||
else
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end,
|
||||
sanity_check = function(self)
|
||||
local parent = self.object:get_attach()
|
||||
|
||||
minetest.register_on_respawnplayer(function(player)
|
||||
mcl_burning.extinguish(player)
|
||||
end)
|
||||
if not parent then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
mcl_burning.set(player, "int", "hud_id")
|
||||
end)
|
||||
local storage = mcl_burning.get_storage(parent)
|
||||
|
||||
if not storage or not storage.burn_time then
|
||||
return
|
||||
end
|
||||
|
||||
return parent, storage
|
||||
end,
|
||||
update_frame = function(self, parent, storage)
|
||||
local frame_overlay = "^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. self.animation_frame
|
||||
local fire_texture = "mcl_burning_entity_flame_animated.png" .. frame_overlay
|
||||
self.object:set_properties({textures = {"blank.png", "blank.png", fire_texture, fire_texture, fire_texture, fire_texture}})
|
||||
if parent:is_player() then
|
||||
parent:hud_change(storage.fire_hud_id, "text", "mcl_burning_hud_flame_animated.png" .. frame_overlay)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -1029,10 +1029,10 @@ local node_ok = function(pos, fallback)
|
||||
return minetest.registered_nodes[fallback]
|
||||
end
|
||||
|
||||
local function get_light(pos)
|
||||
local function get_light(pos, tod)
|
||||
if math.abs(pos.x) < 31000 and math.abs(pos.y) < 31000 and math.abs(pos.z) < 31000 then
|
||||
local lightfunc = minetest.get_natural_light or minetest.get_node_light
|
||||
return lightfunc(pos)
|
||||
return lightfunc(pos, tod)
|
||||
else
|
||||
return 0
|
||||
end
|
||||
@ -3454,8 +3454,8 @@ end
|
||||
-- main mob function
|
||||
local mob_step = function(self, dtime)
|
||||
|
||||
if not self.fire_resistant and self.mcl_burning_burn_time and self.mcl_burning_burn_time > 0 then
|
||||
mcl_burning.tick(self.object, dtime)
|
||||
if not self.fire_resistant then
|
||||
mcl_burning.tick(self.object, dtime, self)
|
||||
end
|
||||
|
||||
if use_cmi then
|
||||
|
@ -1,6 +1,6 @@
|
||||
name = mobs_mc
|
||||
author = maikerumine
|
||||
description = Adds Minecraft-like monsters and animals.
|
||||
depends = mcl_init, mcl_particles, mcl_mobs, mcl_wip, mcl_colors
|
||||
depends = mcl_init, mcl_particles, mcl_mobs, mcl_wip
|
||||
optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, mobs_mc_gameconfig, doc_items
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -516,7 +516,7 @@ local function show_trade_formspec(playername, trader, tradenum)
|
||||
"size[9,8.75]"
|
||||
.."background[-0.19,-0.25;9.41,9.49;mobs_mc_trading_formspec_bg.png]"
|
||||
..disabled_img
|
||||
.."label[4,0;"..F(minetest.colorize(mcl_colors.DARK_GRAY, S(profession))).."]"
|
||||
.."label[4,0;"..F(minetest.colorize("#313131", S(profession))).."]"
|
||||
.."list[current_player;main;0,4.5;9,3;9]"
|
||||
.."list[current_player;main;0,7.74;9,1;]"
|
||||
..b_prev..b_next
|
||||
|
@ -35,10 +35,10 @@ doc.FORMSPEC.ENTRY_HEIGHT = doc.FORMSPEC.ENTRY_END_Y - doc.FORMSPEC.ENTRY_START_
|
||||
-- Internal helper variables
|
||||
local DOC_INTRO = S("This is the help.")
|
||||
|
||||
local COLOR_NOT_VIEWED = mcl_colors.AQUA
|
||||
local COLOR_VIEWED = mcl_colors.WHITE
|
||||
local COLOR_HIDDEN = mcl_colors.GRAY
|
||||
local COLOR_ERROR = mcl_colors.RED
|
||||
local COLOR_NOT_VIEWED = "#00FFFF" -- cyan
|
||||
local COLOR_VIEWED = "#FFFFFF" -- white
|
||||
local COLOR_HIDDEN = "#999999" -- gray
|
||||
local COLOR_ERROR = "#FF0000" -- red
|
||||
|
||||
local CATEGORYFIELDSIZE = {
|
||||
WIDTH = math.ceil(doc.FORMSPEC.WIDTH / 4),
|
||||
@ -770,7 +770,7 @@ function doc.generate_entry_list(cid, playername)
|
||||
if name == nil or name == "" then
|
||||
name = S("Nameless entry (@1)", eid)
|
||||
if doc.entry_viewed(playername, cid, eid) then
|
||||
viewedprefix = mcl_colors.RED
|
||||
viewedprefix = "#FF4444"
|
||||
else
|
||||
viewedprefix = COLOR_ERROR
|
||||
end
|
||||
|
@ -2,4 +2,3 @@ name = doc
|
||||
author = Wuzzy
|
||||
description = A simple in-game documentation system which enables mods to add help entries based on templates.
|
||||
optional_depends = unified_inventory, sfinv_buttons, central_message, inventory_plus
|
||||
depends = mcl_colors
|
||||
|
@ -667,7 +667,7 @@ local function make_formspec(name)
|
||||
fs[#fs + 1] = fmt("label[%f,%f;%s]",
|
||||
sfinv_only and 6.3 or data.iX - 2.2,
|
||||
0.22,
|
||||
ESC(colorize(mcl_colors.DARK_GRAY, fmt("%s / %u", data.pagenum, data.pagemax))))
|
||||
ESC(colorize("#383838", fmt("%s / %u", data.pagenum, data.pagemax))))
|
||||
|
||||
fs[#fs + 1] = fmt([[
|
||||
image_button[%f,0.12;0.8,0.8;craftguide_prev_icon.png;prev;]
|
||||
|
@ -447,7 +447,7 @@ function awards.getFormspec(name, to, sid)
|
||||
first = false
|
||||
|
||||
if def.secret and not award.got then
|
||||
formspec = formspec .. mcl_colors.DARK_GRAY..minetest.formspec_escape(S("(Secret Award)"))
|
||||
formspec = formspec .. "#707070" .. minetest.formspec_escape(S("(Secret Award)"))
|
||||
else
|
||||
local title = award.name
|
||||
if def and def.title then
|
||||
@ -456,7 +456,7 @@ function awards.getFormspec(name, to, sid)
|
||||
if award.got then
|
||||
formspec = formspec .. minetest.formspec_escape(title)
|
||||
else
|
||||
formspec = formspec .. mcl_colors.GRAY.. minetest.formspec_escape(title)
|
||||
formspec = formspec .. "#ACACAC" .. minetest.formspec_escape(title)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -222,7 +222,7 @@ minetest.register_on_dieplayer(function(player, reason)
|
||||
end
|
||||
hittersubtype = hitter:get_luaentity().name
|
||||
if hittername then
|
||||
msg = dmsg("murder", name, hittername)
|
||||
msg = dmsg("murder_hand", name, hittername)
|
||||
elseif hittersubtype ~= nil and hittersubtype ~= "" then
|
||||
msg = mmsg(hittersubtype, name)
|
||||
else
|
||||
|
@ -442,7 +442,7 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
|
||||
end
|
||||
local caption = ""
|
||||
if name ~= "inv" and filtername[name] then
|
||||
caption = "label[0,1.2;"..F(minetest.colorize(mcl_colors.DARK_GRAY, filtername[name])).."]"
|
||||
caption = "label[0,1.2;"..F(minetest.colorize("#313131", filtername[name])).."]"
|
||||
end
|
||||
|
||||
formspec = "size[10,9.3]"..
|
||||
|
@ -109,10 +109,10 @@ local function set_inventory(player, armor_change_only)
|
||||
mcl_formspec.get_itemslot_bg(0,3,1,1)..
|
||||
armor_slot_imgs..
|
||||
-- craft and inventory
|
||||
"label[0,4;"..F(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4;"..F(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
"label[4,0.5;"..F(minetest.colorize(mcl_colors.DARK_GRAY, S("Crafting"))).."]"..
|
||||
"label[4,0.5;"..F(minetest.colorize("#313131", S("Crafting"))).."]"..
|
||||
"list[current_player;craft;4,1;2,2]"..
|
||||
"list[current_player;craftpreview;7,1.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
|
@ -1,6 +1,6 @@
|
||||
name = mcl_inventory
|
||||
author = BlockMen
|
||||
description = Adds the player inventory and creative inventory.
|
||||
depends = mcl_init, mcl_formspec, mcl_colors
|
||||
depends = mcl_init, mcl_formspec
|
||||
optional_depends = mcl_player, _mcl_autogroup, mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting
|
||||
|
||||
|
@ -13,12 +13,12 @@ local S = minetest.get_translator("mcl_dispensers")
|
||||
local setup_dispenser = function(pos)
|
||||
-- Set formspec and inventory
|
||||
local form = "size[9,8.75]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Dispenser"))).."]"..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dispenser"))).."]"..
|
||||
"list[current_name;main;3,0.5;3,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(3,0.5,3,3)..
|
||||
"listring[current_name;main]"..
|
||||
|
@ -1,3 +1,3 @@
|
||||
name = mcl_dispensers
|
||||
depends = mcl_init, mcl_formspec, mesecons, mcl_sounds, mcl_tnt, mcl_worlds, mcl_core, mcl_nether, mcl_armor_stand, mcl_armor, mcl_colors
|
||||
depends = mcl_init, mcl_formspec, mesecons, mcl_sounds, mcl_tnt, mcl_worlds, mcl_core, mcl_nether, mcl_armor_stand, mcl_armor
|
||||
optional_depends = doc, screwdriver
|
||||
|
@ -14,12 +14,12 @@ local S = minetest.get_translator("mcl_droppers")
|
||||
local setup_dropper = function(pos)
|
||||
-- Set formspec and inventory
|
||||
local form = "size[9,8.75]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Dropper"))).."]"..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dropper"))).."]"..
|
||||
"list[current_name;main;3,0.5;3,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(3,0.5,3,3)..
|
||||
"listring[current_name;main]"..
|
||||
|
@ -15,10 +15,10 @@ local setup_dropper = function(pos)
|
||||
-- Set formspec and inventory
|
||||
local form = "size[9,8.75]"..
|
||||
"background[-0.19,-0.25;9.41,9.49;crafting_inventory_9_slots.png]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Dropper"))).."]"..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dropper"))).."]"..
|
||||
"list[current_name;main;3,0.5;3,3;]"..
|
||||
"listring[current_name;main]"..
|
||||
"listring[current_player;main]"
|
||||
|
@ -1,3 +1,3 @@
|
||||
name = mcl_droppers
|
||||
depends = mcl_init, mcl_formspec, mesecons, mcl_util, mcl_colors
|
||||
depends = mcl_init, mcl_formspec, mesecons, mcl_util
|
||||
optional_depends = doc, screwdriver
|
||||
|
@ -16,7 +16,7 @@ local function get_anvil_formspec(set_name)
|
||||
end
|
||||
return "size[9,8.75]"..
|
||||
"background[-0.19,-0.25;9.41,9.49;mcl_anvils_inventory.png]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
@ -27,7 +27,7 @@ local function get_anvil_formspec(set_name)
|
||||
mcl_formspec.get_itemslot_bg(4,2.5,1,1)..
|
||||
"list[context;output;8,2.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(8,2.5,1,1)..
|
||||
"label[3,0.1;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Repair and Name"))).."]"..
|
||||
"label[3,0.1;"..minetest.formspec_escape(minetest.colorize("#313131", S("Repair and Name"))).."]"..
|
||||
"field[3.25,1;4,1;name;;"..minetest.formspec_escape(set_name).."]"..
|
||||
"field_close_on_enter[name;false]"..
|
||||
"button[7,0.7;2,1;name_button;"..minetest.formspec_escape(S("Set Name")).."]"..
|
||||
|
@ -1,5 +1,5 @@
|
||||
name = mcl_anvils
|
||||
author = Wuzzy
|
||||
description = Anvils mods for MCL2
|
||||
depends = mcl_init, mcl_formspec, mcl_sounds, tt, mcl_enchanting, mcl_colors
|
||||
depends = mcl_init, mcl_formspec, mcl_sounds, tt, mcl_enchanting
|
||||
optional_depends = mcl_core, screwdriver
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,79 +1,132 @@
|
||||
# Blender v2.73 (sub 0) OBJ File: '3d_armor_entity_3.blend'
|
||||
# Blender v2.92.0 OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib 3d_armor_entity.mtl
|
||||
o Cube
|
||||
v 1.000000 1.000000 -1.000000
|
||||
v 1.000000 -1.000000 -1.000000
|
||||
v 1.000000 1.000000 1.000000
|
||||
v 1.000000 -1.000000 1.000000
|
||||
v -1.000000 1.000000 -1.000000
|
||||
v -1.000000 -1.000000 -1.000000
|
||||
v -1.000000 1.000000 1.000000
|
||||
v -1.000000 -1.000000 1.000000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.875000 0.500000
|
||||
vt 0.875000 0.750000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.375000 0.750000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.625000 0.250000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.125000 0.500000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.125000 0.750000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
vn 0.0000 0.0000 1.0000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 0.0000 -1.0000 0.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
usemtl Material
|
||||
s off
|
||||
f 1/1/1 5/2/1 7/3/1 3/4/1
|
||||
f 4/5/2 3/4/2 7/6/2 8/7/2
|
||||
f 8/8/3 7/9/3 5/10/3 6/11/3
|
||||
f 6/12/4 2/13/4 4/5/4 8/14/4
|
||||
f 2/13/5 1/1/5 3/4/5 4/5/5
|
||||
f 6/11/6 5/10/6 1/1/6 2/13/6
|
||||
o Player_Cube
|
||||
v 2.200000 9.763893 1.200000
|
||||
v 2.200000 9.763893 -1.200000
|
||||
v 2.200000 9.763893 1.200001
|
||||
v 2.200000 2.663871 1.200000
|
||||
v 2.200000 2.663871 -1.200000
|
||||
v 2.200000 9.763893 -1.200000
|
||||
v -2.200000 9.763893 -1.200000
|
||||
v -2.200000 9.763893 1.200000
|
||||
v -2.200000 2.663871 -1.200000
|
||||
v -2.200000 9.763893 1.200001
|
||||
v -2.200000 2.663871 1.200000
|
||||
v 2.300000 13.863962 2.300000
|
||||
v 2.300000 13.863962 -2.300000
|
||||
v -2.200000 2.663871 -1.200000
|
||||
v 2.300000 13.863962 2.300001
|
||||
v 2.300000 9.263885 2.300000
|
||||
v 2.300000 9.263885 -2.300000
|
||||
v -2.300000 13.863962 -2.300000
|
||||
v -2.300000 13.863962 2.300000
|
||||
v -2.300000 9.263885 -2.300000
|
||||
v 2.300000 9.263885 -2.299999
|
||||
v 2.300000 13.863962 -2.299999
|
||||
v -2.300000 13.863962 -2.299999
|
||||
v -2.300000 13.863962 2.300001
|
||||
v -2.300000 9.263885 2.300000
|
||||
v -2.300000 9.263885 -2.299999
|
||||
v -2.322686 2.473175 -1.300000
|
||||
v -2.322686 2.473175 1.300000
|
||||
v -4.713554 2.682348 1.300000
|
||||
v -4.713554 2.682348 -1.300000
|
||||
v -1.686446 9.745432 -1.300000
|
||||
v -1.686446 9.745432 1.300000
|
||||
v -4.077313 9.954605 -1.299999
|
||||
v -4.077313 9.954605 1.300000
|
||||
v -4.077313 9.954605 -1.300000
|
||||
v 4.077313 9.954605 -1.300000
|
||||
v 4.077313 9.954605 1.300000
|
||||
v -1.686446 9.745432 1.300000
|
||||
v -1.686446 9.745432 -1.299999
|
||||
v 1.686446 9.745432 1.300000
|
||||
v 1.686446 9.745432 -1.300000
|
||||
v 4.713554 2.682348 -1.300000
|
||||
v 4.713554 2.682348 1.300000
|
||||
v 2.322686 2.473175 1.300000
|
||||
v 4.713554 2.682348 1.300000
|
||||
v 4.077313 9.954605 1.300000
|
||||
v 1.686446 9.745432 -1.299999
|
||||
v 2.322686 2.473175 -1.300000
|
||||
v 4.077313 9.954605 -1.299999
|
||||
v 4.713554 2.682348 -1.300000
|
||||
v 2.538733 2.980834 -1.210000
|
||||
v 0.139099 2.938947 -1.200000
|
||||
v 0.139099 2.938947 1.200000
|
||||
v 0.261266 -4.059988 1.200000
|
||||
v 0.261266 -4.059988 -1.200000
|
||||
v 2.660901 -4.018101 1.190000
|
||||
v 2.660901 -4.018101 -1.210000
|
||||
v 2.538733 2.980834 1.190000
|
||||
v 2.538733 2.980834 -1.210000
|
||||
v -0.139099 2.938947 -1.200000
|
||||
v -0.139099 2.938947 1.200000
|
||||
v -0.261266 -4.059988 1.200000
|
||||
v -0.261266 -4.059988 -1.200000
|
||||
v 0.261266 -4.059988 -1.200000
|
||||
v 2.660901 -4.018101 -1.210000
|
||||
v 2.660901 -4.018101 1.190000
|
||||
v 0.261266 -4.059988 1.200000
|
||||
v -2.538734 2.980834 -1.210000
|
||||
v -2.538734 2.980834 1.190000
|
||||
v -0.139099 2.938947 1.200000
|
||||
v -0.139099 2.938947 -1.200000
|
||||
v -0.261266 -4.059988 1.200000
|
||||
v -0.261266 -4.059988 -1.200000
|
||||
v -2.660901 -4.018101 -1.210000
|
||||
v -2.660901 -4.018101 1.190000
|
||||
v 0.000000 -4.387500 -1.400000
|
||||
v 0.000000 -4.387500 1.400000
|
||||
v -2.799999 -4.387500 1.390000
|
||||
v -2.799999 -4.387500 -1.410000
|
||||
v -2.800000 -0.812499 1.390000
|
||||
v -2.800000 -0.812499 -1.410000
|
||||
v -0.000000 -4.387500 -1.400000
|
||||
v -0.000000 -4.387500 1.400000
|
||||
v -0.000000 -0.812499 1.400000
|
||||
v -0.000000 -0.812499 -1.400000
|
||||
v 2.800000 -0.812499 -1.410000
|
||||
v 2.800000 -0.812499 1.390000
|
||||
v 2.799999 -4.387500 -1.410000
|
||||
v 2.799999 -4.387500 1.390000
|
||||
v 0.000000 -0.812499 1.400000
|
||||
v 0.000000 -0.812499 -1.400000
|
||||
v 0.000000 -0.812499 -1.400000
|
||||
v 0.000000 -4.387500 -1.400000
|
||||
v 0.000000 -4.387500 1.400000
|
||||
v 0.000000 -0.812499 1.400000
|
||||
v 0.000000 -0.812499 -1.400000
|
||||
v 2.267006 13.830965 2.267006
|
||||
v 2.267006 13.830965 -2.267006
|
||||
v 2.800000 -0.812499 -1.410000
|
||||
v 2.799999 -4.387500 -1.410000
|
||||
v 2.799999 -4.387500 1.390000
|
||||
v 2.800000 -0.812499 1.390000
|
||||
v 2.267006 13.830965 2.267007
|
||||
v 2.267006 13.830965 -2.267005
|
||||
v 2.267006 9.296881 -2.267005
|
||||
v 2.267006 9.296881 2.267006
|
||||
v 2.267006 9.296881 -2.267006
|
||||
v -2.267006 13.830965 -2.267006
|
||||
v -2.267006 13.830965 2.267006
|
||||
v -2.267006 9.296881 -2.267006
|
||||
v -2.267006 13.830965 -2.267005
|
||||
v -2.267006 13.830965 2.267007
|
||||
v -2.267006 9.296881 -2.267005
|
||||
v -2.267006 9.296881 2.267006
|
||||
v -4.168111 10.060661 1.681621
|
||||
v 1.741822 -5.305762 4.169018
|
||||
v 1.718504 -5.438008 3.407457
|
||||
v -6.641035 -3.963995 3.407457
|
||||
v 4.191429 8.586647 1.681621
|
||||
v -6.617718 -3.831752 4.169018
|
||||
v 4.168111 8.454401 0.920061
|
||||
v -4.191429 9.928415 0.920061
|
||||
v -4.191429 8.586648 1.681620
|
||||
v 6.617716 -3.831752 4.169018
|
||||
v 6.641035 -3.963997 3.407457
|
||||
v -1.718504 -5.438006 3.407457
|
||||
v 4.168111 10.060658 1.681621
|
||||
v -1.741822 -5.305762 4.169018
|
||||
v 4.191429 9.928414 0.920061
|
||||
v -4.168111 8.454404 0.920061
|
||||
vt 0.250000 0.375000
|
||||
vt 0.250000 0.000000
|
||||
vt 0.312500 0.000000
|
||||
@ -81,6 +134,8 @@ vt 0.312500 0.375000
|
||||
vt 0.437500 0.375000
|
||||
vt 0.437500 0.500000
|
||||
vt 0.312500 0.500000
|
||||
vt 0.437500 0.500000
|
||||
vt 0.437500 0.375000
|
||||
vt 0.562500 0.375000
|
||||
vt 0.562500 0.500000
|
||||
vt 0.437500 0.000000
|
||||
@ -97,97 +152,308 @@ vt 0.750000 1.000000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.875000 0.750000
|
||||
vt 0.875000 1.000000
|
||||
vt 0.750000 1.000000
|
||||
vt 0.750000 0.750000
|
||||
vt 0.750000 0.500000
|
||||
vt 0.875000 0.750000
|
||||
vt 0.875000 0.500000
|
||||
vt 1.000000 0.750000
|
||||
vt 1.000000 0.500000
|
||||
vt 0.750000 0.375000
|
||||
vt 0.750000 0.500000
|
||||
vt 0.812500 0.500000
|
||||
vt 0.812500 0.375000
|
||||
vt 0.687500 0.375000
|
||||
vt 0.687500 0.500000
|
||||
vt 0.750000 0.500000
|
||||
vt 0.750000 0.375000
|
||||
vt 0.687500 0.375000
|
||||
vt 0.625000 0.375000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.687500 0.000000
|
||||
vt 0.750000 0.000000
|
||||
vt 0.687500 0.000000
|
||||
vt 0.812500 0.375000
|
||||
vt 0.812500 0.000000
|
||||
vt 0.875000 0.375000
|
||||
vt 0.875000 0.000000
|
||||
vt 0.812500 0.375000
|
||||
vt 0.812500 0.000000
|
||||
vt 0.875000 0.000000
|
||||
vt 0.875000 0.375000
|
||||
vt 0.750000 0.375000
|
||||
vt 0.750000 0.000000
|
||||
vt 0.687500 0.375000
|
||||
vt 0.687500 0.000000
|
||||
vt 0.687500 0.375000
|
||||
vt 0.687500 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.625000 0.375000
|
||||
vt 0.750000 0.500000
|
||||
vt 0.687500 0.500000
|
||||
vt 0.750000 0.375000
|
||||
vt 0.812500 0.375000
|
||||
vt 0.812500 0.500000
|
||||
vt 0.750000 0.500000
|
||||
vt 0.125000 0.375000
|
||||
vt 0.062500 0.375000
|
||||
vt 0.062500 0.500000
|
||||
vt 0.125000 0.500000
|
||||
vt 0.187500 0.375000
|
||||
vt 0.125000 0.375000
|
||||
vt 0.125000 0.500000
|
||||
vt 0.187500 0.500000
|
||||
vt 0.000000 0.375000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.062500 0.000000
|
||||
vt 0.062500 0.375000
|
||||
vt 0.250000 0.375000
|
||||
vt 0.250000 0.000000
|
||||
vt 0.187500 0.000000
|
||||
vt 0.187500 0.375000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.062500 0.000000
|
||||
vt 0.187500 0.375000
|
||||
vt 0.187500 0.000000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.437500 0.875000
|
||||
vt 0.437500 1.000000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.375000 0.875000
|
||||
vt 0.250000 0.875000
|
||||
vt 0.312500 0.875000
|
||||
vt 0.312500 0.656250
|
||||
vt 0.250000 0.656250
|
||||
vt 0.500000 0.875000
|
||||
vt 0.437500 0.656250
|
||||
vt 0.500000 0.656250
|
||||
vt 0.375000 0.656250
|
||||
vt 0.312500 1.000000
|
||||
usemtl Armor
|
||||
vt 0.125000 0.375000
|
||||
vt 0.125000 0.375000
|
||||
vt 0.125000 0.500000
|
||||
vt 0.062500 0.500000
|
||||
vt 0.062500 0.375000
|
||||
vt 0.187500 0.375000
|
||||
vt 0.125000 0.375000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.187500 0.000000
|
||||
vt 0.062500 0.000000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.250000 0.375000
|
||||
vt 0.187500 0.375000
|
||||
vt 0.187500 0.000000
|
||||
vt 0.250000 0.000000
|
||||
vt 0.000000 0.375000
|
||||
vt 0.062500 0.375000
|
||||
vt 0.062500 0.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.187500 0.375000
|
||||
vt 0.187500 0.500000
|
||||
vt 0.125000 0.500000
|
||||
vt 0.125000 0.375000
|
||||
vt 0.381250 0.832812
|
||||
vt 0.381250 0.845312
|
||||
vt 0.375000 0.845312
|
||||
vt 0.375000 0.832812
|
||||
vt 0.362500 0.832812
|
||||
vt 0.368750 0.832812
|
||||
vt 0.368750 0.810938
|
||||
vt 0.362500 0.810938
|
||||
vt 0.387500 0.832812
|
||||
vt 0.381250 0.832812
|
||||
vt 0.381250 0.810938
|
||||
vt 0.387500 0.810938
|
||||
vt 0.375000 0.832812
|
||||
vt 0.368750 0.832812
|
||||
vt 0.368750 0.810938
|
||||
vt 0.375000 0.810938
|
||||
vt 0.381250 0.832812
|
||||
vt 0.375000 0.832812
|
||||
vt 0.375000 0.810938
|
||||
vt 0.381250 0.810938
|
||||
vt 0.375000 0.845312
|
||||
vt 0.368750 0.845312
|
||||
vt 0.381250 0.832812
|
||||
vt 0.381250 0.810938
|
||||
vt 0.375000 0.810938
|
||||
vt 0.375000 0.832812
|
||||
vt 0.375000 0.832812
|
||||
vt 0.375000 0.810938
|
||||
vt 0.368750 0.810938
|
||||
vt 0.368750 0.832812
|
||||
vt 0.387500 0.832812
|
||||
vt 0.387500 0.810938
|
||||
vt 0.381250 0.810938
|
||||
vt 0.381250 0.832812
|
||||
vt 0.362500 0.832812
|
||||
vt 0.362500 0.810938
|
||||
vt 0.368750 0.810938
|
||||
vt 0.368750 0.832812
|
||||
vt 0.381250 0.832812
|
||||
vt 0.375000 0.832812
|
||||
vt 0.375000 0.845312
|
||||
vt 0.381250 0.845312
|
||||
vt 0.368750 0.845312
|
||||
vt 0.375000 0.845312
|
||||
vt 0.500000 0.750000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.750000 0.750000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.750000 1.000000
|
||||
vt 0.875000 0.750000
|
||||
vt 0.750000 0.750000
|
||||
vt 0.750000 1.000000
|
||||
vt 0.875000 1.000000
|
||||
vt 0.750000 0.500000
|
||||
vt 0.875000 0.750000
|
||||
vt 0.875000 0.500000
|
||||
vt 1.000000 0.750000
|
||||
vt 1.000000 0.500000
|
||||
vt 0.032859 0.558649
|
||||
vt 0.032859 0.998468
|
||||
vt 0.362724 0.998468
|
||||
vt 0.362724 0.558649
|
||||
vt 0.032859 0.558649
|
||||
vt 0.362724 0.558649
|
||||
vt 0.362724 0.998468
|
||||
vt 0.032859 0.998468
|
||||
vt 0.039157 0.992309
|
||||
vt 0.039157 0.656118
|
||||
vt 0.060169 0.656118
|
||||
vt 0.060169 0.992309
|
||||
vt -0.003415 0.501261
|
||||
vt 0.368238 0.501261
|
||||
vt 0.368238 0.563203
|
||||
vt -0.003415 0.563203
|
||||
vt 0.368238 0.996797
|
||||
vt -0.003415 0.996797
|
||||
vt -0.003415 0.934855
|
||||
vt 0.368238 0.934855
|
||||
vt 0.394691 0.498800
|
||||
vt 0.394691 0.994336
|
||||
vt 0.363720 0.994336
|
||||
vt 0.363720 0.498800
|
||||
vt 0.032859 0.998468
|
||||
vt 0.032859 0.558649
|
||||
vt 0.362724 0.558649
|
||||
vt 0.362724 0.998468
|
||||
vt 0.032859 0.998468
|
||||
vt 0.362724 0.998468
|
||||
vt 0.362724 0.558649
|
||||
vt 0.032859 0.558649
|
||||
vt 0.039157 0.656118
|
||||
vt 0.039157 0.992309
|
||||
vt 0.060169 0.992309
|
||||
vt 0.060169 0.656118
|
||||
vt -0.003415 0.996797
|
||||
vt 0.368238 0.996797
|
||||
vt 0.368238 0.934855
|
||||
vt -0.003415 0.934855
|
||||
vt 0.368238 0.501261
|
||||
vt -0.003415 0.501261
|
||||
vt -0.003415 0.563203
|
||||
vt 0.368238 0.563203
|
||||
vt 0.394691 0.994336
|
||||
vt 0.394691 0.498800
|
||||
vt 0.363720 0.498800
|
||||
vt 0.363720 0.994336
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
vn 0.0000 -1.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.0872 -0.9962 0.0000
|
||||
vn 0.0872 0.9962 0.0000
|
||||
vn -0.9962 0.0872 0.0000
|
||||
vn 0.9962 -0.0872 0.0000
|
||||
vn -0.9962 -0.0872 0.0000
|
||||
vn 0.9962 0.0872 0.0000
|
||||
vn -0.0872 0.9962 0.0000
|
||||
vn 0.0872 -0.9962 0.0000
|
||||
vn -0.0175 0.9998 0.0000
|
||||
vn 0.0175 -0.9998 0.0000
|
||||
vn 0.9998 0.0175 0.0000
|
||||
vn 0.0042 0.0001 1.0000
|
||||
vn -0.0042 -0.0001 -1.0000
|
||||
vn -0.9998 -0.0175 0.0000
|
||||
vn 0.0175 0.9998 0.0000
|
||||
vn 0.9998 -0.0175 0.0000
|
||||
vn 0.0042 -0.0001 -1.0000
|
||||
vn -0.0042 0.0001 1.0000
|
||||
vn -0.9998 0.0175 0.0000
|
||||
vn -0.0175 -0.9998 0.0000
|
||||
vn -0.0036 -0.0000 1.0000
|
||||
vn 0.0036 0.0000 -1.0000
|
||||
vn -0.0036 0.0000 -1.0000
|
||||
vn 0.0036 -0.0000 1.0000
|
||||
vn 0.0302 0.1710 0.9848
|
||||
vn -0.0302 -0.1710 -0.9848
|
||||
vn 0.1710 0.9698 -0.1737
|
||||
vn 0.9848 -0.1736 0.0000
|
||||
vn -0.9848 0.1736 -0.0000
|
||||
vn -0.1710 -0.9698 0.1736
|
||||
vn -0.0302 0.1710 0.9848
|
||||
vn 0.0302 -0.1710 -0.9848
|
||||
vn -0.1710 0.9698 -0.1736
|
||||
vn 0.9848 0.1736 0.0000
|
||||
vn -0.9848 -0.1736 -0.0000
|
||||
vn 0.1710 -0.9698 0.1736
|
||||
usemtl None
|
||||
s off
|
||||
f 1/1 3/2 4/3 2/4
|
||||
f 5/5 6/6 1/7 2/4
|
||||
f 8/6 7/5 4/8 3/9
|
||||
f 5/5 2/4 4/3 7/10
|
||||
f 7/10 8/11 6/12 5/5
|
||||
f 8/11 3/13 1/14 6/12
|
||||
f 9/15 11/16 12/17 10/18
|
||||
f 13/19 14/20 9/21 10/18
|
||||
f 12/22 11/23 16/20 15/19
|
||||
f 13/19 10/18 12/17 15/24
|
||||
f 14/22 13/19 15/24 16/25
|
||||
f 9/26 14/22 16/25 11/27
|
||||
f 17/28 18/24 19/29 20/30
|
||||
f 24/31 23/32 22/24 21/28
|
||||
f 23/31 24/14 20/13 19/33
|
||||
f 24/31 21/28 17/34 20/33
|
||||
f 21/28 22/30 18/35 17/34
|
||||
f 22/30 23/36 19/37 18/35
|
||||
f 27/30 31/35 30/37 26/36
|
||||
f 28/28 32/34 31/35 27/30
|
||||
f 25/31 29/33 32/34 28/28
|
||||
f 26/31 30/33 29/13 25/14
|
||||
f 25/31 28/28 27/24 26/32
|
||||
f 32/28 29/30 30/29 31/24
|
||||
f 40/38 33/39 34/40 39/41
|
||||
f 36/42 38/38 37/41 35/43
|
||||
f 39/44 37/45 38/46 40/39
|
||||
f 34/1 35/2 37/47 39/42
|
||||
f 40/38 38/48 36/46 33/39
|
||||
f 33/42 36/47 35/48 34/38
|
||||
f 45/38 46/41 42/40 41/39
|
||||
f 41/42 42/38 43/48 44/47
|
||||
f 45/38 41/39 44/46 47/48
|
||||
f 42/1 46/42 48/47 43/2
|
||||
f 46/44 45/39 47/46 48/45
|
||||
f 44/42 43/43 48/41 47/38
|
||||
f 53/49 54/50 49/51 50/52
|
||||
f 51/53 52/54 50/55 49/56
|
||||
f 55/57 51/49 49/58 54/59
|
||||
f 52/52 56/54 53/55 50/60
|
||||
f 56/49 55/52 54/60 53/58
|
||||
f 52/52 51/51 55/61 56/54
|
||||
f 64/49 61/58 62/60 63/52
|
||||
f 57/52 59/60 61/55 64/54
|
||||
f 63/57 62/59 60/58 58/49
|
||||
f 58/53 60/56 59/55 57/54
|
||||
f 61/49 59/52 60/51 62/50
|
||||
f 57/52 64/54 63/61 58/51
|
||||
f 65/15 66/18 68/17 67/16
|
||||
f 69/19 66/18 65/21 70/20
|
||||
f 68/22 71/19 72/20 67/23
|
||||
f 69/19 71/24 68/17 66/18
|
||||
f 70/22 72/25 71/24 69/19
|
||||
f 65/26 67/27 72/25 70/22
|
||||
f 9/15/7 10/16/7 11/17/7 12/18/7
|
||||
f 13/19/8 14/20/8 9/21/8 12/18/8
|
||||
f 15/22/9 16/23/9 11/24/9 10/25/9
|
||||
f 13/19/10 12/18/10 11/17/10 16/26/10
|
||||
f 16/26/11 15/27/11 14/28/11 13/19/11
|
||||
f 15/27/12 10/29/12 9/30/12 14/28/12
|
||||
f 17/31/7 18/32/7 19/33/7 20/34/7
|
||||
f 21/35/8 22/36/8 17/37/8 20/34/8
|
||||
f 19/38/9 18/39/9 23/40/9 24/41/9
|
||||
f 21/35/10 20/34/10 19/33/10 24/42/10
|
||||
f 22/43/11 21/35/11 24/42/11 23/44/11
|
||||
f 17/45/12 22/43/12 23/44/12 18/46/12
|
||||
f 25/47/13 26/48/13 27/49/13 28/50/13
|
||||
f 29/51/14 30/52/14 31/53/14 32/54/14
|
||||
f 30/55/15 29/56/15 28/57/15 27/58/15
|
||||
f 29/51/10 32/54/10 25/59/10 28/60/10
|
||||
f 32/54/16 31/61/16 26/62/16 25/59/16
|
||||
f 31/61/12 30/63/12 27/64/12 26/62/12
|
||||
f 33/65/12 34/66/12 35/67/12 36/68/12
|
||||
f 37/69/17 38/70/17 34/66/17 33/65/17
|
||||
f 39/71/10 40/72/10 38/70/10 37/69/10
|
||||
f 36/73/18 35/74/18 40/75/18 39/76/18
|
||||
f 39/71/19 37/69/19 33/77/19 36/78/19
|
||||
f 38/79/20 40/80/20 35/81/20 34/82/20
|
||||
f 41/83/21 42/84/21 43/85/21 44/86/21
|
||||
f 45/87/22 46/88/22 47/89/22 48/90/22
|
||||
f 44/91/23 47/92/23 46/93/23 41/94/23
|
||||
f 43/95/24 48/96/24 47/97/24 44/98/24
|
||||
f 41/83/25 46/99/25 45/100/25 42/84/25
|
||||
f 42/101/26 45/102/26 48/103/26 43/104/26
|
||||
f 49/105/27 50/106/27 51/107/27 52/108/27
|
||||
f 52/109/28 51/110/28 53/111/28 54/112/28
|
||||
f 49/105/29 52/108/29 54/113/29 55/114/29
|
||||
f 51/115/30 50/116/30 56/117/30 53/118/30
|
||||
f 50/119/31 49/120/31 55/121/31 56/122/31
|
||||
f 54/123/32 53/124/32 56/125/32 55/126/32
|
||||
f 57/127/9 58/128/9 59/129/9 60/130/9
|
||||
f 61/131/11 62/132/11 60/133/11 59/134/11
|
||||
f 63/135/33 61/136/33 59/137/33 58/138/33
|
||||
f 62/139/34 64/140/34 57/141/34 60/142/34
|
||||
f 64/143/7 63/144/7 58/145/7 57/146/7
|
||||
f 62/139/8 61/147/8 63/148/8 64/140/8
|
||||
f 65/149/11 66/150/11 67/151/11 68/152/11
|
||||
f 69/153/35 70/154/35 66/155/35 65/156/35
|
||||
f 68/157/36 67/158/36 71/159/36 72/160/36
|
||||
f 72/161/7 71/162/7 70/163/7 69/164/7
|
||||
f 66/165/9 70/166/9 71/167/9 67/168/9
|
||||
f 69/153/8 65/156/8 68/169/8 72/170/8
|
||||
f 73/171/11 74/172/11 75/173/11 76/174/11
|
||||
f 77/175/9 74/172/9 73/176/9 78/177/9
|
||||
f 75/178/8 79/179/8 80/180/8 76/181/8
|
||||
f 77/175/12 79/182/12 75/173/12 74/172/12
|
||||
f 78/183/7 80/184/7 79/182/7 77/175/7
|
||||
f 73/185/10 76/186/10 80/184/10 78/183/10
|
||||
f 85/187/37 81/188/37 86/189/37 82/190/37
|
||||
f 87/191/38 83/192/38 84/193/38 88/194/38
|
||||
f 81/195/39 85/196/39 87/197/39 88/198/39
|
||||
f 85/199/40 82/200/40 83/201/40 87/202/40
|
||||
f 86/203/41 81/204/41 88/205/41 84/206/41
|
||||
f 82/207/42 86/208/42 84/209/42 83/210/42
|
||||
f 93/211/43 89/212/43 94/213/43 90/214/43
|
||||
f 95/215/44 91/216/44 92/217/44 96/218/44
|
||||
f 89/219/45 93/220/45 95/221/45 96/222/45
|
||||
f 93/223/46 90/224/46 91/225/46 95/226/46
|
||||
f 94/227/47 89/228/47 96/229/47 92/230/47
|
||||
f 90/231/48 94/232/48 92/233/48 91/234/48
|
||||
|
@ -1,23 +1,95 @@
|
||||
local S = minetest.get_translator("mcl_beds")
|
||||
|
||||
local function destruct_bed(pos, oldnode)
|
||||
local node = oldnode or minetest.get_node(pos)
|
||||
local minetest_get_node = minetest.get_node
|
||||
local minetest_get_node_or_nil = minetest.get_node_or_nil
|
||||
local minetest_remove_node = minetest.remove_node
|
||||
local minetest_facedir_to_dir = minetest.facedir_to_dir
|
||||
local minetest_add_item = minetest.add_item
|
||||
local vector_add = vector.add
|
||||
local vector_subtract = vector.subtract
|
||||
|
||||
local function get_bed_next_node(pos, node)
|
||||
local node = node or minetest_get_node_or_nil(pos)
|
||||
if not node then return end
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local pos2, node2
|
||||
|
||||
local dir = minetest_facedir_to_dir(node.param2)
|
||||
|
||||
local pos2, bottom
|
||||
if string.sub(node.name, -4) == "_top" then
|
||||
pos2 = vector.subtract(pos, dir)
|
||||
node2 = minetest.get_node(pos2)
|
||||
if node2 and string.sub(node2.name, -7) == "_bottom" then
|
||||
minetest.remove_node(pos2)
|
||||
end
|
||||
minetest.check_for_falling(pos)
|
||||
elseif string.sub(node.name, -7) == "_bottom" then
|
||||
minetest.add_item(pos, node.name)
|
||||
pos2 = vector.add(pos, dir)
|
||||
node2 = minetest.get_node(pos2)
|
||||
pos2 = vector_subtract(pos, dir)
|
||||
else
|
||||
pos2 = vector_add(pos, dir)
|
||||
bottom = true
|
||||
end
|
||||
|
||||
local node2 = minetest_get_node(pos2)
|
||||
return pos2, node2, bottom, dir
|
||||
end
|
||||
|
||||
local function rotate(pos, node, user, mode, new_param2)
|
||||
if mode ~= screwdriver.ROTATE_FACE then
|
||||
return false
|
||||
end
|
||||
|
||||
local p, node2, bottom = get_bed_next_node(pos, node)
|
||||
if not node2 then return end
|
||||
|
||||
local name = node2.name
|
||||
if not minetest.get_item_group(name, "bed") == 2 or not node.param2 == node2.param2 then return false end
|
||||
|
||||
if bottom then
|
||||
name = string.sub(name, 1, -5)
|
||||
else
|
||||
name = string.sub(name, 1, -8)
|
||||
end
|
||||
|
||||
if minetest.is_protected(p, user:get_player_name()) then
|
||||
minetest.record_protection_violation(p, user:get_player_name())
|
||||
return false
|
||||
end
|
||||
|
||||
local new_dir, newp = minetest_facedir_to_dir(new_param2)
|
||||
if bottom then
|
||||
newp = vector_add(pos, new_dir)
|
||||
else
|
||||
newp = vector_subtract(pos, new_dir)
|
||||
end
|
||||
|
||||
local node3 = minetest_get_node_or_nil(newp)
|
||||
if not node3 then return false end
|
||||
|
||||
local node_def = minetest.registered_nodes[node3.name]
|
||||
if not node_def or not node_def.buildable_to then return false end
|
||||
|
||||
if minetest.is_protected(newp, user:get_player_name()) then
|
||||
minetest.record_protection_violation(newp, user:get_player_name())
|
||||
return false
|
||||
end
|
||||
|
||||
node.param2 = new_param2
|
||||
-- do not remove_node here - it will trigger destroy_bed()
|
||||
minetest.swap_node(p, {name = "air"})
|
||||
minetest.swap_node(pos, node)
|
||||
minetest.swap_node(newp, {name = name .. (bottom and "_top" or "_bottom"), param2 = new_param2})
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
local function destruct_bed(pos, oldnode)
|
||||
local node = oldnode or minetest_get_node_or_nil(pos)
|
||||
if not node then return end
|
||||
|
||||
local pos2, node2, bottom = get_bed_next_node(pos, oldnode)
|
||||
|
||||
if bottom then
|
||||
minetest_add_item(pos, node.name)
|
||||
if node2 and string.sub(node2.name, -4) == "_top" then
|
||||
minetest.remove_node(pos2)
|
||||
minetest_remove_node(pos2)
|
||||
end
|
||||
else
|
||||
if node2 and string.sub(node2.name, -7) == "_bottom" then
|
||||
minetest_remove_node(pos2)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -94,7 +166,7 @@ function mcl_beds.register_bed(name, def)
|
||||
local under = pointed_thing.under
|
||||
|
||||
-- Use pointed node's on_rightclick function first, if present
|
||||
local node = minetest.get_node(under)
|
||||
local node = minetest_get_node(under)
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
||||
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
||||
@ -102,7 +174,7 @@ function mcl_beds.register_bed(name, def)
|
||||
end
|
||||
|
||||
local pos
|
||||
local undername = minetest.get_node(under).name
|
||||
local undername = minetest_get_node(under).name
|
||||
if minetest.registered_items[undername] and minetest.registered_items[undername].buildable_to then
|
||||
pos = under
|
||||
else
|
||||
@ -115,13 +187,13 @@ function mcl_beds.register_bed(name, def)
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local node_def = minetest.registered_nodes[minetest.get_node(pos).name]
|
||||
local node_def = minetest.registered_nodes[minetest_get_node(pos).name]
|
||||
if not node_def or not node_def.buildable_to then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local dir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||
local botpos = vector.add(pos, minetest.facedir_to_dir(dir))
|
||||
local botpos = vector_add(pos, minetest_facedir_to_dir(dir))
|
||||
|
||||
if minetest.is_protected(botpos, placer:get_player_name()) and
|
||||
not minetest.check_player_privs(placer, "protection_bypass") then
|
||||
@ -129,7 +201,7 @@ function mcl_beds.register_bed(name, def)
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local botdef = minetest.registered_nodes[minetest.get_node(botpos).name]
|
||||
local botdef = minetest.registered_nodes[minetest_get_node(botpos).name]
|
||||
if not botdef or not botdef.buildable_to then
|
||||
return itemstack
|
||||
end
|
||||
@ -152,38 +224,7 @@ function mcl_beds.register_bed(name, def)
|
||||
return itemstack
|
||||
end,
|
||||
|
||||
on_rotate = function(pos, node, user, mode, new_param2)
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local p = vector.add(pos, dir)
|
||||
local node2 = minetest.get_node_or_nil(p)
|
||||
if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or
|
||||
not node.param2 == node2.param2 then
|
||||
return false
|
||||
end
|
||||
if minetest.is_protected(p, user:get_player_name()) then
|
||||
minetest.record_protection_violation(p, user:get_player_name())
|
||||
return false
|
||||
end
|
||||
if mode ~= screwdriver.ROTATE_FACE then
|
||||
return false
|
||||
end
|
||||
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
|
||||
local node3 = minetest.get_node_or_nil(newp)
|
||||
local node_def = node3 and minetest.registered_nodes[node3.name]
|
||||
if not node_def or not node_def.buildable_to then
|
||||
return false
|
||||
end
|
||||
if minetest.is_protected(newp, user:get_player_name()) then
|
||||
minetest.record_protection_violation(newp, user:get_player_name())
|
||||
return false
|
||||
end
|
||||
node.param2 = new_param2
|
||||
-- do not remove_node here - it will trigger destroy_bed()
|
||||
minetest.set_node(p, {name = "air"})
|
||||
minetest.set_node(pos, node)
|
||||
minetest.set_node(newp, {name = name .. "_top", param2 = new_param2})
|
||||
return true
|
||||
end,
|
||||
on_rotate = rotate,
|
||||
})
|
||||
|
||||
local node_box_top, selection_box_top, collision_box_top
|
||||
@ -217,7 +258,7 @@ function mcl_beds.register_bed(name, def)
|
||||
mcl_beds.on_rightclick(pos, clicker, true)
|
||||
return itemstack
|
||||
end,
|
||||
on_rotate = false,
|
||||
on_rotate = rotate,
|
||||
after_destruct = destruct_bed,
|
||||
})
|
||||
|
||||
|
@ -303,7 +303,11 @@ function mcl_beds.on_rightclick(pos, player, is_top)
|
||||
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})
|
||||
end
|
||||
|
@ -147,8 +147,8 @@ minetest.register_on_player_receive_fields(function ( player, formname, fields )
|
||||
local formspec = "size[8,9]"..
|
||||
header..
|
||||
"background[-0.5,-0.5;9,10;mcl_books_book_bg.png]"..
|
||||
"field[0.75,1;7.25,1;title;"..minetest.formspec_escape(minetest.colorize(mcl_colors.BLACK, S("Enter book title:")))..";]"..
|
||||
"label[0.75,1.5;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("by @1", name))).."]"..
|
||||
"field[0.75,1;7.25,1;title;"..minetest.formspec_escape(minetest.colorize("#000000", S("Enter book title:")))..";]"..
|
||||
"label[0.75,1.5;"..minetest.formspec_escape(minetest.colorize("#404040", S("by @1", name))).."]"..
|
||||
"button_exit[0.75,7.95;3,1;sign;"..minetest.formspec_escape(S("Sign and Close")).."]"..
|
||||
"tooltip[sign;"..minetest.formspec_escape(S("Note: The book will no longer be editable after signing")).."]"..
|
||||
"button[4.25,7.95;3,1;cancel;"..minetest.formspec_escape(S("Cancel")).."]"
|
||||
|
@ -108,7 +108,7 @@ local damage_particles = function(pos, is_critical)
|
||||
end
|
||||
|
||||
ARROW_ENTITY.on_step = function(self, dtime)
|
||||
mcl_burning.tick(self.object, dtime)
|
||||
mcl_burning.tick(self.object, dtime, self)
|
||||
|
||||
self._time_in_air = self._time_in_air + .001
|
||||
|
||||
|
@ -4,8 +4,8 @@ local function active_brewing_formspec(fuel_percent, brew_percent)
|
||||
|
||||
return "size[9,8.75]"..
|
||||
"background[-0.19,-0.25;9.5,9.5;mcl_brewing_inventory.png]"..
|
||||
"label[4,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Brewing Stand"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[4,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Brewing Stand"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.75;9,1;]"..
|
||||
@ -35,8 +35,8 @@ end
|
||||
|
||||
local brewing_formspec = "size[9,8.75]"..
|
||||
"background[-0.19,-0.25;9.5,9.5;mcl_brewing_inventory.png]"..
|
||||
"label[4,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Brewing Stand"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[4,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Brewing Stand"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.75;9,1;]"..
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = mcl_brewing
|
||||
author = bzoss
|
||||
depends = mcl_init, mcl_formspec, mcl_sounds, mcl_potions, mcl_mobitems, mcl_colors
|
||||
depends = mcl_init, mcl_formspec, mcl_sounds, mcl_potions, mcl_mobitems
|
||||
optional_depends = mcl_core, doc, screwdriver
|
||||
|
@ -475,10 +475,10 @@ minetest.register_node(small_name, {
|
||||
minetest.show_formspec(clicker:get_player_name(),
|
||||
"mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z,
|
||||
"size[9,8.75]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, name)).."]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]"..
|
||||
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
@ -624,12 +624,12 @@ minetest.register_node(left_name, {
|
||||
minetest.show_formspec(clicker:get_player_name(),
|
||||
"mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z,
|
||||
"size[9,11.5]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, name)).."]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]"..
|
||||
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,3.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,3.5,9,3)..
|
||||
"label[0,7;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,7;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,7.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.5,9,3)..
|
||||
"list[current_player;main;0,10.75;9,1;]"..
|
||||
@ -773,12 +773,12 @@ minetest.register_node("mcl_chests:"..basename.."_right", {
|
||||
"mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z,
|
||||
|
||||
"size[9,11.5]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, name)).."]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]"..
|
||||
"list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,3.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,3.5,9,3)..
|
||||
"label[0,7;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,7;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,7.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.5,9,3)..
|
||||
"list[current_player;main;0,10.75;9,1;]"..
|
||||
@ -986,10 +986,10 @@ minetest.register_node("mcl_chests:ender_chest", {
|
||||
})
|
||||
|
||||
local formspec_ender_chest = "size[9,8.75]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Ender Chest"))).."]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Ender Chest"))).."]"..
|
||||
"list[current_player;enderchest;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
@ -1027,11 +1027,14 @@ minetest.register_node("mcl_chests:ender_chest_small", {
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
drop = "mcl_core:obsidian 8",
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", formspec_ender_chest)
|
||||
create_entity(pos, "mcl_chests:ender_chest_small", {"mcl_chests_ender.png"}, minetest.get_node(pos).param2, false, "mcl_chests_enderchest", "mcl_chests_chest", "chest")
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name].groups.opaque == 1 then
|
||||
-- won't open if there is no space from the top
|
||||
return false
|
||||
end
|
||||
minetest.show_formspec(clicker:get_player_name(), "mcl_chests:ender_chest_"..clicker:get_player_name(), formspec_ender_chest)
|
||||
player_chest_open(clicker, pos, "mcl_chests:ender_chest_small", {"mcl_chests_ender.png"}, node.param2, false, "mcl_chests_enderchest", "mcl_chests_chest")
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
@ -1104,10 +1107,10 @@ local function formspec_shulker_box(name)
|
||||
name = S("Shulker Box")
|
||||
end
|
||||
return "size[9,8.75]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, name)).."]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]"..
|
||||
"list[current_name;main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
@ -1406,3 +1409,13 @@ minetest.register_lbm({
|
||||
meta:set_string("formspec", formspec_shulker_box)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_lbm({
|
||||
label = "Upgrade old ender chest formspec",
|
||||
name = "mcl_chests:replace_old_ender_form",
|
||||
nodenames = {"mcl_chests:ender_chest_small"},
|
||||
run_at_every_load = false,
|
||||
action = function(pos, node)
|
||||
minetest.get_meta(pos):set_string("formspec", "")
|
||||
end,
|
||||
})
|
||||
|
@ -1,3 +1,3 @@
|
||||
name = mcl_chests
|
||||
depends = mcl_init, mcl_formspec, mcl_core, mcl_sounds, mcl_end, mesecons, mcl_colors
|
||||
depends = mcl_init, mcl_formspec, mcl_core, mcl_sounds, mcl_end, mesecons
|
||||
optional_depends = doc, screwdriver
|
||||
|
@ -46,56 +46,6 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
-- Stripped Bark
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:stripped_oak_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:stripped_oak", "mcl_core:stripped_oak" },
|
||||
{ "mcl_core:stripped_oak", "mcl_core:stripped_oak" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:stripped_acacia_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:stripped_acacia", "mcl_core:stripped_acacia" },
|
||||
{ "mcl_core:stripped_acacia", "mcl_core:stripped_acacia" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:stripped_dark_oak_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:stripped_dark_oak", "mcl_core:stripped_dark_oak" },
|
||||
{ "mcl_core:stripped_dark_oak", "mcl_core:stripped_dark_oak" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:stripped_birch_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:stripped_birch", "mcl_core:stripped_birch" },
|
||||
{ "mcl_core:stripped_birch", "mcl_core:stripped_birch" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:stripped_spruce_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:stripped_spruce", "mcl_core:stripped_spruce" },
|
||||
{ "mcl_core:stripped_spruce", "mcl_core:stripped_spruce" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:stripped_jungle_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:stripped_jungle", "mcl_core:stripped_jungle" },
|
||||
{ "mcl_core:stripped_jungle", "mcl_core:stripped_jungle" },
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'shapeless',
|
||||
output = 'mcl_core:mossycobble',
|
||||
|
@ -8,7 +8,7 @@ if mod_screwdriver then
|
||||
end
|
||||
|
||||
-- Register tree trunk (wood) and bark
|
||||
local register_tree_trunk = function(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark)
|
||||
local register_tree_trunk = function(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark, stripped_varient)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description_trunk,
|
||||
_doc_items_longdesc = longdesc,
|
||||
@ -22,6 +22,7 @@ local register_tree_trunk = function(subname, description_trunk, description_bar
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
_mcl_stripped_varient = stripped_varient,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:"..subname.."_bark", {
|
||||
@ -37,6 +38,48 @@ local register_tree_trunk = function(subname, description_trunk, description_bar
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
_mcl_stripped_varient = stripped_varient.."_bark",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:"..subname.."_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:"..subname, "mcl_core:"..subname },
|
||||
{ "mcl_core:"..subname, "mcl_core:"..subname },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Register stripped trunk and stripped wood
|
||||
local register_stripped_trunk = function(subname, description_stripped_trunk, description_stripped_bark, longdesc, tile_stripped_inner, tile_stripped_bark)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description_stripped_trunk,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
tiles = {tile_stripped_inner, tile_stripped_inner, tile_stripped_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
groups = {handy=1,axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:"..subname.."_bark", {
|
||||
description = description_stripped_bark,
|
||||
_doc_items_longdesc = S("This is a decorative block."),
|
||||
tiles = {tile_stripped_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
groups = {handy=1,axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
is_ground_content = false,
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
@ -48,166 +91,6 @@ local register_tree_trunk = function(subname, description_trunk, description_bar
|
||||
})
|
||||
end
|
||||
|
||||
-- Register stripped trunk
|
||||
minetest.register_node("mcl_core:stripped_oak", {
|
||||
description = "Stripped Oak Log",
|
||||
_doc_items_longdesc = "Stripped Oak Log is a log that has been stripped of it's bark.",
|
||||
tiles = {"mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_acacia", {
|
||||
description = "Stripped Acacia Log",
|
||||
_doc_items_longdesc = "Stripped Acacia Log is a log that has been stripped of it's bark.",
|
||||
tiles = {"mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_dark_oak", {
|
||||
description = "Stripped Dark Oak Log",
|
||||
_doc_items_longdesc = "Stripped Dark Oak Log is a log that has been stripped of it's bark.",
|
||||
tiles = {"mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_birch", {
|
||||
description = "Stripped Birch Log",
|
||||
_doc_items_longdesc = "Stripped Birch Log is a log that has been stripped of it's bark.",
|
||||
tiles = {"mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_spruce", {
|
||||
description = "Stripped Spruce Log",
|
||||
_doc_items_longdesc = "Stripped Spruce Log is a log that has been stripped of it's bark.",
|
||||
tiles = {"mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_jungle", {
|
||||
description = "Stripped Jungle Log",
|
||||
_doc_items_longdesc = "Stripped Jungle Log is a log that has been stripped of it's bark.",
|
||||
tiles = {"mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
|
||||
-- Register stripped bark
|
||||
minetest.register_node("mcl_core:stripped_oak_bark", {
|
||||
description = "Stripped Oak Bark",
|
||||
_doc_items_longdesc = "Stripped Oak Bark is a bark that has been stripped.",
|
||||
tiles = {"mcl_core_stripped_oak_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_acacia_bark", {
|
||||
description = "Stripped Acacia Bark",
|
||||
_doc_items_longdesc = "Stripped Acacia Bark is a bark that has been stripped.",
|
||||
tiles = {"mcl_core_stripped_acacia_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_dark_oak_bark", {
|
||||
description = "Stripped Dark Oak Bark",
|
||||
_doc_items_longdesc = "Stripped Dark Oak Bark is a bark that has been stripped.",
|
||||
tiles = {"mcl_core_stripped_dark_oak_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_birch_bark", {
|
||||
description = "Stripped Birch Bark",
|
||||
_doc_items_longdesc = "Stripped Birch Bark is a bark that has been stripped.",
|
||||
tiles = {"mcl_core_stripped_birch_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_spruce_bark", {
|
||||
description = "Stripped Spruce Bark",
|
||||
_doc_items_longdesc = "Stripped Spruce Bark is a bark that has been stripped.",
|
||||
tiles = {"mcl_core_stripped_spruce_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:stripped_jungle_bark", {
|
||||
description = "Stripped Jungle Bark",
|
||||
_doc_items_longdesc = "Stripped Jungles Bark is a bark that has been stripped.",
|
||||
tiles = {"mcl_core_stripped_jungle_side.png"},
|
||||
is_ground_content = false,
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
|
||||
local register_wooden_planks = function(subname, description, tiles)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description,
|
||||
@ -333,12 +216,19 @@ end
|
||||
|
||||
---------------------
|
||||
|
||||
register_tree_trunk("tree", S("Oak Wood"), S("Oak Bark"), S("The trunk of an oak tree."), "default_tree_top.png", "default_tree.png")
|
||||
register_tree_trunk("darktree", S("Dark Oak Wood"), S("Dark Oak Bark"), S("The trunk of a dark oak tree."), "mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak.png")
|
||||
register_tree_trunk("acaciatree", S("Acacia Wood"), S("Acacia Bark"), S("The trunk of an acacia."), "default_acacia_tree_top.png", "default_acacia_tree.png")
|
||||
register_tree_trunk("sprucetree", S("Spruce Wood"), S("Spruce Bark"), S("The trunk of a spruce tree."), "mcl_core_log_spruce_top.png", "mcl_core_log_spruce.png")
|
||||
register_tree_trunk("birchtree", S("Birch Wood"), S("Birch Bark"), S("The trunk of a birch tree."), "mcl_core_log_birch_top.png", "mcl_core_log_birch.png")
|
||||
register_tree_trunk("jungletree", S("Jungle Wood"), S("Jungle Bark"), S("The trunk of a jungle tree."), "default_jungletree_top.png", "default_jungletree.png")
|
||||
register_tree_trunk("tree", S("Oak Wood"), S("Oak Bark"), S("The trunk of an oak tree."), "default_tree_top.png", "default_tree.png", "mcl_core:stripped_oak")
|
||||
register_tree_trunk("darktree", S("Dark Oak Wood"), S("Dark Oak Bark"), S("The trunk of a dark oak tree."), "mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak.png", "mcl_core:stripped_dark_oak")
|
||||
register_tree_trunk("acaciatree", S("Acacia Wood"), S("Acacia Bark"), S("The trunk of an acacia."), "default_acacia_tree_top.png", "default_acacia_tree.png", "mcl_core:stripped_acacia")
|
||||
register_tree_trunk("sprucetree", S("Spruce Wood"), S("Spruce Bark"), S("The trunk of a spruce tree."), "mcl_core_log_spruce_top.png", "mcl_core_log_spruce.png", "mcl_core:stripped_spruce")
|
||||
register_tree_trunk("birchtree", S("Birch Wood"), S("Birch Bark"), S("The trunk of a birch tree."), "mcl_core_log_birch_top.png", "mcl_core_log_birch.png", "mcl_core:stripped_birch")
|
||||
register_tree_trunk("jungletree", S("Jungle Wood"), S("Jungle Bark"), S("The trunk of a jungle tree."), "default_jungletree_top.png", "default_jungletree.png", "mcl_core:stripped_jungle")
|
||||
|
||||
register_stripped_trunk("stripped_oak", S("Stripped Oak Log"), S("Stripped Oak Wood"), S("The stripped trunk of an oak tree."), "mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_side.png")
|
||||
register_stripped_trunk("stripped_acacia", S("Stripped Acacia Log"), S("Stripped Acacia Wood"), S("The stripped trunk of an acacia tree."), "mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_side.png")
|
||||
register_stripped_trunk("stripped_dark_oak", S("Stripped Dark Oak Log"), S("Stripped Dark Oak Wood"), S("The stripped trunk of an dark oak tree."), "mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_side.png")
|
||||
register_stripped_trunk("stripped_birch", S("Stripped Birch Log"), S("Stripped Birch Wood"), S("The stripped trunk of an birch tree."), "mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_side.png")
|
||||
register_stripped_trunk("stripped_spruce", S("Stripped Spruce Log"), S("Stripped Spruce Wood"), S("The stripped trunk of an spruce tree."), "mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_side.png")
|
||||
register_stripped_trunk("stripped_jungle", S("Stripped Jungle Log"), S("Stripped Jungle Wood"), S("The stripped trunk of an jungle tree."),"mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_side.png")
|
||||
|
||||
register_wooden_planks("wood", S("Oak Wood Planks"), {"default_wood.png"})
|
||||
register_wooden_planks("darkwood", S("Dark Oak Wood Planks"), {"mcl_core_planks_big_oak.png"})
|
||||
|
@ -2,7 +2,7 @@ local S = minetest.get_translator("mcl_crafting_table")
|
||||
local formspec_escape = minetest.formspec_escape
|
||||
local show_formspec = minetest.show_formspec
|
||||
local C = minetest.colorize
|
||||
local text_color = mcl_colors.DARK_GRAY
|
||||
local text_color = "#313131"
|
||||
local itemslot_bg = mcl_formspec.get_itemslot_bg
|
||||
|
||||
mcl_crafting_table = {}
|
||||
|
@ -770,12 +770,17 @@ mcl_enchanting.enchantments.unbreaking = {
|
||||
description = S("Increases item durability."),
|
||||
curse = false,
|
||||
on_enchant = function(itemstack, level)
|
||||
local tool_capabilities = itemstack:get_tool_capabilities()
|
||||
for group, capability in pairs(tool_capabilities.groupcaps) do
|
||||
capability.uses = capability.uses * (1 + level)
|
||||
local name = itemstack:get_name()
|
||||
if not minetest.registered_tools[name].tool_capabilities then
|
||||
return
|
||||
end
|
||||
|
||||
local tool_capabilities = itemstack:get_tool_capabilities()
|
||||
tool_capabilities.punch_attack_uses = tool_capabilities.punch_attack_uses * (1 + level)
|
||||
itemstack:get_meta():set_tool_capabilities(tool_capabilities)
|
||||
|
||||
-- Unbreaking for groupcaps is handled in this function.
|
||||
mcl_enchanting.update_groupcaps(itemstack)
|
||||
end,
|
||||
requires_tool = true,
|
||||
treasure = false,
|
||||
|
@ -12,11 +12,12 @@ end
|
||||
function mcl_enchanting.unload_enchantments(itemstack)
|
||||
local itemdef = itemstack:get_definition()
|
||||
if itemdef.tool_capabilities then
|
||||
itemstack:get_meta():set_tool_capabilities(itemdef.tool_capabilities)
|
||||
itemstack:get_meta():set_tool_capabilities(nil)
|
||||
end
|
||||
local meta = itemstack:get_meta()
|
||||
if meta:get_string("name") == "" then
|
||||
meta:set_string("description", "")
|
||||
meta:set_string("groupcaps_hash", "")
|
||||
end
|
||||
end
|
||||
|
||||
@ -468,13 +469,13 @@ function mcl_enchanting.show_enchanting_formspec(player)
|
||||
local formspec = ""
|
||||
.. "size[9.07,8.6;]"
|
||||
.. "formspec_version[3]"
|
||||
.. "label[0,0;" .. C(mcl_colors.DARK_GRAY) .. F(table_name) .. "]"
|
||||
.. "label[0,0;" .. C("#313131") .. F(table_name) .. "]"
|
||||
.. mcl_formspec.get_itemslot_bg(0.2, 2.4, 1, 1)
|
||||
.. "list[current_player;enchanting_item;0.2,2.4;1,1]"
|
||||
.. mcl_formspec.get_itemslot_bg(1.1, 2.4, 1, 1)
|
||||
.. "image[1.1,2.4;1,1;mcl_enchanting_lapis_background.png]"
|
||||
.. "list[current_player;enchanting_lapis;1.1,2.4;1,1]"
|
||||
.. "label[0,4;" .. C(mcl_colors.DARK_GRAY) .. F(S("Inventory")).."]"
|
||||
.. "label[0,4;" .. C("#313131") .. F(S("Inventory")).."]"
|
||||
.. mcl_formspec.get_itemslot_bg(0, 4.5, 9, 3)
|
||||
.. mcl_formspec.get_itemslot_bg(0, 7.74, 9, 1)
|
||||
.. "list[current_player;main;0,4.5;9,3;9]"
|
||||
@ -501,11 +502,11 @@ function mcl_enchanting.show_enchanting_formspec(player)
|
||||
local hover_ending = (can_enchant and "_hovered" or "_off")
|
||||
formspec = formspec
|
||||
.. "container[3.2," .. y .. "]"
|
||||
.. (slot and "tooltip[button_" .. i .. ";" .. C(mcl_colors.GRAY) .. F(slot.description) .. " " .. C(mcl_colors.WHITE) .. " . . . ?\n\n" .. (enough_levels and C(enough_lapis and mcl_colors.GRAY or mcl_colors.RED) .. F(S("@1 Lapis Lazuli", i)) .. "\n" .. C(mcl_colors.GRAY) .. F(S("@1 Enchantment Levels", i)) or C(mcl_colors.RED) .. F(S("Level requirement: @1", slot.level_requirement))) .. "]" or "")
|
||||
.. (slot and "tooltip[button_" .. i .. ";" .. C("#818181") .. ((slot.description and F(slot.description)) or "") .. " " .. C("#FFFFFF") .. " . . . ?\n\n" .. (enough_levels and C(enough_lapis and "#818181" or "#FC5454") .. F(S("@1 Lapis Lazuli", i)) .. "\n" .. C("#818181") .. F(S("@1 Enchantment Levels", i)) or C("#FC5454") .. F(S("Level requirement: @1", slot.level_requirement))) .. "]" or "")
|
||||
.. "style[button_" .. i .. ";bgimg=mcl_enchanting_button" .. ending .. ".png;bgimg_hovered=mcl_enchanting_button" .. hover_ending .. ".png;bgimg_pressed=mcl_enchanting_button" .. hover_ending .. ".png]"
|
||||
.. "button[0,0;7.5,1.3;button_" .. i .. ";]"
|
||||
.. (slot and "image[0,0;1.3,1.3;mcl_enchanting_number_" .. i .. ending .. ".png]" or "")
|
||||
.. (slot and "label[7.2,1.1;" .. C(can_enchant and mcl_colors.GREEN or mcl_colors.DARK_GREEN) .. slot.level_requirement .. "]" or "")
|
||||
.. (slot and "label[7.2,1.1;" .. C(can_enchant and "#80FF20" or "#407F10") .. slot.level_requirement .. "]" or "")
|
||||
.. (slot and slot.glyphs or "")
|
||||
.. "container_end[]"
|
||||
y = y + 1.35
|
||||
|
@ -45,18 +45,30 @@ end
|
||||
-- To make it more efficient it will first check a hash value to determine if
|
||||
-- the tool needs to be updated.
|
||||
function mcl_enchanting.update_groupcaps(itemstack)
|
||||
if not itemstack:get_meta():get("tool_capabilities") then
|
||||
local name = itemstack:get_name()
|
||||
if not minetest.registered_tools[name].tool_capabilities then
|
||||
return
|
||||
end
|
||||
|
||||
local name = itemstack:get_name()
|
||||
local level = mcl_enchanting.get_enchantment(itemstack, "efficiency")
|
||||
local groupcaps = get_efficiency_groupcaps(name, level)
|
||||
local efficiency = mcl_enchanting.get_enchantment(itemstack, "efficiency")
|
||||
local unbreaking = mcl_enchanting.get_enchantment(itemstack, "unbreaking")
|
||||
if unbreaking == 0 and efficiency == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
local groupcaps = get_efficiency_groupcaps(name, efficiency)
|
||||
local hash = itemstack:get_meta():get_string("groupcaps_hash")
|
||||
|
||||
if not hash or hash ~= groupcaps.hash then
|
||||
local tool_capabilities = itemstack:get_tool_capabilities()
|
||||
tool_capabilities.groupcaps = groupcaps.values
|
||||
tool_capabilities.groupcaps = table.copy(groupcaps.values)
|
||||
|
||||
-- Increase the number of uses depending on the unbreaking level
|
||||
-- of the tool.
|
||||
for group, capability in pairs(tool_capabilities.groupcaps) do
|
||||
capability.uses = capability.uses * (1 + unbreaking)
|
||||
end
|
||||
|
||||
itemstack:get_meta():set_tool_capabilities(tool_capabilities)
|
||||
itemstack:get_meta():set_string("groupcaps_hash", groupcaps.hash)
|
||||
end
|
||||
|
@ -1,2 +0,0 @@
|
||||
name = mcl_firework
|
||||
author = NO11, j45
|
2
mods/ITEMS/mcl_fireworks/mod.conf
Normal file
2
mods/ITEMS/mcl_fireworks/mod.conf
Normal file
@ -0,0 +1,2 @@
|
||||
name = mcl_fireworks
|
||||
description = Adds fun fireworks to the game which players can use.
|
@ -15,7 +15,9 @@ local function register_rocket(n, duration, force)
|
||||
local elytra = mcl_playerplus.elytra[user]
|
||||
if elytra.active and elytra.rocketing <= 0 then
|
||||
elytra.rocketing = duration
|
||||
itemstack:take_item()
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
minetest.sound_play("mcl_fireworks_rocket", {pos = user:get_pos()})
|
||||
end
|
||||
return itemstack
|
||||
|
@ -9,12 +9,12 @@ local LIGHT_ACTIVE_FURNACE = 13
|
||||
|
||||
local function active_formspec(fuel_percent, item_percent)
|
||||
return "size[9,8.75]"..
|
||||
"label[0,4;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Furnace"))).."]"..
|
||||
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]"..
|
||||
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
|
||||
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||
@ -38,12 +38,12 @@ local function active_formspec(fuel_percent, item_percent)
|
||||
end
|
||||
|
||||
local inactive_formspec = "size[9,8.75]"..
|
||||
"label[0,4;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Furnace"))).."]"..
|
||||
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]"..
|
||||
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
|
||||
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||
|
@ -1,3 +1,3 @@
|
||||
name = mcl_furnaces
|
||||
depends = mcl_init, mcl_formspec, mcl_core, mcl_sounds, mcl_craftguide, mcl_achievements, mcl_particles, mcl_colors
|
||||
depends = mcl_init, mcl_formspec, mcl_core, mcl_sounds, mcl_craftguide, mcl_achievements, mcl_particles
|
||||
optional_depends = doc, screwdriver
|
||||
|
@ -90,7 +90,7 @@ local function addhead(name, texture, desc, longdesc, rangemob, rangefactor)
|
||||
local wdir = minetest.dir_to_wallmounted(diff)
|
||||
|
||||
local itemstring = itemstack:get_name()
|
||||
--local fakestack = ItemStack(itemstack)
|
||||
local fakestack = ItemStack(itemstack)
|
||||
local idef = fakestack:get_definition()
|
||||
local retval
|
||||
if wdir == 0 or wdir == 1 then
|
||||
|
@ -4,10 +4,10 @@ local S = minetest.get_translator("mcl_hoppers")
|
||||
|
||||
local mcl_hoppers_formspec =
|
||||
"size[9,7]"..
|
||||
"label[2,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Hopper"))).."]"..
|
||||
"label[2,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Hopper"))).."]"..
|
||||
"list[current_name;main;2,0.5;5,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2,0.5,5,1)..
|
||||
"label[0,2;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]"..
|
||||
"label[0,2;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,2.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,2.5,9,3)..
|
||||
"list[current_player;main;0,5.74;9,1;]"..
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = mcl_hoppers
|
||||
description = It's just a clone of Minecraft hoppers, functions nearly identical to them minus mesecons making them stop and the way they're placed.
|
||||
depends = mcl_core, mcl_formspec, mcl_sounds, mcl_util, mcl_colors
|
||||
depends = mcl_core, mcl_formspec, mcl_sounds, mcl_util
|
||||
optional_depends = doc, screwdriver
|
||||
|
@ -27,9 +27,8 @@ local DELAY = 3 -- seconds before teleporting in Nether portal in Survival mo
|
||||
local DISTANCE_MAX = 128
|
||||
local PORTAL = "mcl_portals:portal"
|
||||
local OBSIDIAN = "mcl_core:obsidian"
|
||||
local O_Y_MIN, O_Y_MAX = max(mcl_vars.mg_overworld_min, -31), min(mcl_vars.mg_overworld_max_official, 2048)
|
||||
local N_Y_MIN, N_Y_MAX = mcl_vars.mg_bedrock_nether_bottom_min, mcl_vars.mg_bedrock_nether_top_max - H_MIN
|
||||
local O_DY, N_DY = O_Y_MAX - O_Y_MIN + 1, N_Y_MAX - N_Y_MIN + 1
|
||||
local O_Y_MIN, O_Y_MAX = max(mcl_vars.mg_overworld_min, -31), min(mcl_vars.mg_overworld_max, 2048)
|
||||
local N_Y_MIN, N_Y_MAX = mcl_vars.mg_bedrock_nether_bottom_min, mcl_vars.mg_bedrock_nether_top_min - H_MIN
|
||||
|
||||
-- Alpha and particles
|
||||
local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "none"
|
||||
@ -78,6 +77,8 @@ local pos_to_string = minetest.pos_to_string
|
||||
local is_area_protected = minetest.is_area_protected
|
||||
local get_us_time = minetest.get_us_time
|
||||
|
||||
local dimension_to_teleport = { nether = "overworld", overworld = "nether" }
|
||||
|
||||
local limits = {
|
||||
nether = {
|
||||
pmin = {x=LIM_MIN, y = N_Y_MIN, z = LIM_MIN},
|
||||
@ -181,10 +182,10 @@ local function get_target(p)
|
||||
x, o1 = ping_pong(x, TRAVEL_X, LIM_MIN, LIM_MAX)
|
||||
z, o2 = ping_pong(z, TRAVEL_Z, LIM_MIN, LIM_MAX)
|
||||
y = floor(y * TRAVEL_Y + (o1+o2) / 16 * LIM_MAX)
|
||||
y = min(max(y + mcl_vars.mg_overworld_min, mcl_vars.mg_overworld_min), mcl_vars.mg_overworld_max)
|
||||
y = min(max(y + O_Y_MIN, O_Y_MIN), O_Y_MAX)
|
||||
elseif d=="overworld" then
|
||||
x, y, z = floor(x / TRAVEL_X + 0.5), floor(y / TRAVEL_Y + 0.5), floor(z / TRAVEL_Z + 0.5)
|
||||
y = min(max(y + mcl_vars.mg_nether_min, mcl_vars.mg_nether_min), mcl_vars.mg_nether_max)
|
||||
y = min(max(y + N_Y_MIN, N_Y_MIN), N_Y_MAX)
|
||||
end
|
||||
return {x=x, y=y, z=z}, d
|
||||
end
|
||||
@ -457,8 +458,8 @@ local function ecb_scan_area_2(blockpos, action, calls_remaining, param)
|
||||
local nodes = find_nodes_in_area_under_air(pos1, pos2, {"group:building_block"})
|
||||
if nodes then
|
||||
local nc = #nodes
|
||||
log("action", "[mcl_portals] Area for destination Nether portal emerged! Found " .. tostring(nc) .. " nodes under the air around "..pos_to_string(pos))
|
||||
if nc > 0 then
|
||||
log("action", "[mcl_portals] Area for destination Nether portal emerged! Found " .. tostring(nc) .. " nodes under the air around "..pos_to_string(pos))
|
||||
for i=1,nc do
|
||||
local node = nodes[i]
|
||||
local node1 = {x=node.x, y=node.y+1, z=node.z }
|
||||
@ -474,7 +475,7 @@ local function ecb_scan_area_2(blockpos, action, calls_remaining, param)
|
||||
return
|
||||
end
|
||||
if not distance or (distance0 < distance) or (distance0 < distance-1 and node.y > lava and pos0.y < lava) then
|
||||
log("action", "[mcl_portals] found distance "..tostring(distance0).." at pos "..pos_to_string(node))
|
||||
log("verbose", "[mcl_portals] found distance "..tostring(distance0).." at pos "..pos_to_string(node))
|
||||
distance = distance0
|
||||
pos0 = {x=node1.x, y=node1.y, z=node1.z}
|
||||
end
|
||||
@ -626,7 +627,7 @@ end
|
||||
-- Pos can be any of the inner part.
|
||||
-- The frame MUST be filled only with air or any fire, which will be replaced with Nether portal blocks.
|
||||
-- If no Nether portal can be lit, nothing happens.
|
||||
-- Returns number of portals created (0, 1 or 2)
|
||||
-- Returns true if portal created
|
||||
function mcl_portals.light_nether_portal(pos)
|
||||
-- Only allow to make portals in Overworld and Nether
|
||||
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||
@ -636,11 +637,6 @@ function mcl_portals.light_nether_portal(pos)
|
||||
local orientation = random(0, 1)
|
||||
for orientation_iteration = 1, 2 do
|
||||
if check_and_light_shape(pos, orientation) then
|
||||
minetest.after(0.2, function(pos) -- generate target map chunk
|
||||
local pos1 = add(mul(mcl_vars.pos_to_chunk(pos), mcl_vars.chunk_size_in_nodes), mcl_vars.central_chunk_offset_in_nodes)
|
||||
local pos2 = add(pos1, mcl_vars.chunk_size_in_nodes - 1)
|
||||
minetest.emerge_area(pos1, pos2)
|
||||
end, vector.new(pos))
|
||||
return true
|
||||
end
|
||||
orientation = 1 - orientation
|
||||
@ -672,6 +668,7 @@ local function teleport_no_delay(obj, pos)
|
||||
if exit then
|
||||
finalize_teleport(obj, exit)
|
||||
else
|
||||
dim = dimension_to_teleport[dim]
|
||||
-- need to create arrival portal
|
||||
create_portal(target, limits[dim].pmin, limits[dim].pmax, name, obj)
|
||||
end
|
||||
|
@ -352,67 +352,32 @@ minetest.register_tool("mcl_tools:shovel_diamond", {
|
||||
})
|
||||
|
||||
-- Axes
|
||||
local make_stripped_trunk_add_wear = function(itemstack, placer)
|
||||
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
||||
-- Add wear (as if digging a axey node)
|
||||
local toolname = itemstack:get_name()
|
||||
local wear = mcl_autogroup.get_wear(toolname, "axey")
|
||||
itemstack:add_wear(wear)
|
||||
end
|
||||
end
|
||||
local make_stripped_trunk = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
||||
local node = minetest.get_node(pos)
|
||||
local node_name = node.name
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
if minetest.registered_nodes[node_name] and minetest.registered_nodes[node_name].on_rightclick then
|
||||
return minetest.registered_nodes[node_name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
||||
end
|
||||
end
|
||||
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
|
||||
minetest.record_protection_violation(pointed_thing.under, placer:get_player_name())
|
||||
return itemstack
|
||||
end
|
||||
if node_name == "mcl_core:tree" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_oak"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:darktree" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_dark_oak"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:acaciatree" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_acacia"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:birchtree" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_birch"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:sprucetree" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_spruce"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:jungletree" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_jungle"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:tree_bark" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_oak_bark"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:darktree_bark" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_dark_oak_bark"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:acaciatree_bark" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_acacia_bark"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:birchtree_bark" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_birch_bark"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:sprucetree_bark" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_spruce_bark"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
elseif node_name == "mcl_core:jungletree_bark" then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_jungle_bark"})
|
||||
make_stripped_trunk_add_wear(itemstack, placer)
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local noddef = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name]
|
||||
|
||||
if not placer:get_player_control().sneak and noddef.on_rightclick then
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
|
||||
minetest.record_protection_violation(pointed_thing.under, placer:get_player_name())
|
||||
return itemstack
|
||||
end
|
||||
|
||||
if noddef._mcl_stripped_varient == nil then
|
||||
return itemstack
|
||||
else
|
||||
minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_varient, param2=node.param2})
|
||||
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
||||
-- Add wear (as if digging a axey node)
|
||||
local toolname = itemstack:get_name()
|
||||
local wear = mcl_autogroup.get_wear(toolname, "axey")
|
||||
itemstack:add_wear(wear)
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
return itemstack
|
||||
end
|
||||
|
||||
minetest.register_tool("mcl_tools:axe_wood", {
|
||||
|
@ -7,8 +7,8 @@ Drop registered inventories on player death.
|
||||
* function(player): must return inventory
|
||||
* listname: string
|
||||
* drop: bool
|
||||
* true: the entire list will be dropped
|
||||
* false: items with curse_of_vanishing enchantement will be broken.
|
||||
* true: the list will be dropped
|
||||
* false: the list will only be cleared
|
||||
|
||||
## mcl_death_drop.registered_dropped_lists
|
||||
Table containing dropped list inventory, name and drop state.
|
Binary file not shown.
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 170 B |
Binary file not shown.
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 209 B |
Binary file not shown.
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 218 B |
@ -150,13 +150,6 @@ minetest.register_globalstep(function(dtime)
|
||||
|
||||
for _,player in pairs(get_connected_players()) do
|
||||
|
||||
local c_x, c_y = unpack(player_collision(player))
|
||||
|
||||
if player:get_velocity().x + player:get_velocity().y < .5 and c_x + c_y > 0 then
|
||||
--minetest.chat_send_player(player:get_player_name(), "pushed at " .. c_x + c_y .. " parsecs.")
|
||||
player:add_velocity({x=c_x, y=0, z=c_y})
|
||||
end
|
||||
|
||||
--[[
|
||||
_ _ _
|
||||
__ _ _ __ (_)_ __ ___ __ _| |_(_) ___ _ __ ___
|
||||
@ -173,6 +166,14 @@ minetest.register_globalstep(function(dtime)
|
||||
local wielded = player:get_wielded_item()
|
||||
local player_velocity = player:get_velocity() or player:get_player_velocity()
|
||||
|
||||
local c_x, c_y = unpack(player_collision(player))
|
||||
|
||||
if player_velocity.x + player_velocity.y < .5 and c_x + c_y > 0 then
|
||||
local add_velocity = player.add_player_velocity or player.add_velocity
|
||||
add_velocity(player, {x = c_x, y = 0, z = c_y})
|
||||
player_velocity = player:get_velocity() or player:get_player_velocity()
|
||||
end
|
||||
|
||||
-- control head bone
|
||||
local pitch = - degrees(player:get_look_vertical())
|
||||
local yaw = degrees(player:get_look_horizontal())
|
||||
@ -214,6 +215,24 @@ minetest.register_globalstep(function(dtime)
|
||||
if vector.length(player_velocity) < 40 then
|
||||
local add_velocity = player.add_velocity or player.add_player_velocity
|
||||
add_velocity(player, vector.multiply(player:get_look_dir(), 4))
|
||||
minetest.add_particlespawner({
|
||||
amount = 1,
|
||||
time = 0.1,
|
||||
minpos = fly_pos,
|
||||
maxpos = fly_pos,
|
||||
minvel = {x = 0, y = 0, z = 0},
|
||||
maxvel = {x = 0, y = 0, z = 0},
|
||||
minacc = {x = 0, y = 0, z = 0},
|
||||
maxacc = {x = 0, y = 0, z = 0},
|
||||
minexptime = 0.3,
|
||||
maxexptime = 0.5,
|
||||
minsize = 1,
|
||||
maxsize = 2.5,
|
||||
collisiondetection = false,
|
||||
vertical = false,
|
||||
texture = "mcl_particles_crit.png^[colorize:#bc7a57:127",
|
||||
glow = 5,
|
||||
})
|
||||
end
|
||||
end
|
||||
else
|
||||
@ -241,7 +260,7 @@ minetest.register_globalstep(function(dtime)
|
||||
|
||||
if elytra.active then
|
||||
-- set head pitch and yaw when flying
|
||||
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0))
|
||||
player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0))
|
||||
-- sets eye height, and nametag color accordingly
|
||||
player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 0.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }})
|
||||
-- control body bone when flying
|
||||
@ -249,18 +268,18 @@ minetest.register_globalstep(function(dtime)
|
||||
elseif parent then
|
||||
local parent_yaw = degrees(parent:get_yaw())
|
||||
player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }})
|
||||
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch, -limit_vel_yaw(yaw, parent_yaw) + parent_yaw, 0))
|
||||
player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch, -limit_vel_yaw(yaw, parent_yaw) + parent_yaw, 0))
|
||||
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0))
|
||||
elseif control.sneak then
|
||||
-- controls head pitch when sneaking
|
||||
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+36,0,0))
|
||||
player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch, player_vel_yaw - yaw, player_vel_yaw - yaw))
|
||||
-- sets eye height, and nametag color accordingly
|
||||
player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }})
|
||||
-- sneaking body conrols
|
||||
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0))
|
||||
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0, -player_vel_yaw + yaw, 0))
|
||||
elseif get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 and is_sprinting(name) == true then
|
||||
-- set head pitch and yaw when swimming
|
||||
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0))
|
||||
player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0))
|
||||
-- sets eye height, and nametag color accordingly
|
||||
player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,0.8,0.312}, eye_height = 0.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }})
|
||||
-- control body bone when swimming
|
||||
@ -269,7 +288,7 @@ minetest.register_globalstep(function(dtime)
|
||||
-- sets eye height, and nametag color accordingly
|
||||
player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }})
|
||||
|
||||
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch, player_vel_yaw - yaw, 0))
|
||||
player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch, player_vel_yaw - yaw, 0))
|
||||
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0, -player_vel_yaw + yaw, 0))
|
||||
end
|
||||
|
||||
|
@ -239,7 +239,7 @@ end)
|
||||
mcl_skins.show_formspec = function(playername)
|
||||
local formspec = "size[7,8.5]"
|
||||
|
||||
formspec = formspec .. "label[2,2;" .. minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Select player skin:"))) .. "]"
|
||||
formspec = formspec .. "label[2,2;" .. minetest.formspec_escape(minetest.colorize("#383838", S("Select player skin:"))) .. "]"
|
||||
.. "textlist[0,2.5;6.8,6;skins_set;"
|
||||
|
||||
local meta
|
||||
@ -267,7 +267,7 @@ mcl_skins.show_formspec = function(playername)
|
||||
|
||||
if meta then
|
||||
if meta.name and meta.name ~= "" then
|
||||
formspec = formspec .. "label[2,0.5;" .. minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Name: @1", meta.name))) .. "]"
|
||||
formspec = formspec .. "label[2,0.5;" .. minetest.formspec_escape(minetest.colorize("#383838", S("Name: @1", meta.name))) .. "]"
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user