merge from master #1

Merged
SumianVoice merged 61 commits from VoxeLibre/VoxeLibre:master into master 2022-07-19 08:17:16 +02:00
52 changed files with 451 additions and 258 deletions

View File

@ -27,6 +27,10 @@
* Code-Sploit
* NO11
* kabou
* rudzik8
* chmodsayshello
* PrarieWind
* RandomLegoBrick
## Contributors
* Laurent Rocher
@ -71,6 +75,10 @@
* Sven792
* aldum
* Dieter44
* Pepebotella
* MrRar
* Lazerbeak12345
* mrminer
## MineClone5
* kay27
@ -78,10 +86,12 @@
* epCode
* NO11
* j45
* chmodsayshello
* 3raven
* PrarieWind
* Gustavo1
* CableGuy67
* MrRar
## Mineclonia
* erlehmann
@ -134,6 +144,9 @@
* yutyo
* NO11
* kay27
* MysticTempest
* RandomLegoBrick
* cora
## Translations
* Wuzzy
@ -143,6 +156,8 @@
* pitchum
* todoporlalibertad
* Marcin Serwin
* Pepebotella
* Emojigit
## Funders
* 40W
@ -150,5 +165,6 @@
## Special thanks
* celeron55 for creating Minetest
* Jordach for the jukebox music compilation from Big Freaking Dig
* wsor for working tirelessly in the shadows for the good of all of us, particularly helping with solving contentDB and copyright issues.
* The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game
* Notch and Jeb for being the major forces behind Minecraft

View File

@ -2,7 +2,7 @@
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
Developed by many people. Not developed or endorsed by Mojang AB.
Version: 0.75 (in development)
Version: 0.78 (in development)
### Gameplay
You start in a randomly-generated world made entirely of cubes. You can explore
@ -91,11 +91,11 @@ The MineClone2 repository is hosted at Mesehub. To contribute or report issues,
## Target
- Crucially, create a stable, moddable, free/libre clone of Minecraft
based on the Minetest engine with polished features, usable in both
singleplayer and multiplayer. Currently, most of **Minecraft Java
Edition 1.12.2** features are already implemented and polishing existing
singleplayer and multiplayer. Currently, a lot of **Minecraft Java
Edition** features are already implemented and polishing existing
features are prioritized over new feature requests.
- With lessened priority yet strictly, implement features targetting
**Minecraft version 1.17 + OptiFine** (OptiFine only as far as supported
**Current Minecraft versions + OptiFine** (OptiFine only as far as supported
by the Minetest Engine). This means features in parity with the listed
Minecraft experiences are prioritized over those that don't fulfill this
scope.
@ -108,8 +108,7 @@ playerbase on low spec computers, optimizations are hard to investigate.
This game is currently in **beta** stage.
It is playable, but not yet feature-complete.
Backwards-compability is not entirely guaranteed, updating your world might cause small bugs.
If you want to use the git version of MineClone2 in production, consider using the production branch.
It is updated weekly and contains relatively stable code for servers.
If you want to use the development version of MineClone2 in production, the master branch is usually relatively stable. The testing branch often features some experimental PRs and should be considered less stable.
The following main features are available:
@ -124,7 +123,7 @@ The following main features are available:
* Most blocks in the overworld
* Water and lava
* Weather
* 28 biomes
* 28 biomes + 5 Nether Biomes
* The Nether, a fiery underworld in another dimension
* Redstone circuits (partially)
* Minecarts (partial)
@ -162,7 +161,7 @@ The following features are incomplete:
* Special minecarts
* A couple of non-trivial blocks and items
Bonus features (not found in Minecraft 1.12):
Bonus features (not found in Minecraft):
* Built-in crafting guide which shows you crafting and smelting recipes
* In-game help system containing extensive help about gameplay basics, blocks, items and more
@ -175,6 +174,9 @@ Bonus features (not found in Minecraft 1.12):
* Nether Brick Fence Gate
* Red Nether Brick Fence
* Red Nether Brick Fence Gate
* Structure replacements - these small variants of Minecraft structures serve as replacements until we can get large structures working:
* Woodland Cabin (Mansions)
* Nether Outpost (Fortress)
Technical differences from Minecraft:

View File

@ -1,66 +1,55 @@
-- Dripping Water Mod
-- by kddekadenz
local math = math
-- License of code, textures & sounds: CC0
local function register_drop(liquid, glow, sound, nodes)
minetest.register_entity("mcl_dripping:drop_" .. liquid, {
hp_max = 1,
physical = true,
collide_with_objects = false,
collisionbox = {-0.01, 0.01, -0.01, 0.01, 0.01, 0.01},
glow = glow,
pointable = false,
visual = "sprite",
visual_size = {x = 0.1, y = 0.1},
textures = {""},
spritediv = {x = 1, y = 1},
initial_sprite_basepos = {x = 0, y = 0},
static_save = false,
_dropped = false,
on_activate = function(self)
self.object:set_properties({
textures = {"[combine:2x2:" .. -math.random(1, 16) .. "," .. -math.random(1, 16) .. "=default_" .. liquid .. "_source_animated.png"}
})
end,
on_step = function(self, dtime)
local k = math.random(1, 222)
local ownpos = self.object:get_pos()
if k == 1 then
self.object:set_acceleration(vector.new(0, -5, 0))
end
if minetest.get_node(vector.offset(ownpos, 0, 0.5, 0)).name == "air" then
self.object:set_acceleration(vector.new(0, -5, 0))
end
if minetest.get_node(vector.offset(ownpos, 0, -0.1, 0)).name ~= "air" then
local ent = self.object:get_luaentity()
if not ent._dropped then
ent._dropped = true
minetest.sound_play({name = "drippingwater_" .. sound .. "drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
end
if k < 3 then
self.object:remove()
end
end
end,
})
local math = math
local function make_drop(pos,liquid,sound,interval)
local pt = {
velocity = vector.new(0,0,0),
collision_removal = false,
}
local t = math.random() + math.random(1, interval)
minetest.after(t,function()
local x, z = math.random(-45, 45) / 100, math.random(-45, 45) / 100
pt.pos = vector.offset(pos,x,-0.52,z)
pt.acceleration = vector.new(0,0,0)
pt.collisiondetection = false
pt.expirationtime = t
pt.texture="[combine:2x2:" .. -math.random(1, 16) .. "," .. -math.random(1, 16) .. "=default_" .. liquid .. "_source_animated.png"
minetest.add_particle(pt)
minetest.after(t,function()
pt.acceleration = vector.new(0,-5,0)
pt.collisiondetection = true
pt.expirationtime = math.random() + math.random(1, interval/2)
minetest.add_particle(pt)
minetest.sound_play({name = "drippingwater_" .. sound .. "drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
end)
end)
end
local function register_drop(liquid, glow, sound, nodes, interval, chance)
minetest.register_abm({
label = "Create drops",
nodenames = nodes,
neighbors = {"group:" .. liquid},
interval = 2,
chance = 22,
interval = interval,
chance = chance,
action = function(pos)
if minetest.get_item_group(minetest.get_node(vector.offset(pos, 0, 1, 0)).name, liquid) ~= 0
and minetest.get_node(vector.offset(pos, 0, -1, 0)).name == "air" then
local x, z = math.random(-45, 45) / 100, math.random(-45, 45) / 100
minetest.add_entity(vector.offset(pos, x, -0.520, z), "mcl_dripping:drop_" .. liquid)
local r = math.ceil(interval / 20)
local nn=minetest.find_nodes_in_area(vector.offset(pos,-r,0,-r),vector.offset(pos,r,0,r),nodes)
--start a bunch of particle cycles to be able to get away
--with longer abm cycles
table.shuffle(nn)
for i=1,math.random(#nn) do
if minetest.get_item_group(minetest.get_node(vector.offset(nn[i], 0, 1, 0)).name, liquid) ~= 0
and minetest.get_node(vector.offset(nn[i], 0, -1, 0)).name == "air" then
make_drop(nn[i],liquid,sound,interval)
end
end
end,
})
end
register_drop("water", 1, "", {"group:opaque", "group:leaves"})
register_drop("lava", math.max(7, minetest.registered_nodes["mcl_core:lava_source"].light_source - 3), "lava", {"group:opaque"})
register_drop("water", 1, "", {"group:opaque", "group:leaves"},60,10)
register_drop("lava", math.max(7, minetest.registered_nodes["mcl_core:lava_source"].light_source - 3), "lava", {"group:opaque"},60,10)

View File

@ -91,7 +91,7 @@ minetest.register_chatcommand("clearmobs",{
if o.is_mob then
if param == "all" or
( param == "nametagged" and o.nametag ) or
( param == "" and not o.nametag and not o.tamed ) or
( param == "" and ( not o.nametag or o.nametag == "" ) and not o.tamed ) or
( num and num > 0 and vector.distance(p:get_pos(),o.object:get_pos()) <= num ) then
o.object:remove()
end
@ -1905,11 +1905,10 @@ local specific_attack = function(list, what)
return false
end
-- monster find someone to attack
-- find someone to attack
local monster_attack = function(self)
if self.type ~= "monster"
or not damage_enabled
if not damage_enabled
or minetest.is_creative_enabled("")
or self.passive
or self.state == "attack"
@ -1927,10 +1926,9 @@ local monster_attack = function(self)
for n = 1, #objs do
if objs[n]:is_player() then
if mcl_mobs.invis[ objs[n]:get_player_name() ] or (not object_in_range(self, objs[n])) then
type = ""
else
elseif (self.type == "monster" or self._aggro) then
player = objs[n]
type = "player"
name = "player"
@ -2312,9 +2310,9 @@ local function check_doors(self)
local def = minetest.registered_nodes[n.name]
local closed = n.name:find("_b_1")
if t < 0.3 or t > 0.8 then
if not closed then def.on_rightclick(d,n,self) end
if not closed and def.on_rightclick then def.on_rightclick(d,n,self) end
else
if closed then def.on_rightclick(d,n,self) end
if closed and def.on_rightclick then def.on_rightclick(d,n,self) end
end
end
@ -3346,11 +3344,11 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
and (self.child == false or self.type == "monster")
and hitter:get_player_name() ~= self.owner
and not mcl_mobs.invis[ name ] then
if not die then
-- attack whoever punched mob
self.state = ""
do_attack(self, hitter)
self._aggro= true
end
-- alert others to the attack
@ -3362,7 +3360,6 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
obj = objs[n]:get_luaentity()
if obj then
-- only alert members of same mob or friends
if obj.group_attack
and obj.state ~= "attack"
@ -3372,6 +3369,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
elseif type(obj.group_attack) == "table" then
for i=1, #obj.group_attack do
if obj.name == obj.group_attack[i] then
obj._aggro = true
do_attack(obj, hitter)
break
end
@ -4037,6 +4035,7 @@ minetest.register_entity(name, {
fire_damage_resistant = def.fire_damage_resistant or false,
ignited_by_sunlight = def.ignited_by_sunlight or false,
spawn_in_group = def.spawn_in_group,
spawn_in_group_min = def.spawn_in_group_min,
-- End of MCL2 extensions
on_spawn = def.on_spawn,

View File

@ -15,7 +15,7 @@ local math_cos = math.cos
local math_sin = math.sin
local math_round = function(x) return (x > 0) and math_floor(x + 0.5) or math_ceil(x - 0.5) end
--local vector_distance = vector.distance
local vector_distance = vector.distance
local vector_new = vector.new
local vector_floor = vector.floor
@ -25,7 +25,15 @@ local table_remove = table.remove
local pairs = pairs
-- range for mob count
local aoc_range = 32
local aoc_range = 136
local mob_cap = {
monster = 70,
animal =10,
ambient =15,
water = 5, --currently unused
water_ambient = 20, --currently unused
}
--do mobs spawn?
local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false
@ -153,6 +161,10 @@ local list_of_all_biomes = {
-- dimension biome:
"Nether",
"BasaltDelta",
"CrimsonForest",
"WarpedForest",
"SoulsandValley",
"End",
-- Overworld regular:
@ -162,6 +174,8 @@ local list_of_all_biomes = {
"Swampland",
"Taiga",
"ExtremeHills",
"ExtremeHillsM",
"ExtremeHills+_snowtop",
"Jungle",
"Savanna",
"BirchForest",
@ -180,7 +194,6 @@ local list_of_all_biomes = {
"ExtremeHills+_snowtop",
"MesaPlateauFM_grasstop",
"JungleEdgeM",
"ExtremeHillsM",
"JungleM",
"BirchForestM",
"MesaPlateauF",
@ -189,17 +202,29 @@ local list_of_all_biomes = {
"MesaBryce",
"JungleEdge",
"SavannaM",
"Nether",
"WarpedForest",
"SoulsandValley"
}
-- count how many mobs are in an area
local function count_mobs(pos)
local function count_mobs(pos,r,mob_type)
local num = 0
for _,object in pairs(get_objects_inside_radius(pos, aoc_range)) do
if object and object:get_luaentity() and object:get_luaentity().is_mob then
num = num + 1
for _,l in pairs(minetest.luaentities) do
if l and l.is_mob and (mob_type == nil or l.type == mob_type) then
local p = l.object:get_pos()
if p and vector_distance(p,pos) < r then
num = num + 1
end
end
end
return num
end
local function count_mobs_total(mob_type)
local num = 0
for _,l in pairs(minetest.luaentities) do
if l.is_mob then
if mob_type == nil or l.type == mob_type then
num = num + 1
end
end
end
return num
@ -292,7 +317,7 @@ function mcl_mobs:spawn_setup(def)
spawn_dictionary[#spawn_dictionary + 1] = {
name = name,
dimension = dimension,
type_of_spawning = type_of_spawning,
type_of_spawning = type_of_spawning,
biomes = biomes,
min_light = min_light,
max_light = max_light,
@ -386,22 +411,45 @@ local function get_water_spawn(p)
end
end
local function spawn_group(p,mob,spawn_on,group_max)
local nn = minetest.find_nodes_in_area(vector.offset(p,-3,-3,-3),vector.offset(p,3,3,3),spawn_on)
local dbg_spawn_attempts = 0
local dbg_spawn_succ = 0
local function spawn_group(p,mob,spawn_on,group_max,group_min)
if not group_min then group_min = 1 end
local nn= minetest.find_nodes_in_area_under_air(vector.offset(p,-5,-3,-5),vector.offset(p,5,3,5),spawn_on)
local o
if not nn or #nn < 1 then
nn = {}
table.insert(nn,p)
end
for i = 1, math.random(group_max) do
minetest.add_entity(nn[math.random(#nn)],mob)
for i = 1, math.random(group_min,group_max) do
local sp = vector.offset(nn[math.random(#nn)],0,1,0)
if mob.type_of_spawning == "water" then
sp = get_water_spawn(sp)
end
o = minetest.add_entity(sp,mob.name)
if o then dbg_spawn_succ = dbg_spawn_succ + 1 end
end
return o
end
minetest.register_chatcommand("mobstats",{
privs = { debug = true },
func = function(n,param)
local pos = minetest.get_player_by_name(n):get_pos()
minetest.chat_send_player(n,"mobs within 32 radius of player:"..count_mobs(pos,32))
minetest.chat_send_player(n,"total mobs:"..count_mobs_total())
minetest.chat_send_player(n,"spawning attempts since server start:"..dbg_spawn_attempts)
minetest.chat_send_player(n,"successful spawns since server start:"..dbg_spawn_succ)
end
})
if mobs_spawn then
local perlin_noise
local function spawn_a_mob(pos, dimension, y_min, y_max)
dbg_spawn_attempts = dbg_spawn_attempts + 1
local dimension = dimension or mcl_worlds.pos_to_dimension(pos)
local goal_pos = get_next_mob_spawn_pos(pos)
local spawning_position_list = find_nodes_in_area_under_air(
@ -412,9 +460,6 @@ if mobs_spawn then
if #spawning_position_list <= 0 then return end
local spawning_position = spawning_position_list[math_random(1, #spawning_position_list)]
--hard code mob limit in area to 5 for now
if count_mobs(spawning_position) >= 5 then return end
local gotten_node = get_node(spawning_position).name
local gotten_biome = minetest.get_biome_data(spawning_position)
if not gotten_node or not gotten_biome then return end
@ -429,6 +474,7 @@ if mobs_spawn then
local is_water = get_item_group(gotten_node, "water") ~= 0
local is_lava = get_item_group(gotten_node, "lava") ~= 0
local is_leaf = get_item_group(gotten_node, "leaves") ~= 0
local is_bedrock = gotten_node == "mcl_core:bedrock"
local is_ground = not (is_water or is_lava)
local is_grass = minetest.get_item_group(gotten_node,"grass_block") ~= 0
local has_bed = minetest.find_node_near(pos,25,{"group:bed"})
@ -461,8 +507,12 @@ if mobs_spawn then
end
local mob_def = mob_library_worker_table[mob_index]
local mob_type = minetest.registered_entities[mob_def.name].type
local spawn_in_group = minetest.registered_entities[mob_def.name].spawn_in_group
local spawn_in_group = minetest.registered_entities[mob_def.name].spawn_in_group or 4
local mob_count_wide = count_mobs(pos,aoc_range,mob_type)
local mob_count = count_mobs(spawning_position,32,mob_type)
if mob_def
and mob_count_wide < (mob_cap[mob_type] or 15)
and mob_count < 5
and spawning_position.y >= mob_def.min_height
and spawning_position.y <= mob_def.max_height
and mob_def.dimension == dimension
@ -475,6 +525,7 @@ if mobs_spawn then
and (not is_farm_animal(mob_def.name) or is_grass)
and (mob_type ~= "npc" or has_bed)
and (mob_def.type_of_spawning ~= "water" or is_water)
and not is_bedrock
then
if mob_def.type_of_spawning == "water" then
spawning_position = get_water_spawn(spawning_position)
@ -483,10 +534,13 @@ if mobs_spawn then
end
end
--everything is correct, spawn mob
local object = minetest.add_entity(spawning_position, mob_def.name)
local object
if spawn_in_group then
spawn_group(spawning_position,mob_def.name,{gotten_node},spawn_in_group)
object = spawn_group(spawning_position,mob_def,{gotten_node},spawn_in_group,spawn_in_group_min)
else object = minetest.add_entity(spawning_position, mob_def.name)
end
if object then
return mob_def.on_spawn and mob_def.on_spawn(object, spawning_position)
end

View File

@ -7,6 +7,7 @@ mcl_mobs:register_mob("mobs_mc:bat", {
type = "animal",
spawn_class = "ambient",
can_despawn = true,
spawn_in_group = 8,
passive = true,
hp_min = 6,
hp_max = 6,

View File

@ -16,6 +16,8 @@ mcl_mobs:register_mob("mobs_mc:blaze", {
description = S("Blaze"),
type = "monster",
spawn_class = "hostile",
spawn_in_group_min = 2,
spawn_in_group = 3,
hp_min = 20,
hp_max = 20,
xp_min = 10,

View File

@ -122,8 +122,6 @@ mcl_mobs:spawn_specific(
"ExtremeHills_beach",
"ExtremeHillsM",
"ExtremeHills+",
"ExtremeHills+_snowtop",
"StoneBeach",
"Plains",
"Plains_beach",
"SunflowerPlains",

View File

@ -40,7 +40,8 @@ local cod = {
xp_max = 3,
armor = 100,
rotate = 180,
spawn_in_group = 10,
spawn_in_group_min = 3,
spawn_in_group = 8,
tilt_swim = true,
collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.79, 0.3},
visual = "mesh",

View File

@ -83,6 +83,8 @@ mcl_mobs:register_mob("mobs_mc:cow", cow_def)
local mooshroom_def = table.copy(cow_def)
mooshroom_def.description = S("Mooshroom")
mooshroom_def.mesh = "mobs_mc_cow.b3d"
mooshroom_def.spawn_in_group_min = 4
mooshroom_def.spawn_in_group = 8
mooshroom_def.textures = { {"mobs_mc_mooshroom.png", "mobs_mc_mushroom_red.png"}, {"mobs_mc_mooshroom_brown.png", "mobs_mc_mushroom_brown.png" } }
mooshroom_def.on_rightclick = function(self, clicker)
if mcl_mobs:feed_tame(self, clicker, 1, true, true) then return end
@ -151,17 +153,12 @@ mcl_mobs:spawn_specific(
"ground",
{
"flat",
"IcePlainsSpikes",
"ColdTaiga",
"ColdTaiga_beach",
"ColdTaiga_beach_water",
"MegaTaiga",
"MegaSpruceTaiga",
"ExtremeHills",
"ExtremeHills_beach",
"ExtremeHillsM",
"ExtremeHills+",
"ExtremeHills+_snowtop",
"StoneBeach",
"Plains",
"Plains_beach",

View File

@ -274,7 +274,6 @@ mcl_mobs:spawn_specific(
"Plains",
"Desert",
"ColdTaiga",
"MushroomIsland",
"IcePlainsSpikes",
"SunflowerPlains",
"IcePlains",
@ -301,7 +300,6 @@ mcl_mobs:spawn_specific(
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore",
"MesaPlateauFM_sandlevel",
@ -340,7 +338,6 @@ mcl_mobs:spawn_specific(
"Forest_deep_ocean",
"JungleM_deep_ocean",
"FlowerForest_deep_ocean",
"MushroomIsland_ocean",
"MegaTaiga_ocean",
"StoneBeach_deep_ocean",
"IcePlainsSpikes_deep_ocean",
@ -350,7 +347,6 @@ mcl_mobs:spawn_specific(
"MesaBryce_deep_ocean",
"ExtremeHills+_deep_ocean",
"ExtremeHills_ocean",
"MushroomIsland_deep_ocean",
"Forest_ocean",
"MegaTaiga_deep_ocean",
"JungleEdge_ocean",
@ -376,7 +372,6 @@ mcl_mobs:spawn_specific(
"RoofedForest_underground",
"Jungle_underground",
"Swampland_underground",
"MushroomIsland_underground",
"BirchForest_underground",
"Plains_underground",
"MesaPlateauF_underground",

View File

@ -30,7 +30,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
--###################
local dolphin = {
type = "monster",
type = "animal",
spawn_class = "water",
can_despawn = true,
passive = true,
@ -42,7 +42,8 @@ local dolphin = {
walk_chance = 100,
breath_max = 120,
rotate = 180,
spawn_in_group = 3,
spawn_in_group_min = 3,
spawn_in_group = 5,
tilt_swim = true,
collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.79, 0.3},
visual = "mesh",
@ -136,7 +137,6 @@ mcl_mobs:spawn_specific(
"FlowerForest_beach",
"Forest_beach",
"StoneBeach",
"ColdTaiga_beach_water",
"Taiga_beach",
"Savanna_beach",
"Plains_beach",

View File

@ -627,7 +627,6 @@ mcl_mobs:spawn_specific(
"Plains",
"Desert",
"ColdTaiga",
"MushroomIsland",
"IcePlainsSpikes",
"SunflowerPlains",
"IcePlains",
@ -654,7 +653,6 @@ mcl_mobs:spawn_specific(
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore",
"MesaPlateauFM_sandlevel",
@ -693,7 +691,6 @@ mcl_mobs:spawn_specific(
"Forest_deep_ocean",
"JungleM_deep_ocean",
"FlowerForest_deep_ocean",
"MushroomIsland_ocean",
"MegaTaiga_ocean",
"StoneBeach_deep_ocean",
"IcePlainsSpikes_deep_ocean",
@ -703,7 +700,6 @@ mcl_mobs:spawn_specific(
"MesaBryce_deep_ocean",
"ExtremeHills+_deep_ocean",
"ExtremeHills_ocean",
"MushroomIsland_deep_ocean",
"Forest_ocean",
"MegaTaiga_deep_ocean",
"JungleEdge_ocean",
@ -729,7 +725,6 @@ mcl_mobs:spawn_specific(
"RoofedForest_underground",
"Jungle_underground",
"Swampland_underground",
"MushroomIsland_underground",
"BirchForest_underground",
"Plains_underground",
"MesaPlateauF_underground",
@ -767,10 +762,10 @@ mcl_mobs:spawn_specific(
"ground",
{
"Nether",
"SoulsandValley",
"SoulsandVall3ey",
},
0,
minetest.LIGHT_MAX+1,
11,
30,
27500,
4,
@ -786,7 +781,7 @@ mcl_mobs:spawn_specific(
"WarpedForest"
},
0,
minetest.LIGHT_MAX+1,
11,
30,
5000,
4,

View File

@ -23,6 +23,7 @@ mcl_mobs:register_mob("mobs_mc:ghast", {
collisionbox = {-2, 5, -2, 2, 9, 2},
visual = "mesh",
mesh = "mobs_mc_ghast.b3d",
spawn_in_group = 1,
textures = {
{"mobs_mc_ghast.png"},
},

View File

@ -8,12 +8,14 @@ mcl_mobs:register_mob("mobs_mc:guardian", {
description = S("Guardian"),
type = "monster",
spawn_class = "hostile",
spawn_in_group_min = 2,
spawn_in_group = 4,
hp_min = 30,
hp_max = 30,
xp_min = 10,
xp_max = 10,
breath_max = -1,
passive = false,
passive = false,
attack_type = "dogfight",
pathfinding = 1,
view_range = 16,

View File

@ -100,6 +100,8 @@ local horse = {
description = S("Horse"),
type = "animal",
spawn_class = "passive",
spawn_in_group_min = 2,
spawn_in_group = 6,
visual = "mesh",
mesh = "mobs_mc_horse.b3d",
visual_size = {x=3.0, y=3.0},
@ -490,6 +492,8 @@ local d = 0.86 -- donkey scale
local donkey = table.copy(horse)
donkey.description = S("Donkey")
donkey.textures = {{"blank.png", "mobs_mc_donkey.png", "blank.png"}}
donkey.spawn_in_group = 3
donkey.spawn_in_group_min = 1
donkey.animation = {
speed_normal = 25,
stand_start = 0, stand_end = 0,
@ -574,7 +578,7 @@ mcl_mobs:spawn_specific(
"Savanna_beach",
"Plains_beach",
},
0,
9,
minetest.LIGHT_MAX+1,
30,
15000,

View File

@ -28,6 +28,8 @@ mcl_mobs:register_mob("mobs_mc:llama", {
description = S("Llama"),
type = "animal",
spawn_class = "passive",
spawn_in_group_min = 4,
spawn_in_group = 6,
hp_min = 15,
hp_max = 30,
xp_min = 1,
@ -217,18 +219,16 @@ mcl_mobs:spawn_specific(
"overworld",
"ground",
{
"Mesa",
"MesaPlateauFM_grasstop",
"MesaPlateauF",
"MesaPlateauFM",
"MesaPlateauF_grasstop",
"MesaBryce",
"Jungle",
"Jungle_shore",
"JungleM",
"JungleM_shore",
"Savanna",
"SavannaM",
"SavannaM_beach",
"Savanna_beach",
"Savanna_ocean",
"JungleEdge",
"JungleEdgeM",
"ExtremeHills",
"ExtremeHills_beach",
"ExtremeHillsM",
},
0,
minetest.LIGHT_MAX+1,

View File

@ -1,64 +1,58 @@
# textdomain: mobs_mc
Agent=Agente
Bat=Murciélago
Blaze=Blaze
Chicken=Pollo
Cod=Bacalao
Cow=Vaca
Mooshroom=Champiñaca
Mooshroom=Champivaca
Creeper=Creeper
Ender Dragon=Enderdragón
Dolphin=Delfín
Ender Dragon=Ender Dragon
Enderman=Enderman
Endermite=Endermite
Ghast=Ghast
Elder Guardian=Gran guardián
Guardian=Guardián
Horse=Caballo
Skeleton Horse=Caballo esquelético
Zombie Horse=Caballo zombie
Elder Guardian=Guardián Anciano
Donkey=Burro
Horse=Caballo
Mule=Mula
Skeleton Horse=Caballo esqueleto
Zombie Horse=Caballo zombi
Iron Golem=Golem de hierro
Llama=Llama
Cat=Gato
Ocelot=Ocelote
Parrot=Loro
Pig=Cerdo
Polar Bear=Oso polar
Rabbit=Conejo
Killer Bunny=Conejo asesino
Rabbit=Conejo
Salmon=Salmón
Sheep=Oveja
Shulker=Shulker
Silverfish=Lepisma
Skeleton=Esqueleto
Stray=Esqueleto
Wither Skeleton=Esqueleto wither
Stray=Esqueleto glacial
Wither Skeleton=Esqueleto del Wither
Magma Cube=Cubo de Magma
Slime=Slime
Snow Golem=Golem de nieve
Spider=Araña
Cave Spider=Araña de las cuevas
Spider=Araña
Squid=Calamar
Vex=Ánima
Master=Maestro
Villager=Aldeano
Evoker=Invocador
Illusioner=Illusionista
Villager=Aldeano
Vindicator=Vindicador
Zombie Villager=Aldeano zombie
Zombie Villager=Aldeano zombi
Witch=Bruja
Wither=Wither
Wolf=Lobo
Husk=Husk
Zombie=Zombie
Zombie Pigman=Cerdo Zombie
Farmer=Granjero
Fisherman=Pescador
Fletcher=Flechador
Shepherd=Sacerdote
Librarian=Bibliotecario
Cartographer=Cartógrafo
Armorer=Armero
Leatherworker=Peletero
Butcher=Carnicero
Weapon Smith=Herrero de Armas
Tool Smith=Herrero de Herramientas
Cleric=Sacerdote
Nitwit=Simple
Baby Husk=Bebé Zombi Momificado
Baby Zombie=Bebé Zombi
Husk=Zombi Momificado
Zombie=Zombi
Baby Zombie Pigman=Bebé Hombrecerdo Zombi
Zombie Pigman=Hombrecerdo Zombi

View File

@ -30,6 +30,8 @@ local ocelot = {
type = "animal",
spawn_class = "passive",
can_despawn = true,
spawn_in_group = 3,
spawn_in_group_min = 1,
hp_min = 10,
hp_max = 10,
xp_min = 1,

View File

@ -13,6 +13,45 @@ local shoulders = {
right = vector.new(3.75,10.5,0)
}
local function get_random_mob_sound()
local t = table.copy(minetest.registered_entities)
table.shuffle(t)
for _,e in pairs(t) do
if e.is_mob and e.sounds then
return e.sounds[math.random(#e.sounds)]
end
end
return minetest.registered_entities["mobs_mc:parrot"].sounds.random
end
local function imitate_mob_sound(self,mob)
local snd = mob.sounds.random
if not snd or mob.name == "mobs_mc:parrot" or math.random(20) == 1 then
snd = get_random_mob_sound()
end
return minetest.sound_play(snd, {
pos = self.object:get_pos(),
gain = 1.0,
pitch = 2.5,
max_hear_distance = self.sounds and self.sounds.distance or 32
}, true)
end
local function check_mobimitate(self,dtime)
if not self._mobimitate_timer or self._mobimitate_timer > 30 then
self._mobimitate_timer = 0
for _,o in pairs(minetest.get_objects_inside_radius(self.object:get_pos(),20)) do
local l = o:get_luaentity()
if l and l.is_mob and l.name ~= "mobs_mc:parrot" then
imitate_mob_sound(self,l)
return
end
end
end
self._mobimitate_timer = self._mobimitate_timer + dtime
end
--find a free shoulder or return nil
local function get_shoulder(player)
local sh = "left"
@ -159,6 +198,7 @@ mcl_mobs:register_mob("mobs_mc:parrot", {
end,
do_custom = function(self,dtime)
check_perch(self,dtime)
check_mobimitate(self,dtime)
end,
do_punch = function(self,puncher) --do_punch is the mcl_mobs_redo variant - it gets called by on_punch later....
if self.object:get_attach() == puncher then

View File

@ -194,17 +194,12 @@ mcl_mobs:spawn_specific(
"ground",
{
"flat",
"IcePlainsSpikes",
"ColdTaiga",
"ColdTaiga_beach",
"ColdTaiga_beach_water",
"MegaTaiga",
"MegaSpruceTaiga",
"ExtremeHills",
"ExtremeHills_beach",
"ExtremeHillsM",
"ExtremeHills+",
"ExtremeHills+_snowtop",
"StoneBeach",
"Plains",
"Plains_beach",

View File

@ -6,9 +6,10 @@ local rabbit = {
description = S("Rabbit"),
type = "animal",
spawn_class = "passive",
spawn_in_group_min = 2,
spawn_in_group = 3,
passive = true,
reach = 1,
hp_min = 3,
hp_max = 3,
xp_min = 1,

View File

@ -346,7 +346,7 @@ mcl_mobs:spawn_specific(
"Swampland",
"Swampland_shore"
},
0,
9,
minetest.LIGHT_MAX+1,
30,
15000,

View File

@ -162,7 +162,6 @@ mcl_mobs:spawn_specific(
"Plains",
"Desert",
"ColdTaiga",
"MushroomIsland",
"IcePlainsSpikes",
"SunflowerPlains",
"IcePlains",
@ -189,7 +188,6 @@ mcl_mobs:spawn_specific(
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore",
"MesaPlateauFM_sandlevel",
@ -228,7 +226,6 @@ mcl_mobs:spawn_specific(
"Forest_deep_ocean",
"JungleM_deep_ocean",
"FlowerForest_deep_ocean",
"MushroomIsland_ocean",
"MegaTaiga_ocean",
"StoneBeach_deep_ocean",
"IcePlainsSpikes_deep_ocean",
@ -238,7 +235,6 @@ mcl_mobs:spawn_specific(
"MesaBryce_deep_ocean",
"ExtremeHills+_deep_ocean",
"ExtremeHills_ocean",
"MushroomIsland_deep_ocean",
"Forest_ocean",
"MegaTaiga_deep_ocean",
"JungleEdge_ocean",
@ -264,7 +260,6 @@ mcl_mobs:spawn_specific(
"RoofedForest_underground",
"Jungle_underground",
"Swampland_underground",
"MushroomIsland_underground",
"BirchForest_underground",
"Plains_underground",
"MesaPlateauF_underground",

View File

@ -101,7 +101,8 @@ mcl_mobs:spawn_specific(
"nether",
"ground",
{
"Nether"
"Nether",
"SoulsandValley",
},
0,
7,

View File

@ -446,11 +446,6 @@ minetest.LIGHT_MAX+1,
mmin,
mmax)
--mcl_mobs:spawn_specific("mobs_mc:magma_cube_tiny", { "mcl_nether:nether_brick", "mcl_nether:netherrack" }, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11000, 4, mmin, mmax)
--mcl_mobs:spawn_specific("mobs_mc:magma_cube_small", { "mcl_nether:nether_brick", "mcl_nether:netherrack" }, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11100, 4, mmin, mmax)
--mcl_mobs:spawn_specific("mobs_mc:magma_cube_big", { "mcl_nether:nether_brick", "mcl_nether:netherrack" }, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11200, 4, mmin, mmax)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:magma_cube_big", S("Magma Cube"), "mobs_mc_spawn_icon_magmacube.png")
mcl_mobs:register_egg("mobs_mc:slime_big", S("Slime"), "mobs_mc_spawn_icon_slime.png")

View File

@ -109,7 +109,6 @@ mcl_mobs:spawn_specific(
"Plains",
"Desert",
"ColdTaiga",
"MushroomIsland",
"IcePlainsSpikes",
"SunflowerPlains",
"IcePlains",
@ -136,7 +135,6 @@ mcl_mobs:spawn_specific(
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore",
"MesaPlateauFM_sandlevel",
@ -175,7 +173,6 @@ mcl_mobs:spawn_specific(
"Forest_deep_ocean",
"JungleM_deep_ocean",
"FlowerForest_deep_ocean",
"MushroomIsland_ocean",
"MegaTaiga_ocean",
"StoneBeach_deep_ocean",
"IcePlainsSpikes_deep_ocean",
@ -185,7 +182,6 @@ mcl_mobs:spawn_specific(
"MesaBryce_deep_ocean",
"ExtremeHills+_deep_ocean",
"ExtremeHills_ocean",
"MushroomIsland_deep_ocean",
"Forest_ocean",
"MegaTaiga_deep_ocean",
"JungleEdge_ocean",
@ -211,7 +207,6 @@ mcl_mobs:spawn_specific(
"RoofedForest_underground",
"Jungle_underground",
"Swampland_underground",
"MushroomIsland_underground",
"BirchForest_underground",
"Plains_underground",
"MesaPlateauF_underground",

View File

@ -29,6 +29,7 @@ mcl_mobs:register_mob("mobs_mc:villager_zombie", {
description = S("Zombie Villager"),
type = "monster",
spawn_class = "hostile",
spawn_in_group = 1,
hp_min = 20,
hp_max = 20,
xp_min = 5,
@ -147,7 +148,6 @@ mcl_mobs:spawn_specific(
"RoofedForest_underground",
"Jungle_underground",
"Swampland_underground",
"MushroomIsland_underground",
"BirchForest_underground",
"Plains_underground",
"MesaPlateauF_underground",
@ -184,7 +184,6 @@ mcl_mobs:spawn_specific(
"Plains",
"Desert",
"ColdTaiga",
"MushroomIsland",
"IcePlainsSpikes",
"SunflowerPlains",
"IcePlains",
@ -211,7 +210,6 @@ mcl_mobs:spawn_specific(
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore",
"MesaPlateauFM_sandlevel",

View File

@ -18,6 +18,7 @@ local wolf = {
xp_max = 3,
passive = false,
group_attack = true,
spawn_in_group = 8,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.84, 0.3},
visual = "mesh",
mesh = "mobs_mc_wolf.b3d",

View File

@ -162,7 +162,6 @@ mcl_mobs:spawn_specific(
"RoofedForest_underground",
"Jungle_underground",
"Swampland_underground",
"MushroomIsland_underground",
"BirchForest_underground",
"Plains_underground",
"MesaPlateauF_underground",
@ -198,7 +197,6 @@ mcl_mobs:spawn_specific(
"Forest",
"Plains",
"ColdTaiga",
"MushroomIsland",
"IcePlainsSpikes",
"SunflowerPlains",
"IcePlains",
@ -225,7 +223,6 @@ mcl_mobs:spawn_specific(
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore",
"MesaPlateauFM_sandlevel",
@ -254,7 +251,6 @@ mcl_mobs:spawn_specific(
"RoofedForest_underground",
"Jungle_underground",
"Swampland_underground",
"MushroomIsland_underground",
"BirchForest_underground",
"Plains_underground",
"MesaPlateauF_underground",
@ -290,7 +286,6 @@ mcl_mobs:spawn_specific(
"Forest",
"Plains",
"ColdTaiga",
"MushroomIsland",
"IcePlainsSpikes",
"SunflowerPlains",
"IcePlains",
@ -317,7 +312,6 @@ mcl_mobs:spawn_specific(
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore",
"MesaPlateauFM_sandlevel",

View File

@ -134,7 +134,8 @@ mcl_mobs:spawn_specific(
"nether",
"ground",
{
"Nether"
"Nether",
"CrimsonForest",
},
0,
minetest.LIGHT_MAX+1,

View File

@ -1,7 +1,7 @@
mcl_weather.nether_dust = {}
mcl_weather.nether_dust.particlespawners = {}
local PARTICLES_COUNT_NETHER_DUST = tonumber(minetest.settings:get("mcl_weather_rain_particles")) or 150
local PARTICLES_COUNT_NETHER_DUST = tonumber(minetest.settings:get("mcl_weather_dust_particles")) or 150
local psdef= {
amount = PARTICLES_COUNT_NETHER_DUST,

View File

@ -2,7 +2,7 @@ local get_connected_players = minetest.get_connected_players
mcl_weather.snow = {}
local PARTICLES_COUNT_SNOW = tonumber(minetest.settings:get("mcl_weather_snow_particles")) or 99
local PARTICLES_COUNT_SNOW = tonumber(minetest.settings:get("mcl_weather_snow_particles")) or 100
mcl_weather.snow.init_done = false
local psdef= {

View File

@ -1,6 +1,7 @@
local S = minetest.get_translator(minetest.get_current_modname())
local mod_target = minetest.get_modpath("mcl_target")
local enable_pvp = minetest.settings:get_bool("enable_pvp")
local math = math
local vector = vector
@ -204,9 +205,9 @@ function ARROW_ENTITY.on_step(self, dtime)
if hitpoint.type == "object" then
-- find the closest object that is in the way of the arrow
local ok = false
if hitpoint.ref:is_player() then
if hitpoint.ref:is_player() and enable_pvp then
ok = true
elseif hitpoint.ref:get_luaentity() then
elseif not hitpoint.ref:is_player() and hitpoint.ref:get_luaentity() then
if (hitpoint.ref:get_luaentity().is_mob or hitpoint.ref:get_luaentity()._hittable_by_projectile) then
ok = true
end

View File

@ -231,6 +231,7 @@ end
local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements")
local mod_button = minetest.get_modpath("mesecons_button")
local mod_target = minetest.get_modpath("mcl_target")
local enable_pvp = minetest.settings:get_bool("enable_pvp")
minetest.register_craftitem("mcl_bows:rocket", {
description = S("Arrow"),
@ -417,9 +418,9 @@ function ARROW_ENTITY.on_step(self, dtime)
if hitpoint.type == "object" then
-- find the closest object that is in the way of the arrow
local ok = false
if hitpoint.ref:is_player() then
if hitpoint.ref:is_player() and enable_pvp then
ok = true
elseif hitpoint.ref:get_luaentity() then
elseif not hitpoint.ref:is_player() and hitpoint.ref:get_luaentity() then
if (hitpoint.ref:get_luaentity().is_mob or hitpoint.ref:get_luaentity()._hittable_by_projectile) then
ok = true
end

View File

@ -1702,41 +1702,14 @@ end
-- Obsidian crying
local crobby_psdef = {
amount = 1,
time = 0.9, --everything longer than 1 is a coord exploit
minvel = vector.new(0,-2,0),
maxvel = vector.new(0,-0.5,0),
minacc = vector.new(0,-10,0),
maxacc = vector.new(0,-8,0),
minexptime = 1,
maxexptime = 6,
minsize = 1.5,
maxsize = 2,
collisiondetection = true,
collision_removal = true,
object_collision = true,
vertical = true,
texture = "mcl_core_crying_obsidian_tear.png",
}
local crobby_psdef2 = {
amount = 1,
time = 0.9, --everything longer than 1 is a coord exploit
minvel = vector.new(0,-0.01,0),
maxvel = vector.new(0,-0.005,0),
minacc = vector.new(0,-0.1,0),
maxacc = vector.new(0,-0.01,0),
minexptime = 2,
maxexptime = 3,
minsize = 0.3,
maxsize = 0.6,
collisiondetection = true,
collision_removal = true,
object_collision = true,
vertical = true,
texture = "mcl_core_crying_obsidian_tear.png",
local crobby_particle = {
velocity = vector.new(0,0,0),
size = math.random(1.3,2.5),
texture = "mcl_core_crying_obsidian_tear.png",
collision_removal = false,
}
minetest.register_abm({
label = "Obsidian cries",
nodenames = {"mcl_core:crying_obsidian"},
@ -1744,22 +1717,18 @@ minetest.register_abm({
chance = 10,
action = function(pos, node)
minetest.after(math.random(0.1,1.5),function()
crobby_psdef.minpos = vector.offset(pos,-0.6,-0.51,-0.6)
crobby_psdef.maxpos = vector.offset(pos,0.6,0.51,0.6)
minetest.add_particlespawner(crobby_psdef)
crobby_psdef2.minpos = vector.offset(pos,-0.51,-0.51,-0.51)
crobby_psdef2.maxpos = vector.offset(pos,-0.5,0.51,-0.5)
minetest.add_particlespawner(crobby_psdef2)
crobby_psdef2.minpos = vector.offset(pos,0.51,-0.51,-0.51)
crobby_psdef2.maxpos = vector.offset(pos,0.5,0.51,-0.5)
minetest.add_particlespawner(crobby_psdef2)
crobby_psdef2.minpos = vector.offset(pos,0.51,-0.51,0.51)
crobby_psdef2.maxpos = vector.offset(pos,0.5,0.51,0.5)
minetest.add_particlespawner(crobby_psdef2)
crobby_psdef2.minpos = vector.offset(pos,-0.51,-0.51,0.51)
crobby_psdef2.maxpos = vector.offset(pos,-0.5,0.51,0.5)
minetest.add_particlespawner(crobby_psdef2)
local pt = table.copy(crobby_particle)
pt.acceleration = vector.new(0,0,0)
pt.collisiondetection = false
pt.expirationtime = math.random(0.5,1.5)
pt.pos = vector.offset(pos,math.random(-0.5,0.5),-0.51,math.random(-0.5,0.5))
minetest.add_particle(pt)
minetest.after(pt.expirationtime,function()
pt.acceleration = vector.new(0,-9,0)
pt.collisiondetection = true
pt.expirationtime = math.random(1.2,4.5)
minetest.add_particle(pt)
end)
end)
end
})

View File

@ -23,4 +23,13 @@ minetest.register_craft({
{"mcl_core:iron_nugget", "mcl_torches:torch" , "mcl_core:iron_nugget"},
{"mcl_core:iron_nugget", "mcl_core:iron_nugget", "mcl_core:iron_nugget"},
},
})
})
minetest.register_craft({
output = "mcl_lanterns:soul_lantern_floor",
recipe = {
{"mcl_core:iron_nugget", "mcl_core:iron_nugget" , "mcl_core:iron_nugget"},
{"mcl_core:iron_nugget", "mcl_blackstone:soul_torch" , "mcl_core:iron_nugget"},
{"mcl_core:iron_nugget", "mcl_core:iron_nugget" , "mcl_core:iron_nugget"},
},
})

View File

@ -30,6 +30,7 @@ local how_to_shoot = minetest.registered_items["mcl_bows:arrow"]._doc_items_usag
local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements")
local mod_button = minetest.get_modpath("mesecons_button")
local enable_pvp = minetest.settings:get_bool("enable_pvp")
local arrow_longdesc = minetest.registered_items["mcl_bows:arrow"]._doc_items_longdesc or ""
local arrow_tt = minetest.registered_items["mcl_bows:arrow"]._tt_help or ""
@ -217,9 +218,9 @@ function mcl_potions.register_arrow(name, desc, color, def)
if hitpoint.type == "object" then
-- find the closest object that is in the way of the arrow
local ok = false
if hitpoint.ref:is_player() then
if hitpoint.ref:is_player() and enable_pvp then
ok = true
elseif hitpoint.ref:get_luaentity() then
elseif not hitpoint.ref:is_player() and hitpoint.ref:get_luaentity() then
if (hitpoint.ref:get_luaentity().is_mob or hitpoint.ref:get_luaentity()._hittable_by_projectile) then
ok = true
end
@ -283,7 +284,7 @@ function mcl_potions.register_arrow(name, desc, color, def)
if is_player then
if self._shooter and self._shooter:is_player() then
-- “Ding” sound for hitting another player
minetest.sound_play({name="mcl_bows_hit_player", gain=0.1}, {to_player=self._shooter}, true)
minetest.sound_play({name="mcl_bows_hit_player", gain=0.1}, {to_player=self._shooter:get_player_name()}, true)
end
end

View File

@ -404,6 +404,46 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then
y_max = mcl_worlds.layer_to_y(15),
})
--
-- Ancient debris
--
local ancient_debris_wherein = {"mcl_nether:netherrack","mcl_blackstone:blackstone","mcl_blackstone:basalt"}
-- Common spawn
minetest.register_ore({
ore_type = "scatter",
ore = "mcl_nether:ancient_debris",
wherein = ancient_debris_wherein,
clust_scarcity = 25000, -- 0.004% chance
clust_num_ores = 3,
clust_size = 3,
y_min = mcl_vars.mg_nether_min + 8,
y_max = mcl_vars.mg_nether_min + 22,
})
-- Rare spawn (below)
minetest.register_ore({
ore_type = "scatter",
ore = "mcl_nether:ancient_debris",
wherein = ancient_debris_wherein,
clust_scarcity = 32000,
clust_num_ores = 2,
clust_size = 3,
y_min = mcl_vars.mg_nether_min,
y_max = mcl_vars.mg_nether_min + 8,
})
-- Rare spawn (above)
minetest.register_ore({
ore_type = "scatter",
ore = "mcl_nether:ancient_debris",
wherein = ancient_debris_wherein,
clust_scarcity = 32000,
clust_num_ores = 2,
clust_size = 3,
y_min = mcl_vars.mg_nether_min + 22,
y_max = mcl_vars.mg_nether_min + 119,
})
--
-- Redstone
--

View File

@ -244,6 +244,7 @@ dofile(modpath.."/ocean_ruins.lua")
dofile(modpath.."/witch_hut.lua")
dofile(modpath.."/igloo.lua")
dofile(modpath.."/woodland_mansion.lua")
dofile(modpath.."/ruined_portal.lua")
dofile(modpath.."/geode.lua")

View File

@ -0,0 +1,85 @@
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local function get_replacements(b,c,pr)
local r = {}
if not b then return r end
for k,v in pairs(b) do
if pr:next(1,100) < c then table.insert(r,v) end
end
return r
end
local def = {
place_on = {"group:grass_block","group:dirt","mcl_core:dirt_with_grass","group:grass_block","group:sand","group:grass_block_snow","mcl_core:snow"},
fill_ratio = 0.01,
flags = "place_center_x, place_center_z, all_floors",
solid_ground = true,
make_foundation = true,
chunk_probability = 400,
y_max = mcl_vars.mg_overworld_max,
y_min = 1,
sidelen = 10,
y_offset = -4,
filenames = {
modpath.."/schematics/mcl_structures_ruined_portal_1.mts",
modpath.."/schematics/mcl_structures_ruined_portal_2.mts",
modpath.."/schematics/mcl_structures_ruined_portal_3.mts",
modpath.."/schematics/mcl_structures_ruined_portal_4.mts",
modpath.."/schematics/mcl_structures_ruined_portal_5.mts",
modpath.."/schematics/mcl_structures_ruined_portal_99.mts",
},
after_place = function(pos,def,pr)
local hl = def.sidelen / 2
local p1 = vector.offset(pos,-hl,-hl,-hl)
local p2 = vector.offset(pos,hl,hl,hl)
local gold = minetest.find_nodes_in_area(p1,p2,{"mcl_core:goldblock"})
local lava = minetest.find_nodes_in_area(p1,p2,{"mcl_core:lava_source"})
local rack = minetest.find_nodes_in_area(p1,p2,{"mcl_nether:netherrack"})
local brick = minetest.find_nodes_in_area(p1,p2,{"mcl_core:stonebrick"})
local obby = minetest.find_nodes_in_area(p1,p2,{"mcl_core:obsidian"})
minetest.bulk_set_node(get_replacements(gold,30,pr),{name="air"})
minetest.bulk_set_node(get_replacements(lava,20,pr),{name="mcl_nether:magma"})
minetest.bulk_set_node(get_replacements(rack,7,pr),{name="mcl_nether:magma"})
minetest.bulk_set_node(get_replacements(obby,30,pr),{name="mcl_core:crying_obsidian"})
minetest.bulk_set_node(get_replacements(obby,10,pr),{name="air"})
minetest.bulk_set_node(get_replacements(brick,50,pr),{name="mcl_core:stonebrickcracked"})
brick = minetest.find_nodes_in_area(p1,p2,{"mcl_core:stonebrick"})
minetest.bulk_set_node(get_replacements(brick,50,pr),{name="mcl_core:stonebrickmossy"})
end,
loot = {
["mcl_chests:chest_small" ] ={{
stacks_min = 2,
stacks_max = 6,
items = {
{ itemstring = "mcl_core:iron_nugget", weight = 40, amount_min = 9, amount_max = 18 },
{ itemstring = "mcl_core:flint", weight = 40, amount_min = 1, amount_max=4 },
{ itemstring = "mcl_core:obsidian", weight = 40, amount_min = 1, amount_max=2 },
{ itemstring = "mcl_fire:fire_charge", weight = 40, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_fire:flint_and_steel", weight = 40, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_core:gold_nugget", weight = 15, amount_min = 4, amount_max = 24 },
{ itemstring = "mcl_core:apple_gold", weight = 15, },
{ itemstring = "mcl_books:book", weight = 1, func = function(stack, pr)
mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr)
end },
--{ itemstring = "mcl_bamboo:bamboo", weight = 15, amount_min = 1, amount_max=3 }, --FIXME BAMBOO
{ itemstring = "mcl_core:diamond", weight = 3, amount_min = 1, amount_max = 3 },
{ itemstring = "mcl_mobitems:saddle", weight = 3, },
{ itemstring = "mcl_core:emerald", weight = 2, amount_min = 1, amount_max = 3 },
{ itemstring = "mcl_mobitems:iron_horse_armor", weight = 1, },
{ itemstring = "mcl_mobitems:gold_horse_armor", weight = 1, },
{ itemstring = "mcl_mobitems:diamond_horse_armor", weight = 1, },
{ itemstring = "mcl_core:apple_gold", weight = 15, },
}
}}
}
}
mcl_structures.register_structure("ruined_portal_overworld",def)
local ndef = table.copy(def)
ndef.y_min=mcl_vars.mg_lava_nether_max +10
ndef.y_max=mcl_vars.mg_nether_max - 15
ndef.place_on = {"mcl_nether:netherrack","group:soul_block","mcl_blackstone:basalt,mcl_blackstone:blackstone","mcl_crimson:crimson_nylium","mcl_crimson:warped_nylium"},
mcl_structures.register_structure("ruined_portal_nether",ndef)

View File

@ -33,11 +33,14 @@ local function get_player_nodes(player_pos)
work_pos.y = work_pos.y + 1.5 -- head level
local node_head = node_ok(work_pos)
work_pos.y = work_pos.y + 0.5 -- top of head level, at collision box height
local node_head_top = node_ok(work_pos)
work_pos.y = work_pos.y - 0.5
work_pos.y = work_pos.y - 1.2 -- feet level
local node_feet = node_ok(work_pos)
return node_stand, node_stand_below, node_head, node_feet
return node_stand, node_stand_below, node_head, node_feet, node_head_top
end
minetest.register_globalstep(function(dtime)
@ -62,11 +65,12 @@ minetest.register_globalstep(function(dtime)
local pos = player:get_pos()
-- what is around me?
local node_stand, node_stand_below, node_head, node_feet = get_player_nodes(pos)
local node_stand, node_stand_below, node_head, node_feet, node_head_top = get_player_nodes(pos)
mcl_playerinfo[name].node_stand = node_stand
mcl_playerinfo[name].node_stand_below = node_stand_below
mcl_playerinfo[name].node_head = node_head
mcl_playerinfo[name].node_feet = node_feet
mcl_playerinfo[name].node_head_top = node_head_top
end
@ -81,6 +85,7 @@ minetest.register_on_joinplayer(function(player)
node_feet = "",
node_stand = "",
node_stand_below = "",
node_head_top = "",
}
end)

View File

@ -118,7 +118,8 @@ function limit_vel_yaw(player_vel_yaw, yaw)
return player_vel_yaw
end
local node_stand, node_stand_below, node_head, node_feet
local node_stand, node_stand_below, node_head, node_feet, node_head_top
local is_swimming
-- This following part is 2 wrapper functions for player:set_bones
-- and player:set_properties preventing them from being resent on
@ -370,13 +371,16 @@ minetest.register_globalstep(function(dtime)
set_bone_position_conditional(player,"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
is_swimming = true
set_bone_position_conditional(player,"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
set_properties_conditional(player,{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
set_bone_position_conditional(player,"Body_Control", vector.new(0,6.3,0), vector.new(degrees(dir_to_pitch(player_velocity)) - 90,-player_vel_yaw + yaw + 180,0))
else
elseif get_item_group(mcl_playerinfo[name].node_head, "opaque") == 0
and get_item_group(mcl_playerinfo[name].node_head_top, "opaque") == 0 then
-- sets eye height, and nametag color accordingly
is_swimming = false
set_properties_conditional(player,{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 }})
set_bone_position_conditional(player,"Head_Control", vector.new(0,6.3,0), vector.new(pitch, player_vel_yaw - yaw, 0))
@ -398,10 +402,15 @@ minetest.register_globalstep(function(dtime)
node_stand_below = mcl_playerinfo[name].node_stand_below
node_head = mcl_playerinfo[name].node_head
node_feet = mcl_playerinfo[name].node_feet
node_head_top = mcl_playerinfo[name].node_head_top
if not node_stand or not node_stand_below or not node_head or not node_feet then
return
end
if not minetest.registered_nodes[node_stand] or not minetest.registered_nodes[node_stand_below] or not minetest.registered_nodes[node_head] or not minetest.registered_nodes[node_feet] then
if (not minetest.registered_nodes[node_stand]
or not minetest.registered_nodes[node_stand_below]
or not minetest.registered_nodes[node_head]
or not minetest.registered_nodes[node_feet]
or not minetest.registered_nodes[node_head_top]) then
return
end
@ -460,7 +469,8 @@ minetest.register_globalstep(function(dtime)
local node_stand_below = mcl_playerinfo[name].node_stand_below
local node_head = mcl_playerinfo[name].node_head
local node_feet = mcl_playerinfo[name].node_feet
if not node_stand or not node_stand_below or not node_head or not node_feet then
local node_head_top = mcl_playerinfo[name].node_head_top
if not node_stand or not node_stand_below or not node_head or not node_feet or not node_head_top then
return
end
@ -493,8 +503,11 @@ minetest.register_globalstep(function(dtime)
-- Is player suffocating inside node? (Only for solid full opaque cube type nodes
-- without group disable_suffocation=1)
-- if swimming, check the feet node instead, because the head node will be above the player when swimming
local ndef = minetest.registered_nodes[node_head]
if is_swimming then
ndef = minetest.registered_nodes[node_feet]
end
if (ndef.walkable == nil or ndef.walkable == true)
and (ndef.collision_box == nil or ndef.collision_box.type == "regular")
and (ndef.node_box == nil or ndef.node_box.type == "regular")

View File

@ -30,7 +30,7 @@ mcl_weather_thunder_particles (Thunderstorm rain particles) int 900 0
mcl_weather_snow_particles (Snow particles) int 100 0
# Amount of nether dust particles. You can reduce this to get better FPS (default: 150)
mcl_weather_snow_particles (Nether dust particles) int 150 0
mcl_weather_dust_particles (Nether dust particles) int 150 0
# If enabled, breaking blocks will cause them to drop as item.
# Note that blocks never have drops when in Creative Mode.

View File

@ -19,7 +19,7 @@ pathlist = Path(path).rglob('*.lua')
for path in pathlist:
path_in_str = str(path)
# print(path_in_str)
trouve = False
found = False
with open(path_in_str) as f:
local_vars = []
for i, line in enumerate(f.readlines()):
@ -38,7 +38,7 @@ for path in pathlist:
local_vars.append(n.group('local_var'))
if not found:
nb_varloc = len(variables_locales)
nb_varloc = len(local_vars)
#print(path_in_str, ": -", "({} variables locales)".format(nb_varloc) if nb_varloc > 0 else '')
print(', '.join(['"{}"'.format(v) for v in global_vars]))