Merge branch 'master' of https://git.minetest.land/MineClone2/MineClone2
commit
ff538d51bd
|
@ -1,5 +1,8 @@
|
||||||
# This is a game specific minetest.conf file, do not edit
|
# This is a game specific minetest.conf file, do not edit
|
||||||
|
|
||||||
|
# If any of these settings are set in your minetest.conf file in ~/.minetest (Linux) or in the root directory of the game (Run in place/Windows)
|
||||||
|
# They will override these settings
|
||||||
|
|
||||||
# Basic game rules
|
# Basic game rules
|
||||||
time_speed = 72
|
time_speed = 72
|
||||||
|
|
||||||
|
@ -33,7 +36,7 @@ mgvalleys_spflags = noaltitude_chill,noaltitude_dry,nohumid_rivers,vary_river_de
|
||||||
keepInventory = false
|
keepInventory = false
|
||||||
|
|
||||||
# Performance settings
|
# Performance settings
|
||||||
# dedicated_server_step = 0.001
|
dedicated_server_step = 0.05 #tick rate
|
||||||
# abm_interval = 0.25
|
# abm_interval = 0.25
|
||||||
# max_objects_per_block = 4096
|
# max_objects_per_block = 4096
|
||||||
# max_packets_per_iteration = 10096
|
# max_packets_per_iteration = 10096
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# controls
|
||||||
|
|
||||||
|
## controls.players
|
||||||
|
Table containing player controls at runtime.
|
||||||
|
WARNING: Never use this table in writing
|
||||||
|
|
||||||
|
## controls.register_on_press(func)
|
||||||
|
Register a function that will be executed with (player, keyname) every time a player press a key.
|
||||||
|
|
||||||
|
## controls.registered_on_press
|
||||||
|
Table containing functions registered with controls.register_on_press().
|
||||||
|
|
||||||
|
## controls.register_on_release(func)
|
||||||
|
Register a function that will be executed with (player, keyname, clock_from_last_press) every time a player release a key.
|
||||||
|
|
||||||
|
## controls.registered_on_release
|
||||||
|
Table containing functions registered with controls.register_on_release().
|
||||||
|
|
||||||
|
## controls.register_on_hold(func)
|
||||||
|
Register a function that will be executed with (player, keyname, clock_from_start_hold) every time a player hold a key.
|
||||||
|
|
||||||
|
## controls.registered_on_hold
|
||||||
|
Table containing functions registered with controls.register_on_hold().
|
|
@ -0,0 +1,45 @@
|
||||||
|
# flowlib
|
||||||
|
Simple flow functions.
|
||||||
|
|
||||||
|
## flowlib.is_touching(realpos, nodepos, radius)
|
||||||
|
Return true if a sphere of <radius> at <realpos> collide with node at <nodepos>.
|
||||||
|
* realpos: position
|
||||||
|
* nodepos: position
|
||||||
|
* radius: number
|
||||||
|
|
||||||
|
## flowlib.is_water(pos)
|
||||||
|
Return true if node at <pos> is water, false overwise.
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## flowlib.node_is_water(node)
|
||||||
|
Return true if <node> is water, false overwise.
|
||||||
|
* node: node
|
||||||
|
|
||||||
|
## flowlib.is_lava(pos)
|
||||||
|
Return true if node at <pos> is lava, false overwise.
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## flowlib.node_is_lava(node)
|
||||||
|
Return true if <node> is lava, false overwise.
|
||||||
|
* node: node
|
||||||
|
|
||||||
|
## flowlib.is_liquid(pos)
|
||||||
|
Return true if node at <pos> is liquid, false overwise.
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## flowlib.node_is_liquid(node)
|
||||||
|
Return true if <node> is liquid, false overwise.
|
||||||
|
* node: node
|
||||||
|
|
||||||
|
## flowlib.quick_flow(pos, node)
|
||||||
|
Return direction where the water is flowing (to be use to push mobs, items...).
|
||||||
|
* pos: position
|
||||||
|
* node: node
|
||||||
|
|
||||||
|
## flowlib.move_centre(pos, realpos, node, radius)
|
||||||
|
Return the pos of the nearest not water block near from <pos> in a sphere of <radius> at <realpos>.
|
||||||
|
WARNING: This function is never used in mcl2, use at your own risk. The informations described here may be wrong.
|
||||||
|
* pos: position
|
||||||
|
* realpos: position, position of the entity
|
||||||
|
* node: node
|
||||||
|
* radius: number
|
|
@ -0,0 +1,27 @@
|
||||||
|
# mcl_autogroup
|
||||||
|
This mod emulate digging times from mc.
|
||||||
|
|
||||||
|
## mcl_autogroup.can_harvest(nodename, toolname)
|
||||||
|
Return true if <nodename> can be dig with <toolname>.
|
||||||
|
* nodename: string, valid nodename
|
||||||
|
* toolname: (optional) string, valid toolname
|
||||||
|
|
||||||
|
## mcl_autogroup.get_groupcaps(toolname, efficiency)
|
||||||
|
This function is used to calculate diggroups for tools.
|
||||||
|
WARNING: This function can only be called after mod initialization.
|
||||||
|
* toolname: string, name of the tool being enchanted (like "mcl_tools:diamond_pickaxe")
|
||||||
|
* efficiency: (optional) integer, the efficiency level the tool is enchanted with (default 0)
|
||||||
|
|
||||||
|
## mcl_autogroup.get_wear(toolname, diggroup)
|
||||||
|
Return the max wear of <toolname> with <diggroup>
|
||||||
|
WARNING: This function can only be called after mod initialization.
|
||||||
|
* toolname: string, name of the tool used
|
||||||
|
* diggroup: string, the name of the diggroup the tool is used on
|
||||||
|
|
||||||
|
## mcl_autogroup.register_diggroup(group, def)
|
||||||
|
* group: string, name of the group to register as a digging group
|
||||||
|
* def: (optional) table, table with information about the diggroup (defaults to {} if unspecified)
|
||||||
|
* level: (optional) string, if specified it is an array containing the names of the different digging levels the digging group supports
|
||||||
|
|
||||||
|
## mcl_autogroup.registered_diggroups
|
||||||
|
List of registered diggroups, indexed by name.
|
|
@ -0,0 +1,8 @@
|
||||||
|
# mcl_colors
|
||||||
|
Mod providing global table containing legacity minecraft colors to be used in mods.
|
||||||
|
|
||||||
|
## mcl_colors.*
|
||||||
|
Colors by upper name, in hex value.
|
||||||
|
|
||||||
|
## mcl_colors.background.*
|
||||||
|
Background colors by upper name, in hex value.
|
|
@ -0,0 +1,15 @@
|
||||||
|
# mcl_explosions
|
||||||
|
This mod provide helper functions to create explosions.
|
||||||
|
|
||||||
|
## mcl_explosions.explode(pos, strength, info, puncher)
|
||||||
|
* pos: position, initial position of the explosion
|
||||||
|
* strenght: number, radius of the explosion
|
||||||
|
* info: table, explosion informations:
|
||||||
|
* drop_chance: number, if specified becomes the drop chance of all nodes in the explosion (default: 1.0 / strength)
|
||||||
|
* max_blast_resistance: int, if specified the explosion will treat all non-indestructible nodes as having a blast resistance of no more than this value
|
||||||
|
* sound: bool, if true, the explosion will play a sound (default: true)
|
||||||
|
* particles: bool, if true, the explosion will create particles (default: true)
|
||||||
|
* fire: bool, if true, 1/3 nodes become fire (default: false)
|
||||||
|
* griefing: bool, if true, the explosion will destroy nodes (default: true)
|
||||||
|
* grief_protected: bool, if true, the explosion will also destroy nodes which have been protected (default: false)
|
||||||
|
* puncher: (optional) entity, will be used as source for damage done by the explosion
|
|
@ -0,0 +1,80 @@
|
||||||
|
# mcl_worlds
|
||||||
|
This mod provides utility functions about positions and dimensions.
|
||||||
|
|
||||||
|
## mcl_worlds.is_in_void(pos)
|
||||||
|
This function returns:
|
||||||
|
|
||||||
|
* true, true: if pos is in deep void (deadly)
|
||||||
|
* true, false: if the pos is in void (non deadly)
|
||||||
|
* false, false: owerwise
|
||||||
|
|
||||||
|
Params:
|
||||||
|
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## mcl_worlds.y_to_layer(y)
|
||||||
|
This function is used to calculate the minetest y layer and dimension of the given <y> minecraft layer.
|
||||||
|
Mainly used for ore generation.
|
||||||
|
Takes an Y coordinate as input and returns:
|
||||||
|
|
||||||
|
* The corresponding Minecraft layer (can be nil if void)
|
||||||
|
* The corresponding Minecraft dimension ("overworld", "nether" or "end") or "void" if <y> is in the void
|
||||||
|
If the Y coordinate is not located in any dimension, it will return: nil, "void"
|
||||||
|
|
||||||
|
Params:
|
||||||
|
|
||||||
|
* y: int
|
||||||
|
|
||||||
|
## mcl_worlds.pos_to_dimension(pos)
|
||||||
|
This function return the Minecraft dimension of <pos> ("overworld", "nether" or "end") or "void" if <y> is in the void.
|
||||||
|
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## mcl_worlds.layer_to_y(layer, mc_dimension)
|
||||||
|
Takes a Minecraft layer and a “dimension” name and returns the corresponding Y coordinate for MineClone 2.
|
||||||
|
mc_dimension can be "overworld", "nether", "end" (default: "overworld").
|
||||||
|
|
||||||
|
* layer: int
|
||||||
|
* mc_dimension: string
|
||||||
|
|
||||||
|
## mcl_worlds.has_weather(pos)
|
||||||
|
Returns true if <pos> can have weather, false owerwise.
|
||||||
|
Weather can be only in the overworld.
|
||||||
|
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## mcl_worlds.has_dust(pos)
|
||||||
|
Returns true if <pos> can have nether dust, false owerwise.
|
||||||
|
Nether dust can be only in the nether.
|
||||||
|
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## mcl_worlds.compass_works(pos)
|
||||||
|
Returns true if compasses are working at <pos>, false owerwise.
|
||||||
|
In mc, you cant use compass in the nether and the end.
|
||||||
|
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## mcl_worlds.compass_works(pos)
|
||||||
|
Returns true if clock are working at <pos>, false owerwise.
|
||||||
|
In mc, you cant use clock in the nether and the end.
|
||||||
|
|
||||||
|
* pos: position
|
||||||
|
|
||||||
|
## mcl_worlds.register_on_dimension_change(function(player, dimension))
|
||||||
|
Register a callback function func(player, dimension).
|
||||||
|
It will be called whenever a player changes between dimensions.
|
||||||
|
The void counts as dimension.
|
||||||
|
|
||||||
|
* player: player, the player who changed the dimension
|
||||||
|
* dimension: position, The new dimension of the player ("overworld", "nether", "end", "void").
|
||||||
|
|
||||||
|
|
||||||
|
## mcl_worlds.registered_on_dimension_change
|
||||||
|
Table containing all function registered with mcl_worlds.register_on_dimension_change()
|
||||||
|
|
||||||
|
## mcl_worlds.dimension_change(player, dimension)
|
||||||
|
Notify this mod of a dimmension change of <player> to <dimension>
|
||||||
|
|
||||||
|
* player: player, player who changed the dimension
|
||||||
|
* dimension: string, new dimension ("overworld", "nether", "end", "void")
|
|
@ -1,6 +1,6 @@
|
||||||
local S = minetest.get_translator("mcl_boats")
|
local S = minetest.get_translator("mcl_boats")
|
||||||
|
|
||||||
local boat_visual_size = {x = 3, y = 3, z = 3}
|
local boat_visual_size = {x = 1, y = 1, z = 1}
|
||||||
local paddling_speed = 22
|
local paddling_speed = 22
|
||||||
local boat_y_offset = 0.35
|
local boat_y_offset = 0.35
|
||||||
local boat_y_offset_ground = boat_y_offset + 0.6
|
local boat_y_offset_ground = boat_y_offset + 0.6
|
||||||
|
|
Binary file not shown.
|
@ -1,14 +1,36 @@
|
||||||
|
--these are lua locals, used for higher performance
|
||||||
|
local minetest,math,vector,ipairs = minetest,math,vector,ipairs
|
||||||
|
|
||||||
|
--this is used for the player pool in the sound buffer
|
||||||
|
local pool = {}
|
||||||
|
|
||||||
|
local tick = false
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
local name
|
||||||
|
name = player:get_player_name()
|
||||||
|
pool[name] = 0
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
local name
|
||||||
|
name = player:get_player_name()
|
||||||
|
pool[name] = nil
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
local has_awards = minetest.get_modpath("awards")
|
local has_awards = minetest.get_modpath("awards")
|
||||||
|
|
||||||
mcl_item_entity = {}
|
local mcl_item_entity = {}
|
||||||
|
|
||||||
--basic settings
|
--basic settings
|
||||||
local item_drop_settings = {} --settings table
|
local item_drop_settings = {} --settings table
|
||||||
|
item_drop_settings.dug_buffer = 0.65 -- the warm up period before a dug item can be collected
|
||||||
item_drop_settings.age = 1.0 --how old a dropped item (_insta_collect==false) has to be before collecting
|
item_drop_settings.age = 1.0 --how old a dropped item (_insta_collect==false) has to be before collecting
|
||||||
item_drop_settings.radius_magnet = 2.0 --radius of item magnet. MUST BE LARGER THAN radius_collect!
|
item_drop_settings.radius_magnet = 2.0 --radius of item magnet. MUST BE LARGER THAN radius_collect!
|
||||||
item_drop_settings.xp_radius_magnet = 7.25 --radius of xp magnet. MUST BE LARGER THAN radius_collect!
|
item_drop_settings.xp_radius_magnet = 7.25 --radius of xp magnet. MUST BE LARGER THAN radius_collect!
|
||||||
item_drop_settings.radius_collect = 0.2 --radius of collection
|
item_drop_settings.radius_collect = 0.2 --radius of collection
|
||||||
item_drop_settings.player_collect_height = 1.0 --added to their pos y value
|
item_drop_settings.player_collect_height = 0.8 --added to their pos y value
|
||||||
item_drop_settings.collection_safety = false --do this to prevent items from flying away on laggy servers
|
item_drop_settings.collection_safety = false --do this to prevent items from flying away on laggy servers
|
||||||
item_drop_settings.random_item_velocity = true --this sets random item velocity if velocity is 0
|
item_drop_settings.random_item_velocity = true --this sets random item velocity if velocity is 0
|
||||||
item_drop_settings.drop_single_item = false --if true, the drop control drops 1 item instead of the entire stack, and sneak+drop drops the stack
|
item_drop_settings.drop_single_item = false --if true, the drop control drops 1 item instead of the entire stack, and sneak+drop drops the stack
|
||||||
|
@ -74,103 +96,71 @@ local disable_physics = function(object, luaentity, ignore_check, reset_movement
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
|
|
||||||
|
tick = not tick
|
||||||
|
|
||||||
for _,player in pairs(minetest.get_connected_players()) do
|
for _,player in pairs(minetest.get_connected_players()) do
|
||||||
if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then
|
if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then
|
||||||
|
|
||||||
|
|
||||||
|
local name = player:get_player_name()
|
||||||
|
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
|
|
||||||
|
if tick == true and pool[name] > 0 then
|
||||||
|
minetest.sound_play("item_drop_pickup", {
|
||||||
|
pos = pos,
|
||||||
|
gain = 0.7,
|
||||||
|
max_hear_distance = 16,
|
||||||
|
pitch = math.random(70,110)/100
|
||||||
|
})
|
||||||
|
if pool[name] > 6 then
|
||||||
|
pool[name] = 6
|
||||||
|
else
|
||||||
|
pool[name] = pool[name] - 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
local checkpos = {x=pos.x,y=pos.y + item_drop_settings.player_collect_height,z=pos.z}
|
local checkpos = {x=pos.x,y=pos.y + item_drop_settings.player_collect_height,z=pos.z}
|
||||||
|
|
||||||
--magnet and collection
|
--magnet and collection
|
||||||
for _,object in pairs(minetest.get_objects_inside_radius(checkpos, item_drop_settings.xp_radius_magnet)) do
|
for _,object in pairs(minetest.get_objects_inside_radius(checkpos, item_drop_settings.xp_radius_magnet)) do
|
||||||
if not object:is_player() and vector.distance(checkpos, object:get_pos()) < item_drop_settings.radius_magnet and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and object:get_luaentity()._magnet_timer and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then
|
if not object:is_player() and vector.distance(checkpos, object:get_pos()) < item_drop_settings.radius_magnet and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and object:get_luaentity()._magnet_timer and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then
|
||||||
object:get_luaentity()._magnet_timer = object:get_luaentity()._magnet_timer + dtime
|
|
||||||
local collected = false
|
|
||||||
if object:get_luaentity()._magnet_timer >= 0 and object:get_luaentity()._magnet_timer < item_drop_settings.magnet_time and inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
if object:get_luaentity()._magnet_timer >= 0 and object:get_luaentity()._magnet_timer < item_drop_settings.magnet_time and inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||||
|
|
||||||
-- Collection
|
-- Collection
|
||||||
if vector.distance(checkpos, object:get_pos()) <= item_drop_settings.radius_collect and not object:get_luaentity()._removed then
|
if not object:get_luaentity()._removed then
|
||||||
-- Ignore if itemstring is not set yet
|
-- Ignore if itemstring is not set yet
|
||||||
if object:get_luaentity().itemstring ~= "" then
|
if object:get_luaentity().itemstring ~= "" then
|
||||||
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
||||||
minetest.sound_play("item_drop_pickup", {
|
|
||||||
pos = pos,
|
|
||||||
max_hear_distance = 16,
|
|
||||||
gain = 1.0,
|
|
||||||
}, true)
|
|
||||||
check_pickup_achievements(object, player)
|
|
||||||
|
|
||||||
|
check_pickup_achievements(object, player)
|
||||||
|
|
||||||
-- Destroy entity
|
-- Destroy entity
|
||||||
-- This just prevents this section to be run again because object:remove() doesn't remove the item immediately.
|
-- This just prevents this section to be run again because object:remove() doesn't remove the item immediately.
|
||||||
|
object:get_luaentity().target = checkpos
|
||||||
object:get_luaentity()._removed = true
|
object:get_luaentity()._removed = true
|
||||||
object:remove()
|
|
||||||
collected = true
|
object:set_velocity({x=0,y=0,z=0})
|
||||||
|
object:set_acceleration({x=0,y=0,z=0})
|
||||||
|
|
||||||
|
object:move_to(checkpos)
|
||||||
|
|
||||||
|
pool[name] = pool[name] + 1
|
||||||
|
|
||||||
|
minetest.after(0.25, function()
|
||||||
|
--safety check
|
||||||
|
if object and object:get_luaentity() then
|
||||||
|
object:remove()
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Magnet
|
|
||||||
else
|
|
||||||
|
|
||||||
object:get_luaentity()._magnet_active = true
|
|
||||||
object:get_luaentity()._collector_timer = 0
|
|
||||||
|
|
||||||
-- Move object to player
|
|
||||||
disable_physics(object, object:get_luaentity())
|
|
||||||
|
|
||||||
local opos = object:get_pos()
|
|
||||||
local vec = vector.subtract(checkpos, opos)
|
|
||||||
vec = vector.add(opos, vector.divide(vec, 2))
|
|
||||||
object:move_to(vec)
|
|
||||||
|
|
||||||
|
|
||||||
--fix eternally falling items
|
|
||||||
minetest.after(0, function(object)
|
|
||||||
local lua = object:get_luaentity()
|
|
||||||
if lua then
|
|
||||||
object:set_acceleration({x=0, y=0, z=0})
|
|
||||||
end
|
|
||||||
end, object)
|
|
||||||
|
|
||||||
|
|
||||||
--this is a safety to prevent items flying away on laggy servers
|
|
||||||
if item_drop_settings.collection_safety == true then
|
|
||||||
if object:get_luaentity().init ~= true then
|
|
||||||
object:get_luaentity().init = true
|
|
||||||
minetest.after(1, function(args)
|
|
||||||
local playername = args[1]
|
|
||||||
local player = minetest.get_player_by_name(playername)
|
|
||||||
local object = args[2]
|
|
||||||
local lua = object:get_luaentity()
|
|
||||||
if player == nil or not player:is_player() or object == nil or lua == nil or lua.itemstring == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
|
||||||
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
|
||||||
if not object:get_luaentity()._removed then
|
|
||||||
minetest.sound_play("item_drop_pickup", {
|
|
||||||
pos = pos,
|
|
||||||
max_hear_distance = 16,
|
|
||||||
gain = 1.0,
|
|
||||||
}, true)
|
|
||||||
end
|
|
||||||
check_pickup_achievements(object, player)
|
|
||||||
object:get_luaentity()._removed = true
|
|
||||||
object:remove()
|
|
||||||
else
|
|
||||||
enable_physics(object, object:get_luaentity())
|
|
||||||
end
|
|
||||||
end, {player:get_player_name(), object})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not collected then
|
|
||||||
if object:get_luaentity()._magnet_timer > 1 then
|
|
||||||
object:get_luaentity()._magnet_timer = -item_drop_settings.magnet_time
|
|
||||||
object:get_luaentity()._magnet_active = false
|
|
||||||
elseif object:get_luaentity()._magnet_timer < 0 then
|
|
||||||
object:get_luaentity()._magnet_timer = object:get_luaentity()._magnet_timer + dtime
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -230,12 +220,13 @@ local function get_fortune_drops(fortune_drops, fortune_level)
|
||||||
return drop or {}
|
return drop or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local doTileDrops = minetest.settings:get_bool("mcl_doTileDrops", true)
|
||||||
|
|
||||||
function minetest.handle_node_drops(pos, drops, digger)
|
function minetest.handle_node_drops(pos, drops, digger)
|
||||||
-- NOTE: This function override allows digger to be nil.
|
-- NOTE: This function override allows digger to be nil.
|
||||||
-- This means there is no digger. This is a special case which allows this function to be called
|
-- This means there is no digger. This is a special case which allows this function to be called
|
||||||
-- by hand. Creative Mode is intentionally ignored in this case.
|
-- by hand. Creative Mode is intentionally ignored in this case.
|
||||||
|
|
||||||
local doTileDrops = minetest.settings:get_bool("mcl_doTileDrops", true)
|
|
||||||
if (digger and digger:is_player() and minetest.is_creative_enabled(digger:get_player_name())) or doTileDrops == false then
|
if (digger and digger:is_player() and minetest.is_creative_enabled(digger:get_player_name())) or doTileDrops == false then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -335,6 +326,10 @@ function minetest.handle_node_drops(pos, drops, digger)
|
||||||
z = -z
|
z = -z
|
||||||
end
|
end
|
||||||
obj:set_velocity({x=1/x, y=obj:get_velocity().y, z=1/z})
|
obj:set_velocity({x=1/x, y=obj:get_velocity().y, z=1/z})
|
||||||
|
|
||||||
|
obj:get_luaentity().age = item_drop_settings.dug_buffer
|
||||||
|
|
||||||
|
obj:get_luaentity()._insta_collect = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -401,6 +396,9 @@ minetest.register_entity(":__builtin:item", {
|
||||||
-- Number of seconds this item entity has existed so far
|
-- Number of seconds this item entity has existed so far
|
||||||
age = 0,
|
age = 0,
|
||||||
|
|
||||||
|
-- How old it has become in the collection animation
|
||||||
|
collection_age = 0,
|
||||||
|
|
||||||
set_item = function(self, itemstring)
|
set_item = function(self, itemstring)
|
||||||
self.itemstring = itemstring
|
self.itemstring = itemstring
|
||||||
if self.itemstring == "" then
|
if self.itemstring == "" then
|
||||||
|
@ -566,6 +564,11 @@ minetest.register_entity(":__builtin:item", {
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
if self._removed then
|
if self._removed then
|
||||||
|
self.object:set_properties({
|
||||||
|
physical = false
|
||||||
|
})
|
||||||
|
self.object:set_velocity({x=0,y=0,z=0})
|
||||||
|
self.object:set_acceleration({x=0,y=0,z=0})
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.age = self.age + dtime
|
self.age = self.age + dtime
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Item_Drop_Pickup - https://freesound.org/people/benniknop/sounds/317848/ (License: CC0)
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -735,7 +735,9 @@ local item_drop = function(self, cooked, looting_level)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- add item if it exists
|
-- add item if it exists
|
||||||
obj = minetest.add_item(pos, ItemStack(item .. " " .. num))
|
for x = 1, num do
|
||||||
|
obj = minetest.add_item(pos, ItemStack(item .. " " .. 1))
|
||||||
|
end
|
||||||
|
|
||||||
if obj and obj:get_luaentity() then
|
if obj and obj:get_luaentity() then
|
||||||
|
|
||||||
|
@ -2817,6 +2819,10 @@ local do_states = function(self, dtime)
|
||||||
local arrow, ent
|
local arrow, ent
|
||||||
local v = 1
|
local v = 1
|
||||||
if not self.shoot_arrow then
|
if not self.shoot_arrow then
|
||||||
|
self.firing = true
|
||||||
|
minetest.after(1, function()
|
||||||
|
self.firing = false
|
||||||
|
end)
|
||||||
arrow = minetest.add_entity(p, self.arrow)
|
arrow = minetest.add_entity(p, self.arrow)
|
||||||
ent = arrow:get_luaentity()
|
ent = arrow:get_luaentity()
|
||||||
if ent.velocity then
|
if ent.velocity then
|
||||||
|
@ -4221,6 +4227,11 @@ function mobs:register_arrow(name, def)
|
||||||
switch = 0,
|
switch = 0,
|
||||||
owner_id = def.owner_id,
|
owner_id = def.owner_id,
|
||||||
rotate = def.rotate,
|
rotate = def.rotate,
|
||||||
|
on_punch = function(self)
|
||||||
|
local vel = self.object:get_velocity()
|
||||||
|
self.object:set_velocity({x=vel.x * -1, y=vel.y * -1, z=vel.z * -1})
|
||||||
|
end,
|
||||||
|
collisionbox = def.collisionbox or {0, 0, 0, 0, 0, 0},
|
||||||
automatic_face_movement_dir = def.rotate
|
automatic_face_movement_dir = def.rotate
|
||||||
and (def.rotate - (pi / 180)) or false,
|
and (def.rotate - (pi / 180)) or false,
|
||||||
|
|
||||||
|
@ -4283,7 +4294,7 @@ function mobs:register_arrow(name, def)
|
||||||
|
|
||||||
if self.hit_player or self.hit_mob or self.hit_object then
|
if self.hit_player or self.hit_mob or self.hit_object then
|
||||||
|
|
||||||
for _,player in pairs(minetest.get_objects_inside_radius(pos, 1.0)) do
|
for _,player in pairs(minetest.get_objects_inside_radius(pos, 1.5)) do
|
||||||
|
|
||||||
if self.hit_player
|
if self.hit_player
|
||||||
and player:is_player() then
|
and player:is_player() then
|
||||||
|
|
|
@ -534,9 +534,11 @@ mobs:register_mob("mobs_mc:enderman", {
|
||||||
--if (minetest.get_timeofday() * 24000) > 5001 and (minetest.get_timeofday() * 24000) < 19000 then
|
--if (minetest.get_timeofday() * 24000) > 5001 and (minetest.get_timeofday() * 24000) < 19000 then
|
||||||
-- self:teleport(nil)
|
-- self:teleport(nil)
|
||||||
--else
|
--else
|
||||||
|
if pr:next(1, 8) == 8 then --FIXME: real mc rate
|
||||||
self:teleport(hitter)
|
self:teleport(hitter)
|
||||||
self.attack=hitter
|
end
|
||||||
self.state="attack"
|
self.attack=hitter
|
||||||
|
self.state="attack"
|
||||||
--end
|
--end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -63,6 +63,15 @@ mobs:register_mob("mobs_mc:ghast", {
|
||||||
makes_footstep_sound = false,
|
makes_footstep_sound = false,
|
||||||
instant_death = true,
|
instant_death = true,
|
||||||
fire_resistant = true,
|
fire_resistant = true,
|
||||||
|
do_custom = function(self)
|
||||||
|
if self.firing == true then
|
||||||
|
self.base_texture = {"mobs_mc_ghast_firing.png"}
|
||||||
|
self.object:set_properties({textures=self.base_texture})
|
||||||
|
else
|
||||||
|
self.base_texture = {"mobs_mc_ghast.png"}
|
||||||
|
self.object:set_properties({textures=self.base_texture})
|
||||||
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,6 +83,7 @@ mobs:register_arrow("mobs_mc:fireball", {
|
||||||
visual_size = {x = 1, y = 1},
|
visual_size = {x = 1, y = 1},
|
||||||
textures = {"mcl_fire_fire_charge.png"},
|
textures = {"mcl_fire_fire_charge.png"},
|
||||||
velocity = 15,
|
velocity = 15,
|
||||||
|
collisionbox = {-.5, -.5, -.5, .5, .5, .5},
|
||||||
|
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
if rawget(_G, "armor") and armor.last_damage_types then
|
if rawget(_G, "armor") and armor.last_damage_types then
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -20,9 +20,9 @@ if hb.settings.bar_type == "progress_bar" then
|
||||||
hb.settings.start_offset_right.x = hb.load_setting("hudbars_start_offset_right_x", "number", 15)
|
hb.settings.start_offset_right.x = hb.load_setting("hudbars_start_offset_right_x", "number", 15)
|
||||||
hb.settings.start_offset_right.y = hb.load_setting("hudbars_start_offset_right_y", "number", -86)
|
hb.settings.start_offset_right.y = hb.load_setting("hudbars_start_offset_right_y", "number", -86)
|
||||||
else
|
else
|
||||||
hb.settings.start_offset_left.x = hb.load_setting("hudbars_start_statbar_offset_left_x", "number", -265)
|
hb.settings.start_offset_left.x = hb.load_setting("hudbars_start_statbar_offset_left_x", "number", -258)
|
||||||
hb.settings.start_offset_left.y = hb.load_setting("hudbars_start_statbar_offset_left_y", "number", -90)
|
hb.settings.start_offset_left.y = hb.load_setting("hudbars_start_statbar_offset_left_y", "number", -90)
|
||||||
hb.settings.start_offset_right.x = hb.load_setting("hudbars_start_statbar_offset_right_x", "number", 25)
|
hb.settings.start_offset_right.x = hb.load_setting("hudbars_start_statbar_offset_right_x", "number", 16)
|
||||||
hb.settings.start_offset_right.y = hb.load_setting("hudbars_start_statbar_offset_right_y", "number", -90)
|
hb.settings.start_offset_right.y = hb.load_setting("hudbars_start_statbar_offset_right_y", "number", -90)
|
||||||
end
|
end
|
||||||
-- Modified in MCL2!
|
-- Modified in MCL2!
|
||||||
|
|
|
@ -74,6 +74,7 @@ function mesecon.is_mvps_unsticky(node, pulldir, stack, stackid)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Functions to be called on mvps movement
|
-- Functions to be called on mvps movement
|
||||||
|
-- See also the callback
|
||||||
function mesecon.register_on_mvps_move(callback)
|
function mesecon.register_on_mvps_move(callback)
|
||||||
mesecon.on_mvps_move[#mesecon.on_mvps_move+1] = callback
|
mesecon.on_mvps_move[#mesecon.on_mvps_move+1] = callback
|
||||||
end
|
end
|
||||||
|
@ -405,17 +406,20 @@ mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_brown")
|
||||||
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_light_blue")
|
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_light_blue")
|
||||||
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_pink")
|
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_pink")
|
||||||
|
|
||||||
|
-- Includes node heat when moving them
|
||||||
mesecon.register_on_mvps_move(mesecon.move_hot_nodes)
|
mesecon.register_on_mvps_move(mesecon.move_hot_nodes)
|
||||||
|
|
||||||
-- Check for falling after moving node
|
|
||||||
mesecon.register_on_mvps_move(function(moved_nodes)
|
mesecon.register_on_mvps_move(function(moved_nodes)
|
||||||
for i = 1, #moved_nodes do
|
for i = 1, #moved_nodes do
|
||||||
local moved_node = moved_nodes[i]
|
local moved_node = moved_nodes[i]
|
||||||
|
-- Check for falling after moving node
|
||||||
mesecon.on_placenode(moved_node.pos, moved_node.node)
|
mesecon.on_placenode(moved_node.pos, moved_node.node)
|
||||||
minetest.after(0, function()
|
minetest.after(0, function()
|
||||||
minetest.check_for_falling(moved_node.oldpos)
|
minetest.check_for_falling(moved_node.oldpos)
|
||||||
minetest.check_for_falling(moved_node.pos)
|
minetest.check_for_falling(moved_node.pos)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Callback for on_mvps_move stored in nodedef
|
||||||
local node_def = minetest.registered_nodes[moved_node.node.name]
|
local node_def = minetest.registered_nodes[moved_node.node.name]
|
||||||
if node_def and node_def.mesecon and node_def.mesecon.on_mvps_move then
|
if node_def and node_def.mesecon and node_def.mesecon.on_mvps_move then
|
||||||
node_def.mesecon.on_mvps_move(moved_node.pos, moved_node.node,
|
node_def.mesecon.on_mvps_move(moved_node.pos, moved_node.node,
|
||||||
|
|
|
@ -367,6 +367,7 @@ mcl_player.player_register_model("mcl_armor_character.b3d", {
|
||||||
run_walk = {x=440, y=459},
|
run_walk = {x=440, y=459},
|
||||||
run_walk_mine = {x=461, y=480},
|
run_walk_mine = {x=461, y=480},
|
||||||
sit_mount = {x=484, y=484},
|
sit_mount = {x=484, y=484},
|
||||||
|
die = {x=498, y=498},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,56 +1,56 @@
|
||||||
# Blender v2.91.0 OBJ File: ''
|
# Blender v2.92.0 OBJ File: ''
|
||||||
# www.blender.org
|
# www.blender.org
|
||||||
mtllib mcl_bows_arrow.mtl
|
mtllib mcl_bows_arrow.mtl
|
||||||
o Plane
|
o Plane
|
||||||
v -3.782006 -1.443249 0.000500
|
|
||||||
v -3.782006 1.444249 0.000500
|
|
||||||
v 3.782006 1.444249 0.000500
|
|
||||||
v 3.782006 -1.443249 0.000500
|
|
||||||
v 3.331104 1.069925 1.085017
|
|
||||||
v 3.331104 -1.100076 1.085017
|
|
||||||
v 3.331104 1.069925 -1.064830
|
|
||||||
v 3.331104 -1.100076 -1.064829
|
|
||||||
v 3.782006 0.001000 1.443749
|
|
||||||
v 3.782006 0.001000 -1.443750
|
|
||||||
v -3.782006 0.001000 -1.443749
|
|
||||||
v -3.782006 0.001000 1.443750
|
|
||||||
v 3.782006 0.000000 -1.443750
|
|
||||||
v 3.782006 0.000000 1.443749
|
|
||||||
v -3.782006 0.000000 1.443750
|
|
||||||
v -3.782006 0.000000 -1.443749
|
|
||||||
v 3.782006 1.444249 -0.000500
|
v 3.782006 1.444249 -0.000500
|
||||||
v 3.782006 -1.443249 -0.000500
|
v 3.782006 -1.443249 -0.000500
|
||||||
v -3.782006 -1.443249 -0.000500
|
v -3.782006 -1.443249 -0.000500
|
||||||
v -3.782006 1.444249 -0.000500
|
v -3.782006 1.444249 -0.000500
|
||||||
vt 0.000000 0.300000
|
v 3.331104 -1.100076 -1.064829
|
||||||
vt 0.000000 0.700000
|
v 3.331104 1.069925 -1.064830
|
||||||
vt 1.000000 0.700000
|
v 3.331104 1.069925 1.085017
|
||||||
vt 1.000000 0.300000
|
v 3.331104 -1.100076 1.085017
|
||||||
vt -0.007553 -0.000373
|
v 3.782006 0.001000 -1.443750
|
||||||
vt 0.296712 -0.000373
|
v -3.782006 0.001000 -1.443749
|
||||||
vt 0.296712 0.298611
|
v -3.782006 0.001000 1.443750
|
||||||
vt -0.007553 0.298611
|
v 3.782006 0.001000 1.443749
|
||||||
vt 0.000000 0.300000
|
v 3.782006 1.444249 0.000500
|
||||||
vt 1.000000 0.300000
|
v -3.782006 1.444249 0.000500
|
||||||
vt 1.000000 0.700000
|
v -3.782006 -1.443249 0.000500
|
||||||
vt 0.000000 0.700000
|
v 3.782006 -1.443249 0.000500
|
||||||
vt 0.000000 0.300000
|
v 3.782006 0.000000 -1.443750
|
||||||
vt 1.000000 0.300000
|
v 3.782006 -0.000000 1.443749
|
||||||
vt 1.000000 0.700000
|
v -3.782006 -0.000000 1.443750
|
||||||
vt 0.000000 0.700000
|
v -3.782006 0.000000 -1.443749
|
||||||
vt 0.000000 0.300000
|
vt -0.000893 0.835148
|
||||||
vt 0.000000 0.700000
|
vt -0.000893 1.008567
|
||||||
vt 1.000000 0.700000
|
vt 0.486244 1.008567
|
||||||
vt 1.000000 0.300000
|
vt 0.486244 0.835148
|
||||||
vn -0.0000 -0.0000 -1.0000
|
vt 0.159016 0.682983
|
||||||
vn 1.0000 -0.0000 0.0000
|
vt 0.159016 0.849928
|
||||||
|
vt -0.005031 0.849928
|
||||||
|
vt -0.005031 0.682983
|
||||||
|
vt -0.000893 0.835148
|
||||||
|
vt 0.486244 0.835148
|
||||||
|
vt 0.486244 1.008567
|
||||||
|
vt -0.000893 1.008567
|
||||||
|
vt -0.000893 0.835148
|
||||||
|
vt 0.486244 0.835148
|
||||||
|
vt 0.486244 1.008567
|
||||||
|
vt -0.000893 1.008567
|
||||||
|
vt -0.000893 0.835148
|
||||||
|
vt -0.000893 1.008567
|
||||||
|
vt 0.486244 1.008567
|
||||||
|
vt 0.486244 0.835148
|
||||||
|
vn 0.0000 0.0000 -1.0000
|
||||||
|
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 0.0000 -0.0000 1.0000
|
||||||
vn 0.0000 -1.0000 0.0000
|
vn -0.0000 -1.0000 -0.0000
|
||||||
usemtl Material.002
|
usemtl Material.002
|
||||||
s off
|
s 1
|
||||||
f 17/1/1 18/2/1 19/3/1 20/4/1
|
f 1/1/1 2/2/1 3/3/1 4/4/1
|
||||||
f 8/5/2 7/6/2 5/7/2 6/8/2
|
f 5/5/2 6/6/2 7/7/2 8/8/2
|
||||||
f 10/9/3 11/10/3 12/11/3 9/12/3
|
f 9/9/3 10/10/3 11/11/3 12/12/3
|
||||||
f 3/13/4 2/14/4 1/15/4 4/16/4
|
f 13/13/4 14/14/4 15/15/4 16/16/4
|
||||||
f 13/17/5 14/18/5 15/19/5 16/20/5
|
f 17/17/5 18/18/5 19/19/5 20/20/5
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 736 B |
|
@ -7,10 +7,10 @@ local WATER_ALPHA = 179
|
||||||
local WATER_VISC = 1
|
local WATER_VISC = 1
|
||||||
local LAVA_VISC = 7
|
local LAVA_VISC = 7
|
||||||
local LIGHT_LAVA = minetest.LIGHT_MAX
|
local LIGHT_LAVA = minetest.LIGHT_MAX
|
||||||
local USE_TEXTURE_ALPHA
|
local USE_TEXTURE_ALPHA = true
|
||||||
|
|
||||||
if minetest.features.use_texture_alpha_string_modes then
|
if minetest.features.use_texture_alpha_string_modes then
|
||||||
USE_TEXTURE_ALPHA = "blend"
|
USE_TEXTURE_ALPHA = "blend"
|
||||||
WATER_ALPHA = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local lava_death_messages = {
|
local lava_death_messages = {
|
||||||
|
@ -40,7 +40,6 @@ minetest.register_node("mcl_core:water_flowing", {
|
||||||
},
|
},
|
||||||
sounds = mcl_sounds.node_sound_water_defaults(),
|
sounds = mcl_sounds.node_sound_water_defaults(),
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
alpha = WATER_ALPHA,
|
|
||||||
use_texture_alpha = USE_TEXTURE_ALPHA,
|
use_texture_alpha = USE_TEXTURE_ALPHA,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "flowingliquid",
|
paramtype2 = "flowingliquid",
|
||||||
|
@ -86,7 +85,6 @@ S("• When water is directly below lava, the water turns into stone."),
|
||||||
},
|
},
|
||||||
sounds = mcl_sounds.node_sound_water_defaults(),
|
sounds = mcl_sounds.node_sound_water_defaults(),
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
alpha = WATER_ALPHA,
|
|
||||||
use_texture_alpha = USE_TEXTURE_ALPHA,
|
use_texture_alpha = USE_TEXTURE_ALPHA,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
|
|
|
@ -70,7 +70,7 @@ minetest.register_entity("mcl_end:crystal", {
|
||||||
collisionbox = {-1, 0.5, -1, 1, 2.5, 1},
|
collisionbox = {-1, 0.5, -1, 1, 2.5, 1},
|
||||||
mesh = "mcl_end_crystal.b3d",
|
mesh = "mcl_end_crystal.b3d",
|
||||||
textures = {"mcl_end_crystal.png"},
|
textures = {"mcl_end_crystal.png"},
|
||||||
collide_with_objects = true,
|
collide_with_objects = false,
|
||||||
},
|
},
|
||||||
on_punch = crystal_explode,
|
on_punch = crystal_explode,
|
||||||
on_activate = set_crystal_animation,
|
on_activate = set_crystal_animation,
|
||||||
|
|
|
@ -303,8 +303,8 @@ local flying_bobber_ENTITY={
|
||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
pointable = false,
|
pointable = false,
|
||||||
|
|
||||||
get_staticdata = get_staticdata,
|
get_staticdata = mcl_throwing.get_staticdata,
|
||||||
on_activate = on_activate,
|
on_activate = mcl_throwing.on_activate,
|
||||||
|
|
||||||
_lastpos={},
|
_lastpos={},
|
||||||
_thrower = nil,
|
_thrower = nil,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
mcl_ocean = {}
|
||||||
|
|
||||||
-- Prismarine (includes sea lantern)
|
-- Prismarine (includes sea lantern)
|
||||||
dofile(minetest.get_modpath(minetest.get_current_modname()).."/prismarine.lua")
|
dofile(minetest.get_modpath(minetest.get_current_modname()).."/prismarine.lua")
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4,11 +4,6 @@ local S = minetest.get_translator("mcl_portals")
|
||||||
local SPAWN_MIN = mcl_vars.mg_end_min+70
|
local SPAWN_MIN = mcl_vars.mg_end_min+70
|
||||||
local SPAWN_MAX = mcl_vars.mg_end_min+98
|
local SPAWN_MAX = mcl_vars.mg_end_min+98
|
||||||
|
|
||||||
local PORTAL_ALPHA = 192
|
|
||||||
if minetest.features.use_texture_alpha_string_modes then
|
|
||||||
PORTAL_ALPHA = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||||
|
|
||||||
local destroy_portal = function(pos)
|
local destroy_portal = function(pos)
|
||||||
|
@ -81,7 +76,6 @@ minetest.register_node("mcl_portals:portal_end", {
|
||||||
-- This is 15 in MC.
|
-- This is 15 in MC.
|
||||||
light_source = 14,
|
light_source = 14,
|
||||||
post_effect_color = {a = 192, r = 0, g = 0, b = 0},
|
post_effect_color = {a = 192, r = 0, g = 0, b = 0},
|
||||||
alpha = PORTAL_ALPHA,
|
|
||||||
after_destruct = destroy_portal,
|
after_destruct = destroy_portal,
|
||||||
-- This prevents “falling through”
|
-- This prevents “falling through”
|
||||||
collision_box = {
|
collision_box = {
|
||||||
|
|
|
@ -30,7 +30,6 @@ local N_Y_MIN, N_Y_MAX = mcl_vars.mg_bedrock_nether_bottom_min, mcl_vars.mg_be
|
||||||
local O_DY, N_DY = O_Y_MAX - O_Y_MIN + 1, N_Y_MAX - N_Y_MIN + 1
|
local O_DY, N_DY = O_Y_MAX - O_Y_MIN + 1, N_Y_MAX - N_Y_MIN + 1
|
||||||
|
|
||||||
-- Alpha and particles
|
-- Alpha and particles
|
||||||
local ALPHA = minetest.features.use_texture_alpha_string_modes and 192
|
|
||||||
local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "none"
|
local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "none"
|
||||||
local node_particles_levels = { none=0, low=1, medium=2, high=3 }
|
local node_particles_levels = { none=0, low=1, medium=2, high=3 }
|
||||||
local PARTICLES = node_particles_levels[node_particles_allowed]
|
local PARTICLES = node_particles_levels[node_particles_allowed]
|
||||||
|
@ -263,7 +262,6 @@ minetest.register_node(PORTAL, {
|
||||||
drop = "",
|
drop = "",
|
||||||
light_source = 11,
|
light_source = 11,
|
||||||
post_effect_color = {a = 180, r = 51, g = 7, b = 89},
|
post_effect_color = {a = 180, r = 51, g = 7, b = 89},
|
||||||
alpha = ALPHA,
|
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
|
|
@ -33,3 +33,9 @@ Handle creative mode, and throw params.
|
||||||
|
|
||||||
* entity_name: the name of the entity to throw
|
* entity_name: the name of the entity to throw
|
||||||
* velocity: (optional) velocity overide (can be nil)
|
* velocity: (optional) velocity overide (can be nil)
|
||||||
|
|
||||||
|
## mcl_throwing.get_staticdata(self)
|
||||||
|
Must be used in entity def if you want the entity to be saved after unloading mapblock.
|
||||||
|
|
||||||
|
## mcl_throwing.on_activate(self, staticdata, dtime_s)
|
||||||
|
Must be used in entity def if you want the entity to be saved after unloading mapblock.
|
||||||
|
|
|
@ -58,7 +58,7 @@ function mcl_throwing.dispense_function(stack, dispenserpos, droppos, dropnode,
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Staticdata handling because objects may want to be reloaded
|
-- Staticdata handling because objects may want to be reloaded
|
||||||
local get_staticdata = function(self)
|
function mcl_throwing.get_staticdata(self)
|
||||||
local thrower
|
local thrower
|
||||||
-- Only save thrower if it's a player name
|
-- Only save thrower if it's a player name
|
||||||
if type(self._thrower) == "string" then
|
if type(self._thrower) == "string" then
|
||||||
|
@ -71,7 +71,7 @@ local get_staticdata = function(self)
|
||||||
return minetest.serialize(data)
|
return minetest.serialize(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_activate = function(self, staticdata, dtime_s)
|
function mcl_throwing.on_activate(self, staticdata, dtime_s)
|
||||||
local data = minetest.deserialize(staticdata)
|
local data = minetest.deserialize(staticdata)
|
||||||
if data then
|
if data then
|
||||||
self._lastpos = data._lastpos
|
self._lastpos = data._lastpos
|
||||||
|
|
|
@ -9,8 +9,8 @@ local snowball_ENTITY={
|
||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
pointable = false,
|
pointable = false,
|
||||||
|
|
||||||
get_staticdata = get_staticdata,
|
get_staticdata = mcl_throwing.get_staticdata,
|
||||||
on_activate = on_activate,
|
on_activate = mcl_throwing.on_activate,
|
||||||
_thrower = nil,
|
_thrower = nil,
|
||||||
|
|
||||||
_lastpos={},
|
_lastpos={},
|
||||||
|
@ -23,8 +23,8 @@ local egg_ENTITY={
|
||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
pointable = false,
|
pointable = false,
|
||||||
|
|
||||||
get_staticdata = get_staticdata,
|
get_staticdata = mcl_throwing.get_staticdata,
|
||||||
on_activate = on_activate,
|
on_activate = mcl_throwing.on_activate,
|
||||||
_thrower = nil,
|
_thrower = nil,
|
||||||
|
|
||||||
_lastpos={},
|
_lastpos={},
|
||||||
|
@ -38,8 +38,8 @@ local pearl_ENTITY={
|
||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
pointable = false,
|
pointable = false,
|
||||||
|
|
||||||
get_staticdata = get_staticdata,
|
get_staticdata = mcl_throwing.get_staticdata,
|
||||||
on_activate = on_activate,
|
on_activate = mcl_throwing.on_activate,
|
||||||
|
|
||||||
_lastpos={},
|
_lastpos={},
|
||||||
_thrower = nil, -- Player ObjectRef of the player who threw the ender pearl
|
_thrower = nil, -- Player ObjectRef of the player who threw the ender pearl
|
||||||
|
|
|
@ -178,7 +178,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
|
|
||||||
-- Apply animations based on what the player is doing
|
-- Apply animations based on what the player is doing
|
||||||
if player:get_hp() == 0 then
|
if player:get_hp() == 0 then
|
||||||
player_set_animation(player, "lay")
|
player_set_animation(player, "die")
|
||||||
elseif walking and velocity.x > 0.35 or walking and velocity.x < -0.35 or walking and velocity.z > 0.35 or walking and velocity.z < -0.35 then
|
elseif walking and velocity.x > 0.35 or walking and velocity.x < -0.35 or walking and velocity.z > 0.35 or walking and velocity.z < -0.35 then
|
||||||
if player_sneak[name] ~= controls.sneak then
|
if player_sneak[name] ~= controls.sneak then
|
||||||
player_anim[name] = nil
|
player_anim[name] = nil
|
||||||
|
@ -253,3 +253,28 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
||||||
end
|
end
|
||||||
return hp_change
|
return hp_change
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
|
minetest.register_on_respawnplayer(function(player)
|
||||||
|
local pos = player:get_pos()
|
||||||
|
minetest.add_particlespawner({
|
||||||
|
amount = 50,
|
||||||
|
time = 0.001,
|
||||||
|
minpos = vector.add(pos, 0),
|
||||||
|
maxpos = vector.add(pos, 0),
|
||||||
|
minvel = vector.new(-5,-5,-5),
|
||||||
|
maxvel = vector.new(5,5,5),
|
||||||
|
minexptime = 1.1,
|
||||||
|
maxexptime = 1.5,
|
||||||
|
minsize = 1,
|
||||||
|
maxsize = 2,
|
||||||
|
collisiondetection = false,
|
||||||
|
vertical = false,
|
||||||
|
texture = "mcl_particles_mob_death.png^[colorize:#000000:255",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.sound_play("mcl_mobs_mob_poof", {
|
||||||
|
pos = pos,
|
||||||
|
gain = 1.0,
|
||||||
|
max_hear_distance = 8,
|
||||||
|
}, true)
|
||||||
|
end)
|
||||||
|
|
|
@ -227,6 +227,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
if mcl_skins.skin_count <= 6 then
|
if mcl_skins.skin_count <= 6 then
|
||||||
-- Change skin immediately if there are not many skins
|
-- Change skin immediately if there are not many skins
|
||||||
mcl_skins.cycle_skin(player)
|
mcl_skins.cycle_skin(player)
|
||||||
|
if player:get_attach() ~= nil then
|
||||||
|
mcl_player.player_set_animation(player, "sit")
|
||||||
|
end
|
||||||
else
|
else
|
||||||
-- Show skin selection formspec otherwise
|
-- Show skin selection formspec otherwise
|
||||||
mcl_skins.show_formspec(player:get_player_name())
|
mcl_skins.show_formspec(player:get_player_name())
|
||||||
|
@ -294,4 +297,3 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.log("action", "[mcl_skins] Mod initialized with "..mcl_skins.skin_count.." custom skin(s)")
|
minetest.log("action", "[mcl_skins] Mod initialized with "..mcl_skins.skin_count.." custom skin(s)")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue