forked from VoxeLibre/VoxeLibre
Merge branch 'master' into objects
This commit is contained in:
commit
422076f761
|
@ -163,6 +163,8 @@ function boat.get_staticdata(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function boat.on_death(self, killer)
|
function boat.on_death(self, killer)
|
||||||
|
mcl_burning.extinguish(self.object)
|
||||||
|
|
||||||
if killer and killer:is_player() and minetest.is_creative_enabled(killer:get_player_name()) then
|
if killer and killer:is_player() and minetest.is_creative_enabled(killer:get_player_name()) then
|
||||||
local inv = killer:get_inventory()
|
local inv = killer:get_inventory()
|
||||||
if not inv:contains_item("main", self._itemstring) then
|
if not inv:contains_item("main", self._itemstring) then
|
||||||
|
@ -188,6 +190,8 @@ function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, d
|
||||||
end
|
end
|
||||||
|
|
||||||
function boat.on_step(self, dtime, moveresult)
|
function boat.on_step(self, dtime, moveresult)
|
||||||
|
mcl_burning.tick(self.object, dtime)
|
||||||
|
|
||||||
self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
|
self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
|
||||||
local v_factor = 1
|
local v_factor = 1
|
||||||
local v_slowdown = 0.02
|
local v_slowdown = 0.02
|
||||||
|
|
|
@ -191,6 +191,14 @@ minetest.register_craftitem("mcl_paintings:painting", {
|
||||||
if pointed_thing.type ~= "node" then
|
if pointed_thing.type ~= "node" then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local node = minetest.get_node(pointed_thing.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
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
|
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
|
||||||
dir = vector.normalize(dir)
|
dir = vector.normalize(dir)
|
||||||
if dir.y ~= 0 then
|
if dir.y ~= 0 then
|
||||||
|
|
|
@ -450,7 +450,7 @@ mobs:spawn_specific("mobs_mc:donkey", mobs_mc.spawn.grassland_savanna, {"air"},
|
||||||
|
|
||||||
-- spawn eggs
|
-- spawn eggs
|
||||||
mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0)
|
mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0)
|
||||||
mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_icon_horse_skeleton.png", 0)
|
--mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_icon_horse_skeleton.png", 0)
|
||||||
--mobs:register_egg("mobs_mc:zombie_horse", S("Zombie Horse"), "mobs_mc_spawn_icon_horse_zombie.png", 0)
|
--mobs:register_egg("mobs_mc:zombie_horse", S("Zombie Horse"), "mobs_mc_spawn_icon_horse_zombie.png", 0)
|
||||||
mobs:register_egg("mobs_mc:donkey", S("Donkey"), "mobs_mc_spawn_icon_donkey.png", 0)
|
mobs:register_egg("mobs_mc:donkey", S("Donkey"), "mobs_mc_spawn_icon_donkey.png", 0)
|
||||||
mobs:register_egg("mobs_mc:mule", S("Mule"), "mobs_mc_spawn_icon_mule.png", 0)
|
mobs:register_egg("mobs_mc:mule", S("Mule"), "mobs_mc_spawn_icon_mule.png", 0)
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.8 KiB |
|
@ -116,6 +116,8 @@ end
|
||||||
ARROW_ENTITY.on_step = function(self, dtime)
|
ARROW_ENTITY.on_step = function(self, dtime)
|
||||||
mcl_burning.tick(self.object, dtime)
|
mcl_burning.tick(self.object, dtime)
|
||||||
|
|
||||||
|
self._time_in_air = self._time_in_air + .001
|
||||||
|
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local dpos = table.copy(pos) -- digital pos
|
local dpos = table.copy(pos) -- digital pos
|
||||||
dpos = vector.round(dpos)
|
dpos = vector.round(dpos)
|
||||||
|
@ -125,9 +127,11 @@ ARROW_ENTITY.on_step = function(self, dtime)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.object:get_attach() and not self.object:get_attach(parent) then
|
minetest.register_on_leaveplayer(function(player)
|
||||||
self.object:remove()
|
if self.object:get_attach(parent) == player then
|
||||||
end
|
self.object:remove()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
if self._stuck then
|
if self._stuck then
|
||||||
self._stucktimer = self._stucktimer + dtime
|
self._stucktimer = self._stucktimer + dtime
|
||||||
|
@ -208,10 +212,10 @@ ARROW_ENTITY.on_step = function(self, dtime)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
local ok = false
|
local ok = false
|
||||||
-- Arrows can only damage players and mobs
|
-- Arrows can only damage players and mobs
|
||||||
if obj ~= self._shooter and obj:is_player() then
|
if obj:is_player() then
|
||||||
ok = true
|
ok = true
|
||||||
elseif obj:get_luaentity() ~= nil then
|
elseif obj:get_luaentity() ~= nil then
|
||||||
if obj ~= self._shooter and (obj:get_luaentity()._cmi_is_mob or obj:get_luaentity()._hittable_by_projectile) then
|
if (obj:get_luaentity()._cmi_is_mob or obj:get_luaentity()._hittable_by_projectile) then
|
||||||
ok = true
|
ok = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -229,11 +233,12 @@ ARROW_ENTITY.on_step = function(self, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If an attackable object was found, we will damage the closest one only
|
-- If an attackable object was found, we will damage the closest one only
|
||||||
|
|
||||||
if closest_object ~= nil then
|
if closest_object ~= nil then
|
||||||
local obj = closest_object
|
local obj = closest_object
|
||||||
local is_player = obj:is_player()
|
local is_player = obj:is_player()
|
||||||
local lua = obj:get_luaentity()
|
local lua = obj:get_luaentity()
|
||||||
if obj ~= self._shooter and (is_player or (lua and (lua._cmi_is_mob or lua._hittable_by_projectile))) then
|
if obj == self._shooter and self._time_in_air > 1.02 or obj ~= self._shooter and (is_player or (lua and (lua._cmi_is_mob or lua._hittable_by_projectile))) then
|
||||||
if obj:get_hp() > 0 then
|
if obj:get_hp() > 0 then
|
||||||
-- Check if there is no solid node between arrow and object
|
-- Check if there is no solid node between arrow and object
|
||||||
local ray = minetest.raycast(self.object:get_pos(), obj:get_pos(), true)
|
local ray = minetest.raycast(self.object:get_pos(), obj:get_pos(), true)
|
||||||
|
@ -462,6 +467,7 @@ ARROW_ENTITY.get_staticdata = function(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
ARROW_ENTITY.on_activate = function(self, staticdata, dtime_s)
|
ARROW_ENTITY.on_activate = function(self, staticdata, dtime_s)
|
||||||
|
self._time_in_air = 1.0
|
||||||
self._in_player = false
|
self._in_player = false
|
||||||
local data = minetest.deserialize(staticdata)
|
local data = minetest.deserialize(staticdata)
|
||||||
if data then
|
if data then
|
||||||
|
|
|
@ -92,7 +92,7 @@ function mcl_buckets.register_liquid(def)
|
||||||
-- Check if pointing to a buildable node
|
-- Check if pointing to a buildable node
|
||||||
local item = itemstack:get_name()
|
local item = itemstack:get_name()
|
||||||
|
|
||||||
if extra_check and extra_check(place_pos, user) == false then
|
if def.extra_check and def.extra_check(place_pos, user) == false then
|
||||||
-- Fail placement of liquid
|
-- Fail placement of liquid
|
||||||
elseif minetest.registered_nodes[nn] and minetest.registered_nodes[nn].buildable_to then
|
elseif minetest.registered_nodes[nn] and minetest.registered_nodes[nn].buildable_to then
|
||||||
-- buildable; replace the node
|
-- buildable; replace the node
|
||||||
|
|
|
@ -2,6 +2,20 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
local mod_mcl_core = minetest.get_modpath("mcl_core")
|
local mod_mcl_core = minetest.get_modpath("mcl_core")
|
||||||
local mod_mclx_core = minetest.get_modpath("mclx_core")
|
local mod_mclx_core = minetest.get_modpath("mclx_core")
|
||||||
|
|
||||||
|
local sound_place = function(itemname, pos)
|
||||||
|
local def = minetest.registered_nodes[itemname]
|
||||||
|
if def and def.sounds and def.sounds.place then
|
||||||
|
minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local sound_take = function(itemname, pos)
|
||||||
|
local def = minetest.registered_nodes[itemname]
|
||||||
|
if def and def.sounds and def.sounds.dug then
|
||||||
|
minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if mod_mcl_core then
|
if mod_mcl_core then
|
||||||
-- Lava bucket
|
-- Lava bucket
|
||||||
mcl_buckets.register_liquid({
|
mcl_buckets.register_liquid({
|
||||||
|
|
|
@ -77,7 +77,7 @@ minetest.register_entity("mcl_end:crystal", {
|
||||||
_exploded = false,
|
_exploded = false,
|
||||||
_hittable_by_projectile = true
|
_hittable_by_projectile = true
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("mcl_end:crystal", {
|
minetest.register_craftitem("mcl_end:crystal", {
|
||||||
inventory_image = "mcl_end_crystal_item.png",
|
inventory_image = "mcl_end_crystal_item.png",
|
||||||
description = S("End Crystal"),
|
description = S("End Crystal"),
|
||||||
|
@ -86,9 +86,14 @@ minetest.register_craftitem("mcl_end:crystal", {
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
||||||
local node = minetest.get_node(pos).name
|
local node = minetest.get_node(pos).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 find_crystal(pos) then return itemstack end
|
if find_crystal(pos) then return itemstack end
|
||||||
if node == "mcl_core:obsidian" or node == "mcl_core:bedrock" then
|
if node == "mcl_core:obsidian" or node == "mcl_core:bedrock" then
|
||||||
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
spawn_crystal(pos)
|
spawn_crystal(pos)
|
||||||
|
@ -110,5 +115,5 @@ minetest.register_craft({
|
||||||
{"mcl_core:glass", "mcl_mobitems:ghast_tear", "mcl_core:glass"},
|
{"mcl_core:glass", "mcl_mobitems:ghast_tear", "mcl_core:glass"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias("mcl_end_crystal:end_crystal", "mcl_end:crystal")
|
minetest.register_alias("mcl_end_crystal:end_crystal", "mcl_end:crystal")
|
||||||
|
|
|
@ -106,7 +106,7 @@ minetest.register_node("mcl_nether:magma", {
|
||||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||||
-- From walkover mod
|
-- From walkover mod
|
||||||
on_walk_over = function(loc, nodeiamon, player)
|
on_walk_over = function(loc, nodeiamon, player)
|
||||||
if minetest.global_exists("mcl_potions") and mcl_potions.player_has_effect(player, "fire_proof") then
|
if player and player:get_player_control().sneak or minetest.global_exists("mcl_potions") and mcl_potions.player_has_effect(player, "fire_proof") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Hurt players standing on top of this block
|
-- Hurt players standing on top of this block
|
||||||
|
|
|
@ -22,11 +22,6 @@ wieldview.transform = {
|
||||||
["mcl_flowers:oxeye_daisy"]="R270",
|
["mcl_flowers:oxeye_daisy"]="R270",
|
||||||
["mcl_flowers:fern"]="R270",
|
["mcl_flowers:fern"]="R270",
|
||||||
["mcl_flowers:tallgrass"]="R270",
|
["mcl_flowers:tallgrass"]="R270",
|
||||||
["mcl_buckets:bucket_empty"]="R270",
|
|
||||||
["mcl_buckets:bucket_water"]="R270",
|
|
||||||
["mcl_buckets:bucket_river_water"]="R270",
|
|
||||||
["mcl_buckets:bucket_lava"]="R270",
|
|
||||||
["mcl_mobitems:milk_bucket"]="R270",
|
|
||||||
["mcl_potions:glass_bottle"]="R270",
|
["mcl_potions:glass_bottle"]="R270",
|
||||||
["mcl_potions:water"]="R270",
|
["mcl_potions:water"]="R270",
|
||||||
["mcl_potions:awkward"]="R270",
|
["mcl_potions:awkward"]="R270",
|
||||||
|
|
Loading…
Reference in New Issue