diff --git a/API.md b/API.md index e73d5f8a4..f2070b8e7 100644 --- a/API.md +++ b/API.md @@ -42,7 +42,7 @@ A lot of things are possible by using one of the APIs in the mods. Note that not * Buckets: `ITEMS/mcl_buckets` * Dispenser support: `ITEMS/REDSTONE/mcl_dispensers` -## Mobs +### Mobs * Mobs: `ENTITIES/mcl_mobs` MineClone 2 uses its own mobs framework, called “Mobs Redo: MineClone 2 Edition” or “MRM” for short. diff --git a/CREDITS.md b/CREDITS.md index c1174e797..c2c59b504 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -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 diff --git a/README.md b/README.md index 908769438..01719a7a7 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/game.conf b/game.conf index db7357702..9f54e5159 100644 --- a/game.conf +++ b/game.conf @@ -1,2 +1,2 @@ -name = MineClone 2 +title = MineClone 2 description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more. diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index b7cc92775..a44e7ea87 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -110,9 +110,11 @@ end local boat = { physical = true, + pointable = true, -- Warning: Do not change the position of the collisionbox top surface, -- lowering it causes the boat to fall through the world if underwater collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, + selectionbox = {-0.7, -0.35, -0.7, 0.7, 0.3, 0.7}, visual = "mesh", mesh = "mcl_boats_boat.b3d", textures = {"mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png"}, diff --git a/mods/ENTITIES/mcl_burning/api.lua b/mods/ENTITIES/mcl_burning/api.lua index 885875aca..1d07e96f0 100644 --- a/mods/ENTITIES/mcl_burning/api.lua +++ b/mods/ENTITIES/mcl_burning/api.lua @@ -134,6 +134,7 @@ function mcl_burning.set_on_fire(obj, burn_time) end function mcl_burning.extinguish(obj) + if not obj:get_pos() then return end if mcl_burning.is_burning(obj) then local storage = mcl_burning.get_storage(obj) if obj:is_player() then diff --git a/mods/ENTITIES/mcl_dripping/init.lua b/mods/ENTITIES/mcl_dripping/init.lua index 57ba7ecfe..0a5b3d08c 100644 --- a/mods/ENTITIES/mcl_dripping/init.lua +++ b/mods/ENTITIES/mcl_dripping/init.lua @@ -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 = pos, 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"}) \ No newline at end of file +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) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 5d86071eb..260b71286 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -59,6 +59,8 @@ mcl_item_entity.register_pickup_achievement("tree", "mcl:mineWood") mcl_item_entity.register_pickup_achievement("mcl_mobitems:blaze_rod", "mcl:blazeRod") mcl_item_entity.register_pickup_achievement("mcl_mobitems:leather", "mcl:killCow") mcl_item_entity.register_pickup_achievement("mcl_core:diamond", "mcl:diamonds") +mcl_item_entity.register_pickup_achievement("mcl_core:crying_obsidian", "mcl:whosCuttingOnions") +mcl_item_entity.register_pickup_achievement("mcl_nether:ancient_debris", "mcl:hiddenInTheDepths") local function check_pickup_achievements(object, player) if has_awards then @@ -78,7 +80,6 @@ local function enable_physics(object, luaentity, ignore_check) object:set_properties({ physical = true }) - object:set_velocity({x=0,y=0,z=0}) object:set_acceleration({x=0,y=-get_gravity(),z=0}) end end @@ -536,9 +537,9 @@ minetest.register_entity(":__builtin:item", { self.itemstring = data.itemstring self.always_collect = data.always_collect if data.age then - self.age = data.age + dtime_s + self.age = data.age else - self.age = dtime_s + self.age = self.age end --remember collection data -- If true, can collect item without delay @@ -774,8 +775,8 @@ minetest.register_entity(":__builtin:item", { return end - -- Move item around on flowing liquids - if def and def.liquidtype == "flowing" then + -- Move item around on flowing liquids; add 'source' check to allow items to continue flowing a bit in the source block of flowing water. + if def and def.liquidtype == "flowing" or def.liquidtype == "source" then --[[ Get flowing direction (function call from flowlib), if there's a liquid. NOTE: According to Qwertymine, flowlib.quickflow is only reliable for liquids with a flowing distance of 7. @@ -784,11 +785,11 @@ minetest.register_entity(":__builtin:item", { -- Just to make sure we don't manipulate the speed for no reason if vec.x ~= 0 or vec.y ~= 0 or vec.z ~= 0 then -- Minecraft Wiki: Flowing speed is "about 1.39 meters per second" - local f = 1.39 + local f = 1.2 -- Set new item moving speed into the direciton of the liquid local newv = vector.multiply(vec, f) - self.object:set_acceleration({x = 0, y = 0, z = 0}) - self.object:set_velocity({x = newv.x, y = -0.22, z = newv.z}) + -- Swap to acceleration instead of a static speed to better mimic MC mechanics. + self.object:set_acceleration({x = newv.x, y = -0.22, z = newv.z}) self.physical_state = true self._flowing = true @@ -808,7 +809,7 @@ minetest.register_entity(":__builtin:item", { local nn = minetest.get_node({x=p.x, y=p.y-0.5, z=p.z}).name local v = self.object:get_velocity() - if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and v.y == 0 then + if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and not minetest.registered_nodes[nn].groups.slippery and v.y == 0 then if self.physical_state then local own_stack = ItemStack(self.object:get_luaentity().itemstring) -- Merge with close entities of the same item diff --git a/mods/ENTITIES/mcl_minecarts/rails.lua b/mods/ENTITIES/mcl_minecarts/rails.lua index 91282f253..5117fe48c 100644 --- a/mods/ENTITIES/mcl_minecarts/rails.lua +++ b/mods/ENTITIES/mcl_minecarts/rails.lua @@ -21,7 +21,7 @@ local function register_rail(itemstring, tiles, def_extras, creative) stack_max = 64, groups = groups, sounds = mcl_sounds.node_sound_metal_defaults(), - _mcl_blast_resistance = 3.5, + _mcl_blast_resistance = 0.7, _mcl_hardness = 0.7, after_destruct = function(pos) -- Scan for minecarts in this pos and force them to execute their "floating" check. diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 933634cce..c7b55b32a 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -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 @@ -298,9 +298,13 @@ local function update_roll(self) if is_Fleckenstein then cbox[2], cbox[5] = -cbox[5], -cbox[2] + self.object:set_properties({collisionbox = cbox}) + -- This leads to child mobs having the wrong collisionbox + -- and seeing as it seems to be nothing but an easter egg + -- i've put it inside the if. Which just makes it be upside + -- down lol. end - self.object:set_properties({collisionbox = cbox}) end -- set and return valid yaw @@ -1901,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" @@ -1923,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" @@ -2283,6 +2285,9 @@ end local function go_to_pos(entity,b) if not entity then return end local s=entity.object:get_pos() + if not b then + --self.state = "stand" + return end if vector.distance(b,s) < 1 then --set_velocity(entity,0) return true @@ -2305,15 +2310,52 @@ 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 end end +local gowp_etime = 0 + +local function check_gowp(self,dtime) + gowp_etime = gowp_etime + dtime + if gowp_etime < 0.2 then return end + gowp_etime = 0 + local p = self.object:get_pos() + if not p or not self._target then return end + if vector.distance(p,self._target) < 1 then + self.waypoints = nil + self._target = nil + self.current_target = nil + self.state = "stand" + if self.callback_arrived then return self.callback_arrived(self) end + return true + end + if self.waypoints and ( not self.current_target or vector.distance(p,self.current_target) < 2 ) then + self.current_target = table.remove(self.waypoints, 1) + --minetest.log("nextwp:".. tostring(self.current_target) ) + go_to_pos(self,self.current_target) + return + elseif self.current_target then + go_to_pos(self,self.current_target) + end + + if self.current_target and not minetest.line_of_sight(self.object:get_pos(),self.current_target) then + self.waypoints=minetest.find_path(p,self._target,150,1,4) + if not self.waypoints then self.state = "walk" end --give up + self.current_target = nil + return + end + if not self.current_target then + --minetest.log("no path") + self.state = "walk" + end +end + -- execute current state (stand, walk, run, attacks) -- returns true if mob has died local do_states = function(self, dtime) @@ -2326,9 +2368,8 @@ local do_states = function(self, dtime) local s = self.object:get_pos() local objs = minetest.get_objects_inside_radius(s, 3) - + local lp for n = 1, #objs do - if objs[n]:is_player() then lp = objs[n]:get_pos() break @@ -2336,7 +2377,7 @@ local do_states = function(self, dtime) end -- look at any players nearby, otherwise turn randomly - if self.look_at_players then + if lp and self.look_at_players then local vec = { x = lp.x - s.x, @@ -2372,32 +2413,7 @@ local do_states = function(self, dtime) end elseif self.state == "gowp" then - local p = self.object:get_pos() - if not p or not self._target then return end - if vector.distance(p,self._target) < 2 or ( self.waypoints and #self.waypoints == 0 ) then - self.waypoints = nil - self._target = nil - self.current_target = nil - self.state = "walk" - if self.callback_arrived then return self.callback_arrived(self) end - return true - end - if self.waypoints and ( not self.current_target or vector.distance(p,self.current_target) < 1.5 ) then - self.current_target = table.remove(self.waypoints, 1) - --minetest.log("nextwp:".. tostring(self.current_target) ) - elseif self.current_target then - go_to_pos(self,self.current_target) - end - - if self.current_target and not minetest.line_of_sight(self.object:get_pos(),self.current_target) then - self.waypoints=minetest.find_path(p,self._target,150,1,4) - self.current_target = nil - return - end - if not self.current_target then - --minetest.log("no path") - self.state = "walk" - end + check_gowp(self,dtime) elseif self.state == "walk" then local s = self.object:get_pos() @@ -2908,7 +2924,12 @@ local plane_adjacents = { vector.new(0,0,-1), } + +local gopath_last = os.time() function mcl_mobs:gopath(self,target,callback_arrived) + if os.time() - gopath_last < 15 then return end + gopath_last = os.time() + --minetest.log("gowp") local p = self.object:get_pos() local t = vector.offset(target,0,1,0) local wp = minetest.find_path(p,t,150,1,4) @@ -2928,11 +2949,15 @@ function mcl_mobs:gopath(self,target,callback_arrived) if wp and #wp > 0 then self._target = t self.callback_arrived = callback_arrived + table.remove(wp,1) self.waypoints = wp self.state = "gowp" return true else - --minetest.log("no path found") + self.state = "walk" + self.waypoints = nil + self.current_target = nil + -- minetest.log("no path found") end end @@ -2964,7 +2989,7 @@ local function damage_mob(self,reason,damage) if damage > 0 then self.health = self.health - damage - effect(pos, 5, "mcl_particles_smoke.png", 1, 2, 2, nil) + effect(self.object:get_pos(), 5, "mcl_particles_smoke.png", 1, 2, 2, nil) if check_for_death(self, reason, {type = reason}) then return true @@ -3210,35 +3235,36 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) local die = false - -- only play hit sound and show blood effects if damage is 1 or over; lower to 0.1 to ensure armor works appropriately. - if damage >= 0.1 then - -- weapon sounds - if weapon:get_definition().sounds ~= nil then + if damage >= 0 then + -- only play hit sound and show blood effects if damage is 1 or over; lower to 0.1 to ensure armor works appropriately. + if damage >= 0.1 then + -- weapon sounds + if weapon:get_definition().sounds ~= nil then - local s = random(0, #weapon:get_definition().sounds) + local s = random(0, #weapon:get_definition().sounds) - minetest.sound_play(weapon:get_definition().sounds[s], { - object = self.object, --hitter, - max_hear_distance = 8 - }, true) - else - minetest.sound_play("default_punch", { - object = self.object, - max_hear_distance = 5 - }, true) + minetest.sound_play(weapon:get_definition().sounds[s], { + object = self.object, --hitter, + max_hear_distance = 8 + }, true) + else + minetest.sound_play("default_punch", { + object = self.object, + max_hear_distance = 5 + }, true) + end + + damage_effect(self, damage) + + -- do damage + self.health = self.health - damage + + -- skip future functions if dead, except alerting others + if check_for_death(self, "hit", {type = "punch", puncher = hitter}) then + die = true + end end - - damage_effect(self, damage) - - -- do damage - self.health = self.health - damage - - -- skip future functions if dead, except alerting others - if check_for_death(self, "hit", {type = "punch", puncher = hitter}) then - die = true - end - -- knock back effect (only on full punch) if not die and self.knock_back @@ -3318,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 @@ -3334,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" @@ -3344,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 @@ -4008,6 +4034,8 @@ minetest.register_entity(name, { fire_resistant = def.fire_resistant or false, 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, @@ -4333,7 +4361,7 @@ end -- feeding, taming and breeding (thanks blert2112) -function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame) +function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame, notake) if not self.follow then return false end @@ -4346,7 +4374,7 @@ function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame) local item = clicker:get_wielded_item() - item:take_item() + if not notake then item:take_item() end clicker:set_wielded_item(item) end diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 74fcc3255..4e45a0045 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -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", @@ -192,11 +205,26 @@ local list_of_all_biomes = { } -- 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 @@ -289,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, @@ -376,11 +404,52 @@ local function is_farm_animal(n) return n == "mobs_mc:pig" or n == "mobs_mc:cow" or n == "mobs_mc:sheep" or n == "mobs_mc:chicken" or n == "mobs_mc:horse" or n == "mobs_mc:donkey" end +local function get_water_spawn(p) + local nn = minetest.find_nodes_in_area(vector.offset(p,-2,-1,-2),vector.offset(p,2,-15,2),{"group:water"}) + if nn and #nn > 0 then + return nn[math.random(#nn)] + end +end + +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_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( @@ -391,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 @@ -407,6 +473,8 @@ 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"}) @@ -426,6 +494,7 @@ if mobs_spawn then perlin_noise = perlin_noise or minetest_get_perlin(noise_params) local noise = perlin_noise:get_3d(spawning_position) local current_summary_chance = summary_chance + table.shuffle(mob_library_worker_table) while #mob_library_worker_table > 0 do local mob_chance_offset = (math_round(noise * current_summary_chance + 12345) % current_summary_chance) + 1 local mob_index = 1 @@ -438,7 +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 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 @@ -446,14 +520,29 @@ if mobs_spawn then and gotten_light >= mob_def.min_light and gotten_light <= mob_def.max_light and (is_ground or mob_def.type_of_spawning ~= "ground") + and (mob_def.type_of_spawning ~= "ground" or not is_leaf) and (mob_def.check_position and mob_def.check_position(spawning_position) or true) 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) + if not spawning_position then + return + end + end --everything is correct, spawn mob - local object = minetest.add_entity(spawning_position, mob_def.name) + local object + if spawn_in_group then + 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, pos) + return mob_def.on_spawn and mob_def.on_spawn(object, spawning_position) end end current_summary_chance = current_summary_chance - mob_chance diff --git a/mods/ENTITIES/mcl_wither_spawning/init.lua b/mods/ENTITIES/mcl_wither_spawning/init.lua index 2f1d744d8..a8f7f108d 100644 --- a/mods/ENTITIES/mcl_wither_spawning/init.lua +++ b/mods/ENTITIES/mcl_wither_spawning/init.lua @@ -46,6 +46,9 @@ end local wither_head = minetest.registered_nodes["mcl_heads:wither_skeleton"] local old_on_place = wither_head.on_place function wither_head.on_place(itemstack, placer, pointed) - minetest.after(0, wither_spawn, pointed.above) - old_on_place(itemstack, placer, pointed) + local n = minetest.get_node(vector.offset(pointed.above,0,-1,0)) + if n and n.name == "mcl_nether:soul_sand" then + minetest.after(0, wither_spawn, pointed.above) + end + return old_on_place(itemstack, placer, pointed) end diff --git a/mods/ENTITIES/mobs_mc/bat.lua b/mods/ENTITIES/mobs_mc/bat.lua index b41dabcba..1a40203c0 100644 --- a/mods/ENTITIES/mobs_mc/bat.lua +++ b/mods/ENTITIES/mobs_mc/bat.lua @@ -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, diff --git a/mods/ENTITIES/mobs_mc/blaze.lua b/mods/ENTITIES/mobs_mc/blaze.lua index e0ff50909..c06e0bea6 100644 --- a/mods/ENTITIES/mobs_mc/blaze.lua +++ b/mods/ENTITIES/mobs_mc/blaze.lua @@ -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, diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua index a36b58502..886a945b9 100644 --- a/mods/ENTITIES/mobs_mc/chicken.lua +++ b/mods/ENTITIES/mobs_mc/chicken.lua @@ -122,8 +122,6 @@ mcl_mobs:spawn_specific( "ExtremeHills_beach", "ExtremeHillsM", "ExtremeHills+", - "ExtremeHills+_snowtop", - "StoneBeach", "Plains", "Plains_beach", "SunflowerPlains", diff --git a/mods/ENTITIES/mobs_mc/cod.lua b/mods/ENTITIES/mobs_mc/cod.lua new file mode 100644 index 000000000..fe72c2f84 --- /dev/null +++ b/mods/ENTITIES/mobs_mc/cod.lua @@ -0,0 +1,274 @@ +--MCmobs v0.4 +--maikerumine +--made for MC like Survival game +--License for code WTFPL and otherwise stated in readmes + +local pi = math.pi +local atann = math.atan +local atan = function(x) + if not x or x ~= x then + return 0 + else + return atann(x) + end +end + +local dir_to_pitch = function(dir) + local dir2 = vector.normalize(dir) + local xz = math.abs(dir.x) + math.abs(dir.z) + return -math.atan2(-dir.y, xz) +end + +local function degrees(rad) + return rad * 180.0 / math.pi +end + +local S = minetest.get_translator(minetest.get_current_modname()) + +--################### +--################### cod +--################### + +local cod = { + type = "animal", + spawn_class = "water", + can_despawn = true, + passive = true, + hp_min = 3, + hp_max = 3, + xp_min = 1, + xp_max = 3, + armor = 100, + rotate = 180, + 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", + mesh = "extra_mobs_cod.b3d", + textures = { + {"extra_mobs_cod.png"} + }, + sounds = { + }, + animation = { + stand_start = 1, + stand_end = 20, + walk_start = 1, + walk_end = 20, + run_start = 1, + run_end = 20, + }, + drops = { + {name = "mcl_fishing:fish_raw", + chance = 1, + min = 1, + max = 1,}, + {name = "mcl_dye:white", + chance = 20, + min = 1, + max = 1,}, + }, + visual_size = {x=3, y=3}, + makes_footstep_sound = false, + fly = true, + fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, + breathes_in_water = true, + jump = false, + view_range = 16, + runaway = true, + fear_height = 4, + do_custom = function(self) + --[[ this is supposed to make them jump out the water but doesn't appear to work very well + self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0)) + if minetest.get_item_group(self.standing_in, "water") ~= 0 then + if self.object:get_velocity().y < 5 then + self.object:add_velocity({ x = 0 , y = math.random(-.007, .007), z = 0 }) + end + end +--]] + for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 10)) do + local lp = object:get_pos() + local s = self.object:get_pos() + local vec = { + x = lp.x - s.x, + y = lp.y - s.y, + z = lp.z - s.z + } + if object and not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "mobs_mc:cod" then + self.state = "runaway" + self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0}) + end + end + end, + on_rightclick = function(self, clicker) + if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + self.object:remove() + clicker:set_wielded_item("mcl_fishing:bucket_cod") + awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing") + end + end +} + +mcl_mobs:register_mob("mobs_mc:cod", cod) + + +--spawning TODO: in schools + +local water = 0 + +mcl_mobs:spawn_specific( +"mobs_mc:cod", +"overworld", +"water", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +4000, +3, +water-16, +water+1) + +--spawn egg +mcl_mobs:register_egg("mobs_mc:cod", S("Cod"), "extra_mobs_spawn_icon_cod.png", 0) diff --git a/mods/ENTITIES/mobs_mc/common.lua b/mods/ENTITIES/mobs_mc/common.lua deleted file mode 100644 index e69de29bb..000000000 diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index b2d6158bc..d72a6c0f9 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -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", diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 8d50c6755..c98abe718 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -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", diff --git a/mods/ENTITIES/mobs_mc/dolphin.lua b/mods/ENTITIES/mobs_mc/dolphin.lua new file mode 100644 index 000000000..2afe04c43 --- /dev/null +++ b/mods/ENTITIES/mobs_mc/dolphin.lua @@ -0,0 +1,253 @@ +--MCmobs v0.4 +--maikerumine +--made for MC like Survival game +--License for code WTFPL and otherwise stated in readmes + +local pi = math.pi +local atann = math.atan +local atan = function(x) + if not x or x ~= x then + return 0 + else + return atann(x) + end +end + +local dir_to_pitch = function(dir) + local dir2 = vector.normalize(dir) + local xz = math.abs(dir.x) + math.abs(dir.z) + return -math.atan2(-dir.y, xz) +end + +local function degrees(rad) + return rad * 180.0 / math.pi +end + +local S = minetest.get_translator(minetest.get_current_modname()) + +--################### +--################### dolphin +--################### + +local dolphin = { + type = "animal", + spawn_class = "water", + can_despawn = true, + passive = true, + hp_min = 10, + hp_max = 10, + xp_min = 1, + xp_max = 3, + armor = 100, + walk_chance = 100, + breath_max = 120, + rotate = 180, + 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", + mesh = "extra_mobs_dolphin.b3d", + textures = { + {"extra_mobs_dolphin.png"} + }, + sounds = { + }, + animation = { + stand_start = 20, + stand_end = 20, + walk_start = 0, + walk_end = 15, + run_start = 30, + run_end = 45, + }, + drops = { + {name = "mcl_fishing:fish_raw", + chance = 1, + min = 0, + max = 1,}, + }, + visual_size = {x=3, y=3}, + makes_footstep_sound = false, + fly = true, + fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, + breathes_in_water = true, + jump = false, + view_range = 16, + fear_height = 4, + walk_velocity = 3, + run_velocity = 6, + reach = 2, + damage = 2.5, + attack_type = "dogfight", + do_custom = function(self,dtime) + --[[ this is supposed to make them jump out the water but doesn't appear to work very well + self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0)) + if minetest.get_item_group(self.standing_in, "water") ~= 0 then + if self.object:get_velocity().y < 5 then + self.object:add_velocity({ x = 0 , y = math.random(-.007, .007), z = 0 }) + end + end + --]] + end, +} + +mcl_mobs:register_mob("mobs_mc:dolphin", dolphin) + + +--spawning TO DO: in schools +local water = 0 +mcl_mobs:spawn_specific( +"mobs_mc:dolphin", +"overworld", +"water", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +4000, +3, +water-16, +water+1) + +--spawn egg +mcl_mobs:register_egg("mobs_mc:dolphin", S("Dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0) diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index d2f971f79..e7a233fc5 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -35,6 +35,7 @@ mcl_mobs:register_mob("mobs_mc:enderdragon", { }, physical = true, damage = 10, + knock_back = false, jump = true, jump_height = 14, fly = true, diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 9ed59bb1f..8472f76e0 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -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", @@ -766,15 +761,32 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"Nether", +"SoulsandVall3ey", }, 0, -7, +11, 30, 27500, 4, mcl_vars.mg_nether_min, mcl_vars.mg_nether_max) +-- Warped Forest spawn (common) +mcl_mobs:spawn_specific( +"mobs_mc:enderman", +"nether", +"ground", +{ +"WarpedForest" +}, +0, +11, +30, +5000, +4, +mcl_vars.mg_nether_min, +mcl_vars.mg_nether_max) + -- spawn eggs mcl_mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0) diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index fd77b9ed8..c5172c4e5 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -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"}, }, @@ -81,12 +82,14 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"Nether", +"SoulsandValley", +"BasaltDelta", }, 0, -minetest.LIGHT_MAX+1, +7, 30, -18000, +72000, 2, mcl_vars.mg_nether_min, mcl_vars.mg_nether_max) @@ -105,7 +108,12 @@ mcl_mobs:register_arrow("mobs_mc:fireball", { full_punch_interval = 1.0, damage_groups = {fleshy = 6}, }, nil) - mcl_mobs:boom(self, self.object:get_pos(), 1, true) + local p = self.object:get_pos() + if p then + mcl_mobs:boom(self, p, 1, true) + else + mcl_mobs:boom(self, player:get_pos(), 1, true) + end end, hit_mob = function(self, mob) diff --git a/mods/ENTITIES/mobs_mc/guardian.lua b/mods/ENTITIES/mobs_mc/guardian.lua index 53e93f472..dd5f3a83e 100644 --- a/mods/ENTITIES/mobs_mc/guardian.lua +++ b/mods/ENTITIES/mobs_mc/guardian.lua @@ -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, diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 53951b460..30c8e7d94 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -81,11 +81,27 @@ for b=1, #horse_base do end end +-- in e7898352d890c2414af653eba624939df9c0b8b4 (0.76-dev) all items from mobs_mc were moved to mcl_mobitems +-- this results in existing horses wearing armor would still have the old texture filename in their +-- properties this function updates them. It should be removed some time in the future when we can be +-- reasonably sure all horses that want it get the new nexture. +local function update_textures(self) + local old = "mobs_mc_horse_armor_" + local txt = self.object:get_properties().textures + if txt[2]:find(old) then + txt[2] = txt[2]:gsub(old,"mcl_mobitems_horse_armor_") + self.object:set_properties({textures=txt}) + return + end +end + -- Horse 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}, @@ -138,7 +154,7 @@ local horse = { max = 2, looting = "common",}, }, - + on_spawn = update_textures, do_custom = function(self, dtime) -- set needed values if not already present @@ -476,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, @@ -528,41 +546,14 @@ 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", "SunflowerPlains", - "Taiga", - "Taiga_beach", - "Forest", - "Forest_beach", - "FlowerForest", - "FlowerForest_beach", - "BirchForest", - "BirchForestM", - "RoofedForest", "Savanna", "Savanna_beach", "SavannaM", - "Jungle", - "Jungle_shore", - "JungleM", - "JungleM_shore", - "JungleEdge", - "JungleEdgeM", - "Swampland", - "Swampland_shore" + "Savanna_beach", + "Plains_beach", }, 0, minetest.LIGHT_MAX+1, @@ -572,20 +563,22 @@ minetest.LIGHT_MAX+1, mobs_mc.water_level+3, mcl_vars.mg_overworld_max) - mcl_mobs:spawn_specific( "mobs_mc:donkey", "overworld", "ground", { -"Mesa", -"MesaPlateauFM_grasstop", -"MesaPlateauF", -"MesaPlateauFM", -"MesaPlateauF_grasstop", -"MesaBryce", + "flat", + "Plains", + "Plains_beach", + "SunflowerPlains", + "Savanna", + "Savanna_beach", + "SavannaM", + "Savanna_beach", + "Plains_beach", }, -0, +9, minetest.LIGHT_MAX+1, 30, 15000, diff --git a/mods/ENTITIES/mobs_mc/init.lua b/mods/ENTITIES/mobs_mc/init.lua index 02f5023a5..5be1af71c 100644 --- a/mods/ENTITIES/mobs_mc/init.lua +++ b/mods/ENTITIES/mobs_mc/init.lua @@ -142,3 +142,7 @@ dofile(path .. "/slime+magma_cube.lua") -- Wuzzy dofile(path .. "/spider.lua") -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture) dofile(path .. "/vex.lua") -- KrupnoPavel dofile(path .. "/wither.lua") -- Mesh and animation by toby109tt / https://github.com/22i + +dofile(path .. "/cod.lua") +dofile(path .. "/salmon.lua") +dofile(path .. "/dolphin.lua") diff --git a/mods/ENTITIES/mobs_mc/iron_golem.lua b/mods/ENTITIES/mobs_mc/iron_golem.lua index 7f1e66714..81c7ed4bb 100644 --- a/mods/ENTITIES/mobs_mc/iron_golem.lua +++ b/mods/ENTITIES/mobs_mc/iron_golem.lua @@ -37,6 +37,7 @@ mcl_mobs:register_mob("mobs_mc:iron_golem", { run_velocity = 1.2, -- Approximation damage = 14, + knock_back = false, reach = 3, group_attack = true, attacks_monsters = true, diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index a211b117a..e11566e3e 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -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, diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.es.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.es.tr index 7f89bb664..09e0335b8 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.es.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.es.tr @@ -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 diff --git a/mods/ENTITIES/mobs_mc/locale/template.txt b/mods/ENTITIES/mobs_mc/locale/template.txt index aedd8754c..1f9261df6 100644 --- a/mods/ENTITIES/mobs_mc/locale/template.txt +++ b/mods/ENTITIES/mobs_mc/locale/template.txt @@ -62,3 +62,6 @@ Weapon Smith= Tool Smith= Cleric= Nitwit= +Cod= +Salmon= +Dolphin= diff --git a/mods/ENTITIES/mobs_mc/models/extra_mobs_cod.b3d b/mods/ENTITIES/mobs_mc/models/extra_mobs_cod.b3d new file mode 100644 index 000000000..c7e60e12c Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/extra_mobs_cod.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/extra_mobs_dolphin.b3d b/mods/ENTITIES/mobs_mc/models/extra_mobs_dolphin.b3d new file mode 100644 index 000000000..37e2e96ae Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/extra_mobs_dolphin.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/extra_mobs_salmon.b3d b/mods/ENTITIES/mobs_mc/models/extra_mobs_salmon.b3d new file mode 100644 index 000000000..50180af95 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/extra_mobs_salmon.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_villager.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_villager.b3d index 1b92adfa5..a941ca8ef 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_villager.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_villager.b3d differ diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index 983199762..7d8b444da 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -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, diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index 84b3aaead..80a5b9318 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -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 diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index 3cf88b915..b1958dc69 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -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", diff --git a/mods/ENTITIES/mobs_mc/polar_bear.lua b/mods/ENTITIES/mobs_mc/polar_bear.lua index 3fd2d0a0c..4b2f338b2 100644 --- a/mods/ENTITIES/mobs_mc/polar_bear.lua +++ b/mods/ENTITIES/mobs_mc/polar_bear.lua @@ -76,7 +76,6 @@ mcl_mobs:spawn_specific( "ColdTaiga", "IcePlainsSpikes", "IcePlains", -"ExtremeHills+_snowtop", }, 0, minetest.LIGHT_MAX+1, diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 524000a71..c11167007 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -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, @@ -132,18 +133,9 @@ mcl_mobs:spawn_specific( "Desert", "FlowerForest", "Taiga", -"ExtremeHills", -"BirchForest", "MegaSpruceTaiga", "MegaTaiga", -"ExtremeHills+", -"Plains", "ColdTaiga", -"SunflowerPlains", -"RoofedForest", -"MesaPlateauFM_grasstop", -"ExtremeHillsM", -"BirchForestM", }, 9, minetest.LIGHT_MAX+1, diff --git a/mods/ENTITIES/mobs_mc/salmon.lua b/mods/ENTITIES/mobs_mc/salmon.lua new file mode 100644 index 000000000..3c38f6860 --- /dev/null +++ b/mods/ENTITIES/mobs_mc/salmon.lua @@ -0,0 +1,228 @@ +--MCmobs v0.4 +--maikerumine +--made for MC like Survival game +--License for code WTFPL and otherwise stated in readmes + +local S = minetest.get_translator(minetest.get_current_modname()) + +--################### +--################### salmon +--################### + +local salmon = { + type = "animal", + spawn_class = "water", + can_despawn = true, + passive = true, + hp_min = 3, + hp_max = 3, + xp_min = 1, + xp_max = 3, + armor = 100, + spawn_in_group = 5, + tilt_swim = true, + collisionbox = {-0.4, 0.0, -0.4, 0.4, 0.79, 0.4}, + visual = "mesh", + mesh = "extra_mobs_salmon.b3d", + textures = { + {"extra_mobs_salmon.png"} + }, + sounds = { + }, + animation = { + stand_start = 1, + stand_end = 20, + walk_start = 1, + walk_end = 20, + run_start = 1, + run_end = 20, + }, + drops = { + {name = "mcl_fishing:salmon_raw", + chance = 1, + min = 1, + max = 1,}, + {name = "mcl_dye:white", + chance = 20, + min = 1, + max = 1,}, + }, + visual_size = {x=3, y=3}, + makes_footstep_sound = false, + swim = true, + fly = true, + fly_in = "mcl_core:water_source", + breathes_in_water = true, + jump = false, + view_range = 16, + runaway = true, + fear_height = 4, + on_rightclick = function(self, clicker) + if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + self.object:remove() + clicker:set_wielded_item("mcl_fishing:bucket_salmon") + awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing") + end + end +} + +mcl_mobs:register_mob("mobs_mc:salmon", salmon) + + +--spawning TODO: in schools +local water = 0 +mcl_mobs:spawn_specific( +"mobs_mc:salmon", +"overworld", +"water", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +4000, +3, +water-16, +water+1) + +--spawn egg +mcl_mobs:register_egg("mobs_mc:salmon", S("Salmon"), "extra_mobs_spawn_icon_salmon.png", 0) diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index d2d09be50..412c0cbdb 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -346,7 +346,7 @@ mcl_mobs:spawn_specific( "Swampland", "Swampland_shore" }, -0, +9, minetest.LIGHT_MAX+1, 30, 15000, diff --git a/mods/ENTITIES/mobs_mc/shulker.lua b/mods/ENTITIES/mobs_mc/shulker.lua index 5b3c4d282..77273db2f 100644 --- a/mods/ENTITIES/mobs_mc/shulker.lua +++ b/mods/ENTITIES/mobs_mc/shulker.lua @@ -33,6 +33,7 @@ mcl_mobs:register_mob("mobs_mc:shulker", { -- TODO: Make shulker dye-able visual_size = {x=3, y=3}, walk_chance = 0, + knock_back = false, jump = false, drops = { {name = "mcl_mobitems:shulker_shell", diff --git a/mods/ENTITIES/mobs_mc/skeleton+stray.lua b/mods/ENTITIES/mobs_mc/skeleton+stray.lua index aab719b1c..fbf16961a 100644 --- a/mods/ENTITIES/mobs_mc/skeleton+stray.lua +++ b/mods/ENTITIES/mobs_mc/skeleton+stray.lua @@ -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", @@ -302,10 +297,10 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"SoulsandValley", }, 0, -7, +minetest.LIGHT_MAX+1, 30, 10000, 3, diff --git a/mods/ENTITIES/mobs_mc/skeleton_wither.lua b/mods/ENTITIES/mobs_mc/skeleton_wither.lua index 5e31453fa..040f22d66 100644 --- a/mods/ENTITIES/mobs_mc/skeleton_wither.lua +++ b/mods/ENTITIES/mobs_mc/skeleton_wither.lua @@ -101,7 +101,8 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"Nether", +"SoulsandValley", }, 0, 7, diff --git a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua index 0c6c1ee1e..701ae852a 100644 --- a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua +++ b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua @@ -402,7 +402,8 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"Nether", +"BasaltDelta", }, 0, minetest.LIGHT_MAX+1, @@ -418,7 +419,8 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"Nether", +"BasaltDelta", }, 0, minetest.LIGHT_MAX+1, @@ -433,7 +435,8 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"Nether", +"BasaltDelta", }, 0, minetest.LIGHT_MAX+1, @@ -443,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") diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_accept.1.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_accept.1.ogg new file mode 100644 index 000000000..b72b8b83f Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_accept.1.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_accept.2.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_accept.2.ogg new file mode 100644 index 000000000..6de7085b0 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_accept.2.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_hurt.1.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_hurt.1.ogg new file mode 100644 index 000000000..6c96f57b8 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_hurt.1.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_hurt.2.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_hurt.2.ogg new file mode 100644 index 000000000..a7568a3d6 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_hurt.2.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.1.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.1.ogg new file mode 100644 index 000000000..f17771367 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.1.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.2.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.2.ogg new file mode 100644 index 000000000..763bf9132 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.2.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.3.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.3.ogg new file mode 100644 index 000000000..e012ed349 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.3.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.4.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.4.ogg new file mode 100644 index 000000000..51d808f52 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_villager_trade.4.ogg differ diff --git a/mods/ENTITIES/mobs_mc/spider.lua b/mods/ENTITIES/mobs_mc/spider.lua index 0fc16928e..b39db1ea1 100644 --- a/mods/ENTITIES/mobs_mc/spider.lua +++ b/mods/ENTITIES/mobs_mc/spider.lua @@ -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", diff --git a/mods/ENTITIES/mobs_mc/textures/extra_mobs_cod.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_cod.png new file mode 100644 index 000000000..ce6f6dea9 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/extra_mobs_cod.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/extra_mobs_dolphin.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_dolphin.png new file mode 100644 index 000000000..6b8a40bf2 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/extra_mobs_dolphin.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/extra_mobs_salmon.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_salmon.png new file mode 100644 index 000000000..ed62d950b Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/extra_mobs_salmon.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_cod.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_cod.png new file mode 100644 index 000000000..3026890f7 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_cod.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_dolphin.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_dolphin.png new file mode 100644 index 000000000..54819ada6 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_dolphin.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_salmon.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_salmon.png new file mode 100644 index 000000000..ce5dcf971 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/extra_mobs_spawn_icon_salmon.png differ diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index f04602ebf..a62db7158 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -136,8 +136,7 @@ local professions = { { { { "mcl_fishing:fish_raw", 6, 15,}, E1 }, { { "mcl_fishing:salmon_raw", 6, 6, "mcl_core:emerald", 1, 1 },{ "mcl_fishing:salmon_cooked", 6, 6 } }, - -- FIXME missing campfire - -- {{ "mcl_core:emerald", 1, 2 },{"mcl_campfires:campfire",1,1} }, + { { "mcl_core:emerald", 1, 2 },{"mcl_campfires:campfire_lit",1,1} }, }, { { { "mcl_fishing:salmon_raw", 6, 13,}, E1 }, @@ -427,7 +426,7 @@ local professions = { "mobs_mc_villager_weaponsmith.png", "mobs_mc_villager_weaponsmith.png", }, - jobsite = "mcl_furnaces:furnace", --FIXME: grindstone + jobsite = "mcl_grindstone:grindstone", trades = { { { { "mcl_core:coal_lump", 15, 15 }, E1 }, @@ -458,7 +457,7 @@ local professions = { "mobs_mc_villager_toolsmith.png", "mobs_mc_villager_toolsmith.png", }, - jobsite = "mcl_anvils:anvil", --FIXME: smithing table + jobsite = "mcl_smithing_table:table", trades = { { { { "mcl_core:coal_lump", 15, 15 }, E1 }, @@ -613,6 +612,8 @@ local function employ(self,jobsite_pos) end local function look_for_job(self) + if self.last_jobhunt and os.time() - self.last_jobhunt < 360 then return end + self.last_jobhunt = os.time() + math.random(0,60) local p = self.object:get_pos() local nn = minetest.find_nodes_in_area(vector.offset(p,-48,-48,-48),vector.offset(p,48,48,48),jobsites) for _,n in pairs(nn) do @@ -628,14 +629,24 @@ local function look_for_job(self) end local function get_a_job(self) + if self.child then return end local p = self.object:get_pos() - local nn = minetest.find_nodes_in_area(vector.offset(p,-8,-8,-8),vector.offset(p,8,8,8),jobsites) - for _,n in pairs(nn) do - if n and employ(self,n) then return true end - end + local n = minetest.find_node_near(p,1,jobsites) + if n and employ(self,n) then return true end if self.state ~= "gowp" then look_for_job(self) end end +local function check_jobsite(self) + if self._traded or not self._jobsite then return end + local n = mcl_vars.get_node(self._jobsite) + local m = minetest.get_meta(self._jobsite) + if m:get_string("villager") ~= self._id then + self._profession = "unemployed" + self._trades = nil + set_textures(self) + end +end + local function update_max_tradenum(self) if not self._trades then return @@ -724,7 +735,10 @@ local function set_trade(trader, player, inv, concrete_tradenum) local trade = trades[concrete_tradenum] inv:set_stack("wanted", 1, ItemStack(trade.wanted[1])) local offered = ItemStack(trade.offered) - mcl_enchanting.load_enchantments(offered) + -- Only load enchantments for enchanted items; fixes unnecessary metadata being applied to regular items from villagers. + if mcl_enchanting.is_enchanted(offered:get_name()) then + mcl_enchanting.load_enchantments(offered) + end inv:set_stack("offered", 1, offered) if trade.wanted[2] then local wanted2 = ItemStack(trade.wanted[2]) @@ -982,6 +996,11 @@ local trade_inventory = { elseif listname == "output" then if not trader_exists(player:get_player_name()) then return 0 + -- Begin Award Code + -- May need to be moved if award gets unlocked in the wrong cases. + elseif trader_exists(player:get_player_name()) then + awards.unlock(player:get_player_name(), "mcl:whatAdeal") + -- End Award Code end -- Only allow taking full stack local count = stack:get_count() @@ -1094,6 +1113,7 @@ local trade_inventory = { local trader = player_trading_with[name] local tradenum = player_tradenum[name] local trades + trader._traded = true if trader and trader._trades then trades = minetest.deserialize(trader._trades) end @@ -1224,6 +1244,7 @@ mcl_mobs:register_mob("mobs_mc:villager", { -- TODO: sounds sounds = { random = "mobs_mc_villager", + damage = "mobs_mc_villager_hurt", distance = 10, }, animation = { @@ -1236,10 +1257,12 @@ mcl_mobs:register_mob("mobs_mc:villager", { run_speed = 25, run_start = 0, run_end = 40, - die_speed = 15, - die_start = 210, - die_end = 220, - die_loop = false, + head_shake_start = 210, + head_shake_end = 220, + head_shake_loop = false, + head_nod_start = 210, + head_nod_end = 220, + head_nod_loop = false, }, follow = pick_up, nofollow = true, @@ -1261,19 +1284,18 @@ mcl_mobs:register_mob("mobs_mc:villager", { end end if clicker then - mcl_mobs:feed_tame(self, clicker, 1, true, false) + mcl_mobs:feed_tame(self, clicker, 1, true, false, true) return end return true --do not pick up end, on_rightclick = function(self, clicker) - local trg=vector.new(0,9,0) if self._jobsite then mcl_mobs:gopath(self,self._jobsite,function() --minetest.log("arrived at jobsite") end) end - if self.child or self._profession == "unemployed" then + if self.child or self._profession == "unemployed" or self._profession == "nitwit" then return end -- Initiate trading @@ -1344,20 +1366,24 @@ mcl_mobs:register_mob("mobs_mc:villager", { end if self._profession == "unemployed" then get_a_job(self) + else + check_jobsite(self) end end end, on_spawn = function(self) + if not self._profession then + self._profession = "unemployed" + if math.random(100) == 1 then + self._profession = "nitwit" + end + end if self._id then set_textures(self) return end self._id=minetest.sha1(minetest.get_gametime()..minetest.pos_to_string(self.object:get_pos())..tostring(math.random())) - self._profession = "unemployed" - if math.random(100) == 1 then - self._profession = "nitwit" - end set_textures(self) end, on_die = function(self, pos) @@ -1376,7 +1402,8 @@ mcl_mobs:register_mob("mobs_mc:villager", { }) - +--[[ +Villager spawning in mcl_villages mcl_mobs:spawn_specific( "mobs_mc:villager", "overworld", @@ -1406,6 +1433,6 @@ minetest.LIGHT_MAX+1, 4, mobs_mc.water_level+1, mcl_vars.mg_overworld_max) - +--]] -- spawn eggs mcl_mobs:register_egg("mobs_mc:villager", S("Villager"), "mobs_mc_spawn_icon_villager.png", 0) diff --git a/mods/ENTITIES/mobs_mc/villager_zombie.lua b/mods/ENTITIES/mobs_mc/villager_zombie.lua index 3dece8c29..cd0e89215 100644 --- a/mods/ENTITIES/mobs_mc/villager_zombie.lua +++ b/mods/ENTITIES/mobs_mc/villager_zombie.lua @@ -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, @@ -119,20 +120,7 @@ mcl_mobs:register_mob("mobs_mc:villager_zombie", { villager_obj:set_yaw(yaw) villager.target_yaw = yaw villager.nametag = self.nametag - local texture = self.base_texture[1]:gsub("zombie", "villager") - if texture == "mobs_mc_villager_villager.png" then - texture = "mobs_mc_villager.png" - end - local textures = {texture} - villager.base_texture = textures - villager_obj:set_properties({textures = textures}) - local matches = {} - for prof, tex in pairs(professions) do - if texture == tex then - table.insert(matches, prof) - end - end - villager._profession = matches[math.random(#matches)] + villager._profession = "unemployed" self._curing = nil mcl_burning.extinguish(obj) obj:remove() @@ -160,7 +148,6 @@ mcl_mobs:spawn_specific( "RoofedForest_underground", "Jungle_underground", "Swampland_underground", -"MushroomIsland_underground", "BirchForest_underground", "Plains_underground", "MesaPlateauF_underground", @@ -197,7 +184,6 @@ mcl_mobs:spawn_specific( "Plains", "Desert", "ColdTaiga", -"MushroomIsland", "IcePlainsSpikes", "SunflowerPlains", "IcePlains", @@ -224,7 +210,6 @@ mcl_mobs:spawn_specific( "ExtremeHills_beach", "ColdTaiga_beach", "Swampland_shore", -"MushroomIslandShore", "JungleM_shore", "Jungle_shore", "MesaPlateauFM_sandlevel", diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index f2232c397..a1606836d 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -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", @@ -232,29 +233,22 @@ dog.on_rightclick = function(self, clicker) end mcl_mobs:register_mob("mobs_mc:dog", dog) - -- Spawn mcl_mobs:spawn_specific( "mobs_mc:wolf", "overworld", "ground", { -"FlowerForest", -"Swampland", -"Taiga", -"ExtremeHills", -"BirchForest", -"MegaSpruceTaiga", -"MegaTaiga", -"ExtremeHills+", -"Forest", -"Plains", -"ColdTaiga", -"SunflowerPlains", -"RoofedForest", -"MesaPlateauFM_grasstop", -"ExtremeHillsM", -"BirchForestM", + "Taiga", + "MegaSpruceTaiga", + "MegaTaiga", + "Forest", + "ColdTaiga", + "FlowerForest_beach", + "Forest_beach", + "ColdTaiga_beach_water", + "Taiga_beach", + "ColdTaiga_beach", }, 0, minetest.LIGHT_MAX+1, diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 640b2ed11..c27d9b8f4 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -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", diff --git a/mods/ENTITIES/mobs_mc/zombiepig.lua b/mods/ENTITIES/mobs_mc/zombiepig.lua index 3d0b4f183..33838a9b5 100644 --- a/mods/ENTITIES/mobs_mc/zombiepig.lua +++ b/mods/ENTITIES/mobs_mc/zombiepig.lua @@ -118,7 +118,8 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"Nether", +"CrimsonForest", }, 0, minetest.LIGHT_MAX+1, @@ -133,7 +134,8 @@ mcl_mobs:spawn_specific( "nether", "ground", { -"Nether" +"Nether", +"CrimsonForest", }, 0, minetest.LIGHT_MAX+1, diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index 3579316e8..14d8f5176 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -238,8 +238,8 @@ after(5, function(dtime) end) minetest.register_chatcommand("lightning", { - params = "[ ]", - description = S("Let lightning strike at the specified position or yourself"), + params = "[ | ]", + description = S("Let lightning strike at the specified position or player. No parameter will strike yourself."), privs = { maphack = true }, func = function(name, param) local pos = {} @@ -247,21 +247,21 @@ minetest.register_chatcommand("lightning", { pos.x = tonumber(pos.x) pos.y = tonumber(pos.y) pos.z = tonumber(pos.z) + local player_to_strike if not (pos.x and pos.y and pos.z) then pos = nil + player_to_strike = minetest.get_player_by_name(param) + if not player_to_strike and param == "" then + player_to_strike = minetest.get_player_by_name(name) + end end - if name == "" and pos == nil then + if not player_to_strike and pos == nil then return false, "No position specified and unknown player" end if pos then lightning.strike(pos) - else - local player = minetest.get_player_by_name(name) - if player then - lightning.strike(player:get_pos()) - else - return false, S("No position specified and unknown player") - end + elseif player_to_strike then + lightning.strike(player_to_strike:get_pos()) end return true end, diff --git a/mods/ENVIRONMENT/lightning/locale/template.txt b/mods/ENVIRONMENT/lightning/locale/template.txt index 2c07393f6..2e7e5878a 100644 --- a/mods/ENVIRONMENT/lightning/locale/template.txt +++ b/mods/ENVIRONMENT/lightning/locale/template.txt @@ -1,4 +1,3 @@ # textdomain: lightning -@1 was struck by lightning.= -Let lightning strike at the specified position or yourself= +Let lightning strike at the specified position or player. No parameter will strike yourself.= No position specified and unknown player= diff --git a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua index a90c8e96e..023c8b20d 100644 --- a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua +++ b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua @@ -1,8 +1,10 @@ mcl_weather.nether_dust = {} mcl_weather.nether_dust.particlespawners = {} +local PARTICLES_COUNT_NETHER_DUST = tonumber(minetest.settings:get("mcl_weather_dust_particles")) or 150 + local psdef= { - amount = 150, + amount = PARTICLES_COUNT_NETHER_DUST, time = 0, minpos = vector.new(-15,-15,-15), maxpos =vector.new(15,15,15), diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index f0be39f6c..717f2fd52 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -1,5 +1,5 @@ -local PARTICLES_COUNT_RAIN = 800 -local PARTICLES_COUNT_THUNDER = 1200 +local PARTICLES_COUNT_RAIN = tonumber(minetest.settings:get("mcl_weather_rain_particles")) or 500 +local PARTICLES_COUNT_THUNDER = tonumber(minetest.settings:get("mcl_weather_thunder_particles")) or 900 local get_connected_players = minetest.get_connected_players @@ -20,22 +20,20 @@ mcl_weather.rain = { init_done = false, } local update_sound={} -local vel=math.random(0,3) -local falling_speed=math.random(10,15) -local size = math.random(1,3) + local psdef= { amount = mcl_weather.rain.particles_count, time=0, minpos = vector.new(-15,20,-15), maxpos = vector.new(15,25,15), - minvel = vector.new(-2,-falling_speed-2,-2), - maxvel = vector.new(2,-falling_speed+2,2), + minvel = vector.new(-2,-17,-2), + maxvel = vector.new(2,-8,2), minacc = vector.new(0,0,0), maxacc = vector.new(0,-0.5,0), - minexptime = 15, - maxexptime = 30, - minsize = size, - maxsize= size*2, + minexptime = 1, + maxexptime = 4, + minsize = 4, + maxsize= 8, collisiondetection = true, collision_removal = true, vertical = true, @@ -70,9 +68,10 @@ end -- no no no NO NO f*.. no. no manual particle creatin' PLS!! this sends EVERY particle over the net. function mcl_weather.rain.add_rain_particles(player) mcl_weather.rain.last_rp_count = mcl_weather.rain.particles_count + local l = false for k,v in pairs(textures) do psdef.texture=v - mcl_weather.add_spawner_player(player,"rain"..k,psdef) + l = l or mcl_weather.add_spawner_player(player,"rain"..k,psdef) end if l then update_sound[player:get_player_name()]=true diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index 7b6183d44..54751007b 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -146,8 +146,25 @@ mcl_weather.skycolor = { player:set_stars({visible = false}) mcl_weather.skycolor.override_day_night_ratio(player, 0.5) elseif dim == "nether" then - player:set_sky({ type = "plain", - base_color = "#300808", + local nether_sky = { + Nether = "#300808", + BasaltDelta = "#685F70", + SoulsandValley = "#1B4745", + CrimsonForest = "#330303", + WarpedForest = "#1A051A" + } + local biometint = nether_sky[minetest.get_biome_name(minetest.get_biome_data(player:get_pos()).biome)] + + player:set_sky({ + type = "regular", + sky_color = { + day_sky = "#300808", + day_horizon = biometint, + dawn_sky = "#300808", + dawn_horizon = biometint, + night_sky = "#300808", + night_horizon = biometint, + }, clouds = false, }) player:set_sun({visible = false , sunrise_visible = false}) diff --git a/mods/ENVIRONMENT/mcl_weather/snow.lua b/mods/ENVIRONMENT/mcl_weather/snow.lua index a55428996..fc9526d63 100644 --- a/mods/ENVIRONMENT/mcl_weather/snow.lua +++ b/mods/ENVIRONMENT/mcl_weather/snow.lua @@ -2,11 +2,11 @@ local get_connected_players = minetest.get_connected_players mcl_weather.snow = {} -mcl_weather.snow.particles_count = 15 +local PARTICLES_COUNT_SNOW = tonumber(minetest.settings:get("mcl_weather_snow_particles")) or 100 mcl_weather.snow.init_done = false local psdef= { - amount = 99, + amount = PARTICLES_COUNT_SNOW, time = 0, --stay on til we turn it off minpos = vector.new(-25,20,-25), maxpos =vector.new(25,25,25), @@ -14,9 +14,9 @@ local psdef= { maxvel = vector.new(0.2,-4,0.2), minacc = vector.new(0,-1,0), maxacc = vector.new(0,-4,0), - minexptime = 15, - maxexptime = 30, - minsize = 0.5, + minexptime = 3, + maxexptime = 5, + minsize = 2, maxsize = 5, collisiondetection = true, collision_removal = true, diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index c963773d1..55e64b9b7 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -101,6 +101,17 @@ awards.register_achievement("mcl:bookcase", { } }) +awards.register_achievement("mcl:buildIronPickaxe", { + title = S("Isn't It Iron Pick"), + description = S("Craft a iron pickaxe using sticks and iron."), + icon = "default_tool_steelpick.png", + trigger = { + type = "craft", + item = "mcl_tools:pick_iron", + target = 1 + } +}) + -- Item pickup achievements: These are awarded when picking up a certain item. -- The achivements are manually given in the mod mcl_item_entity. awards.register_achievement("mcl:diamonds", { @@ -125,6 +136,18 @@ awards.register_achievement("mcl:mineWood", { icon = "default_tree.png", }) +awards.register_achievement("mcl:whosCuttingOnions", { + title = S("Who is Cutting Onions?"), + description = S("Pick up a crying obsidian from the floor."), + icon = "default_obsidian.png^mcl_core_crying_obsidian.png", +}) + +awards.register_achievement("mcl:hiddenInTheDepths", { + title = S("Hidden in the Depths"), + description = S("Pick up an Ancient Debris from the floor."), + icon = "mcl_nether_ancient_debris_side.png", +}) + -- Smelting achivements: These are awarded when picking up an item from a furnace -- output. They are given in mcl_furnaces. awards.register_achievement("mcl:acquireIron", { @@ -158,9 +181,89 @@ awards.register_achievement("mcl:snipeSkeleton", { -- Triggered in mcl_portals awards.register_achievement("mcl:buildNetherPortal", { - title = S("Into the Nether"), + title = S("We Need to Go Deeper"), description = S("Use obsidian and a fire starter to construct a Nether portal."), - icon = "default_obsidian.png", + icon = "mcl_fire_flint_and_steel.png", +}) + +awards.register_achievement("mcl:enterEndPortal", { + title = S("The End?"), + description = S("Or the beginning?\nHint: Enter an end portal."), + icon = "mcl_end_end_stone.png", +}) + +awards.register_achievement("mcl:theNether", { + title = S("The Nether"), + description = S("Bring summer clothes.\nHint: Enter the Nether."), + icon = "mcl_nether_netherrack.png", +}) + +-- Triggered in mcl_totems +awards.register_achievement("mcl:postMortal", { + title = S("Postmortal"), + description = S("Use a Totem of Undying to cheat death."), + icon = "mcl_totems_totem.png", +}) + +-- Triggered in mcl_beds +awards.register_achievement("mcl:sweetDreams", { + title = S("Sweet Dreams"), + description = S("Sleep in a bed to change your respawn point."), + icon = "mcl_beds_bed_red.png", +}) + +awards.register_achievement("mcl:notQuiteNineLives", { + title = S('Not Quite "Nine" Lives'), + description = S("Charge a Respawn Anchor to the maximum."), + icon = "respawn_anchor_side4.png", +}) + +-- Triggered in mobs_mc +awards.register_achievement("mcl:whatAdeal", { + title = S("What A Deal!"), + description = S("Successfully trade with a Villager."), + icon = "mcl_core_emerald.png", +}) + +awards.register_achievement("mcl:tacticalFishing", { + title = S("Tactical Fishing"), + description = S("Catch a fish... without a fishing rod!"), + icon = "pufferfish_bucket.png", +}) + +-- Triggered in mcl_fishing +awards.register_achievement("mcl:fishyBusiness", { + title = S("Fishy Business"), + description = S("Catch a fish.\nHint: Catch a fish, salmon, clownfish, or pufferfish."), + icon = "mcl_fishing_fishing_rod.png", +}) + +-- Triggered in mcl_compass +awards.register_achievement("mcl:countryLode", { + title = S("Country Lode,\nTake Me Home"), + description = S("Use a compass on a Lodestone."), + icon = "lodestone_side4.png", +}) + +-- Triggered in mcl_smithing_table +awards.register_achievement("mcl:seriousDedication", { + title = S("Serious Dedication"), + description = S("Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices."), + icon = "farming_tool_netheritehoe.png", +}) + +-- Triggered in mcl_brewing +awards.register_achievement("mcl:localBrewery", { + title = S("Local Brewery"), + description = S("Brew a Potion.\nHint: Take a potion or glass bottle out of the brewing stand."), + icon = "mcl_potions_potion_overlay.png^[colorize:#F82423:"..tostring(127).."^mcl_potions_potion_bottle.png", +}) + +-- Triggered in mcl_enchanting +awards.register_achievement("mcl:enchanter", { + title = S("Enchanter"), + description = S("Enchant an item using an Enchantment Table."), + icon = "mcl_enchanting_book_enchanted.png", }) -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) diff --git a/mods/HUD/mcl_achievements/locale/template.txt b/mods/HUD/mcl_achievements/locale/template.txt index ecdba2672..cb97e5d00 100644 --- a/mods/HUD/mcl_achievements/locale/template.txt +++ b/mods/HUD/mcl_achievements/locale/template.txt @@ -19,7 +19,7 @@ Getting an Upgrade= Hit a skeleton, wither skeleton or stray by bow and arrow from a distance of at least 20 meters.= Hot Topic= Into Fire= -Into the Nether= +We Need to Go Deeper= Iron Belly= Librarian= Mine emerald ore.= @@ -47,3 +47,29 @@ Use a crafting table to craft a wooden hoe from wooden planks and sticks.= Use a crafting table to craft a wooden pickaxe from wooden planks and sticks.= Use obsidian and a fire starter to construct a Nether portal.= Use wheat to craft a bread.= +Who is Cutting Onions?= +Pick up a crying obsidian from the floor.= +Hidden in the Depths= +Pick up an Ancient Debris from the floor.= +The Nether= +Bring summer clothes.@nHint: Enter the Nether.= +Isn't It Iron Pick= +Craft a iron pickaxe using sticks and iron.= +Postmortal= +Use a Totem of Undying to cheat death.= +Sweet Dreams= +Sleep in a bed to change your respawn point.= +Not Quite "Nine" Lives= +Charge a Respawn Anchor to the maximum.= +What A Deal!= +Successfully trade with a Villager.= +Fishy Business= +Catch a fish.@nHint: Catch a fish, salmon, clownfish, or pufferfish.= +Country Lode,@nTake Me Home= +Use a compass on a Lodestone.= +Serious Dedication= +Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices.= +Local Brewery= +Brew a Potion.@nHint: Take a potion or glass bottle out of the brewing stand.= +Enchanter= +Enchant an item using an Enchantment Table.= diff --git a/mods/HUD/mcl_info/API.md b/mods/HUD/mcl_info/API.md new file mode 100644 index 000000000..18c901162 --- /dev/null +++ b/mods/HUD/mcl_info/API.md @@ -0,0 +1,18 @@ +## mcl_info +An api to make custom entries in the mcl2 debug hud. + +### mcl_info.register_debug_field(name,defintion) +Debug field defintion example: +{ + level = 3, + --show with debug level 3 and upwards + + func = function(player,pos) return minetest.pos_to_string(pos) end, + -- Function that is run for at each debug + -- sample (default: every .63 seconds) + -- It should output a string and determines + -- the content of the debug field. +} + +### mcl_info.registered_debug_fields +Table the debug definitions are stored in. Do not modify this directly. If you need to overwrite a field just set it again with mcl_info.register_debug_field(). diff --git a/mods/HUD/mcl_info/init.lua b/mods/HUD/mcl_info/init.lua new file mode 100644 index 000000000..5331a9bd6 --- /dev/null +++ b/mods/HUD/mcl_info/init.lua @@ -0,0 +1,161 @@ +mcl_info = {} +local refresh_interval = .63 +local huds = {} +local default_debug = 0 +local after = minetest.after +local get_connected_players = minetest.get_connected_players +local get_biome_name = minetest.get_biome_name +local get_biome_data = minetest.get_biome_data +local format = string.format + +local min1, min2, min3 = mcl_vars.mg_overworld_min, mcl_vars.mg_end_min, mcl_vars.mg_nether_min +local max1, max2, max3 = mcl_vars.mg_overworld_max, mcl_vars.mg_end_max, mcl_vars.mg_nether_max + 128 + +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) +local S = minetest.get_translator(modname) +local storage = minetest.get_mod_storage() +local player_dbg = {} + +local function check_setting(s) + return s +end + +--return player setting, set it to 2nd argument if supplied +local function player_setting(p,s) + local name = p:get_player_name() + if check_setting(s) then + p:get_meta():set_string("mcl_info_show",s) + player_dbg[name] = tonumber(s) + end + if not player_dbg[name] then + local r = p:get_meta():get_string("mcl_info_show") + if r == nil or r == "" then r = 0 end + player_dbg[name] = tonumber(r) + end + return player_dbg[name] +end + +mcl_info.registered_debug_fields = {} +local fields_keyset = {} +function mcl_info.register_debug_field(name,def) + table.insert(fields_keyset,name) + mcl_info.registered_debug_fields[name]=def +end + +local function nodeinfo(pos) + local n = minetest.get_node_or_nil(pos) + if not n then return "" end + local l = minetest.get_node_light(pos) + local ld = minetest.get_node_light(pos,0.5) + local r = n.name .. " p1:"..n.param1.." p2:"..n.param2 + if l and ld then + r = r .. " Light: "..l.."/"..ld + end + return r +end + +local function get_text(player, bits) + local pos = vector.offset(player:get_pos(),0,0.5,0) + local bits = bits + if bits == 0 then return "" end + + local r = "" + for _,key in ipairs(fields_keyset) do + local def = mcl_info.registered_debug_fields[key] + if def.level == nil or def.level <= bits then + r = r ..key..": "..tostring(def.func(player,pos)).."\n" + end + end + + return r +end + +local function info() + for _, player in pairs(get_connected_players()) do + local name = player:get_player_name() + local s = player_setting(player) + local pos = player:get_pos() + local text = get_text(player, s) + local hud = huds[name] + if s and not hud then + local def = { + hud_elem_type = "text", + alignment = {x = 1, y = -1}, + scale = {x = 100, y = 100}, + position = {x = 0.0073, y = 0.889}, + text = text, + style = 5, + ["number"] = 0xcccac0, + z_index = 0, + } + local def_bg = table.copy(def) + def_bg.offset = {x = 2, y = 1} + def_bg["number"] = 0 + def_bg.z_index = -1 + huds[name] = { + player:hud_add(def), + player:hud_add(def_bg), + text, + } + elseif text ~= hud[3] then + hud[3] = text + player:hud_change(huds[name][1], "text", text) + player:hud_change(huds[name][2], "text", text) + end + end + after(refresh_interval, info) +end +info() + +minetest.register_on_leaveplayer(function(p) + local name = p:get_player_name() + huds[name] = nil + player_dbg[name] = nil +end) + +minetest.register_chatcommand("debug",{ + description = S("Set debug bit mask: 0 = disable, 1 = biome name, 2 = coordinates, 3 = all"), + params = S(""), + privs = { debug = true }, + func = function(name, params) + local player = minetest.get_player_by_name(name) + if params == "" then return true, "Debug bitmask is "..player_setting(player) end + local dbg = math.floor(tonumber(params) or default_debug) + if dbg < 0 or dbg > 4 then + minetest.chat_send_player(name, S("Error! Possible values are integer numbers from @1 to @2", 0, 4)) + return false,"Current bitmask: "..player_setting(player) + end + return true, "Debug bit mask set to "..player_setting(player,dbg) + end +}) + +mcl_info.register_debug_field("Node feet",{ + level = 4, + func = function(pl,pos) + return nodeinfo(pos) + end +}) +mcl_info.register_debug_field("Node below",{ + level = 4, + func = function(pl,pos) + return nodeinfo(vector.offset(pos,0,-1,0)) + end +}) +mcl_info.register_debug_field("Biome",{ + level = 3, + func = function(pl,pos) + local biome_data = get_biome_data(pos) + local biome = biome_data and get_biome_name(biome_data.biome) or "No biome" + if biome_data then + return format("%s (%s), Humidity: %.1f, Temperature: %.1f",biome, biome_data.biome, biome_data.humidity, biome_data.heat) + end + return "No biome" + end +}) +mcl_info.register_debug_field("Coords",{ + level = 2, + func = function(pl,pos) + return format("x:%.1f y:%.1f z:%.1f", pos.x, pos.y, pos.z) + end +}) diff --git a/mods/HUD/mcl_info/locale/mcl_info.ru.tr b/mods/HUD/mcl_info/locale/mcl_info.ru.tr new file mode 100644 index 000000000..7f5b79fe1 --- /dev/null +++ b/mods/HUD/mcl_info/locale/mcl_info.ru.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_info +Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 3 @= all=Установка отладочной битовой маски: 0 @= отключить, 1 @= биом, 2 @= координаты, 3 @= всё +Error! Possible values are integer numbers from @1 to @2=Ошибка! Допустимые значения - целые числа от @1 до @2 +Debug bit mask set to @1=Отладочной битовой маске присвоено значение @1 diff --git a/mods/HUD/mcl_info/locale/template.txt b/mods/HUD/mcl_info/locale/template.txt new file mode 100644 index 000000000..1a0b70ebc --- /dev/null +++ b/mods/HUD/mcl_info/locale/template.txt @@ -0,0 +1,4 @@ +# textdomain: mcl_info +Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 3 @= all= +Error! Possible values are integer numbers from @1 to @2= +Debug bit mask set to @1= diff --git a/mods/HUD/mcl_info/mod.conf b/mods/HUD/mcl_info/mod.conf new file mode 100644 index 000000000..41fdfb0b5 --- /dev/null +++ b/mods/HUD/mcl_info/mod.conf @@ -0,0 +1,3 @@ +name = mcl_info +description = Prints biome name and player position +depends = mcl_init diff --git a/mods/HUD/mcl_offhand/init.lua b/mods/HUD/mcl_offhand/init.lua index b0fc223ec..5f48eede9 100644 --- a/mods/HUD/mcl_offhand/init.lua +++ b/mods/HUD/mcl_offhand/init.lua @@ -59,8 +59,9 @@ minetest.register_globalstep(function(dtime) local itemstack = mcl_offhand.get_offhand(player) local offhand_item = itemstack:get_name() local offhand_hud = mcl_offhand[player].hud - if offhand_item ~= "" then - local item_texture = minetest.registered_items[offhand_item].inventory_image .. "^[resize:" .. max_offhand_px .. "x" .. max_offhand_px + local item = minetest.registered_items[offhand_item] + if offhand_item ~= "" and item then + local item_texture = item.inventory_image .. "^[resize:" .. max_offhand_px .. "x" .. max_offhand_px local position = {x = 0.5, y = 1} local offset = {x = -320, y = -32} diff --git a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua index 6e4616299..a27904e48 100644 --- a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua @@ -1,3 +1,4 @@ +local GRAVITY = tonumber(minetest.settings:get("movement_gravity")) local table = table --register stoppers for movestones/pistons @@ -328,17 +329,17 @@ function mesecon.mvps_move_objects(pos, dir, nodestack) -- Move object at tip of stack, pushpos is position at tip of stack local pushpos = vector.add(pos, vector.multiply(dir, #nodestack)) - local objects = minetest.get_objects_inside_radius(pushpos, 1) + local objects = minetest.get_objects_inside_radius(pushpos, 1.15) for _, obj in ipairs(objects) do table.insert(objects_to_move, obj) end -- Move objects lying/standing on the stack (before it was pushed - oldstack) - if tonumber(minetest.settings:get("movement_gravity")) > 0 and dir.y == 0 then + if GRAVITY > 0 then -- If gravity positive and dir horizontal, push players standing on the stack for _, n in ipairs(nodestack) do local p_above = vector.add(n.pos, {x=0, y=1, z=0}) - local objects = minetest.get_objects_inside_radius(p_above, 1) + local objects = minetest.get_objects_inside_radius(p_above, 1.15) for _, obj in ipairs(objects) do table.insert(objects_to_move, obj) end @@ -347,7 +348,10 @@ function mesecon.mvps_move_objects(pos, dir, nodestack) for _, obj in ipairs(objects_to_move) do local entity = obj:get_luaentity() - if not entity or not mesecon.is_mvps_unmov(entity.name) then + local player = obj:is_player() + + + if not entity or not player and not mesecon.is_mvps_unmov(entity.name) then local np = vector.add(obj:get_pos(), dir) --move only if destination is not solid @@ -355,6 +359,30 @@ function mesecon.mvps_move_objects(pos, dir, nodestack) if not ((not minetest.registered_nodes[nn.name]) or minetest.registered_nodes[nn.name].walkable) then obj:set_pos(np) + -- Launch Player, TNT & mobs like in Minecraft + -- Only doing so if slimeblock is attached. + for _, r in ipairs(mesecon.rules.alldirs) do + local adjpos = vector.add(np, r) + local adjnode = minetest.get_node(adjpos) + if minetest.registered_nodes[adjnode.name] and minetest.registered_nodes[adjnode.name].mvps_sticky then + local np = vector.add(obj:get_pos(), dir) + + -- Reset acceleration of all objects before launching. + -- Fixes eggs, & snowballs thrown by dispensers + obj:set_acceleration({x=dir.x, y=-GRAVITY, z=dir.z}) + + --Need to set velocities differently for players, items & mobs/tnt, and falling anvils. + if player then + obj:add_velocity({x = dir.x * 10, y = dir.y * 13, z = dir.z * 10}) + elseif entity.name == "__builtin:item" then + obj:add_velocity({x = dir.x * 9, y = dir.y * 11, z = dir.z * 9}) + elseif entity.name == "__builtin:falling_node" then + obj:add_velocity({x = dir.x * 43, y = dir.y * 72, z = dir.z * 43}) + else + obj:add_velocity({x = dir.x * 6, y = dir.y * 9, z = dir.z * 6}) + end + end + end end end end diff --git a/mods/ITEMS/mcl_amethyst/init.lua b/mods/ITEMS/mcl_amethyst/init.lua index 0ee78de41..e43223a41 100644 --- a/mods/ITEMS/mcl_amethyst/init.lua +++ b/mods/ITEMS/mcl_amethyst/init.lua @@ -117,7 +117,6 @@ for _, def in pairs(bud_def) do walkable = false, light_source = def.light_source, groups = { - dig_by_water = 1, destroy_by_lava_flow = 1, dig_by_piston = 1, pickaxey = 1, @@ -162,7 +161,6 @@ minetest.register_node("mcl_amethyst:amethyst_cluster",{ walkable = false, light_source = 7, groups = { - dig_by_water = 1, destroy_by_lava_flow = 1, dig_by_piston = 1, pickaxey = 1, diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index d3b32b844..a56299cd9 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -84,6 +84,19 @@ local function distinguish_tool_and_material(input1, input2) end end +-- Helper function to make sure update_anvil_slots NEVER overstacks the output slot +local function fix_stack_size(stack) + if not stack or stack == "" then return "" end + local count = stack:get_count() + local max_count = stack:get_stack_max() + + if count > max_count then + stack:set_count(max_count) + count = max_count + end + return count +end + -- Update the inventory slots of an anvil node. -- meta: Metadata of anvil node local function update_anvil_slots(meta) @@ -213,6 +226,7 @@ local function update_anvil_slots(meta) -- Set the new output slot if new_output then + fix_stack_size(new_output) inv:set_stack("output", 1, new_output) end end diff --git a/mods/ITEMS/mcl_armor/api.lua b/mods/ITEMS/mcl_armor/api.lua index 6ec1b377b..1b9aa4f73 100644 --- a/mods/ITEMS/mcl_armor/api.lua +++ b/mods/ITEMS/mcl_armor/api.lua @@ -114,6 +114,10 @@ function mcl_armor.register_set(def) for k, v in pairs(element_groups) do groups[k] = v end + local upgrade_item = nil + if def._mcl_upgradable and def._mcl_upgrade_item_material then + upgrade_item = itemstring:gsub("_[%l%d]*$",def._mcl_upgrade_item_material) + end minetest.register_tool(itemstring, { description = S(def.description .. " " .. (descriptions[name] or element.description)), @@ -133,6 +137,8 @@ function mcl_armor.register_set(def) _on_break = on_break_callbacks[name] or def.on_break, _mcl_armor_element = name, _mcl_armor_texture = textures[name] or modname .. "_" .. itemname .. ".png", + _mcl_upgradable = def._mcl_upgradable, + _mcl_upgrade_item = upgrade_item }) if def.craft_material then diff --git a/mods/ITEMS/mcl_armor/register.lua b/mods/ITEMS/mcl_armor/register.lua index 1f9ce7b02..0f8ef6315 100644 --- a/mods/ITEMS/mcl_armor/register.lua +++ b/mods/ITEMS/mcl_armor/register.lua @@ -49,6 +49,8 @@ mcl_armor.register_set({ }, repair_material = "mcl_core:iron_ingot", cook_material = "mcl_core:iron_nugget", + sound_equip = "mcl_armor_equip_iron", + sound_unequip = "mcl_armor_unequip_iron", }) mcl_armor.register_set({ @@ -64,6 +66,8 @@ mcl_armor.register_set({ }, craft_material = "mcl_core:iron_ingot", cook_material = "mcl_core:iron_nugget", + sound_equip = "mcl_armor_equip_iron", + sound_unequip = "mcl_armor_unequip_iron", }) mcl_armor.register_set({ @@ -79,6 +83,27 @@ mcl_armor.register_set({ }, toughness = 2, craft_material = "mcl_core:diamond", + sound_equip = "mcl_armor_equip_diamond", + sound_unequip = "mcl_armor_unequip_diamond", + _mcl_upgradable = true, + _mcl_upgrade_item_material = "_netherite", +}) + +mcl_armor.register_set({ + name = "netherite", + description = "Netherite", + durability = 555, + enchantability = 10, + points = { + head = 3, + torso = 8, + legs = 6, + feet = 3, + }, + toughness = 2, + craft_material = "mcl_nether:netherite_ingot", + sound_equip = "mcl_armor_equip_diamond", + sound_unequip = "mcl_armor_unequip_diamond", }) mcl_armor.register_protection_enchantment({ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_netherite.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_netherite.png new file mode 100644 index 000000000..39f84afb1 Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_netherite.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_netherite.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_netherite.png new file mode 100644 index 000000000..8e3a38366 Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_netherite.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_netherite.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_netherite.png new file mode 100644 index 000000000..c35f11247 Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_netherite.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_boots_netherite.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_boots_netherite.png new file mode 100644 index 000000000..a73c1b2fd Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_boots_netherite.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_chestplate_netherite.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_chestplate_netherite.png new file mode 100644 index 000000000..32fabb10f Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_chestplate_netherite.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_helmet_netherite.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_helmet_netherite.png new file mode 100644 index 000000000..b906e2098 Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_helmet_netherite.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_leggings_netherite.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_leggings_netherite.png new file mode 100644 index 000000000..3ac1b844a Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_leggings_netherite.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_netherite.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_netherite.png new file mode 100644 index 000000000..7411e0a70 Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_netherite.png differ diff --git a/mods/ITEMS/mcl_beacons/init.lua b/mods/ITEMS/mcl_beacons/init.lua new file mode 100644 index 000000000..cebcd66f2 --- /dev/null +++ b/mods/ITEMS/mcl_beacons/init.lua @@ -0,0 +1,215 @@ +--[[ +there are strings in meta, which are being used to see which effect will be given to the player(s) +Valid strings: + swiftness + leaping + strenght + regeneration +]]-- +--TODO: add beacon beam +--TODO: beacons should only work when there are no blocks (few exceptions) above them! +--TODO: add translation + + +local formspec_string= + "size[11,14]".. + + "label[4.5,0.5;Beacon:]".. + "label[0.5,1;Primary Power:]".. + "label[0.5,8.25;Inventory:]".. + + "image[1,1.5;1,1;custom_beacom_symbol_4.png]".. + "image[1,3;1,1;custom_beacom_symbol_3.png]".. + "image[1,4.5;1,1;custom_beacom_symbol_2.png]".. + "image[1,6;1,1;custom_beacom_symbol_1.png]".. + + "image_button[5.2,1.5;1,1;mcl_potions_effect_swift.png;swiftness;]".. + "image_button[5.2,3;1,1;mcl_potions_effect_leaping.png;leaping;]".. + "image_button[5.2,4.5;1,1;mcl_potions_effect_strong.png;strenght;]".. + "image_button[5.2,6;1,1;mcl_potions_effect_regenerating.png;regeneration;]".. + + "item_image[1,7;1,1;mcl_core:diamond]".. + "item_image[2.2,7;1,1;mcl_core:emerald]".. + "item_image[3.4,7;1,1;mcl_core:iron_ingot]".. + "item_image[4.6,7;1,1;mcl_core:gold_ingot]".. + + mcl_formspec.get_itemslot_bg(6,7,1,1).. + "list[context;input;6,7;1,1;]".. + mcl_formspec.get_itemslot_bg(1,9,9,3).. + "list[current_player;main;1,9;9,3;9]".. + mcl_formspec.get_itemslot_bg(1,12.5,9,1).. + "list[current_player;main;1,12.5;9,1;]" + + + +local function beacon_blockcheck(pos) + for y_offset = 1,4 do + local block_y = pos.y - y_offset + for block_x = (pos.x-y_offset),(pos.x+y_offset) do + for block_z = (pos.z-y_offset),(pos.z+y_offset) do + local valid_block = false --boolean to which stores if block is valid or not + for _, beacon_block in pairs(beacon_blocklist) do + if beacon_block == minetest.get_node({x=block_x,y=block_y,z=block_z}).name and not valid_block then --is the block in the pyramid a valid beacon block + valid_block =true + end + end + if not valid_block then + return y_offset -1 --the last layer is complete, this one is missing or incomplete + end + end + end + if y_offset == 4 then --all checks are done, beacon is maxed + return y_offset + end + end +end + + + +minetest.register_node("mcl_beacons:beacon", { + --glasslike drawtype? + description = "Beacon", + tiles = { + "beacon_top.png", + "beacon_bottom.png", + "beacon_side_1.png", + "beacon_side_2.png", + "beacon_side_3.png", + "beacon_side_4.png" + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("input", 1) + local form = formspec_string + meta:set_string("formspec", form) + end, + on_receive_fields = function(pos, formname, fields, sender) + if fields.swiftness or fields.regeneration or fields.leaping or fields.strenght then + local sender_name = sender:get_player_name() + local power_level = beacon_blockcheck(pos) + if minetest.is_protected(pos, sender_name) then + minetest.record_protection_violation(pos, sender_name) + return + elseif power_level == 0 then + return + end + + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local input = inv:get_stack("input",1) + + if input:is_empty() then + return + end + + local valid_item = false + + for _, item in ipairs(beacon_fuellist) do + if input:get_name() == item then + valid_item = true + end + end + + if valid_item ~= true then + return + end + + local successful = false + if fields.swiftness then + if power_level == 4 then + minetest.get_meta(pos):set_int("effect_level",2) + else + minetest.get_meta(pos):set_int("effect_level",1) + end + minetest.get_meta(pos):set_string("effect","swiftness") + successful = true + elseif fields.leaping and power_level >= 2 then + if power_level == 4 then + minetest.get_meta(pos):set_int("effect_level",2) + else + minetest.get_meta(pos):set_int("effect_level",1) + end + minetest.get_meta(pos):set_string("effect","leaping") + successful = true + elseif fields.strenght and power_level >= 3 then + if power_level == 4 then + minetest.get_meta(pos):set_int("effect_level",2) + else + minetest.get_meta(pos):set_int("effect_level",1) + end + minetest.get_meta(pos):set_string("effect","strenght") + successful = true + elseif fields.regeneration and power_level == 4 then + minetest.get_meta(pos):set_int("effect_level",2) + minetest.get_meta(pos):set_string("effect","regeneration") + successful = true + end + if successful then + input:take_item() + inv:set_stack("input",1,input) + end + end + end, + light_source = 15, + sounds = mcl_sounds.node_sound_glass_defaults(), +}) + +mesecon.register_mvps_stopper("mcl_beacons:beacon") +mcl_wip.register_wip_item("mcl_beacons:beacon") + +beacon_blocklist = {"mcl_core:diamondblock","mcl_core:ironblock","mcl_core:goldblock","mcl_core:emeraldblock"}--this is supposed to be a global, don't change that! || TODO: add netherite blocks once implemented! +beacon_fuellist ={"mcl_core:diamond","mcl_core:emerald","mcl_core:iron_ingot","mcl_core:gold_ingot"} + +function register_beaconblock (itemstring)--API function for other mods + table.insert(beacon_blocklist, itemstring) +end + +function register_beaconfuel(itemstring) + table.insert(beacon_fuellist, itemstring) +end + +local function effect_player(effect,pos,power_level, effect_level) + local all_objects = minetest.get_objects_inside_radius(pos, (power_level+1)*10) + for _,obj2 in ipairs(all_objects) do + if obj2:is_player() then + if effect == "swiftness" then + mcl_potions.swiftness_func(obj2,effect_level,16) + return + elseif effect == "leaping" then + mcl_potions.leaping_func(obj2, effect_level, 16) + return + elseif effect == "strenght" then + mcl_potions.strength_func(obj2, effect_level, 16) + return + elseif effect == "regeneration" then + mcl_potions.regeneration_func(obj2, effect_level, 16) + return + end + end + end + + +end + + +local function abm_function(pos) + local power_level = beacon_blockcheck(pos) + local meta = minetest.get_meta(pos) + local effect_string = meta:get_string("effect") + if meta:get_int("effect_level") == 2 and power_level < 4 then + return + else + effect_player(effect_string,pos,power_level,meta:get_int("effect_level")) + end + +end + + +minetest.register_abm{ + label = "beacon check & apply effect(s)", + nodenames = {"mcl_beacons:beacon"}, + interval = 5, + chance = 1, + action = abm_function, +} \ No newline at end of file diff --git a/mods/ITEMS/mcl_beacons/mod.conf b/mods/ITEMS/mcl_beacons/mod.conf new file mode 100644 index 000000000..98bd645ee --- /dev/null +++ b/mods/ITEMS/mcl_beacons/mod.conf @@ -0,0 +1,2 @@ +author=chmodsayshello +depends=mcl_formspec, mcl_init, mcl_wip, mesecons_mvps, mcl_core, mcl_sounds diff --git a/mods/ITEMS/mcl_beacons/textures/beacon_bottom.png b/mods/ITEMS/mcl_beacons/textures/beacon_bottom.png new file mode 100644 index 000000000..af02df21f Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/beacon_bottom.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/beacon_side_1.png b/mods/ITEMS/mcl_beacons/textures/beacon_side_1.png new file mode 100644 index 000000000..dfd93ef98 Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/beacon_side_1.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/beacon_side_2.png b/mods/ITEMS/mcl_beacons/textures/beacon_side_2.png new file mode 100644 index 000000000..8a348a97c Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/beacon_side_2.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/beacon_side_3.png b/mods/ITEMS/mcl_beacons/textures/beacon_side_3.png new file mode 100644 index 000000000..22d4cad5c Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/beacon_side_3.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/beacon_side_4.png b/mods/ITEMS/mcl_beacons/textures/beacon_side_4.png new file mode 100644 index 000000000..d8523a2ac Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/beacon_side_4.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/beacon_top.png b/mods/ITEMS/mcl_beacons/textures/beacon_top.png new file mode 100644 index 000000000..ec4e5151b Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/beacon_top.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_1.png b/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_1.png new file mode 100644 index 000000000..112cfcdb0 Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_1.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_2.png b/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_2.png new file mode 100644 index 000000000..efbec3776 Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_2.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_3.png b/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_3.png new file mode 100644 index 000000000..975013384 Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_3.png differ diff --git a/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_4.png b/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_4.png new file mode 100644 index 000000000..42c471c35 Binary files /dev/null and b/mods/ITEMS/mcl_beacons/textures/custom_beacom_symbol_4.png differ diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index c1e76c90a..e570bd8eb 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -76,6 +76,7 @@ local function lay_down(player, pos, bed_pos, state, skip) -- save respawn position when entering bed if spawn_mod and mcl_spawn.set_spawn_pos(player, bed_pos, nil) then minetest.chat_send_player(name, S("New respawn position set!")) + awards.unlock(player:get_player_name(), "mcl:sweetDreams") end -- No sleeping if too far away diff --git a/mods/ITEMS/mcl_beds/respawn_anchor.lua b/mods/ITEMS/mcl_beds/respawn_anchor.lua index 469a8ba4f..bb36fe9d0 100644 --- a/mods/ITEMS/mcl_beds/respawn_anchor.lua +++ b/mods/ITEMS/mcl_beds/respawn_anchor.lua @@ -39,6 +39,9 @@ for i=0,4 do elseif string.match(node.name, "mcl_beds:respawn_anchor_charged_") then minetest.chat_send_player(player.get_player_name(player), S"New respawn position set!") mcl_spawn.set_spawn_pos(player, pos, nil) + if i == 4 then + awards.unlock(player:get_player_name(), "mcl:notQuiteNineLives") + end end end @@ -88,11 +91,11 @@ for i=0,4 do end -minetest.register_craft({ --TODO: Please change this crafting recipe once crying obsidian is implemented! +minetest.register_craft({ output = "mcl_beds:respawn_anchor", recipe = { - {"mcl_core:obsidian", "mcl_core:obsidian", "mcl_core:obsidian"}, + {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"}, {"mcl_nether:glowstone", "mcl_nether:glowstone", "mcl_nether:glowstone"}, - {"mcl_core:obsidian", "mcl_core:obsidian", "mcl_core:obsidian"} + {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"} } }) diff --git a/mods/ITEMS/mcl_bells/init.lua b/mods/ITEMS/mcl_bells/init.lua index b216c6659..f1fce85e9 100644 --- a/mods/ITEMS/mcl_bells/init.lua +++ b/mods/ITEMS/mcl_bells/init.lua @@ -35,10 +35,14 @@ minetest.register_node("mcl_bells:bell", { is_ground_content = false, groups = {pickaxey=2, deco_block=1 }, sounds = mcl_sounds.node_sound_metal_defaults(), - _mcl_blast_resistance = 6, + _mcl_blast_resistance = 5, _mcl_hardness = 5, on_rightclick = mcl_bells.ring_once, use_texture_alpha = "clip", + mesecons = {effector = { + action_on = mcl_bells.ring_once, + rules = mesecon.rules.flat, + }}, }) if has_mcl_wip then diff --git a/mods/ITEMS/mcl_bells/mod.conf b/mods/ITEMS/mcl_bells/mod.conf index 18e74a7a8..e25b1fc5c 100644 --- a/mods/ITEMS/mcl_bells/mod.conf +++ b/mods/ITEMS/mcl_bells/mod.conf @@ -1,2 +1,3 @@ name = mcl_bells -optional_depends = mcl_wip +depends = mesecons +optional_depends = mcl_wip \ No newline at end of file diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index 4909edf2f..cfdd87837 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -13,8 +13,8 @@ minetest.register_node("mcl_blackstone:blackstone", { sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, groups = {cracky = 3, pickaxey=2, material_stone=1, cobble=1}, - _mcl_blast_resistance = 2, - _mcl_hardness = 2, + _mcl_blast_resistance = 6, + _mcl_hardness = 1.5, }) minetest.register_node("mcl_blackstone:blackstone_gilded", { description = S("Gilded Blackstone"), @@ -53,8 +53,8 @@ minetest.register_node("mcl_blackstone:nether_gold", { {items = {"mcl_blackstone:nether_gold"}, rarity = 8}, } }, - _mcl_blast_resistance = 2, - _mcl_hardness = 2, + _mcl_blast_resistance = 3, + _mcl_hardness = 3, _mcl_silk_touch_drop = true, _mcl_fortune_drop = mcl_core.fortune_drop_ore, }) @@ -67,8 +67,8 @@ minetest.register_node("mcl_blackstone:basalt_polished", { on_rotate = on_rotate, is_ground_content = false, groups = {cracky = 3, pickaxey=2, material_stone=1}, - _mcl_blast_resistance = 2, - _mcl_hardness = 2, + _mcl_blast_resistance = 4.2, + _mcl_hardness = 1.25, }) minetest.register_node("mcl_blackstone:basalt", { description = S("Basalt"), @@ -79,8 +79,17 @@ minetest.register_node("mcl_blackstone:basalt", { on_rotate = on_rotate, is_ground_content = false, groups = {cracky = 3, pickaxey=2, material_stone=1}, - _mcl_blast_resistance = 2, - _mcl_hardness = 2, + _mcl_blast_resistance = 4.2, + _mcl_hardness = 1.25, +}) +minetest.register_node("mcl_blackstone:basalt_smooth", { + description = S("Smooth Basalt"), + tiles = {"mcl_blackstone_basalt_smooth.png"}, + sounds = mcl_sounds.node_sound_stone_defaults(), + is_ground_content = false, + groups = {cracky = 3, pickaxey=2, material_stone=1}, + _mcl_blast_resistance = 4.2, + _mcl_hardness = 1.25, }) minetest.register_node("mcl_blackstone:blackstone_polished", { description = S("Polished Blackstone"), @@ -88,7 +97,7 @@ minetest.register_node("mcl_blackstone:blackstone_polished", { sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, groups = {cracky = 3, pickaxey=2, material_stone=1}, - _mcl_blast_resistance = 2, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) minetest.register_node("mcl_blackstone:blackstone_chiseled_polished", { @@ -97,8 +106,8 @@ minetest.register_node("mcl_blackstone:blackstone_chiseled_polished", { sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, groups = {cracky = 3, pickaxey=2, material_stone=1}, - _mcl_blast_resistance = 2, - _mcl_hardness = 2, + _mcl_blast_resistance = 6, + _mcl_hardness = 1.5, }) minetest.register_node("mcl_blackstone:blackstone_brick_polished", { description = S("Polished Blackstone Bricks"), @@ -106,8 +115,8 @@ minetest.register_node("mcl_blackstone:blackstone_brick_polished", { sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, groups = {cracky = 3, pickaxey=2, material_stone=1}, - _mcl_blast_resistance = 2, - _mcl_hardness = 2, + _mcl_blast_resistance = 6, + _mcl_hardness = 1.5, }) minetest.register_node("mcl_blackstone:quartz_brick", { description = S("Quartz Bricks"), @@ -116,8 +125,8 @@ minetest.register_node("mcl_blackstone:quartz_brick", { is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), groups = {cracky = 3, pickaxey=2, material_stone=1}, - _mcl_blast_resistance = 2, - _mcl_hardness = 2, + _mcl_blast_resistance = 0.8, + _mcl_hardness = 0.8, }) minetest.register_node("mcl_blackstone:soul_soil", { description = S("Soul Soil"), @@ -314,36 +323,7 @@ for s=1, #specialstones do end if minetest.settings:get_bool("mcl_generate_ores", true) then - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_blackstone:blackstone_gilded", - wherein = "mcl_blackstone:blackstone", - clust_scarcity = 4775, - clust_num_ores = 2, - clust_size = 2, - y_min = mcl_vars.mg_nether_min, - y_max = mcl_vars.mg_nether_max, - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_blackstone:nether_gold", - wherein = "mcl_nether:netherrack", - clust_scarcity = 830, - clust_num_ores = 5, - clust_size = 3, - y_min = mcl_vars.mg_nether_min, - y_max = mcl_vars.mg_nether_max, - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_blackstone:nether_gold", - wherein = "mcl_nether:netherrack", - clust_scarcity = 1660, - clust_num_ores = 4, - clust_size = 2, - y_min = mcl_vars.mg_nether_min, - y_max = mcl_vars.mg_nether_max, - }) + end --]] --soul torch diff --git a/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_1.mts b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_1.mts new file mode 100644 index 000000000..7ec39bacf Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_1.mts differ diff --git a/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_2.mts b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_2.mts new file mode 100644 index 000000000..bafc88993 Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_2.mts differ diff --git a/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_3.mts b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_3.mts new file mode 100644 index 000000000..39809dda9 Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_3.mts differ diff --git a/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_4.mts b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_4.mts new file mode 100644 index 000000000..2acfefe70 Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_4.mts differ diff --git a/mods/ITEMS/mcl_blast_furnace/init.lua b/mods/ITEMS/mcl_blast_furnace/init.lua index 168c28bd5..b8bbe001f 100644 --- a/mods/ITEMS/mcl_blast_furnace/init.lua +++ b/mods/ITEMS/mcl_blast_furnace/init.lua @@ -288,7 +288,8 @@ local function blast_furnace_node_timer(pos, elapsed) -- Cooking -- - local el = elapsed_game_time + -- Run the blast_furnace at twice the speed of a furnace. + local el = elapsed_game_time * 2 -- Check if we have cookable content: cookable local aftercooked @@ -329,13 +330,12 @@ local function blast_furnace_node_timer(pos, elapsed) elseif active then el = math.min(el, fuel_totaltime - fuel_time) -- The furnace is currently active and has enough fuel - fuel_time = (fuel_time + el) *2 --multiply speed of fuel consumption to match proper output + fuel_time = fuel_time + el end -- If there is a cookable item then check if it is ready yet if cookable and active then - -- In the src_time variable, the *2 is the multiplication that makes the blast furnace work faster than a normal furnace. - src_time = (src_time + el)*2 + src_time = src_time + el -- Place result in dst list if done if src_time >= cooked.time then inv:add_item("dst", cooked.item) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index 1816184bb..a03b875cb 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -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 @@ -188,7 +189,8 @@ function ARROW_ENTITY.on_step(self, dtime) -- The radius of 3 is fairly liberal, but anything lower than than will cause -- arrow to hilariously go through mobs often. -- TODO: Implement an ACTUAL collision detection (engine support needed). - local objs = minetest.get_objects_inside_radius(pos, 1.5) + + local closest_object local closest_distance @@ -196,32 +198,33 @@ function ARROW_ENTITY.on_step(self, dtime) self._deflection_cooloff = self._deflection_cooloff - dtime end - -- Iterate through all objects and remember the closest attackable object - for k, obj in pairs(objs) do - local ok = false - -- Arrows can only damage players and mobs - if obj:is_player() then - ok = true - elseif obj:get_luaentity() then - if (obj:get_luaentity().is_mob or obj:get_luaentity()._hittable_by_projectile) then + local arrow_dir = self.object:get_velocity() + --create a raycast from the arrow based on the velocity of the arrow to deal with lag + local raycast = minetest.raycast(pos, vector.add(pos, vector.multiply(arrow_dir, 0.1)), true, false) + for hitpoint in raycast do + 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() and enable_pvp then ok = true + 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 end - end - - if ok then - local dist = vector.distance(pos, obj:get_pos()) - if not closest_object or not closest_distance then - closest_object = obj - closest_distance = dist - elseif dist < closest_distance then - closest_object = obj - closest_distance = dist + if ok then + local dist = vector.distance(hitpoint.ref:get_pos(), pos) + if not closest_object or not closest_distance then + closest_object = hitpoint.ref + closest_distance = dist + elseif dist < closest_distance then + closest_object = hitpoint.ref + closest_distance = dist + end end end end - -- If an attackable object was found, we will damage the closest one only - if closest_object then local obj = closest_object local is_player = obj:is_player() @@ -249,7 +252,7 @@ function ARROW_ENTITY.on_step(self, dtime) -- Punch target object but avoid hurting enderman. if not lua or lua.name ~= "mobs_mc:enderman" then if not self._in_player then - damage_particles(self.object:get_pos(), self._is_critical) + damage_particles(vector.add(pos, vector.multiply(self.object:get_velocity(), 0.1)), self._is_critical) end if mcl_burning.is_burning(self.object) then mcl_burning.set_on_fire(obj, 5) @@ -304,6 +307,8 @@ function ARROW_ENTITY.on_step(self, dtime) minetest.after(150, function() self.object:remove() end) + else + self.object:remove() end end end diff --git a/mods/ITEMS/mcl_bows/crossbow.lua b/mods/ITEMS/mcl_bows/crossbow.lua index b211f6b39..9ee6d6e9c 100644 --- a/mods/ITEMS/mcl_bows/crossbow.lua +++ b/mods/ITEMS/mcl_bows/crossbow.lua @@ -151,7 +151,7 @@ S("The speed and damage of the arrow increases the longer you charge. The regula }) minetest.register_tool("mcl_bows:crossbow_loaded", { - description = S("Corssbow"), + description = S("Crossbow"), _tt_help = S("Launches arrows"), _doc_items_longdesc = S("Corssbow are ranged weapons to shoot arrows at your foes.").."\n".. S("The speed and damage of the arrow increases the longer you charge. The regular damage of the arrow is between 1 and 9. At full charge, there's also a 20% of a critical hit, dealing 10 damage instead."), @@ -181,7 +181,7 @@ S("The speed and damage of the arrow increases the longer you charge. The regula itemstack:get_meta():set_string("active", "true") return itemstack end, - groups = {weapon=1,weapon_ranged=1,crossbow=1,enchantability=1}, + groups = {weapon=1,weapon_ranged=1,crossbow=1,enchantability=1,not_in_creative_inventory=1}, _mcl_uses = 326, }) diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua index 9eb8ab8c4..d25c52647 100644 --- a/mods/ITEMS/mcl_bows/rocket.lua +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -19,15 +19,16 @@ local function dir_to_pitch(dir) end local function damage_explosion(self, damagemulitplier) - mcl_explosions.explode(self.object:get_pos(), 3, {}) - local objects = minetest.get_objects_inside_radius(self.object:get_pos(), 8) + local p = self.object:get_pos() + mcl_explosions.explode(p, 3, {}) + local objects = minetest.get_objects_inside_radius(p, 8) for _,obj in pairs(objects) do if obj:is_player() then - mcl_util.deal_damage(obj, damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos()), {type = "explosion"}) + mcl_util.deal_damage(obj, damagemulitplier - vector.distance(p, obj:get_pos()), {type = "explosion"}) elseif obj:get_luaentity().is_mob then obj:punch(self.object, 1.0, { full_punch_interval=1.0, - damage_groups={fleshy=damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos())}, + damage_groups={fleshy=damagemulitplier - vector.distance(p, obj:get_pos())}, }, self.object:get_velocity()) end end @@ -230,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"), @@ -409,29 +411,34 @@ function ARROW_ENTITY.on_step(self, dtime) end -- Iterate through all objects and remember the closest attackable object - for k, obj in pairs(objs) do - local ok = false - -- Arrows can only damage players and mobs - if obj:is_player() then - ok = true - elseif obj:get_luaentity() then - if (obj:get_luaentity().is_mob or obj:get_luaentity()._hittable_by_projectile) then + local arrow_dir = self.object:get_velocity() + --create a raycast from the arrow based on the velocity of the arrow to deal with lag + local raycast = minetest.raycast(pos, vector.add(pos, vector.multiply(arrow_dir, 0.1)), true, false) + for hitpoint in raycast do + 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() and enable_pvp then ok = true + 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 end - end - - if ok then - local dist = vector.distance(pos, obj:get_pos()) - if not closest_object or not closest_distance then - closest_object = obj - closest_distance = dist - elseif dist < closest_distance then - closest_object = obj - closest_distance = dist + if ok then + local dist = vector.distance(hitpoint.ref:get_pos(), pos) + if not closest_object or not closest_distance then + closest_object = hitpoint.ref + closest_distance = dist + elseif dist < closest_distance then + closest_object = hitpoint.ref + closest_distance = dist + end end end end + -- If an attackable object was found, we will damage the closest one only if closest_object then diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 2ff2a806f..9c6879430 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -369,6 +369,9 @@ local function allow_take(pos, listname, index, stack, player) minetest.record_protection_violation(pos, name) return 0 else + if listname == "stand" then + awards.unlock(name, "mcl:localBrewery") + end return stack:get_count() end end diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index 85215caaf..148df7711 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -29,15 +29,15 @@ local is_creative_enabled = minetest.is_creative_enabled local is_protected = minetest.is_protected local record_protection_violation = minetest.record_protection_violation -if mod_mcl_core then - minetest.register_craft({ - output = "mcl_buckets:bucket_empty 1", - recipe = { - {"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"}, - {"", "mcl_core:iron_ingot", ""}, - }, - }) -end + +minetest.register_craft({ + output = "mcl_buckets:bucket_empty 1", + recipe = { + {"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"}, + {"", "mcl_core:iron_ingot", ""}, + }, +}) + mcl_buckets = { liquids = {}, @@ -88,9 +88,7 @@ end local pointable_sources = {} local function bucket_raycast(user) - --local pos = user:get_pos() local pos = user:get_pos() - --local pos = vector.add(user:get_pos(), user:get_bone_position("Head_Control")) pos.y = pos.y + user:get_properties().eye_height local look_dir = user:get_look_dir() look_dir = vector.multiply(look_dir, 5) @@ -100,7 +98,6 @@ local function bucket_raycast(user) if ray then for pointed_thing in ray do if pointed_thing and pointable_sources[get_node(pointed_thing.above).name] then - --minetest.chat_send_all("found!") return {under=pointed_thing.under,above=pointed_thing.above} end end @@ -242,7 +239,6 @@ local function on_place_bucket_empty(itemstack, user, pointed_thing) if liquid_name then local liquid_def = mcl_buckets.liquids[liquid_name] if liquid_def then - --minetest.chat_send_all("test") -- Fill bucket, but not in Creative Mode -- FIXME: remove this line --if not is_creative_enabled(user:get_player_name()) then @@ -282,6 +278,12 @@ local function on_place_bucket_empty(itemstack, user, pointed_thing) new_bucket = ItemStack("mcl_buckets:bucket_river_water") end sound_take("mclx_core:river_water_source", pointed_thing.under) + elseif nn == "mcl_cauldrons:cauldron_3_lava" then + set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"}) + if not is_creative_enabled(user:get_player_name()) then + new_bucket = ItemStack("mcl_buckets:bucket_lava") + end + sound_take("mcl_core:lava_source", pointed_thing.under) end if new_bucket then return give_bucket(new_bucket, itemstack, user) @@ -366,7 +368,6 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", { _doc_items_longdesc = S("A bucket can be used to collect and release liquids."), _doc_items_usagehelp = S("Punch a liquid source to collect it. You can then use the filled bucket to place the liquid somewhere else."), _tt_help = S("Collects liquids"), - --liquids_pointable = true, inventory_image = "bucket.png", stack_max = 16, _on_dispense = function(stack, pos, droppos, dropnode, dropdir) diff --git a/mods/ITEMS/mcl_buckets/register.lua b/mods/ITEMS/mcl_buckets/register.lua index 1a7c8fe14..365966724 100644 --- a/mods/ITEMS/mcl_buckets/register.lua +++ b/mods/ITEMS/mcl_buckets/register.lua @@ -10,13 +10,6 @@ local function sound_place(itemname, pos) end end ---[[local sound_take = function(itemname, pos) - local def = minetest.registered_nodes[itemname] - if def and def.sounds and def.sounds.dug then - minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true) - end -end]] - if mod_mcl_core then -- Lava bucket mcl_buckets.register_liquid({ @@ -29,11 +22,21 @@ if mod_mcl_core then end end, source_take = {"mcl_core:lava_source", "mcl_nether:nether_lava_source"}, - on_take = function(user) - if has_awards and user and user:is_player() then - awards.unlock(user:get_player_name(), "mcl:hotStuff") - end - end, + on_take = function(user) + if has_awards and user and user:is_player() then + awards.unlock(user:get_player_name(), "mcl:hotStuff") + end + end, + extra_check = function(pos, placer) + local nn = minetest.get_node(pos).name + if minetest.get_item_group(nn, "cauldron") ~= 0 then + if nn ~= "mcl_cauldrons:cauldron_3_lava" then + minetest.set_node(pos, {name="mcl_cauldrons:cauldron_3_lava"}) + end + sound_place("mcl_core:lava_source", pos) + return false, true + end + end, bucketname = "mcl_buckets:bucket_lava", inventory_image = "bucket_lava.png", name = S("Lava Bucket"), diff --git a/mods/ITEMS/mcl_campfires/README.md b/mods/ITEMS/mcl_campfires/README.md new file mode 100644 index 000000000..8747aa7e3 --- /dev/null +++ b/mods/ITEMS/mcl_campfires/README.md @@ -0,0 +1,21 @@ +mcl_campfires +=============== +Adds the campfire and its soul variant. + +License of code +--------------- +See the main MineClone 2 README.md file. +Authors: +Gerold55 - Code Start + Models? +PrairieWind - Improved and Cleaned Up Code, and added the soul campfire and crafting recipes. +cora - Added burning damage. + +License of media +---------------- +See the main MineClone 2 README.md file for license on most of the textures. + +For the following textures: +mcl_campfires_campfire_inv.png +mcl_campfires_soul_campfire_inv.png +License: CC0 1.0 Universal (CC0 1.0) +Author: RandomLegoBrick diff --git a/mods/ITEMS/mcl_campfires/init.lua b/mods/ITEMS/mcl_campfires/init.lua new file mode 100644 index 000000000..e51ec9f54 --- /dev/null +++ b/mods/ITEMS/mcl_campfires/init.lua @@ -0,0 +1,145 @@ +-- |||||||||||||||||||||||||||||||| +-- ||||||||||| CAMPFIRES |||||||||| +-- |||||||||||||||||||||||||||||||| + +-- TO-DO: +-- * Add Smoke Particles +-- * Add Spark Particles +-- * Add Cooking Meat +-- * Add Working Sounds + +local S = minetest.get_translator(minetest.get_current_modname()) + +local campfires = { + { name = "Campfire", lightlevel = 15, techname = "campfire", damage = 1, drops = "mcl_core:charcoal_lump 2" }, + { name = "Soul Campfire", lightlevel = 10, techname = "soul_campfire", damage = 2, drops = "mcl_blackstone:soul_soil" }, +} + +for _, campfire in pairs(campfires) do +-- Define Campfire + minetest.register_node("mcl_campfires:" .. campfire.techname, { + description = S(campfire.name), + _tt_help = S("Cooks food and keeps bees happy."), + _doc_items_longdesc = S("Campfires have multiple uses, including keeping bees happy, cooking raw meat and fish, and as a trap."), + inventory_image = "mcl_campfires_" .. campfire.techname .. "_inv.png", + drawtype = "mesh", + mesh = "mcl_campfires_campfire.obj", + tiles = {{name="mcl_campfires_log.png"},}, + groups = { handy=1, axey=1, material_wood=1, not_in_creative_inventory=1, campfire=1, }, + paramtype = "light", + paramtype2 = "facedir", + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + if player:get_wielded_item():get_name() == "mcl_fire:flint_and_steel" then + node.name = "mcl_campfires:" .. campfire.techname .. "_lit" + minetest.set_node(pos, node) + end + end, + drop = campfire.drops, + _mcl_silk_touch_drop = {"mcl_campfires:" .. campfire.techname}, + mcl_sounds.node_sound_wood_defaults(), + selection_box = { + type = 'fixed', + fixed = {-.5, -.5, -.5, .5, -.05, .5}, --left, bottom, front, right, top + }, + collision_box = { + type = 'fixed', + fixed = {-.5, -.5, -.5, .5, -.05, .5}, + }, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + }) + + --Define Lit Campfire + minetest.register_node("mcl_campfires:" .. campfire.techname .. "_lit", { + description = S(campfire.name), + _tt_help = S("Cooks food and keeps bees happy."), + _doc_items_longdesc = S("Campfires have multiple uses, including keeping bees happy, cooking raw meat and fish, and as a trap."), + inventory_image = "mcl_campfires_" .. campfire.techname .. "_inv.png", + drawtype = "mesh", + mesh = "mcl_campfires_campfire_lit.obj", + tiles = {{ + name="mcl_campfires_" .. campfire.techname .. "_fire.png", + animation={ + type="vertical_frames", + aspect_w=16, + aspect_h=16, + length=2.0 + }}, + {name="mcl_campfires_" .. campfire.techname .. "_log_lit.png", + animation={ + type="vertical_frames", + aspect_w=16, + aspect_h=16, + length=2.0 + }} + }, + groups = { handy=1, axey=1, material_wood=1, campfire=1, lit_campfire=1 }, + paramtype = "light", + paramtype2 = "facedir", + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + if player:get_wielded_item():get_name():find("shovel") then + node.name = "mcl_campfires:" .. campfire.techname + minetest.set_node(pos, node) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) + end + end, + drop = campfire.drops, + _mcl_silk_touch_drop = {"mcl_campfires:" .. campfire.techname .. "_lit"}, + light_source = campfire.lightlevel, + mcl_sounds.node_sound_wood_defaults(), + selection_box = { + type = "fixed", + fixed = {-.5, -.5, -.5, .5, -.05, .5}, --left, bottom, front, right, top + }, + collision_box = { + type = "fixed", + fixed = {-.5, -.5, -.5, .5, -.05, .5}, + }, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + damage_per_second = campfire.damage, + }) +end + +minetest.register_craft({ + output = "mcl_campfires:campfire_lit", + recipe = { + { "", "mcl_core:stick", "" }, + { "mcl_core:stick", "group:coal", "mcl_core:stick" }, + { "group:tree", "group:tree", "group:tree" }, + } +}) + +minetest.register_craft({ + output = "mcl_campfires:soul_campfire_lit", + recipe = { + { "", "mcl_core:stick", "" }, + { "mcl_core:stick", "group:soul_block", "mcl_core:stick" }, + { "group:tree", "group:tree", "group:tree" }, + } +}) + +local function burn_in_campfire(obj) + local p = obj:get_pos() + if p then + local n = minetest.find_node_near(p,0.4,{"group:lit_campfire"},true) + if n then + mcl_burning.set_on_fire(obj, 5) + end + end +end + +local etime = 0 +minetest.register_globalstep(function(dtime) + etime = dtime + etime + if etime < 0.5 then return end + etime = 0 + for _,pl in pairs(minetest.get_connected_players()) do + burn_in_campfire(pl) + end + for _,ent in pairs(minetest.luaentities) do + if ent.is_mob then + burn_in_campfire(ent.object) + end + end +end) diff --git a/mods/ITEMS/mcl_campfires/local/template.txt b/mods/ITEMS/mcl_campfires/local/template.txt new file mode 100644 index 000000000..04825b5f4 --- /dev/null +++ b/mods/ITEMS/mcl_campfires/local/template.txt @@ -0,0 +1,4 @@ +Campfire= +Soul Campfire= +Cooks food and keeps bees happy.= +Campfires have multiple uses, including keeping bees happy, cooking raw meat and fish, and as a trap.= \ No newline at end of file diff --git a/mods/ITEMS/mcl_campfires/mod.conf b/mods/ITEMS/mcl_campfires/mod.conf new file mode 100644 index 000000000..5c4b77dda --- /dev/null +++ b/mods/ITEMS/mcl_campfires/mod.conf @@ -0,0 +1,3 @@ +name = mcl_campfires +depends = mcl_sounds +author = PrairieWind, Gerold55 \ No newline at end of file diff --git a/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire.obj b/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire.obj new file mode 100644 index 000000000..a559fdd4f --- /dev/null +++ b/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire.obj @@ -0,0 +1,224 @@ +# Blender v2.78 (sub 0) OBJ File: '' +# www.blender.org +mtllib campfire.mtl +o nodebox4 +v 0.500000 -0.312500 0.250000 +v 0.500000 -0.312500 0.500000 +v 0.500000 -0.062500 0.500000 +v 0.500000 -0.062500 0.250000 +v -0.500000 -0.312500 0.250000 +v -0.500000 -0.312500 0.500000 +v -0.500000 -0.062500 0.500000 +v -0.500000 -0.062500 0.250000 +v 0.500000 -0.312500 0.500000 +v 0.500000 -0.062500 0.500000 +v -0.500000 -0.062500 0.500000 +v -0.500000 -0.312500 0.500000 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vn -1.0000 0.0000 0.0000 +vn 0.0000 -0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +usemtl none +s 1 +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/1 6/6/1 7/7/1 8/8/1 +f 1/9/2 4/10/2 8/11/2 5/5/2 +f 1/9/3 2/12/3 6/13/3 5/5/3 +f 4/14/3 3/15/3 7/16/3 8/17/3 +f 9/18/2 10/19/2 11/20/2 12/21/2 +o nodebox4.001 +v 0.500000 -0.312500 -0.498288 +v 0.500000 -0.312500 -0.248288 +v 0.500000 -0.062500 -0.248288 +v 0.500000 -0.062500 -0.498288 +v -0.500000 -0.312500 -0.498288 +v -0.500000 -0.312500 -0.248288 +v -0.500000 -0.062500 -0.248288 +v -0.500000 -0.062500 -0.498288 +v 0.500000 -0.312500 -0.248288 +v 0.500000 -0.062500 -0.248288 +v -0.500000 -0.062500 -0.248288 +v -0.500000 -0.312500 -0.248288 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vn -1.0000 0.0000 0.0000 +vn 0.0000 -0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +usemtl none +s 1 +f 13/22/4 14/23/4 15/24/4 16/25/4 +f 17/26/4 18/27/4 19/28/4 20/29/4 +f 13/30/5 16/31/5 20/32/5 17/26/5 +f 13/30/6 14/33/6 18/34/6 17/26/6 +f 16/35/6 15/36/6 19/37/6 20/38/6 +f 21/39/5 22/40/5 23/41/5 24/42/5 +o nodebox3 +v 0.250000 -0.500000 -0.500000 +v 0.250000 -0.437500 -0.500000 +v -0.250000 -0.437500 -0.500000 +v -0.250000 -0.500000 -0.500000 +v 0.250000 -0.500000 0.500000 +v 0.250000 -0.437500 0.500000 +v -0.250000 -0.437500 0.500000 +v -0.250000 -0.500000 0.500000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vt 1.0000 0.1250 +vt 0.0000 0.1250 +vt 1.0000 0.0000 +vt 1.0000 0.1250 +vt 0.0000 0.1250 +vt 1.0000 0.5000 +vt 0.0000 0.5000 +vt 0.0001 0.0001 +vt 1.0000 0.0000 +vt 1.0000 0.5000 +vt 0.0000 0.5000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +usemtl none_NONE +s 1 +f 25/43/7 29/44/7 30/45/7 26/46/7 +f 28/47/7 32/48/7 31/49/7 27/50/7 +usemtl none +f 25/51/8 26/52/8 27/53/8 28/47/8 +f 29/54/8 30/55/8 31/56/8 32/48/8 +f 25/51/9 29/57/9 32/58/9 28/59/9 +f 26/46/9 30/60/9 31/61/9 27/62/9 +o nodebox4.003 +v -0.248335 -0.500045 0.508619 +v -0.498333 -0.500045 0.509533 +v -0.498334 -0.250045 0.509533 +v -0.248335 -0.250045 0.508619 +v -0.251992 -0.500045 -0.491375 +v -0.501991 -0.500045 -0.490460 +v -0.501991 -0.250045 -0.490460 +v -0.251992 -0.250045 -0.491375 +v -0.498333 -0.500045 0.509533 +v -0.498334 -0.250045 0.509533 +v -0.501991 -0.250045 -0.490460 +v -0.501991 -0.500045 -0.490460 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vn -0.0037 -0.0000 -1.0000 +vn -1.0000 0.0000 0.0037 +vn -0.0000 -1.0000 -0.0000 +usemtl none +s 1 +f 33/63/10 34/64/10 35/65/10 36/66/10 +f 37/67/10 38/68/10 39/69/10 40/70/10 +f 33/71/11 36/72/11 40/73/11 37/67/11 +f 33/71/12 34/74/12 38/75/12 37/67/12 +f 36/76/12 35/77/12 39/78/12 40/79/12 +f 41/80/11 42/81/11 43/82/11 44/83/11 +o nodebox4.002 +v 0.499948 -0.500045 0.505882 +v 0.249950 -0.500045 0.506796 +v 0.249950 -0.250045 0.506796 +v 0.499948 -0.250045 0.505882 +v 0.496291 -0.500045 -0.494111 +v 0.246293 -0.500045 -0.493197 +v 0.246293 -0.250045 -0.493197 +v 0.496291 -0.250045 -0.494111 +v 0.249950 -0.500045 0.506796 +v 0.249950 -0.250045 0.506796 +v 0.246293 -0.250045 -0.493197 +v 0.246293 -0.500045 -0.493197 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vn -0.0037 0.0000 -1.0000 +vn -1.0000 -0.0000 0.0037 +vn -0.0000 -1.0000 -0.0000 +usemtl none +s 1 +f 45/84/13 46/85/13 47/86/13 48/87/13 +f 49/88/13 50/89/13 51/90/13 52/91/13 +f 45/92/14 48/93/14 52/94/14 49/88/14 +f 45/92/15 46/95/15 50/96/15 49/88/15 +f 48/97/15 47/98/15 51/99/15 52/100/15 +f 53/101/14 54/102/14 55/103/14 56/104/14 diff --git a/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire1.mtl b/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire1.mtl new file mode 100644 index 000000000..7355efe9f --- /dev/null +++ b/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire1.mtl @@ -0,0 +1,35 @@ +# Blender MTL File: 'campfire.blend' +# Material Count: 3 + +newmtl Material.001 +Ns 96.078431 +Ka 1.000000 1.000000 1.000000 +Kd 0.640000 0.640000 0.640000 +Ks 0.500000 0.500000 0.500000 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 +map_Kd G:\minetest-0.4.16-win641\textures\Pixel Perfection v4.0\mcl_campfire_fire.png + +newmtl none +Ns 96.078431 +Ka 1.000000 1.000000 1.000000 +Kd 0.640000 0.640000 0.640000 +Ks 0.500000 0.500000 0.500000 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 +map_Kd \home\nathan\Downloads\mcl_campfire_log.png + +newmtl none_NONE +Ns 96.078431 +Ka 1.000000 1.000000 1.000000 +Kd 0.640000 0.640000 0.640000 +Ks 0.500000 0.500000 0.500000 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 +map_Kd \\home\\nathan\\Downloads\\mcl_campfire_log.png diff --git a/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire1.obj b/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire1.obj new file mode 100644 index 000000000..92a377303 --- /dev/null +++ b/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire1.obj @@ -0,0 +1,248 @@ +# Blender v2.78 (sub 0) OBJ File: 'campfire.blend' +# www.blender.org +mtllib campfire1.mtl +o nodebox4.005_nodebox4.006 +v 0.243779 -0.499707 -0.497529 +v 0.493779 -0.499707 -0.497421 +v 0.493779 -0.249707 -0.497421 +v 0.243779 -0.249707 -0.497529 +v 0.243349 -0.499707 0.502471 +v 0.493349 -0.499707 0.502578 +v 0.493349 -0.249707 0.502578 +v 0.243349 -0.249707 0.502471 +v 0.493779 -0.499707 -0.497421 +v 0.493779 -0.249707 -0.497421 +v 0.493349 -0.499707 0.502578 +v 0.493349 -0.249707 0.502578 +vt -0.0000 0.7500 +vt -0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt -0.0000 0.7500 +vt -0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt -0.0000 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt -0.0000 0.7500 +vn -0.0004 0.0000 1.0000 +vn 1.0000 -0.0000 0.0004 +vn -0.0000 -1.0000 0.0000 +usemtl none +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/1 6/6/1 7/7/1 8/8/1 +f 1/9/2 4/10/2 8/11/2 5/5/2 +f 1/9/3 2/12/3 6/13/3 5/5/3 +f 4/14/3 3/15/3 7/16/3 8/17/3 +f 9/18/2 10/19/2 12/20/2 11/21/2 +o nodebox4.004_nodebox4.005 +v -0.500021 -0.499707 -0.497848 +v -0.250021 -0.499707 -0.497741 +v -0.250021 -0.249707 -0.497741 +v -0.500021 -0.249707 -0.497848 +v -0.500451 -0.499707 0.502152 +v -0.250451 -0.499707 0.502259 +v -0.250451 -0.249707 0.502259 +v -0.500451 -0.249707 0.502152 +v -0.250021 -0.499707 -0.497741 +v -0.250021 -0.249707 -0.497741 +v -0.250451 -0.499707 0.502259 +v -0.250451 -0.249707 0.502259 +vt -0.0000 0.7500 +vt -0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt -0.0000 0.7500 +vt -0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt -0.0000 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt -0.0000 0.7500 +vn -0.0004 0.0000 1.0000 +vn 1.0000 -0.0000 0.0004 +vn -0.0000 -1.0000 0.0000 +usemtl none +s off +f 13/22/4 14/23/4 15/24/4 16/25/4 +f 17/26/4 18/27/4 19/28/4 20/29/4 +f 13/30/5 16/31/5 20/32/5 17/26/5 +f 13/30/6 14/33/6 18/34/6 17/26/6 +f 16/35/6 15/36/6 19/37/6 20/38/6 +f 21/39/5 22/40/5 24/41/5 23/42/5 +o nodebox4.001_nodebox4.004 +v 0.500000 -0.312500 -0.493800 +v 0.500000 -0.312500 -0.243800 +v 0.500000 -0.062500 -0.243800 +v 0.500000 -0.062500 -0.493800 +v -0.500000 -0.312500 -0.493800 +v -0.500000 -0.312500 -0.243800 +v -0.500000 -0.062500 -0.243800 +v -0.500000 -0.062500 -0.493800 +v 0.500000 -0.312500 -0.243800 +v 0.500000 -0.062500 -0.243800 +v -0.500000 -0.312500 -0.243800 +v -0.500000 -0.062500 -0.243800 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.7500 +vn -1.0000 0.0000 0.0000 +vn 0.0000 -0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +usemtl none +s off +f 25/43/7 26/44/7 27/45/7 28/46/7 +f 29/47/7 30/48/7 31/49/7 32/50/7 +f 25/51/8 28/52/8 32/53/8 29/47/8 +f 25/51/9 26/54/9 30/55/9 29/47/9 +f 28/56/9 27/57/9 31/58/9 32/59/9 +f 33/60/8 34/61/8 36/62/8 35/63/8 +o Plane +v -0.311754 -0.438770 -0.196249 +v 0.276360 -0.438621 0.247948 +v -0.311276 0.135801 -0.196634 +v 0.276838 0.135950 0.247562 +v -0.274993 -0.438696 0.270317 +v 0.240407 -0.438696 -0.218656 +v -0.275322 0.135875 0.269969 +v 0.240077 0.135875 -0.219003 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vt 1.0000 1.0000 +vt -0.0000 1.0000 +vn -0.6027 0.0010 0.7980 +vn 0.6883 0.0008 0.7255 +usemtl Material.001 +s off +f 37/64/10 38/65/10 40/66/10 39/67/10 +f 41/68/11 42/69/11 44/70/11 43/71/11 +o nodebox3 +v 0.250000 -0.500000 -0.500000 +v 0.250000 -0.500000 0.500000 +v 0.250000 -0.437500 0.500000 +v 0.250000 -0.437500 -0.500000 +v -0.250000 -0.500000 -0.500000 +v -0.250000 -0.500000 0.500000 +v -0.250000 -0.437500 0.500000 +v -0.250000 -0.437500 -0.500000 +vt 1.0000 0.0000 +vt 1.0000 0.0625 +vt 0.0000 0.0625 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vt 1.0000 0.0625 +vt 0.0000 0.0625 +vt 0.0000 0.0000 +vt 1.0000 0.4375 +vt 0.0000 0.4375 +vt 0.0001 0.0001 +vt 0.9999 0.0001 +vt 1.0000 0.5000 +vt 0.0000 0.5000 +vt 0.0001 0.0001 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vt 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +vn -1.0000 0.0000 0.0000 +usemtl none +s off +f 45/72/12 48/73/12 52/74/12 49/75/12 +f 46/76/12 47/77/12 51/78/12 50/79/12 +f 45/72/13 46/80/13 50/81/13 49/82/13 +f 48/83/13 47/84/13 51/85/13 52/86/13 +usemtl none_NONE +f 45/87/14 46/88/14 47/89/14 48/90/14 +f 49/75/14 50/79/14 51/91/14 52/92/14 +o nodebox4 +v 0.500000 -0.312500 0.250000 +v 0.500000 -0.312500 0.500000 +v 0.500000 -0.062500 0.500000 +v 0.500000 -0.062500 0.250000 +v -0.500000 -0.312500 0.250000 +v -0.500000 -0.312500 0.500000 +v -0.500000 -0.062500 0.500000 +v -0.500000 -0.062500 0.250000 +v 0.500000 -0.312500 0.500000 +v 0.500000 -0.062500 0.500000 +v -0.500000 -0.312500 0.500000 +v -0.500000 -0.062500 0.500000 +vt -0.0000 0.7500 +vt 0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt -0.0000 0.7500 +vt -0.0000 0.5000 +vt 0.2500 0.5000 +vt 0.2500 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt -0.0000 0.7500 +vt 1.0000 0.7500 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt -0.0000 0.7500 +vn -1.0000 0.0000 0.0000 +vn 0.0000 -0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +usemtl none +s off +f 53/93/15 54/94/15 55/95/15 56/96/15 +f 57/97/15 58/98/15 59/99/15 60/100/15 +f 53/101/16 56/102/16 60/103/16 57/97/16 +f 53/101/17 54/104/17 58/105/17 57/97/17 +f 56/106/17 55/107/17 59/108/17 60/109/17 +f 61/110/16 62/111/16 64/112/16 63/113/16 diff --git a/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire_lit.obj b/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire_lit.obj new file mode 100644 index 000000000..a17acc05f --- /dev/null +++ b/mods/ITEMS/mcl_campfires/models/mcl_campfires_campfire_lit.obj @@ -0,0 +1,225 @@ +# Blender v2.79 (sub 7) OBJ File: 'campfire.blend' +# www.blender.org +o Plane +v -0.240246 -0.438696 -0.141059 +v 0.205043 -0.438696 0.192756 +v -0.239959 0.135875 -0.141442 +v 0.205331 0.135875 0.192373 +v -0.216088 -0.438696 0.214432 +v 0.181502 -0.438696 -0.162771 +v -0.216417 0.135875 0.214085 +v 0.181172 0.135875 -0.163119 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vn -0.5998 0.0008 0.8001 +vn 0.6883 0.0008 0.7255 +g Plane_Plane_Material.001 +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 5/5/2 6/6/2 8/7/2 7/8/2 +o nodebox3 +v 0.250000 -0.500000 -0.500000 +v 0.250000 -0.500000 0.500000 +v 0.250000 -0.437500 0.500000 +v 0.250000 -0.437500 -0.500000 +v -0.250000 -0.500000 -0.500000 +v -0.250000 -0.500000 0.500000 +v -0.250000 -0.437500 0.500000 +v -0.250000 -0.437500 -0.500000 +v 0.243779 -0.499707 -0.497529 +v 0.493779 -0.499707 -0.497421 +v 0.493779 -0.249707 -0.497421 +v 0.243779 -0.249707 -0.497529 +v 0.243349 -0.499707 0.502471 +v 0.493349 -0.499707 0.502579 +v 0.493349 -0.249707 0.502578 +v 0.243349 -0.249707 0.502471 +v 0.493779 -0.499707 -0.497421 +v 0.493779 -0.249707 -0.497421 +v 0.493349 -0.499707 0.502579 +v 0.493349 -0.249707 0.502578 +v -0.500021 -0.499707 -0.497848 +v -0.250021 -0.499707 -0.497741 +v -0.250021 -0.249707 -0.497741 +v -0.500021 -0.249707 -0.497848 +v -0.500451 -0.499707 0.502152 +v -0.250451 -0.499707 0.502259 +v -0.250451 -0.249707 0.502259 +v -0.500451 -0.249707 0.502152 +v -0.250021 -0.499707 -0.497741 +v -0.250021 -0.249707 -0.497741 +v -0.250451 -0.499707 0.502259 +v -0.250451 -0.249707 0.502259 +v 0.500000 -0.312500 -0.493800 +v 0.500000 -0.312500 -0.243800 +v 0.500000 -0.062500 -0.243800 +v 0.500000 -0.062500 -0.493800 +v -0.500000 -0.312500 -0.493800 +v -0.500000 -0.312500 -0.243800 +v -0.500000 -0.062500 -0.243800 +v -0.500000 -0.062500 -0.493800 +v 0.500000 -0.312500 -0.243800 +v 0.500000 -0.062500 -0.243800 +v -0.500000 -0.312500 -0.243800 +v -0.500000 -0.062500 -0.243800 +v 0.500000 -0.312500 0.250000 +v 0.500000 -0.312500 0.500000 +v 0.500000 -0.062500 0.500000 +v 0.500000 -0.062500 0.250000 +v -0.500000 -0.312500 0.250000 +v -0.500000 -0.312500 0.500000 +v -0.500000 -0.062500 0.500000 +v -0.500000 -0.062500 0.250000 +v 0.500000 -0.312500 0.500000 +v 0.500000 -0.062500 0.500000 +v -0.500000 -0.312500 0.500000 +v -0.500000 -0.062500 0.500000 +vt 0.999982 0.000018 +vt 1.000000 0.062500 +vt 0.000000 0.062500 +vt 0.000018 0.000018 +vt 0.999982 0.000018 +vt 1.000000 0.062500 +vt 0.000000 0.062500 +vt 0.000018 0.000018 +vt 1.000000 0.437500 +vt 0.000000 0.437500 +vt 0.000071 0.000071 +vt 0.999929 0.000071 +vt 1.000000 0.500000 +vt 0.000000 0.500000 +vt 0.000071 0.000071 +vt -0.000000 0.750000 +vt -0.000000 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.750000 +vt -0.000000 0.750000 +vt -0.000000 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.750000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.750000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.750000 +vt -0.000000 0.750000 +vt -0.000000 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.750000 +vt -0.000000 0.750000 +vt -0.000000 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.750000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.750000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.750000 +vt 0.000000 0.750000 +vt 0.000000 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.750000 +vt 0.000000 0.750000 +vt 0.000000 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.750000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.750000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.750000 +vt -0.000000 0.750000 +vt 0.000000 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.750000 +vt -0.000000 0.750000 +vt -0.000000 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.750000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.750000 +vt 1.000000 0.750000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.750000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +vn -0.0004 0.0000 1.0000 +vn 1.0000 -0.0000 0.0004 +vn -1.0000 0.0000 0.0000 +g nodebox3_nodebox3_none +s off +f 9/9/3 12/10/3 16/11/3 13/12/3 +f 10/13/3 11/14/3 15/15/3 14/16/3 +f 9/9/4 10/17/4 14/18/4 13/19/4 +f 12/20/4 11/21/4 15/22/4 16/23/4 +f 17/24/5 18/25/5 19/26/5 20/27/5 +f 21/28/5 22/29/5 23/30/5 24/31/5 +f 17/32/6 20/33/6 24/34/6 21/28/6 +f 17/32/4 18/35/4 22/36/4 21/28/4 +f 20/37/4 19/38/4 23/39/4 24/40/4 +f 25/41/6 26/42/6 28/43/6 27/44/6 +f 29/45/5 30/46/5 31/47/5 32/48/5 +f 33/49/5 34/50/5 35/51/5 36/52/5 +f 29/53/6 32/54/6 36/55/6 33/49/6 +f 29/53/4 30/56/4 34/57/4 33/49/4 +f 32/58/4 31/59/4 35/60/4 36/61/4 +f 37/62/6 38/63/6 40/64/6 39/65/6 +f 41/66/7 42/67/7 43/68/7 44/69/7 +f 45/70/7 46/71/7 47/72/7 48/73/7 +f 41/74/3 44/75/3 48/76/3 45/70/3 +f 41/74/4 42/77/4 46/78/4 45/70/4 +f 44/79/4 43/80/4 47/81/4 48/82/4 +f 49/83/3 50/84/3 52/85/3 51/86/3 +f 53/87/7 54/88/7 55/89/7 56/90/7 +f 57/91/7 58/92/7 59/93/7 60/94/7 +f 53/95/3 56/96/3 60/97/3 57/91/3 +f 53/95/4 54/98/4 58/99/4 57/91/4 +f 56/100/4 55/101/4 59/102/4 60/103/4 +f 61/104/3 62/105/3 64/106/3 63/107/3 +g nodebox3_nodebox3_none_NONE +f 9/108/7 10/109/7 11/110/7 12/111/7 +f 13/12/7 14/16/7 15/112/7 16/113/7 diff --git a/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_fire.png b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_fire.png new file mode 100644 index 000000000..d1288ec9d Binary files /dev/null and b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_fire.png differ diff --git a/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_inv.png b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_inv.png new file mode 100644 index 000000000..6d8ee3c06 Binary files /dev/null and b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_inv.png differ diff --git a/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_log_lit.png b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_log_lit.png new file mode 100644 index 000000000..7dd086000 Binary files /dev/null and b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_campfire_log_lit.png differ diff --git a/mods/ITEMS/mcl_campfires/textures/mcl_campfires_fire1.png b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_fire1.png new file mode 100644 index 000000000..865d6e3e0 Binary files /dev/null and b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_fire1.png differ diff --git a/mods/ITEMS/mcl_campfires/textures/mcl_campfires_log.png b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_log.png new file mode 100644 index 000000000..2401f4889 Binary files /dev/null and b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_log.png differ diff --git a/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_fire.png b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_fire.png new file mode 100644 index 000000000..ecf149833 Binary files /dev/null and b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_fire.png differ diff --git a/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_inv.png b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_inv.png new file mode 100644 index 000000000..88c7a6e4c Binary files /dev/null and b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_inv.png differ diff --git a/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_log_lit.png b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_log_lit.png new file mode 100644 index 000000000..1cc1f8043 Binary files /dev/null and b/mods/ITEMS/mcl_campfires/textures/mcl_campfires_soul_campfire_log_lit.png differ diff --git a/mods/ITEMS/mcl_cartography_table/init.lua b/mods/ITEMS/mcl_cartography_table/init.lua index d2f065880..a7c66b4e2 100644 --- a/mods/ITEMS/mcl_cartography_table/init.lua +++ b/mods/ITEMS/mcl_cartography_table/init.lua @@ -11,7 +11,9 @@ minetest.register_node("mcl_cartography_table:cartography_table", { "cartography_table_side3.png", "cartography_table_side1.png" }, paramtype2 = "facedir", - groups = {choppy=1, deco_block=1, material_wood=1,flammable=1} + groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 }, + _mcl_blast_resistance = 2.5, + _mcl_hardness = 2.5 }) diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index 55866f5cc..6a8270794 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -5,7 +5,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) -- TODO: Extinguish fire of burning entities -- Convenience function because the cauldron nodeboxes are very similar -local create_cauldron_nodebox = function(water_level) +local function create_cauldron_nodebox(water_level) local floor_y if water_level == 0 then -- empty floor_y = -0.1875 @@ -36,12 +36,6 @@ local create_cauldron_nodebox = function(water_level) } end -local cauldron_nodeboxes = {} -for w=0,3 do - cauldron_nodeboxes[w] = create_cauldron_nodebox(w) -end - - -- Empty cauldron minetest.register_node("mcl_cauldrons:cauldron", { description = S("Cauldron"), @@ -55,7 +49,7 @@ minetest.register_node("mcl_cauldrons:cauldron", { paramtype = "light", is_ground_content = false, groups = {pickaxey=1, deco_block=1, cauldron=1}, - node_box = cauldron_nodeboxes[0], + node_box = create_cauldron_nodebox(0), selection_box = { type = "regular" }, tiles = { "mcl_cauldrons_cauldron_inner.png^mcl_cauldrons_cauldron_top.png", @@ -68,12 +62,15 @@ minetest.register_node("mcl_cauldrons:cauldron", { }) -- Template function for cauldrons with water -local register_filled_cauldron = function(water_level, description, river_water) +local function register_filled_cauldron(water_level, description, liquid) local id = "mcl_cauldrons:cauldron_"..water_level local water_tex - if river_water then + if liquid == "river_water" then id = id .. "r" water_tex = "default_river_water_source_animated.png^[verticalframe:16:0" + elseif liquid == "lava" then + id = id .. "_lava" + water_tex = "default_lava_source_animated.png^[verticalframe:16:0" else water_tex = "default_water_source_animated.png^[verticalframe:16:0" end @@ -85,8 +82,8 @@ local register_filled_cauldron = function(water_level, description, river_water) paramtype = "light", is_ground_content = false, groups = {pickaxey=1, not_in_creative_inventory=1, cauldron=(1+water_level), cauldron_filled=water_level, comparator_signal=water_level}, - node_box = cauldron_nodeboxes[water_level], - collision_box = cauldron_nodeboxes[0], + node_box = create_cauldron_nodebox(water_level), + collision_box = create_cauldron_nodebox(0), selection_box = { type = "regular" }, tiles = { "("..water_tex..")^mcl_cauldrons_cauldron_top.png", @@ -106,14 +103,12 @@ local register_filled_cauldron = function(water_level, description, river_water) end -- Filled cauldrons (3 levels) -register_filled_cauldron(1, S("Cauldron (1/3 Water)")) -register_filled_cauldron(2, S("Cauldron (2/3 Water)")) -register_filled_cauldron(3, S("Cauldron (3/3 Water)")) - -if minetest.get_modpath("mclx_core") then - register_filled_cauldron(1, S("Cauldron (1/3 River Water)"), true) - register_filled_cauldron(2, S("Cauldron (2/3 River Water)"), true) - register_filled_cauldron(3, S("Cauldron (3/3 River Water)"), true) +for i=1,3 do + register_filled_cauldron(i, S("Cauldron (" ..i .. "/3 Water)")) + register_filled_cauldron(i, S("Cauldron (" ..i .. "/3 Water)"),"lava") + if minetest.get_modpath("mclx_core") then + register_filled_cauldron(i, S("Cauldron (" ..i .. "/3 Water)"),"river_water") + end end minetest.register_craft({ @@ -125,19 +120,36 @@ minetest.register_craft({ } }) -minetest.register_abm({ - label = "cauldrons", - nodenames = {"group:cauldron_filled"}, - interval = 0.5, - chance = 1, - action = function(pos, node) - for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0.4)) do - if mcl_burning.is_burning(obj) then - mcl_burning.extinguish(obj) - local new_group = minetest.get_item_group(node.name, "cauldron_filled") - 1 - minetest.swap_node(pos, {name = "mcl_cauldrons:cauldron" .. (new_group == 0 and "" or "_" .. new_group)}) - break +local function cauldron_extinguish(obj,pos) + local node = minetest.get_node(pos) + if mcl_burning.is_burning(obj) then + mcl_burning.extinguish(obj) + local new_group = minetest.get_item_group(node.name, "cauldron_filled") - 1 + minetest.swap_node(pos, {name = "mcl_cauldrons:cauldron" .. (new_group == 0 and "" or "_" .. new_group)}) + end +end + +local etime = 0 +minetest.register_globalstep(function(dtime) + etime = dtime + etime + if etime < 0.5 then return end + etime = 0 + for _,pl in pairs(minetest.get_connected_players()) do + local n = minetest.find_node_near(pl:get_pos(),0.4,{"group:cauldron_filled"},true) + if n and not minetest.get_node(n).name:find("lava") then + cauldron_extinguish(pl,n) + elseif n and minetest.get_node(n).name:find("lava") then + mcl_burning.set_on_fire(pl, 5) + end + end + for _,ent in pairs(minetest.luaentities) do + if ent.object:get_pos() and ent.is_mob then + local n = minetest.find_node_near(ent.object:get_pos(),0.4,{"group:cauldron_filled"},true) + if n and not minetest.get_node(n).name:find("lava") then + cauldron_extinguish(ent.object,n) + elseif n and minetest.get_node(n).name:find("lava") then + mcl_burning.set_on_fire(ent.object, 5) end end end -}) +end) diff --git a/mods/ITEMS/mcl_cauldrons/mod.conf b/mods/ITEMS/mcl_cauldrons/mod.conf index 4787d60f9..36d5b303b 100644 --- a/mods/ITEMS/mcl_cauldrons/mod.conf +++ b/mods/ITEMS/mcl_cauldrons/mod.conf @@ -1,3 +1,3 @@ name = mcl_cauldrons depends = mcl_core, mcl_sounds -optional_depends = mclx_core, doc +optional_depends = mclx_core, doc, mcl_burning diff --git a/mods/ITEMS/mcl_compass/init.lua b/mods/ITEMS/mcl_compass/init.lua index 0bcc3f0af..9ec1ba074 100644 --- a/mods/ITEMS/mcl_compass/init.lua +++ b/mods/ITEMS/mcl_compass/init.lua @@ -189,6 +189,7 @@ minetest.register_globalstep(function(dtime) if string_find(stack:get_name(), "_lodestone") then stack:set_name("mcl_compass:" .. compass_frame .. "_lodestone") + awards.unlock(player:get_player_name(), "mcl:countryLode") else stack:set_name("mcl_compass:" .. compass_frame) end @@ -284,7 +285,7 @@ minetest.register_craft({ output = "mcl_compass:lodestone", recipe = { {"mcl_core:stonebrickcarved","mcl_core:stonebrickcarved","mcl_core:stonebrickcarved"}, - {"mcl_core:stonebrickcarved", "mcl_core:diamondblock", "mcl_core:stonebrickcarved"}, + {"mcl_core:stonebrickcarved", "mcl_nether:netherite_ingot", "mcl_core:stonebrickcarved"}, {"mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved"} } }) diff --git a/mods/ITEMS/mcl_copper/nodes.lua b/mods/ITEMS/mcl_copper/nodes.lua index 38fbb6c3d..22c1bf807 100644 --- a/mods/ITEMS/mcl_copper/nodes.lua +++ b/mods/ITEMS/mcl_copper/nodes.lua @@ -34,7 +34,7 @@ minetest.register_node("mcl_copper:block", { groups = {pickaxey = 2, building_block = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, - _mcl_hardness = 5, + _mcl_hardness = 3, }) minetest.register_node("mcl_copper:block_exposed", { diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index fc08a0957..c9caf9423 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -1698,3 +1698,37 @@ function mcl_core.after_snow_destruct(pos) local node = minetest.get_node(npos) mcl_core.clear_snow_dirt(npos, node) end + + +-- Obsidian crying + +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"}, + interval = 5, + chance = 10, + action = function(pos, node) + minetest.after(math.random(0.1,1.5),function() + 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 +}) diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 0e9b53d04..96d045710 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -361,7 +361,7 @@ minetest.register_node("mcl_core:dirt_with_grass", { _doc_items_longdesc = S("A grass block is dirt with a grass cover. Grass blocks are resourceful blocks which allow the growth of all sorts of plants. They can be turned into farmland with a hoe and turned into grass paths with a shovel. In light, the grass slowly spreads onto dirt nearby. Under an opaque block or a liquid, a grass block may turn back to dirt."), _doc_items_hidden = false, paramtype2 = "color", - tiles = {"mcl_core_grass_block_top.png", { name="default_dirt.png", color="white" }}, + tiles = {"mcl_core_grass_block_top.png", { name="default_dirt.png^mcl_dirt_grass_shadow.png", color="white" }}, overlay_tiles = {"mcl_core_grass_block_top.png", "", {name="mcl_core_grass_block_side_overlay.png", tileable_vertical=false}}, palette = "mcl_core_palette_grass.png", palette_index = 0, @@ -389,7 +389,7 @@ minetest.register_node("mcl_core:dirt_with_grass", { return mcl_core.on_snowable_construct(pos) end, _mcl_snowed = "mcl_core:dirt_with_grass_snow", - _mcl_blast_resistance = 0.5, + _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6, _mcl_silk_touch_drop = true, }) @@ -434,7 +434,7 @@ minetest.register_node("mcl_core:mycelium", { on_construct = mcl_core.on_snowable_construct, _mcl_snowed = "mcl_core:mycelium_snow", - _mcl_blast_resistance = 0.5, + _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6, _mcl_silk_touch_drop = true, }) @@ -451,8 +451,8 @@ minetest.register_node("mcl_core:podzol", { sounds = mcl_sounds.node_sound_dirt_defaults(), on_construct = mcl_core.on_snowable_construct, _mcl_snowed = "mcl_core:podzol_snow", - _mcl_blast_resistance = 0.5, - _mcl_hardness = 0.6, + _mcl_blast_resistance = 0.8, + _mcl_hardness = 0.8, _mcl_silk_touch_drop = true, }) mcl_core.register_snowed_node("mcl_core:podzol_snow", "mcl_core:podzol", nil, nil, false, S("Podzol with Snow")) @@ -556,8 +556,8 @@ minetest.register_node("mcl_core:sandstonesmooth", { stack_max = 64, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 0.8, - _mcl_hardness = 0.8, + _mcl_blast_resistance = 6, + _mcl_hardness = 2, }) minetest.register_node("mcl_core:sandstonecarved", { @@ -581,8 +581,8 @@ minetest.register_node("mcl_core:sandstonesmooth2", { stack_max = 64, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 0.8, - _mcl_hardness = 0.8, + _mcl_blast_resistance = 6, + _mcl_hardness = 2, }) -- red sandstone -- @@ -775,7 +775,7 @@ minetest.register_node("mcl_core:goldblock", { groups = {pickaxey=4, building_block=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, - _mcl_hardness = 5, + _mcl_hardness = 3, }) minetest.register_node("mcl_core:diamondblock", { @@ -831,6 +831,19 @@ minetest.register_node("mcl_core:obsidian", { end, }) +minetest.register_node("mcl_core:crying_obsidian", { + description = S("Crying Obsidian"), + _doc_items_longdesc = S("Crying obsidian is a luminous obsidian that can generate as part of ruined portals."), + tiles = {"default_obsidian.png^mcl_core_crying_obsidian.png"}, + is_ground_content = false, + light_source = 10, + sounds = mcl_sounds.node_sound_stone_defaults(), + stack_max = 64, + groups = {pickaxey=5, building_block=1, material_stone=1}, + _mcl_blast_resistance = 1200, + _mcl_hardness = 50, +}) + minetest.register_node("mcl_core:ice", { description = S("Ice"), _doc_items_longdesc = S("Ice is a solid block usually found in cold areas. It melts near block light sources at a light level of 12 or higher. When it melts or is broken while resting on top of another block, it will turn into a water source."), @@ -1062,8 +1075,8 @@ minetest.register_node("mcl_core:snowblock", { on_construct = mcl_core.on_snow_construct, after_destruct = mcl_core.after_snow_destruct, drop = "mcl_throwing:snowball 4", - _mcl_blast_resistance = 0.2, - _mcl_hardness = 0.2, + _mcl_blast_resistance = 0.1, + _mcl_hardness = 0.1, _mcl_silk_touch_drop = true, }) diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian.png b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian.png new file mode 100644 index 000000000..6229fe08a Binary files /dev/null and b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear.png b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear.png new file mode 100644 index 000000000..eb3fc2cb5 Binary files /dev/null and b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear2.png b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear2.png new file mode 100644 index 000000000..07d1978ba Binary files /dev/null and b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear2.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear3.png b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear3.png new file mode 100644 index 000000000..ea0f58393 Binary files /dev/null and b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear3.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_dirt_podzol_side.png b/mods/ITEMS/mcl_core/textures/mcl_core_dirt_podzol_side.png index 0d89941ff..4f0bf5fe9 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_dirt_podzol_side.png and b/mods/ITEMS/mcl_core/textures/mcl_core_dirt_podzol_side.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_grass_side_snowed.png b/mods/ITEMS/mcl_core/textures/mcl_core_grass_side_snowed.png index 9830db7eb..b38bf0e4f 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_grass_side_snowed.png and b/mods/ITEMS/mcl_core/textures/mcl_core_grass_side_snowed.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_dirt_grass_shadow.png b/mods/ITEMS/mcl_core/textures/mcl_dirt_grass_shadow.png new file mode 100644 index 000000000..5a1fa6197 Binary files /dev/null and b/mods/ITEMS/mcl_core/textures/mcl_dirt_grass_shadow.png differ diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua new file mode 100644 index 000000000..bb8736ae1 --- /dev/null +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -0,0 +1,485 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) +-- Warped and Crimson fungus +-- by debiankaios +-- adapted for mcl2 by cora + +local function generate_warped_tree(pos) + minetest.place_schematic(pos,modpath.."/schematics/warped_fungus_1.mts","random",nil,false,"place_center_x,place_center_z") +end + +function generate_crimson_tree(pos) + minetest.place_schematic(pos,modpath.."/schematics/crimson_fungus_1.mts","random",nil,false,"place_center_x,place_center_z") +end + +function grow_twisting_vines(pos, moreontop) + local y = pos.y + 1 + while not (moreontop == 0) do + if minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air" then + minetest.set_node({x = pos.x, y = y, z = pos.z}, {name="mcl_crimson:twisting_vines"}) + moreontop = moreontop - 1 + y = y + 1 + elseif minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "mcl_crimson:twisting_vines" then + y = y + 1 + else + moreontop = 0 + end + end +end + +minetest.register_node("mcl_crimson:warped_fungus", { + description = S("Warped Fungus Mushroom"), + drawtype = "plantlike", + tiles = { "farming_warped_fungus.png" }, + inventory_image = "farming_warped_fungus.png", + wield_image = "farming_warped_fungus.png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1}, + light_source = 1, + selection_box = { + type = "fixed", + fixed = { -3/16, -0.5, -3/16, 3/16, -2/16, 3/16 }, + }, + node_placement_prediction = "", + on_rightclick = function(pos, node, pointed_thing, player, itemstack) + if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then + local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) + if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then + local random = math.random(1, 5) + if random == 1 then + generate_warped_tree(pos) + end + end + end + end, + _mcl_blast_resistance = 0, +}) + +minetest.register_node("mcl_crimson:twisting_vines", { + description = S("Twisting Vines"), + drawtype = "plantlike", + tiles = { "twisting_vines_plant.png" }, + inventory_image = "twisting_vines.png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + climbable = true, + buildable_to = true, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1}, + selection_box = { + type = "fixed", + fixed = { -3/16, -0.5, -3/16, 3/16, 0.5, 3/16 }, + }, + node_placement_prediction = "", + on_rightclick = function(pos, node, pointed_thing, itemstack) + if pointed_thing:get_wielded_item():get_name() == "mcl_crimson:twisting_vines" then + itemstack:take_item() + grow_twisting_vines(pos, 1) + elseif pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then + itemstack:take_item() + grow_twisting_vines(pos, math.random(1, 3)) + end + end, + drop = { + max_items = 1, + items = { + {items = {"mcl_crimson:twisting_vines"}, rarity = 3}, + }, + }, + _mcl_shears_drop = true, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = { + items = { + {items = {"mcl_crimson:twisting_vines"}, rarity = 3}, + }, + items = { + {items = {"mcl_crimson:twisting_vines"}, rarity = 1.8181818181818181}, + }, + "mcl_crimson:twisting_vines", + "mcl_crimson:twisting_vines", + }, + _mcl_blast_resistance = 0, +}) + +minetest.register_node("mcl_crimson:nether_sprouts", { + description = S("Nether Sprouts"), + drawtype = "plantlike", + tiles = { "nether_sprouts.png" }, + inventory_image = "nether_sprouts.png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + buildable_to = true, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1}, + selection_box = { + type = "fixed", + fixed = { -4/16, -0.5, -4/16, 4/16, 0, 4/16 }, + }, + node_placement_prediction = "", + drop = "", + _mcl_shears_drop = true, + _mcl_silk_touch_drop = false, + _mcl_blast_resistance = 0, +}) + +minetest.register_node("mcl_crimson:warped_roots", { + description = S("Warped Roots"), + drawtype = "plantlike", + tiles = { "warped_roots.png" }, + inventory_image = "warped_roots.png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + buildable_to = true, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1}, + selection_box = { + type = "fixed", + fixed = { -6/16, -0.5, -6/16, 6/16, -4/16, 6/16 }, + }, + node_placement_prediction = "", + _mcl_silk_touch_drop = false, + _mcl_blast_resistance = 0, +}) + +minetest.register_node("mcl_crimson:warped_wart_block", { + description = S("Warped Wart Block"), + tiles = {"warped_wart_block.png"}, + groups = {handy = 1, hoe = 7, swordy = 1, deco_block = 1}, + _mcl_hardness = 2, +}) + +minetest.register_node("mcl_crimson:shroomlight", { + description = S("Shroomlight"), + tiles = {"shroomlight.png"}, + groups = {handy = 1, hoe = 7, swordy = 1, leafdecay = 5, leaves = 1, deco_block = 1}, + light_source = minetest.LIGHT_MAX, + _mcl_hardness = 2, +}) + +minetest.register_node("mcl_crimson:warped_hyphae", { + description = S("Warped Hyphae"), + _doc_items_longdesc = S("The stem of a warped hyphae"), + _doc_items_hidden = false, + tiles = { + "warped_hyphae.png", + "warped_hyphae.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + }, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + _mcl_stripped_variant = "mcl_crimson:stripped_warped_hyphae", +}) + +minetest.register_node("mcl_crimson:warped_nylium", { + description = S("Warped Nylium"), + tiles = { + "warped_nylium.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png^warped_nylium_side.png", + "mcl_nether_netherrack.png^warped_nylium_side.png", + "mcl_nether_netherrack.png^warped_nylium_side.png", + "mcl_nether_netherrack.png^warped_nylium_side.png", + }, + paramtype2 = "facedir", + is_ground_content = true, + drop = "mcl_nether:netherrack", + groups = {pickaxey=1, building_block=1, material_stone=1}, + _mcl_hardness = 0.4, + _mcl_blast_resistance = 0.4, + _mcl_silk_touch_drop = true, +}) + +--Stem bark, stripped stem and bark + +minetest.register_node("mcl_crimson:warped_hyphae_bark", { + description = S("Warped Hyphae Bark"), + _doc_items_longdesc = S("This is a decorative block surrounded by the bark of an hyphae."), + tiles = {"warped_hyphae_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + _mcl_stripped_variant = "mcl_crimson:stripped_warped_hyphae_bark", +}) + +minetest.register_craft({ + output = "mcl_crimson:warped_hyphae_bark 3", + recipe = { + { "mcl_crimson:warped_hyphae", "mcl_crimson:warped_hyphae" }, + { "mcl_crimson:warped_hyphae", "mcl_crimson:warped_hyphae" }, + }, +}) + +minetest.register_node("mcl_crimson:stripped_warped_hyphae", { + description = S("Stripped warped hyphae"), + _doc_items_longdesc = S("The stripped hyphae of a warped fungus"), + _doc_items_hidden = false, + tiles = {"warped_stem_stripped_top.png", "warped_stem_stripped_top.png", "warped_stem_stripped_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + _mcl_blast_resistance = 2, + _mcl_hardness = 2, +}) + +minetest.register_node("mcl_crimson:stripped_warped_hyphae_bark", { + description = S("Stripped warped hyphae bark"), + _doc_items_longdesc = S("The stripped hyphae bark of a warped fungus"), + tiles = {"crimson_stem_stripped_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, +}) + +minetest.register_craft({ + output = "mcl_crimson:stripped_warped_hyphae_bark 3", + recipe = { + { "mcl_crimson:stripped_warped_hyphae", "mcl_crimson:stripped_warped_hyphae" }, + { "mcl_crimson:stripped_warped_hyphae", "mcl_crimson:stripped_warped_hyphae" }, + }, +}) + +minetest.register_node("mcl_crimson:warped_hyphae_wood", { + description = S("Warped Hyphae Wood"), + tiles = {"warped_hyphae_wood.png"}, + groups = {handy = 5,axey = 1, flammable = 3, wood=1,building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20}, + paramtype2 = "facedir", + _mcl_hardness = 2, +}) + +mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_crimson:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab")) + +minetest.register_craft({ + output = "mcl_crimson:warped_hyphae_wood 4", + recipe = { + {"mcl_crimson:warped_hyphae"}, + }, +}) + +minetest.register_craft({ + output = "mcl_crimson:warped_nylium 2", + recipe = { + {"mcl_crimson:warped_wart_block"}, + {"mcl_nether:netherrack"}, + }, +}) + +minetest.register_abm({ + label = "mcl_crimson:warped_fungus", + nodenames = {"mcl_crimson:warped_fungus"}, + interval = 11, + chance = 128, + action = function(pos) + local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0)) + if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then + if pos.y < -28400 then + generate_warped_tree(pos) + end + end + end +}) + +minetest.register_node("mcl_crimson:crimson_fungus", { + description = S("Crimson Fungus Mushroom"), + drawtype = "plantlike", + tiles = { "farming_crimson_fungus.png" }, + inventory_image = "farming_crimson_fungus.png", + wield_image = "farming_crimson_fungus.png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1}, + light_source = 1, + selection_box = { + type = "fixed", + fixed = { -3/16, -0.5, -3/16, 3/16, -2/16, 3/16 }, + }, + node_placement_prediction = "", + on_rightclick = function(pos, node, pointed_thing, player) + if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then + local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0)) + if nodepos.name == "mcl_crimson:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then + local random = math.random(1, 5) + if random == 1 then + generate_crimson_tree(pos) + end + end + end + end, + _mcl_blast_resistance = 0, +}) + +minetest.register_node("mcl_crimson:crimson_roots", { + description = S("Crimson Roots"), + drawtype = "plantlike", + tiles = { "crimson_roots.png" }, + inventory_image = "crimson_roots.png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + buildable_to = true, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1}, + selection_box = { + type = "fixed", + fixed = { -6/16, -0.5, -6/16, 6/16, -4/16, 6/16 }, + }, + node_placement_prediction = "", + _mcl_silk_touch_drop = false, + _mcl_blast_resistance = 0, +}) + +minetest.register_node("mcl_crimson:crimson_hyphae", { + description = S("Crimson Hyphae"), + _doc_items_longdesc = S("The stem of a crimson hyphae"), + _doc_items_hidden = false, + tiles = { + "crimson_hyphae.png", + "crimson_hyphae.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + }, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + _mcl_stripped_variant = "mcl_crimson:stripped_crimson_hyphae", +}) + +--Stem bark, stripped stem and bark + +minetest.register_node("mcl_crimson:crimson_hyphae_bark", { + description = S("Crimson Hyphae Bark"), + _doc_items_longdesc = S("This is a decorative block surrounded by the bark of an hyphae."), + tiles = {"crimson_hyphae_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + _mcl_stripped_variant = "mcl_crimson:stripped_crimson_hyphae_bark", +}) + +minetest.register_craft({ + output = "mcl_crimson:crimson_hyphae_bark 3", + recipe = { + { "mcl_crimson:crimson_hyphae", "mcl_crimson:crimson_hyphae" }, + { "mcl_crimson:crimson_hyphae", "mcl_crimson:crimson_hyphae" }, + }, +}) + +minetest.register_node("mcl_crimson:stripped_crimson_hyphae", { + description = S("Stripped Crimson Hyphae"), + _doc_items_longdesc = S("The stripped stem of a crimson hyphae"), + _doc_items_hidden = false, + tiles = {"crimson_stem_stripped_top.png", "crimson_stem_stripped_top.png", "crimson_stem_stripped_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + _mcl_blast_resistance = 2, + _mcl_hardness = 2, +}) + +minetest.register_node("mcl_crimson:stripped_crimson_hyphae_bark", { + description = S("Stripped Crimson Hyphae Bark"), + _doc_items_longdesc = S("The stripped wood of a crimson hyphae"), + tiles = {"crimson_stem_stripped_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, +}) + +minetest.register_craft({ + output = "mcl_crimson:stripped_crimson_hyphae_bark 3", + recipe = { + { "mcl_crimson:stripped_crimson_hyphae", "mcl_crimson:stripped_crimson_hyphae" }, + { "mcl_crimson:stripped_crimson_hyphae", "mcl_crimson:stripped_crimson_hyphae" }, + }, +}) + +minetest.register_node("mcl_crimson:crimson_hyphae_wood", { + description = S("Crimson Hyphae Wood"), + tiles = {"crimson_hyphae_wood.png"}, + groups = {handy = 5, axey = 1, wood = 1, building_block = 1, material_wood = 1}, + paramtype2 = "facedir", + _mcl_hardness = 2, +}) + +minetest.register_node("mcl_crimson:crimson_nylium", { + description = S("Crimson Nylium"), + tiles = { + "crimson_nylium.png", + "mcl_nether_netherrack.png", + "mcl_nether_netherrack.png^crimson_nylium_side.png", + "mcl_nether_netherrack.png^crimson_nylium_side.png", + "mcl_nether_netherrack.png^crimson_nylium_side.png", + "mcl_nether_netherrack.png^crimson_nylium_side.png", + }, + groups = {pickaxey = 1, building_block = 1, material_stone = 1}, + paramtype2 = "facedir", + is_ground_content = true, + drop = "mcl_nether:netherrack", + _mcl_hardness = 0.4, + _mcl_blast_resistance = 0.4, + _mcl_silk_touch_drop = true, +}) + +minetest.register_craft({ + output = "mcl_crimson:crimson_hyphae_wood 4", + recipe = { + {"mcl_crimson:crimson_hyphae"}, + }, +}) + +minetest.register_craft({ + output = "mcl_crimson:crimson_nylium 2", + recipe = { + {"mcl_nether:nether_wart"}, + {"mcl_nether:netherrack"}, + }, +}) + +mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_crimson:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab") + +minetest.register_abm({ + label = "mcl_crimson:crimson_fungus", + nodenames = {"mcl_crimson:crimson_fungus"}, + interval = 11, + chance = 128, + action = function(pos) + local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0)) + if nodepos.name == "mcl_crimson:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then + if pos.y < -28400 then + generate_crimson_tree(pos) + end + end + end +}) diff --git a/mods/ITEMS/mcl_crimson/locale/mcl_crimson.de.tr b/mods/ITEMS/mcl_crimson/locale/mcl_crimson.de.tr new file mode 100644 index 000000000..480094dbd --- /dev/null +++ b/mods/ITEMS/mcl_crimson/locale/mcl_crimson.de.tr @@ -0,0 +1,24 @@ +# textdomain: mcl_crimson + +Warped Fungus Mushroom=Wirrpilz +Twisting Vines=Zwirbelranken +Nether Sprouts=Nethersprossen +Warped Roots=Wirrwurzeln +Warped Wart Block=Wirrwarzenblock +Shroomlight=Pilzlicht +Warped Hyphae=Wirrhyphe +Warped Nylium=Wirr-Nezel +Warped Checknode - only to check!=Wirr Checkblock - Nur zum checken! +Warped Hyphae Wood=Wirrhyphen Holz +Warped Stair=Wirrtreppe +Warped Slab=Wirrstufe +Double Warped Slab=Doppelte Wirrstufe +Crimson Fungus Mushroom=Karmesinpilz +Crimson Roots=Karmesinwurzeln +Crimson Hyphae=Karmesinhyphe +Crimson Hyphae Wood=Karmesinhyphenholz +Crimson Stair=Karmesintreppe +Crimson Slab=Karmesinstufe +Double Crimson Slab=Doppelte Karmesinstufe +Crimson Nylium=Karmesin-Nezel +Crimson Checknode - only to check!=Karmesin Checkblock - Nur zum checken! diff --git a/mods/ITEMS/mcl_crimson/locale/mcl_crimson.fr.tr b/mods/ITEMS/mcl_crimson/locale/mcl_crimson.fr.tr new file mode 100644 index 000000000..41f151617 --- /dev/null +++ b/mods/ITEMS/mcl_crimson/locale/mcl_crimson.fr.tr @@ -0,0 +1,23 @@ +# textdomain: mcl_crimson + +Warped Fungus Mushroom=Champignon tordu +Twisting Vines=Liane tordue +Nether Sprouts=Racines du nether +Warped Roots=Racines tordues +Warped Wart Block=Bloc de verrues tordu +Shroomlight=Champilampe +Warped Hyphae=Tige tordue +Warped Nylium=Nylium tordu +Warped Checknode - only to check!=Bloc de vérification tordu - seulement pour vérifier ! +Warped Hyphae Wood=Planches tordues +Warped Stair=Escalier tordu +Warped Slab=Dalle tordue +Crimson Fungus Mushroom=Champignon écarlate +Crimson Roots=Racines écarlates +Crimson Hyphae=Tige écarlate +Crimson Hyphae Wood=Planches écarlates +Crimson Stair=Escalier écarlate +Crimson Slab=Dalle écarlate +Double Crimson Slab=Dalle double écarlate +Crimson Nylium=Nylium écarlate +Crimson Checknode - only to check!=Bloc de vérification écarlate - seulement pour vérifier ! \ No newline at end of file diff --git a/mods/ITEMS/mcl_crimson/locale/template.txt b/mods/ITEMS/mcl_crimson/locale/template.txt new file mode 100644 index 000000000..386bc5160 --- /dev/null +++ b/mods/ITEMS/mcl_crimson/locale/template.txt @@ -0,0 +1,23 @@ +# textdomain: mcl_crimson + +Warped Fungus Mushroom= +Twisting Vines= +Nether Sprouts= +Warped Roots= +Warped Wart Block= +Shroomlight= +Warped Hyphae= +Warped Nylium= +Warped Checknode - only to check!= +Warped Hyphae Wood= +Warped Stair= +Warped Slab= +Crimson Fungus Mushroom= +Crimson Roots= +Crimson Hyphae= +Crimson Hyphae Wood= +Crimson Stair= +Crimson Slab= +Double Crimson Slab= +Crimson Nylium= +Crimson Checknode - only to check!= diff --git a/mods/ITEMS/mcl_crimson/mod.conf b/mods/ITEMS/mcl_crimson/mod.conf new file mode 100644 index 000000000..4dbf770c3 --- /dev/null +++ b/mods/ITEMS/mcl_crimson/mod.conf @@ -0,0 +1,4 @@ +name = mcl_crimson +author = debiankaios +depends = mcl_stairs, mobs_mc, mcl_util + diff --git a/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_1.mts b/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_1.mts new file mode 100644 index 000000000..a61712fef Binary files /dev/null and b/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_1.mts differ diff --git a/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_2.mts b/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_2.mts new file mode 100644 index 000000000..b509fae50 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_2.mts differ diff --git a/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_3.mts b/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_3.mts new file mode 100644 index 000000000..84f8fa791 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/schematics/crimson_fungus_3.mts differ diff --git a/mods/ITEMS/mcl_crimson/schematics/warped_fungus_1.mts b/mods/ITEMS/mcl_crimson/schematics/warped_fungus_1.mts new file mode 100644 index 000000000..487e39f1a Binary files /dev/null and b/mods/ITEMS/mcl_crimson/schematics/warped_fungus_1.mts differ diff --git a/mods/ITEMS/mcl_crimson/schematics/warped_fungus_2.mts b/mods/ITEMS/mcl_crimson/schematics/warped_fungus_2.mts new file mode 100644 index 000000000..564731158 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/schematics/warped_fungus_2.mts differ diff --git a/mods/ITEMS/mcl_crimson/schematics/warped_fungus_3.mts b/mods/ITEMS/mcl_crimson/schematics/warped_fungus_3.mts new file mode 100644 index 000000000..079631a20 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/schematics/warped_fungus_3.mts differ diff --git a/mods/ITEMS/mcl_crimson/textures/crimson_hyphae.png b/mods/ITEMS/mcl_crimson/textures/crimson_hyphae.png new file mode 100644 index 000000000..bf921d408 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/crimson_hyphae.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/crimson_hyphae_side.png b/mods/ITEMS/mcl_crimson/textures/crimson_hyphae_side.png new file mode 100644 index 000000000..6920c9e0d Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/crimson_hyphae_side.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/crimson_hyphae_wood.png b/mods/ITEMS/mcl_crimson/textures/crimson_hyphae_wood.png new file mode 100644 index 000000000..e1f9e70a9 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/crimson_hyphae_wood.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/crimson_nylium.png b/mods/ITEMS/mcl_crimson/textures/crimson_nylium.png new file mode 100644 index 000000000..0ba14eecb Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/crimson_nylium.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/crimson_nylium_side.png b/mods/ITEMS/mcl_crimson/textures/crimson_nylium_side.png new file mode 100644 index 000000000..22d6f872f Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/crimson_nylium_side.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/crimson_roots.png b/mods/ITEMS/mcl_crimson/textures/crimson_roots.png new file mode 100644 index 000000000..f173bfb00 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/crimson_roots.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/crimson_stem_stripped_side.png b/mods/ITEMS/mcl_crimson/textures/crimson_stem_stripped_side.png new file mode 100644 index 000000000..ad6a41a2e Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/crimson_stem_stripped_side.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/crimson_stem_stripped_top.png b/mods/ITEMS/mcl_crimson/textures/crimson_stem_stripped_top.png new file mode 100644 index 000000000..313ae0f5a Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/crimson_stem_stripped_top.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/farming_crimson_fungus.png b/mods/ITEMS/mcl_crimson/textures/farming_crimson_fungus.png new file mode 100644 index 000000000..ab1771b95 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/farming_crimson_fungus.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/farming_warped_fungus.png b/mods/ITEMS/mcl_crimson/textures/farming_warped_fungus.png new file mode 100644 index 000000000..5b465b6d1 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/farming_warped_fungus.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/nether_sprouts.png b/mods/ITEMS/mcl_crimson/textures/nether_sprouts.png new file mode 100644 index 000000000..27f686d57 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/nether_sprouts.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/nether_wart_block.png b/mods/ITEMS/mcl_crimson/textures/nether_wart_block.png new file mode 100644 index 000000000..b2d20b8d9 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/nether_wart_block.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/shroomlight.png b/mods/ITEMS/mcl_crimson/textures/shroomlight.png new file mode 100644 index 000000000..8961a5a05 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/shroomlight.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem.png b/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem.png new file mode 100644 index 000000000..3b25e2bad Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem_side.png b/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem_side.png new file mode 100644 index 000000000..ad6a41a2e Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem_side.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem_top.png b/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem_top.png new file mode 100644 index 000000000..21696b098 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/stripped_crimson_stem_top.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem.png b/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem.png new file mode 100644 index 000000000..88a7a8d33 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem_side.png b/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem_side.png new file mode 100644 index 000000000..db93c05cb Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem_side.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem_top.png b/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem_top.png new file mode 100644 index 000000000..4a8f14800 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/stripped_warped_stem_top.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/twisting_vines.png b/mods/ITEMS/mcl_crimson/textures/twisting_vines.png new file mode 100644 index 000000000..985d735bc Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/twisting_vines.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/twisting_vines_plant.png b/mods/ITEMS/mcl_crimson/textures/twisting_vines_plant.png new file mode 100644 index 000000000..3fd68c0cd Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/twisting_vines_plant.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_hyphae.png b/mods/ITEMS/mcl_crimson/textures/warped_hyphae.png new file mode 100644 index 000000000..08dacdf58 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_hyphae.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_hyphae_side.png b/mods/ITEMS/mcl_crimson/textures/warped_hyphae_side.png new file mode 100644 index 000000000..178504e31 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_hyphae_side.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_hyphae_wood.png b/mods/ITEMS/mcl_crimson/textures/warped_hyphae_wood.png new file mode 100644 index 000000000..319ce93f2 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_hyphae_wood.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_hyphae_wood_2nd.png b/mods/ITEMS/mcl_crimson/textures/warped_hyphae_wood_2nd.png new file mode 100644 index 000000000..e579559c1 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_hyphae_wood_2nd.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_nylium.png b/mods/ITEMS/mcl_crimson/textures/warped_nylium.png new file mode 100644 index 000000000..c3aedfa29 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_nylium.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_nylium_side.png b/mods/ITEMS/mcl_crimson/textures/warped_nylium_side.png new file mode 100644 index 000000000..70354cca0 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_nylium_side.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_roots.png b/mods/ITEMS/mcl_crimson/textures/warped_roots.png new file mode 100644 index 000000000..fb21ab290 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_roots.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_stem_stripped_side.png b/mods/ITEMS/mcl_crimson/textures/warped_stem_stripped_side.png new file mode 100644 index 000000000..db93c05cb Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_stem_stripped_side.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_stem_stripped_top.png b/mods/ITEMS/mcl_crimson/textures/warped_stem_stripped_top.png new file mode 100644 index 000000000..2e2c35b7c Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_stem_stripped_top.png differ diff --git a/mods/ITEMS/mcl_crimson/textures/warped_wart_block.png b/mods/ITEMS/mcl_crimson/textures/warped_wart_block.png new file mode 100644 index 000000000..7b6ae1041 Binary files /dev/null and b/mods/ITEMS/mcl_crimson/textures/warped_wart_block.png differ diff --git a/mods/ITEMS/mcl_enchanting/engine.lua b/mods/ITEMS/mcl_enchanting/engine.lua index 34fb55698..46a05abf9 100644 --- a/mods/ITEMS/mcl_enchanting/engine.lua +++ b/mods/ITEMS/mcl_enchanting/engine.lua @@ -576,6 +576,7 @@ function mcl_enchanting.handle_formspec_fields(player, formname, fields) minetest.sound_play("mcl_enchanting_enchant", {to_player = name, gain = 5.0}) mcl_enchanting.reset_table_slots(player) mcl_enchanting.show_enchanting_formspec(player) + awards.unlock(player:get_player_name(), "mcl:enchanter") end end diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index 06c6722c4..82f6e76e4 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -29,7 +29,7 @@ minetest.register_node("mcl_end:end_bricks", { groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 9, - _mcl_hardness = 0.8, + _mcl_hardness = 3, }) minetest.register_node("mcl_end:purpur_block", { diff --git a/mods/ITEMS/mcl_end/eye_of_ender.lua b/mods/ITEMS/mcl_end/eye_of_ender.lua index ea3d70aba..bc697e359 100644 --- a/mods/ITEMS/mcl_end/eye_of_ender.lua +++ b/mods/ITEMS/mcl_end/eye_of_ender.lua @@ -87,7 +87,7 @@ minetest.register_craftitem("mcl_end:ender_eye", { end local origin = user:get_pos() origin.y = origin.y + 1.5 - local strongholds = mcl_structures.get_registered_structures("stronghold") + local strongholds = mcl_structures.get_structure_data("stronghold") local dim = mcl_worlds.pos_to_dimension(origin) local is_creative = minetest.is_creative_enabled(user:get_player_name()) diff --git a/mods/ITEMS/mcl_farming/hoes.lua b/mods/ITEMS/mcl_farming/hoes.lua index d2250eb70..e023f123e 100644 --- a/mods/ITEMS/mcl_farming/hoes.lua +++ b/mods/ITEMS/mcl_farming/hoes.lua @@ -54,7 +54,8 @@ local uses = { stone = 132, iron = 251, gold = 33, - diamond = 1562, + diamond = 1562, + netherite = 2031, } local hoe_tt = S("Turns block into farmland") @@ -255,6 +256,8 @@ minetest.register_tool("mcl_farming:hoe_diamond", { _mcl_diggroups = { hoey = { speed = 8, level = 5, uses = 1562 } }, + _mcl_upgradable = true, + _mcl_upgrade_item = "mcl_farming:hoe_netherite" }) minetest.register_craft({ @@ -271,5 +274,26 @@ minetest.register_craft({ {"mcl_core:diamond", "mcl_core:diamond"}, {"mcl_core:stick", ""}, {"mcl_core:stick", ""} - } -}) + } +}) + +minetest.register_tool("mcl_farming:hoe_netherite", { + description = S("Netherite Hoe"), + _tt_help = hoe_tt.."\n"..S("Uses: @1", uses.netherite), + _doc_items_longdesc = hoe_longdesc, + _doc_items_usagehelp = hoe_usagehelp, + inventory_image = "farming_tool_netheritehoe.png", + wield_scale = mcl_vars.tool_wield_scale, + on_place = hoe_on_place_function(uses.netherite), + groups = { tool=1, hoe=1, enchantability=10 }, + tool_capabilities = { + full_punch_interval = 0.25, + damage_groups = { fleshy = 4, }, + punch_attack_uses = uses.netherite, + }, + _repair_material = "mcl_nether:netherite_ingot", + _mcl_toollike_wield = true, + _mcl_diggroups = { + hoey = { speed = 8, level = 5, uses = uses.netherite } + }, +}) diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index 04a971de8..78532c0c0 100644 --- a/mods/ITEMS/mcl_farming/potatoes.lua +++ b/mods/ITEMS/mcl_farming/potatoes.lua @@ -91,7 +91,7 @@ minetest.register_craftitem("mcl_farming:potato_item", { _doc_items_longdesc = S("Potatoes are food items which can be eaten, cooked in the furnace and planted. Pigs like potatoes."), _doc_items_usagehelp = S("Hold it in your hand and rightclick to eat it. Place it on top of farmland to plant it. It grows in sunlight and grows faster on hydrated farmland. Rightclick an animal to feed it."), inventory_image = "farming_potato.png", - groups = {food = 2, eatable = 1, compostability = 65}, + groups = {food = 2, eatable = 1, compostability = 65, smoker_cookable = 1}, _mcl_saturation = 0.6, stack_max = 64, on_secondary_use = minetest.item_eat(1), diff --git a/mods/ITEMS/mcl_farming/soil.lua b/mods/ITEMS/mcl_farming/soil.lua index 8b31d888f..a6721cc26 100644 --- a/mods/ITEMS/mcl_farming/soil.lua +++ b/mods/ITEMS/mcl_farming/soil.lua @@ -21,7 +21,7 @@ minetest.register_node("mcl_farming:soil", { end, groups = {handy=1,shovely=1, dirtifies_below_solid=1, dirtifier=1, soil=2, soil_sapling=1, deco_block=1 }, sounds = mcl_sounds.node_sound_dirt_defaults(), - _mcl_blast_resistance = 0.5, + _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6, }) diff --git a/mods/ITEMS/mcl_farming/textures/farming_tool_netheritehoe.png b/mods/ITEMS/mcl_farming/textures/farming_tool_netheritehoe.png new file mode 100644 index 000000000..f6acbbff3 Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/farming_tool_netheritehoe.png differ diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 1d8f24fb3..08c039bc3 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -75,6 +75,7 @@ local fish = function(itemstack, player, pointed_thing) stacks_min = 1, stacks_max = 1, }, pr) + awards.unlock(player:get_player_name(), "mcl:fishyBusiness") elseif r <= junk_value then -- Junk items = mcl_loot.get_loot({ @@ -110,6 +111,7 @@ local fish = function(itemstack, player, pointed_thing) { itemstring = "mcl_mobs:nametag", }, { itemstring = "mcl_mobitems:saddle", }, { itemstring = "mcl_flowers:waterlily", }, + { itemstring = "mcl_mobitems:nautilus_shell", }, }, stacks_min = 1, stacks_max = 1, @@ -124,6 +126,9 @@ local fish = function(itemstack, player, pointed_thing) local inv = player:get_inventory() if inv:room_for_item("main", item) then inv:add_item("main", item) + if item:get_name() == "mcl_mobitems:leather" then + awards.unlock(player:get_player_name(), "mcl:killCow") + end else minetest.add_item(pos, item) end @@ -511,3 +516,30 @@ minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, end end ) + +-- Fish Buckets +fish_names = { + { techname = "cod", name = "Cod" }, + { techname = "salmon", name = "Salmon" } + --{ techname = "pufferfish", name = "Pufferfish" } FIXME: Uncomment when pufferfish mobs are added. + --{ techname = "tropical_fish", name = "Tropical Fish" } FIXME: Uncomment when pufferfish mobs are added. +} + +for _, fish in pairs(fish_names) do + mcl_buckets.register_liquid({ + bucketname = "mcl_fishing:bucket_" .. fish.techname, + source_place = function(pos) + minetest.add_entity(pos, "mobs_mc:" .. fish.techname) + return "mcl_core:water_source" + end, + source_take = {"mobs_mc:" .. fish.techname}, + inventory_image = fish.techname .. "_bucket.png", + name = S("Bucket of @1", S(fish.name)), + longdesc = S("This bucket is filled with water and @1.", S(fish.name)), + usagehelp = S("Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 fish with a bucket of water.", S(fish.name), S(fish.name)), + tt_help = S("Places a water source and a @1 fish.", S(fish.name)), + extra_check = function(pos, placer) + return true, true + end, + }) +end diff --git a/mods/ITEMS/mcl_fishing/locale/template.txt b/mods/ITEMS/mcl_fishing/locale/template.txt index a1544666b..32e3d8740 100644 --- a/mods/ITEMS/mcl_fishing/locale/template.txt +++ b/mods/ITEMS/mcl_fishing/locale/template.txt @@ -16,3 +16,9 @@ Pufferfish= Pufferfish are a common species of fish and can be obtained by fishing. They can technically be eaten, but they are very bad for humans. Eating a pufferfish only restores 1 hunger point and will poison you very badly (which drains your health non-fatally) and causes serious food poisoning (which increases your hunger).= Catches fish in water= Very poisonous= +Cod= +Salmon= +Bucket of @1= +This bucket is filled with water and @1.= +Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 fish with a bucket of water.= +Places a water source and a @1 fish.= \ No newline at end of file diff --git a/mods/ITEMS/mcl_fishing/mod.conf b/mods/ITEMS/mcl_fishing/mod.conf index c4e5f5f2e..71bde6146 100644 --- a/mods/ITEMS/mcl_fishing/mod.conf +++ b/mods/ITEMS/mcl_fishing/mod.conf @@ -1,3 +1,3 @@ name = mcl_fishing description = Adds fish and fishing poles to go fishing. -depends = mcl_core, mcl_sounds, mcl_loot, mcl_mobs, mcl_enchanting, mcl_throwing, mcl_colors +depends = mcl_core, mcl_sounds, mcl_loot, mcl_mobs, mcl_enchanting, mcl_throwing, mcl_colors, mcl_buckets diff --git a/mods/ITEMS/mcl_fishing/textures/cod_bucket.png b/mods/ITEMS/mcl_fishing/textures/cod_bucket.png new file mode 100644 index 000000000..582207cb0 Binary files /dev/null and b/mods/ITEMS/mcl_fishing/textures/cod_bucket.png differ diff --git a/mods/ITEMS/mcl_fishing/textures/pufferfish_bucket.png b/mods/ITEMS/mcl_fishing/textures/pufferfish_bucket.png new file mode 100644 index 000000000..2c88bac35 Binary files /dev/null and b/mods/ITEMS/mcl_fishing/textures/pufferfish_bucket.png differ diff --git a/mods/ITEMS/mcl_fishing/textures/salmon_bucket.png b/mods/ITEMS/mcl_fishing/textures/salmon_bucket.png new file mode 100644 index 000000000..b9ac22fd9 Binary files /dev/null and b/mods/ITEMS/mcl_fishing/textures/salmon_bucket.png differ diff --git a/mods/ITEMS/mcl_fishing/textures/tropical_fish_bucket.png b/mods/ITEMS/mcl_fishing/textures/tropical_fish_bucket.png new file mode 100644 index 000000000..edf7dd244 Binary files /dev/null and b/mods/ITEMS/mcl_fishing/textures/tropical_fish_bucket.png differ diff --git a/mods/ITEMS/mcl_fletching_table/README.md b/mods/ITEMS/mcl_fletching_table/README.md index af0b88185..a30e2c1b4 100644 --- a/mods/ITEMS/mcl_fletching_table/README.md +++ b/mods/ITEMS/mcl_fletching_table/README.md @@ -10,4 +10,10 @@ LGPLv2.1 License of media ---------------- -See the main MineClone 2 README.md file. \ No newline at end of file + +fletching_table_bottom.png +fletching_table_front.png +fletching_table_side.png +fletching_table_top.png +License: CC BY-SA 4.0 +Author: MrRar diff --git a/mods/ITEMS/mcl_fletching_table/init.lua b/mods/ITEMS/mcl_fletching_table/init.lua index 88763b218..686a1dc2c 100644 --- a/mods/ITEMS/mcl_fletching_table/init.lua +++ b/mods/ITEMS/mcl_fletching_table/init.lua @@ -5,12 +5,14 @@ minetest.register_node("mcl_fletching_table:fletching_table", { _tt_help = S("A fletching table"), _doc_items_longdesc = S("This is the fletcher villager's work station. It currently has no use beyond decoration."), tiles = { - "fletching_table_top.png", "fletching_table_top.png", - "fletching_table_side.png", "fletching_table_side.png", - "fletching_table_front.png", "fletching_table_front.png" + "fletching_table_top.png", "fletching_table_bottom.png", + "fletching_table_front.png", "fletching_table_front.png", + "fletching_table_side.png", "fletching_table_side.png" }, paramtype2 = "facedir", - groups = {choppy=1, deco_block=1, material_wood=1, flammable=1} + groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 }, + _mcl_blast_resistance = 2.5, + _mcl_hardness = 2.5 }) minetest.register_craft({ diff --git a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_bottom.png b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_bottom.png new file mode 100644 index 000000000..5c1289766 Binary files /dev/null and b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_bottom.png differ diff --git a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_front.png b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_front.png index da2eb3519..091389e26 100644 Binary files a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_front.png and b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_front.png differ diff --git a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_side.png b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_side.png index c79454afe..33ff2842f 100644 Binary files a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_side.png and b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_side.png differ diff --git a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_top.png b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_top.png index 0ecead696..e6088e7d2 100644 Binary files a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_top.png and b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_top.png differ diff --git a/mods/ITEMS/mcl_grindstone/init.lua b/mods/ITEMS/mcl_grindstone/init.lua new file mode 100644 index 000000000..f373070cd --- /dev/null +++ b/mods/ITEMS/mcl_grindstone/init.lua @@ -0,0 +1,39 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +minetest.register_node("mcl_grindstone:grindstone", { + description = S("Grindstone"), + _tt_help = S("Used to disenchant/fix tools"), + _doc_items_longdesc = S("This is currently a decorative block which serves as the weapon smith's work station. In minecraft this is used to disenchant/fix tools howerver this has not yet been implemented"), + tiles = { + "grindstone_top.png", + "grindstone_top.png", + "grindstone_side.png", + "grindstone_side.png", + "grindstone_front.png", + "grindstone_front.png" + }, + drawtype = "nodebox", + paramtype2 = "facedir", + node_box = { + type = "fixed", + -- created with nodebox editor + fixed = { + {-0.25, -0.25, -0.375, 0.25, 0.5, 0.375}, + {-0.375, -0.0625, -0.1875, -0.25, 0.3125, 0.1875}, + {0.25, -0.0625, -0.1875, 0.375, 0.3125, 0.1875}, + {0.25, -0.5, -0.125, 0.375, -0.0625, 0.125}, + {-0.375, -0.5, -0.125, -0.25, -0.0625, 0.125}, + } + }, + groups = {pickaxey = 1, deco_block = 1}, + _mcl_blast_resistance = 6, + _mcl_hardness = 2 +}) + +minetest.register_craft({ + output = "mcl_grindstone:grindstone", + recipe = { + { "mcl_core:stick", "mcl_stairs:slab_stone_rough", "mcl_core:stick"}, + { "group:wood", "", "group:wood"}, + } +}) \ No newline at end of file diff --git a/mods/ITEMS/mcl_grindstone/mod.conf b/mods/ITEMS/mcl_grindstone/mod.conf new file mode 100644 index 000000000..154de013f --- /dev/null +++ b/mods/ITEMS/mcl_grindstone/mod.conf @@ -0,0 +1,3 @@ +name = mcl_grindstone +author = TheRandomLegoBrick +description = Adds a cool looking block for the weaponsmiths jobsite \ No newline at end of file diff --git a/mods/ITEMS/mcl_grindstone/textures/grindstone_front.png b/mods/ITEMS/mcl_grindstone/textures/grindstone_front.png new file mode 100644 index 000000000..ec72b0470 Binary files /dev/null and b/mods/ITEMS/mcl_grindstone/textures/grindstone_front.png differ diff --git a/mods/ITEMS/mcl_grindstone/textures/grindstone_side.png b/mods/ITEMS/mcl_grindstone/textures/grindstone_side.png new file mode 100644 index 000000000..ec28f3014 Binary files /dev/null and b/mods/ITEMS/mcl_grindstone/textures/grindstone_side.png differ diff --git a/mods/ITEMS/mcl_grindstone/textures/grindstone_top.png b/mods/ITEMS/mcl_grindstone/textures/grindstone_top.png new file mode 100644 index 000000000..1096deba6 Binary files /dev/null and b/mods/ITEMS/mcl_grindstone/textures/grindstone_top.png differ diff --git a/mods/ITEMS/mcl_itemframes/init.lua b/mods/ITEMS/mcl_itemframes/init.lua index 364bffee6..eac5b066b 100644 --- a/mods/ITEMS/mcl_itemframes/init.lua +++ b/mods/ITEMS/mcl_itemframes/init.lua @@ -64,7 +64,10 @@ minetest.register_entity("mcl_itemframes:map", { }, on_activate = function(self, staticdata) self.id = staticdata - self.object:set_properties({textures = {mcl_maps.load_map(self.id)}}) + mcl_maps.load_map(self.id, function(texture) + -- will not crash even if self.object is invalid by now + self.object:set_properties({textures = {texture}}) + end) end, get_staticdata = function(self) return self.id diff --git a/mods/ITEMS/mcl_lanterns/register.lua b/mods/ITEMS/mcl_lanterns/register.lua index efdd1ed98..86305052b 100644 --- a/mods/ITEMS/mcl_lanterns/register.lua +++ b/mods/ITEMS/mcl_lanterns/register.lua @@ -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"}, }, -}) \ No newline at end of file +}) + +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"}, + }, +}) diff --git a/mods/ITEMS/mcl_loom/README.md b/mods/ITEMS/mcl_loom/README.md index 08ee0dea3..e91bad8fd 100644 --- a/mods/ITEMS/mcl_loom/README.md +++ b/mods/ITEMS/mcl_loom/README.md @@ -10,4 +10,10 @@ LGPLv2.1 License of media ---------------- -See the main MineClone 2 README.md file. \ No newline at end of file + +loom_bottom.png +loom_front.png +loom_side.png +loom_top.png +License: CC BY-SA 4.0 +Author: MrRar diff --git a/mods/ITEMS/mcl_loom/init.lua b/mods/ITEMS/mcl_loom/init.lua index 6126a5d39..19be8d58b 100644 --- a/mods/ITEMS/mcl_loom/init.lua +++ b/mods/ITEMS/mcl_loom/init.lua @@ -8,11 +8,13 @@ minetest.register_node("mcl_loom:loom", { tiles = { "loom_top.png", "loom_bottom.png", "loom_side.png", "loom_side.png", - "loom_front.png", "loom_front.png" + "loom_side.png", "loom_front.png" }, paramtype2 = "facedir", - groups = {choppy=1, deco_block=1, material_wood=1, flammable=1} - }) + groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 }, + _mcl_blast_resistance = 2.5, + _mcl_hardness = 2.5 +}) minetest.register_craft({ diff --git a/mods/ITEMS/mcl_loom/textures/loom_bottom.png b/mods/ITEMS/mcl_loom/textures/loom_bottom.png index 835d36fca..bf4e7c0c5 100644 Binary files a/mods/ITEMS/mcl_loom/textures/loom_bottom.png and b/mods/ITEMS/mcl_loom/textures/loom_bottom.png differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_bottom1.png b/mods/ITEMS/mcl_loom/textures/loom_bottom1.png deleted file mode 100644 index f5dfe8189..000000000 Binary files a/mods/ITEMS/mcl_loom/textures/loom_bottom1.png and /dev/null differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_front.png b/mods/ITEMS/mcl_loom/textures/loom_front.png index ba1aebc80..83191e649 100644 Binary files a/mods/ITEMS/mcl_loom/textures/loom_front.png and b/mods/ITEMS/mcl_loom/textures/loom_front.png differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_front1.png b/mods/ITEMS/mcl_loom/textures/loom_front1.png deleted file mode 100644 index 411e51891..000000000 Binary files a/mods/ITEMS/mcl_loom/textures/loom_front1.png and /dev/null differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_side.png b/mods/ITEMS/mcl_loom/textures/loom_side.png index bbeaeb6d8..3e64107c7 100644 Binary files a/mods/ITEMS/mcl_loom/textures/loom_side.png and b/mods/ITEMS/mcl_loom/textures/loom_side.png differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_side1.png b/mods/ITEMS/mcl_loom/textures/loom_side1.png deleted file mode 100644 index baf1aed5d..000000000 Binary files a/mods/ITEMS/mcl_loom/textures/loom_side1.png and /dev/null differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_top.png b/mods/ITEMS/mcl_loom/textures/loom_top.png index af980f3c1..cf0c1e3eb 100644 Binary files a/mods/ITEMS/mcl_loom/textures/loom_top.png and b/mods/ITEMS/mcl_loom/textures/loom_top.png differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_top1.png b/mods/ITEMS/mcl_loom/textures/loom_top1.png deleted file mode 100644 index febcb864d..000000000 Binary files a/mods/ITEMS/mcl_loom/textures/loom_top1.png and /dev/null differ diff --git a/mods/ITEMS/mcl_maps/init.lua b/mods/ITEMS/mcl_maps/init.lua index 450d8fbad..fb13625d5 100644 --- a/mods/ITEMS/mcl_maps/init.lua +++ b/mods/ITEMS/mcl_maps/init.lua @@ -139,7 +139,7 @@ function mcl_maps.create_map(pos) return itemstack end -function mcl_maps.load_map(id) +function mcl_maps.load_map(id, callback) if id == "" or creating_maps[id] then return end @@ -152,16 +152,19 @@ function mcl_maps.load_map(id) -- Minetest 5.3 and 5.4 until media loads loaded_maps[id] = true dynamic_add_media(map_textures_path .. texture, function() end) + if callback then callback(texture) end else -- minetest.dynamic_add_media() never blocks -- in Minetest 5.5, callback runs after load dynamic_add_media(map_textures_path .. texture, function() loaded_maps[id] = true + if callback then callback(texture) end end) end end if loaded_maps[id] then + if callback then callback(texture) end return texture end end diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index 6b3c9bec4..2f3bd3c01 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -327,6 +327,24 @@ minetest.register_tool("mcl_mobitems:carrot_on_a_stick", { _mcl_toollike_wield = true, }) +minetest.register_craftitem("mcl_mobitems:nautilus_shell", { + description = S("Nautilus Shell"), + _tt_help = S("Used to craft a conduit"), + _doc_items_longdesc = S("The Nautilus Shell is used to craft a conduit. They can be obtained by fishing or killing a drowned that is wielding a shell."), + inventory_image = "mcl_mobitems_nautilus_shell.png", + groups = { craftitem=1 }, + stack_max = 64, +}) + +minetest.register_craftitem("mcl_mobitems:heart_of_the_sea", { + description = S("Heart of the Sea"), + _tt_help = S("Used to craft a conduit"), + _doc_items_longdesc = S("The Heart of the Sea is used to craft a conduit. They can be obtained by finding them in a buried treasure chest."), + inventory_image = "mcl_mobitems_heart_of_the_sea.png", + groups = { craftitem=1 }, + stack_max = 64, +}) + local horse_armor_use = S("Place it on a horse to put on the horse armor. Donkeys and mules can't wear horse armor.") minetest.register_craftitem("mcl_mobitems:iron_horse_armor", { diff --git a/mods/ITEMS/mcl_mobitems/locale/template.txt b/mods/ITEMS/mcl_mobitems/locale/template.txt index a3066dd1b..690ae3fac 100644 --- a/mods/ITEMS/mcl_mobitems/locale/template.txt +++ b/mods/ITEMS/mcl_mobitems/locale/template.txt @@ -93,6 +93,12 @@ A carrot on a stick can be used on saddled pigs to ride them.= Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.= +Nautilus Shell= +Used to craft a conduit= +The Nautilus Shell is used to craft a conduit. They can be obtained by fishing or killing a drowned that is wielding a shell.= +Heart of the Sea= +The Heart of the Sea is used to craft a conduit. They can be obtained by finding them in a buried treasure chest.= + Iron Horse Armor= Iron horse armor can be worn by horses to increase their protection from harm a bit.= Golden Horse Armor= diff --git a/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_heart_of_the_sea.png b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_heart_of_the_sea.png new file mode 100644 index 000000000..b55893963 Binary files /dev/null and b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_heart_of_the_sea.png differ diff --git a/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_heart_of_the_sea_split.png b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_heart_of_the_sea_split.png new file mode 100644 index 000000000..4f6affbf1 Binary files /dev/null and b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_heart_of_the_sea_split.png differ diff --git a/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_nautilus_shell.png b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_nautilus_shell.png new file mode 100644 index 000000000..aa415508d Binary files /dev/null and b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_nautilus_shell.png differ diff --git a/mods/ITEMS/mcl_mud/README.txt b/mods/ITEMS/mcl_mud/README.txt new file mode 100644 index 000000000..fe0a3f91c --- /dev/null +++ b/mods/ITEMS/mcl_mud/README.txt @@ -0,0 +1,21 @@ +License of Code +---------------- + +Author: TheRandomLegoBrick +License: GPLv3 +See https://www.gnu.org/licenses/gpl-3.0.en.html for further information + + +License of Media (textures & sounds) +------------------------------------- + +Author: TheRandomLegoBrick +Liscense: CC0 1.0 Universal (CC0 1.0) +Files: + mud_footsteps.ogg + mud_place_dug.ogg + mcl_mud_bricks.png + mcl_mud_packed_mud.png + mcl_mud.png + +See https://creativecommons.org/publicdomain/zero/1.0/legalcode for further information \ No newline at end of file diff --git a/mods/ITEMS/mcl_mud/init.lua b/mods/ITEMS/mcl_mud/init.lua new file mode 100644 index 000000000..64ff36c09 --- /dev/null +++ b/mods/ITEMS/mcl_mud/init.lua @@ -0,0 +1,65 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +minetest.register_node("mcl_mud:mud", { + description = S("Mud"), + _doc_items_longdesc = S("Mud is a decorative block that generates in mangrove swamps. Mud can also be obtained by using water bottles on dirt or coarse dirt."), + _doc_items_hidden = false, + tiles = {"mcl_mud.png"}, + is_ground_content = true, + sounds = { + footstep = {name="mud_footsteps", gain=1}, + dug = {name="mud_place_dug", gain=1}, + place = {name="mud_place_dug", gain=1}, + }, + groups = {handy=1, shovely=1, enderman_takable=1, grass_block=1, soil_sugarcane=1, building_block=1}, + _mcl_blast_resistance = 0.5, + _mcl_hardness = 0.5, + collision_box = { + type = "fixed", + fixed = { + {-8 / 16, -8 / 16, -8 / 16, 8 / 16, 6 / 16, 8 / 16}, + }, + }, +}) + +minetest.register_node("mcl_mud:packed_mud", { + description = S("Packed Mud"), + _doc_items_longdesc = S("Packed mud is a decorative block used to craft mud bricks."), + _doc_items_hidden = false, + tiles = {"mcl_mud_packed_mud.png"}, + groups = {handy=1, pickaxey=1, building_block=1}, + sounds = mcl_sounds.node_sound_dirt_defaults(), + _mcl_blast_resistance = 3, + _mcl_hardness = 1, +}) + +minetest.register_node("mcl_mud:mud_bricks", { + description = S("Mud Bricks"), + _doc_items_longdesc = S("Decorative block crafted from packed mud."), + _doc_items_hidden = false, + tiles = {"mcl_mud_bricks.png"}, + groups = {handy=1, pickaxey=1, building_block=1}, + sounds = mcl_sounds.node_sound_stone_defaults(), + _mcl_blast_resistance = 3, + _mcl_hardness = 1.5, +}) + +-- packed mud +minetest.register_craft({ + type = "shapeless", + output = "mcl_mud:packed_mud", + recipe = { + "mcl_mud:mud", + "mcl_farming:wheat_item", + } +}) + +-- mud bricks +minetest.register_craft({ + type = "shaped", + output = "mcl_mud:mud_bricks 4", + recipe = { + {"mcl_mud:packed_mud", "mcl_mud:packed_mud"}, + {"mcl_mud:packed_mud", "mcl_mud:packed_mud"} + } +}) \ No newline at end of file diff --git a/mods/ITEMS/mcl_mud/mod.conf b/mods/ITEMS/mcl_mud/mod.conf new file mode 100644 index 000000000..70f48ef1e --- /dev/null +++ b/mods/ITEMS/mcl_mud/mod.conf @@ -0,0 +1,4 @@ +name = mcl_mud +author = TheRandomLegoBrick +description = Adds various mud blocks. +depends = mcl_sounds \ No newline at end of file diff --git a/mods/ITEMS/mcl_mud/sounds/mud_footsteps.ogg b/mods/ITEMS/mcl_mud/sounds/mud_footsteps.ogg new file mode 100644 index 000000000..e18c93965 Binary files /dev/null and b/mods/ITEMS/mcl_mud/sounds/mud_footsteps.ogg differ diff --git a/mods/ITEMS/mcl_mud/sounds/mud_place_dug.ogg b/mods/ITEMS/mcl_mud/sounds/mud_place_dug.ogg new file mode 100644 index 000000000..5a93ca14a Binary files /dev/null and b/mods/ITEMS/mcl_mud/sounds/mud_place_dug.ogg differ diff --git a/mods/ITEMS/mcl_mud/textures/mcl_mud.png b/mods/ITEMS/mcl_mud/textures/mcl_mud.png new file mode 100644 index 000000000..629831124 Binary files /dev/null and b/mods/ITEMS/mcl_mud/textures/mcl_mud.png differ diff --git a/mods/ITEMS/mcl_mud/textures/mcl_mud_bricks.png b/mods/ITEMS/mcl_mud/textures/mcl_mud_bricks.png new file mode 100644 index 000000000..c102118e7 Binary files /dev/null and b/mods/ITEMS/mcl_mud/textures/mcl_mud_bricks.png differ diff --git a/mods/ITEMS/mcl_mud/textures/mcl_mud_packed_mud.png b/mods/ITEMS/mcl_mud/textures/mcl_mud_packed_mud.png new file mode 100644 index 000000000..5e335e97e Binary files /dev/null and b/mods/ITEMS/mcl_mud/textures/mcl_mud_packed_mud.png differ diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 2d8def90d..f4a241cee 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -51,6 +51,35 @@ minetest.register_node("mcl_nether:quartz_ore", { _mcl_fortune_drop = mcl_core.fortune_drop_ore }) +minetest.register_node("mcl_nether:ancient_debris", { + description = S("Ancient Debris"), + _doc_items_longdesc = S("Ancient debris can be found in the nether and is very very rare."), + stack_max = 64, + tiles = {"mcl_nether_ancient_debris_top.png", "mcl_nether_ancient_debris_side.png"}, + is_ground_content = true, + groups = {pickaxey=4, building_block=1, material_stone=1, xp=0}, + drop = "mcl_nether:ancient_debris", + sounds = mcl_sounds.node_sound_stone_defaults(), + _mcl_blast_resistance = 1200, + _mcl_hardness = 30, + _mcl_silk_touch_drop = true +}) + +minetest.register_node("mcl_nether:netheriteblock", { + description = S("Netherite Block"), + _doc_items_longdesc = S("Netherite block is very hard and can be made of 9 netherite ingots."), + stack_max = 64, + tiles = {"mcl_nether_netheriteblock.png"}, + is_ground_content = true, + groups = {pickaxey=4, building_block=1, material_stone=1, xp = 0}, + drop = "mcl_nether:netheriteblock", + sounds = mcl_sounds.node_sound_stone_defaults(), + _mcl_blast_resistance = 1200, + _mcl_hardness = 50, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore +}) + -- For eternal fire on top of netherrack and magma blocks -- (this code does not require a dependency on mcl_fire) local function eternal_after_destruct(pos, oldnode) @@ -251,6 +280,22 @@ minetest.register_craftitem("mcl_nether:quartz", { groups = { craftitem = 1 }, }) +minetest.register_craftitem("mcl_nether:netherite_scrap", { + description = S("Netherite Scrap"), + _doc_items_longdesc = S("Netherite scrap is a crafting ingredient for netherite ingots."), + inventory_image = "mcl_nether_netherite_scrap.png", + stack_max = 64, + groups = { craftitem = 1 }, +}) + +minetest.register_craftitem("mcl_nether:netherite_ingot", { + description = S("Netherite Ingot"), + _doc_items_longdesc = S("Netherite ingots can be used with a smithing table to upgrade items to netherite."), + inventory_image = "mcl_nether_netherite_ingot.png", + stack_max = 64, + groups = { craftitem = 1 }, +}) + minetest.register_craftitem("mcl_nether:netherbrick", { description = S("Nether Brick"), _doc_items_longdesc = S("Nether bricks are the main crafting ingredient for crafting nether brick blocks and nether fences."), @@ -266,6 +311,13 @@ minetest.register_craft({ cooktime = 10, }) +minetest.register_craft({ + type = "cooking", + output = "mcl_nether:netherite_scrap", + recipe = "mcl_nether:ancient_debris", + cooktime = 10, +}) + minetest.register_craft({ output = "mcl_nether:quartz_block", recipe = { @@ -337,5 +389,32 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "mcl_nether:netherite_ingot", + recipe = { + {"mcl_nether:netherite_scrap", "mcl_nether:netherite_scrap", "mcl_nether:netherite_scrap"}, + {"mcl_nether:netherite_scrap", "mcl_core:gold_ingot", "mcl_core:gold_ingot"}, + {"mcl_core:gold_ingot", "mcl_core:gold_ingot", ""}, + } +}) + +minetest.register_craft({ + output = "mcl_nether:netheriteblock", + recipe = { + {"mcl_nether:netherite_ingot", "mcl_nether:netherite_ingot", "mcl_nether:netherite_ingot"}, + {"mcl_nether:netherite_ingot", "mcl_nether:netherite_ingot", "mcl_nether:netherite_ingot"}, + {"mcl_nether:netherite_ingot", "mcl_nether:netherite_ingot", "mcl_nether:netherite_ingot"} + } +}) + +minetest.register_craft({ + output = "mcl_nether:netherite_ingot 9", + recipe = { + {"mcl_nether:netheriteblock", "", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + dofile(minetest.get_modpath(minetest.get_current_modname()).."/nether_wart.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/lava.lua") diff --git a/mods/ITEMS/mcl_nether/textures/mcl_nether_ancient_debris_side.png b/mods/ITEMS/mcl_nether/textures/mcl_nether_ancient_debris_side.png new file mode 100644 index 000000000..989160402 Binary files /dev/null and b/mods/ITEMS/mcl_nether/textures/mcl_nether_ancient_debris_side.png differ diff --git a/mods/ITEMS/mcl_nether/textures/mcl_nether_ancient_debris_top.png b/mods/ITEMS/mcl_nether/textures/mcl_nether_ancient_debris_top.png new file mode 100644 index 000000000..ba68f658a Binary files /dev/null and b/mods/ITEMS/mcl_nether/textures/mcl_nether_ancient_debris_top.png differ diff --git a/mods/ITEMS/mcl_nether/textures/mcl_nether_netherite_ingot.png b/mods/ITEMS/mcl_nether/textures/mcl_nether_netherite_ingot.png new file mode 100644 index 000000000..113961198 Binary files /dev/null and b/mods/ITEMS/mcl_nether/textures/mcl_nether_netherite_ingot.png differ diff --git a/mods/ITEMS/mcl_nether/textures/mcl_nether_netherite_scrap.png b/mods/ITEMS/mcl_nether/textures/mcl_nether_netherite_scrap.png new file mode 100644 index 000000000..c93b6e1af Binary files /dev/null and b/mods/ITEMS/mcl_nether/textures/mcl_nether_netherite_scrap.png differ diff --git a/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png b/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png new file mode 100644 index 000000000..302ead2a0 Binary files /dev/null and b/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png differ diff --git a/mods/ITEMS/mcl_ocean/kelp.lua b/mods/ITEMS/mcl_ocean/kelp.lua index ae273abe9..5cddabd30 100644 --- a/mods/ITEMS/mcl_ocean/kelp.lua +++ b/mods/ITEMS/mcl_ocean/kelp.lua @@ -782,7 +782,7 @@ minetest.register_node("mcl_ocean:dried_kelp_block", { on_place = mcl_util.rotate_axis, on_rotate = on_rotate, _mcl_hardness = 0.5, - _mcl_blast_resistance = 12.5, + _mcl_blast_resistance = 2.5, }) minetest.register_craft({ diff --git a/mods/ITEMS/mcl_ocean/prismarine.lua b/mods/ITEMS/mcl_ocean/prismarine.lua index e38b3e0a6..32d17538d 100644 --- a/mods/ITEMS/mcl_ocean/prismarine.lua +++ b/mods/ITEMS/mcl_ocean/prismarine.lua @@ -40,7 +40,7 @@ minetest.register_node("mcl_ocean:prismarine", { tiles = {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 1.5, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index e4982c39b..8fa22e4fb 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -99,7 +99,7 @@ minetest.register_node("mcl_portals:portal_end", { groups = {portal=1, not_in_creative_inventory = 1, disable_jump = 1}, _mcl_hardness = -1, - _mcl_blast_resistance = 36000000, + _mcl_blast_resistance = 3600000, }) -- Obsidian platform at the End portal destination in the End @@ -241,7 +241,7 @@ function mcl_portals.end_portal_teleport(pos, node) end mcl_portals.end_teleport(obj, objpos) - + awards.unlock(obj:get_player_name(), "mcl:enterEndPortal") end end end diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 0d93e11d1..1dd34d007 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -427,6 +427,9 @@ local function finalize_teleport(obj, exit) mcl_worlds.dimension_change(obj, dim) minetest.sound_play("mcl_portals_teleport", {pos=exit, gain=0.5, max_hear_distance = 16}, true) log("action", "[mcl_portals] player "..name.." teleported to Nether portal at "..pos_to_string(exit)..".") + if dim == "nether" then + awards.unlock(obj:get_player_name(), "mcl:theNether") + end else log("action", "[mcl_portals] entity teleported to Nether portal at "..pos_to_string(exit)..".") end diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 5b9f1fab3..2ea7e2879 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -176,6 +176,76 @@ local fill_cauldron = function(cauldron, water_type) end end +-- function to set node and empty water bottle (used for cauldrons and mud) +local function set_node_empty_bottle(itemstack, placer, pointed_thing, newitemstring) + local pname = placer:get_player_name() + if minetest.is_protected(pointed_thing.under, pname) then + minetest.record_protection_violation(pointed_thing.under, pname) + return itemstack + end + + -- set the node to `itemstring` + minetest.set_node(pointed_thing.under, {name=newitemstring}) + + -- play sound + minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) + + -- + if minetest.is_creative_enabled(placer:get_player_name()) then + return itemstack + else + return "mcl_potions:glass_bottle" + end +end + +-- used for water bottles and river water bottles +local function dispense_water_bottle(stack, pos, droppos) + local node = minetest.get_node(droppos) + if node.name == "mcl_core:dirt" or node.name == "mcl_core:coarse_dirt" then + -- convert dirt/coarse dirt to mud + minetest.set_node(droppos, {name = "mcl_mud:mud"}) + minetest.sound_play("mcl_potions_bottle_pour", {pos=droppos, gain=0.5, max_hear_range=16}, true) + return ItemStack("mcl_potions:glass_bottle") + + elseif node.name == "mcl_mud:mud" then + -- dont dispense into mud + return stack + end +end + +-- on_place function for `mcl_potions:water` and `mcl_potions:river_water` + +local function water_bottle_on_place(itemstack, placer, pointed_thing) + if pointed_thing.type == "node" then + local node = minetest.get_node(pointed_thing.under) + local def = minetest.registered_nodes[node.name] + + -- Call on_rightclick if the pointed node defines it + if placer and not placer:get_player_control().sneak then + if def and def.on_rightclick then + return def.on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack + end + end + + local cauldron = nil + if itemstack:get_name() == "mcl_potions:water" then -- regular water + cauldron = fill_cauldron(node.name, "mcl_core:water_source") + elseif itemstack:get_name() == "mcl_potions:river_water" then -- river water + cauldron = fill_cauldron(node.name, "mclx_core:river_water_source") + end + + + if cauldron then + set_node_empty_bottle(itemstack, placer, pointed_thing, cauldron) + elseif node.name == "mcl_core:dirt" or node.name == "mcl_core:coarse_dirt" then + set_node_empty_bottle(itemstack, placer, pointed_thing, "mcl_mud:mud") + end + end + + -- Drink the water by default + return minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, placer, pointed_thing) +end + -- Itemstring of potions is “mcl_potions:” minetest.register_craftitem("mcl_potions:water", { @@ -187,39 +257,9 @@ minetest.register_craftitem("mcl_potions:water", { inventory_image = potion_image("#0022FF"), wield_image = potion_image("#0022FF"), groups = {brewitem=1, food=3, can_eat_when_full=1, water_bottle=1}, - on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type == "node" then - local node = minetest.get_node(pointed_thing.under) - local def = minetest.registered_nodes[node.name] - - -- Call on_rightclick if the pointed node defines it - if placer and not placer:get_player_control().sneak then - if def and def.on_rightclick then - return def.on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack - end - end - - local cauldron = fill_cauldron(node.name, "mcl_core:water_source") - if cauldron then - local pname = placer:get_player_name() - if minetest.is_protected(pointed_thing.under, pname) then - minetest.record_protection_violation(pointed_thing.under, pname) - return itemstack - end - -- Increase water level of cauldron by 1 - minetest.set_node(pointed_thing.under, {name=cauldron}) - minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) - if minetest.is_creative_enabled(placer:get_player_name()) then - return itemstack - else - return "mcl_potions:glass_bottle" - end - end - end - - -- Drink the water by default - return minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, placer, pointed_thing) - end, + on_place = water_bottle_on_place, + _on_dispense = dispense_water_bottle, + _dispense_into_walkable = true, on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), }) @@ -234,39 +274,9 @@ minetest.register_craftitem("mcl_potions:river_water", { inventory_image = potion_image("#0044FF"), wield_image = potion_image("#0044FF"), groups = {brewitem=1, food=3, can_eat_when_full=1, water_bottle=1}, - on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type == "node" then - local node = minetest.get_node(pointed_thing.under) - local def = minetest.registered_nodes[node.name] - - -- Call on_rightclick if the pointed node defines it - if placer and not placer:get_player_control().sneak then - if def and def.on_rightclick then - return def.on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack - end - end - - local cauldron = fill_cauldron(node.name, "mclx_core:river_water_source") - if cauldron then - local pname = placer:get_player_name() - if minetest.is_protected(pointed_thing.under, pname) then - minetest.record_protection_violation(pointed_thing.under, pname) - return itemstack - end - -- Increase water level of cauldron by 1 - minetest.set_node(pointed_thing.under, {name=cauldron}) - minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) - if minetest.is_creative_enabled(placer:get_player_name()) then - return itemstack - else - return "mcl_potions:glass_bottle" - end - end - end - - -- Drink the water by default - return minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, placer, pointed_thing) - end, + on_place = water_bottle_on_place, + _on_dispense = dispense_water_bottle, + _dispense_into_walkable = true, on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), }) diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index e6da04dff..53a37705e 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -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 "" @@ -210,29 +211,34 @@ function mcl_potions.register_arrow(name, desc, color, def) end -- Iterate through all objects and remember the closest attackable object - for k, obj in pairs(objs) do - local ok = false - -- Arrows can only damage players and mobs - if obj ~= self._shooter and obj:is_player() then - ok = true - elseif obj:get_luaentity() then - if obj ~= self._shooter and obj:get_luaentity().is_mob then + local arrow_dir = self.object:get_velocity() + --create a raycast from the arrow based on the velocity of the arrow to deal with lag + local raycast = minetest.raycast(pos, vector.add(pos, vector.multiply(arrow_dir, 0.1)), true, false) + for hitpoint in raycast do + 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() and enable_pvp then ok = true + 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 end - end - - if ok then - local dist = vector.distance(pos, obj:get_pos()) - if not closest_object or not closest_distance then - closest_object = obj - closest_distance = dist - elseif dist < closest_distance then - closest_object = obj - closest_distance = dist + if ok then + local dist = vector.distance(hitpoint.ref:get_pos(), pos) + if not closest_object or not closest_distance then + closest_object = hitpoint.ref + closest_distance = dist + elseif dist < closest_distance then + closest_object = hitpoint.ref + closest_distance = dist + end end end end + -- If an attackable object was found, we will damage the closest one only if closest_object then local obj = closest_object @@ -278,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 diff --git a/mods/ITEMS/mcl_shields/init.lua b/mods/ITEMS/mcl_shields/init.lua index 038ffc0f3..0ba02c1bb 100644 --- a/mods/ITEMS/mcl_shields/init.lua +++ b/mods/ITEMS/mcl_shields/init.lua @@ -275,9 +275,16 @@ local function handle_blocking(player) player_shield.blocking = 2 end elseif shield_in_offhand then - local offhand_can_block = (wielded_item(player) == "" or not mcl_util.get_pointed_thing(player, true)) + local pointed_thing = mcl_util.get_pointed_thing(player, true) + local offhand_can_block = (wielded_item(player) == "" or not pointed_thing) and (minetest.get_item_group(wielded_item(player), "bow") ~= 1 and minetest.get_item_group(wielded_item(player), "crossbow") ~= 1) + if pointed_thing and pointed_thing.type == "node" then + if minetest.get_item_group(minetest.get_node(pointed_thing.under).name, "container") > 1 then + return + end + end + if not offhand_can_block then return end diff --git a/mods/ITEMS/mcl_smithing_table/init.lua b/mods/ITEMS/mcl_smithing_table/init.lua new file mode 100644 index 000000000..f32cb8c28 --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/init.lua @@ -0,0 +1,149 @@ +--[[ +By EliasFleckenstein03 and Code-Sploit +]] + +local S = minetest.get_translator("mcl_smithing_table") +mcl_smithing_table = {} + +-- Function to upgrade diamond tool/armor to netherite tool/armor +function mcl_smithing_table.upgrade_item(itemstack) + itemstack = ItemStack(itemstack) -- Copy the stack + + local def = itemstack:get_definition() + + if not def or not def._mcl_upgradable then + return + end + + local itemname = itemstack:get_name() + + local upgrade_item = def._mcl_upgrade_item or itemname:gsub("diamond", "netherite") + + if upgrade_item == itemname then + return + end + + itemstack:set_name(upgrade_item) + + -- Reload the ToolTips of the tool + + tt.reload_itemstack_description(itemstack) + + -- Only return itemstack if upgrade was successfull + return itemstack +end + +-- Badly copied over from mcl_anvils +-- ToDo: Make better formspec + +local formspec = "size[9,9]" .. + "background[-0.19,-0.25;9.41,9.49;mcl_smithing_table_inventory.png]".. + "label[0,4.0;" .. minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))) .. "]" .. + "list[current_player;main;0,4.5;9,3;9]" .. + mcl_formspec.get_itemslot_bg(0,4.5,9,3) .. + "list[current_player;main;0,7.74;9,1;]" .. + mcl_formspec.get_itemslot_bg(0,7.74,9,1) .. + "list[context;diamond_item;1,2.5;1,1;]" .. + mcl_formspec.get_itemslot_bg(1,2.5,1,1) .. + "list[context;netherite;4,2.5;1,1;]" .. + mcl_formspec.get_itemslot_bg(4,2.5,1,1) .. + "list[context;upgraded_item;8,2.5;1,1;]" .. + mcl_formspec.get_itemslot_bg(8,2.5,1,1) .. + "label[3,0.1;" .. minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Upgrade Gear"))) .. "]" .. + "listring[context;output]".. + "listring[current_player;main]".. + "listring[context;input]".. + "listring[current_player;main]" + +local function reset_upgraded_item(pos) + local inv = minetest.get_meta(pos):get_inventory() + local upgraded_item + + if inv:get_stack("netherite", 1):get_name() == "mcl_nether:netherite_ingot" then + upgraded_item = mcl_smithing_table.upgrade_item(inv:get_stack("diamond_item", 1)) + end + + inv:set_stack("upgraded_item", 1, upgraded_item) +end + +minetest.register_node("mcl_smithing_table:table", { + description = S("Smithing table"), + -- ToDo: Add _doc_items_longdesc and _doc_items_usagehelp + + stack_max = 64, + groups = {pickaxey = 2, deco_block = 1}, + + tiles = { + "mcl_smithing_table_top.png", + "mcl_smithing_table_bottom.png", + "mcl_smithing_table_side.png", + "mcl_smithing_table_side.png", + "mcl_smithing_table_side.png", + "mcl_smithing_table_front.png", + }, + + sounds = mcl_sounds.node_sound_metal_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", formspec) + + local inv = meta:get_inventory() + + inv:set_size("diamond_item", 1) + inv:set_size("netherite", 1) + inv:set_size("upgraded_item", 1) + end, + + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + if listname == "diamond_item" and mcl_smithing_table.upgrade_item(stack) or listname == "netherite" and stack:get_name() == "mcl_nether:netherite_ingot" then + return stack:get_count() + end + + return 0 + end, + + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + return 0 + end, + + on_metadata_inventory_put = reset_upgraded_item, + + on_metadata_inventory_take = function(pos, listname, index, stack, player) + local inv = minetest.get_meta(pos):get_inventory() + + local function take_item(listname) + local itemstack = inv:get_stack(listname, 1) + itemstack:take_item() + inv:set_stack(listname, 1, itemstack) + end + + if listname == "upgraded_item" then + take_item("diamond_item") + take_item("netherite") + + -- ToDo: make epic sound + minetest.sound_play("mcl_smithing_table_upgrade", {pos = pos, max_hear_distance = 16}) + end + if listname == "upgraded_item" then + if stack:get_name() == "mcl_farming:hoe_netherite" then + awards.unlock(player:get_player_name(), "mcl:seriousDedication") + end + end + + reset_upgraded_item(pos) + end, + + _mcl_blast_resistance = 2.5, + _mcl_hardness = 2.5 +}) + + +minetest.register_craft({ + output = "mcl_smithing_table:table", + recipe = { + {"mcl_core:iron_ingot", "mcl_core:iron_ingot", ""}, + {"group:wood", "group:wood", ""}, + {"group:wood", "group:wood", ""} + } +}) diff --git a/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.de.tr b/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.de.tr new file mode 100644 index 000000000..9e7d88337 --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.de.tr @@ -0,0 +1,16 @@ +# textdomain: mcl_anvils +Set Name=Name setzen +Repair and Name=Reparieren und benennen +Inventory=Inventar +Anvil=Amboss +The anvil allows you to repair tools and armor, and to give names to items. It has a limited durability, however. Don't let it fall on your head, it could be quite painful!=Der Amboss ermöglicht es, Werkzeuge und Rüstung zu reparieren und Gegenstände zu benennen. Er hat jedoch eine begrenzte Lebensdauer. Lassen Sie ihn nicht auf Ihren Kopf fallen, das könnte ziemlich schmerzhaft sein! +To use an anvil, rightclick it. An anvil has 2 input slots (on the left) and one output slot.=Um einen Amboss zu benutzen, rechtsklicken Sie auf ihn. Ein Amboss hat 2 Eingabeplätze (links) und einen Ausgabeplatz (rechts). +To rename items, put an item stack in one of the item slots while keeping the other input slot empty. Type in a name, hit enter or “Set Name”, then take the renamed item from the output slot.=Um Gegenstände umzubenennen, platzieren Sie einen Gegenstand in einen der Eingangsplätze und lassen Sie den anderen frei. Geben Sie einen Namen ein und drücken Sie die Eingabetaste oder „Name setzen”, dann nehmen Sie den umbenannten Gegenstand an sich. +There are two possibilities to repair tools (and armor):=Es gibt zwei Möglichkeiten, Werkzeuge (und Rüstung) zu reparieren: +• Tool + Tool: Place two tools of the same type in the input slots. The “health” of the repaired tool is the sum of the “health” of both input tools, plus a 12% bonus.=• Werkzeug + Werkzeug: Platzieren sie zwei gleiche Werkzeuge in die Eingangsplätze. Der Zustand des reparierten Werkzeugs ist die Summe des Zustands beider Eingangswerkzeuge, plus einem Bonus von 12%. +• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.=• Werkzeug + Material: Einige Werkzeuge können auch repariert werden, indem man sie mit einem Gegenstand, aus dem sie gemacht worden sind, kombiniert. Zum Beispiel können Eisenspitzhacken mit Eisenbarren repariert werden. Dadurch wird das Werkzeug um 25% repariert. +Armor counts as a tool. It is possible to repair and rename a tool in a single step.=Rüstung zählt als Werkzeug. Es ist möglich, ein Werkzeug in einem Arbeitsschritt zu reparieren und zu benennen. +The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.=Der Amboss hat begrenze Lebensdauer und 3 Schadensstufen: Kein Schaden, leicht beschädigt, und stark beschädigt. Jedes mal, wenn Sie etwas reparieren oder umbenennen, gibt es eine 12%-ige Chance, dass der Amboss Schaden nimmt. Ambosse können auch beschädigt werden, wenn sie um mehr als 1 Block fallen. Wenn ein sehr beschädigter Amboss erneut beschädigt wird, wird er zerstört. +Slightly Damaged Anvil=Leicht beschädigter Amboss +Very Damaged Anvil=Stark beschädigter Amboss +Repair and rename items=Für die Reparatur und Umbenennung von Gegenständen diff --git a/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.es.tr b/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.es.tr new file mode 100644 index 000000000..7212b92ba --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.es.tr @@ -0,0 +1,15 @@ +# textdomain: mcl_anvils +Set Name=Establece un nombre +Repair and Name=Reparar y nombrar +Inventory=Inventario +Anvil=Yunque +The anvil allows you to repair tools and armor, and to give names to items. It has a limited durability, however. Don't let it fall on your head, it could be quite painful!=El yunque le permite reparar herramientas y armaduras, y dar nombres a los elementos. Sin embargo, tiene una durabilidad limitada. No lo dejes caer sobre tu cabeza, ¡podría ser bastante doloroso! +To use an anvil, rightclick it. An anvil has 2 input slots (on the left) and one output slot.=Para usar un yunque, haga clic derecho sobre él. Un yunque tiene 2 ranuras de entrada (a la izquierda) y una ranura de salida. +To rename items, put an item stack in one of the item slots while keeping the other input slot empty. Type in a name, hit enter or “Set Name”, then take the renamed item from the output slot.=Para cambiar el nombre de los elementos, coloque una pila de elementos en una de las ranuras de elementos mientras mantiene vacía la otra ranura de entrada. Escriba un nombre, presione enter o "Establecer nombre", luego obtenga el elemento renombrado en la ranura de salida. +There are two possibilities to repair tools (and armor):=Hay dos posibilidades para reparar herramientas (y armaduras): +• Tool + Tool: Place two tools of the same type in the input slots. The “health” of the repaired tool is the sum of the “health” of both input tools, plus a 12% bonus.=• Herramienta + Herramienta: Coloque dos herramientas del mismo tipo en las ranuras de entrada. La "salud" de la herramienta reparada es la suma de la "salud" de ambas herramientas, con un bono del 12%. +• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.=• Herramienta + Material: Algunas herramientas también pueden repararse combinándolas con un elemento del que está hecho. Por ejemplo, los picos de hierro pueden repararse con lingotes de hierro. Esto repara la herramienta en un 25%. +Armor counts as a tool. It is possible to repair and rename a tool in a single step.=La armadura cuenta como una herramienta. Es posible reparar y cambiar el nombre de una herramienta en un solo paso. +The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.=El yunque tiene una durabilidad limitada y 3 niveles de daño: sin daños, ligeramente dañado y muy dañado. Cada vez que reparas o cambias el nombre de algo, hay un 12% de posibilidades de que el yunque se dañe. Los yunques también tienen la posibilidad de dañarse cuando caen en más de 1 bloque. Si un yunque muy dañado se daña nuevamente, se destruye. +Slightly Damaged Anvil=Yunque dañado +Very Damaged Anvil=Yunque muy dañado diff --git a/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.fr.tr b/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.fr.tr new file mode 100644 index 000000000..1f03de8e5 --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.fr.tr @@ -0,0 +1,16 @@ +# textdomain: mcl_anvils +Set Name=Définir le Nom +Repair and Name=Réparation et Nomme +Inventory=Inventaire +Anvil=Enclume +The anvil allows you to repair tools and armor, and to give names to items. It has a limited durability, however. Don't let it fall on your head, it could be quite painful!=L'enclume vous permet de réparer des outils et des armures, et de donner des noms à des objets. Il a cependant une durabilité limitée. Ne la laissez pas tomber sur la tête, cela pourrait être assez douloureux! +To use an anvil, rightclick it. An anvil has 2 input slots (on the left) and one output slot.=Pour utiliser une enclume, faites un clic droit dessus. Une enclume a 2 emplacements d'entrée (à gauche) et un emplacement de sortie. +To rename items, put an item stack in one of the item slots while keeping the other input slot empty. Type in a name, hit enter or “Set Name”, then take the renamed item from the output slot.=Pour renommer des objets, placez une pile d'objets dans l'un des emplacements d'objets tout en laissant l'autre emplacement d'entrée vide. Tapez un nom, appuyez sur Entrée ou sur «Définir le nom», puis prenez l'élément renommé dans l'emplacement de sortie. +There are two possibilities to repair tools (and armor):=Il existe deux possibilités pour réparer les outils (et les armures): +• Tool + Tool: Place two tools of the same type in the input slots. The “health” of the repaired tool is the sum of the “health” of both input tools, plus a 12% bonus.=• Outil + Outil: Placez deux outils du même type dans les emplacements d'entrée. La "santé" de l'outil réparé est la somme de la "santé" des deux outils d'entrée, plus un bonus de 12%. +• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.=• Outil + Matériel: Certains outils peuvent également être réparés en les combinant avec un élément dont il est fait. Par exemple, les pioches de fer peuvent être réparées avec des lingots de fer. Cela répare l'outil de 25%. +Armor counts as a tool. It is possible to repair and rename a tool in a single step.=L'armure compte comme un outil. Il est possible de réparer et de renommer un outil en une seule étape. +The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.=L'enclume a une durabilité limitée et 3 niveaux de dommages: en bon état, légèrement endommagé et très endommagé. Chaque fois que vous réparez ou renommez quelque chose, il y a 12% de chances que l'enclume soit endommagée. Les enclumes ont également une chance d'être endommagées lorsqu'elles tombent de plus d'un bloc. Si une enclume très endommagée est à nouveau endommagée, elle est détruite. +Slightly Damaged Anvil=Enclume Légèrement Endommagée +Very Damaged Anvil=Enclume Très Endommagée +Repair and rename items=Réparer et renommer des objets diff --git a/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.ru.tr b/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.ru.tr new file mode 100644 index 000000000..20281bd6b --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/locale/mcl_anvils.ru.tr @@ -0,0 +1,16 @@ +# textdomain: mcl_anvils +Set Name=Дать имя +Repair and Name=Починить и дать имя +Inventory=Инвентарь +Anvil=Наковальня +The anvil allows you to repair tools and armor, and to give names to items. It has a limited durability, however. Don't let it fall on your head, it could be quite painful!=Наковальня позволяет ремонтировать инструменты и защиту, а также давать имена предметам. Но она имеет ограниченный срок службы. Не дайте ей упасть вам на голову, это может быть больно! +To use an anvil, rightclick it. An anvil has 2 input slots (on the left) and one output slot.=Чтобы воспользоваться наковальней, кликните по ней правой кнопкой. Наковальня имеет два входных отсека (слева) и один выходной. +To rename items, put an item stack in one of the item slots while keeping the other input slot empty. Type in a name, hit enter or “Set Name”, then take the renamed item from the output slot.=Для переименования положите стопку предметов в один отсек, второй оставьте пустым. Наберите имя, нажмите [Enter] или “Дать имя” и заберите переименованные предметы из выходного отсека. +There are two possibilities to repair tools (and armor):=Есть два способа отремонтировать инструменты (и защиту): +• Tool + Tool: Place two tools of the same type in the input slots. The “health” of the repaired tool is the sum of the “health” of both input tools, plus a 12% bonus.=• Инструмент + Инструмент: Положите два инструмента одного типа во входные отсеки. “Здоровье” отремонтированного инструмента будет равно сумме “здоровья” каждого из них, плюс 12% бонус. +• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.=• Инструмент + Материал: Некоторые инструменты можно также ремонтировать, добавляя к ним предмет, из которого они сделаны. Например, железные кирки ремонтируются добавлением слитков железа. Таким способом инструмент восстанавливается на 25%. +Armor counts as a tool. It is possible to repair and rename a tool in a single step.=Защиты считается за инструмент. Можно ремонтировать и переименовывать за одно действие. +The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.=Наковальня имеет ограниченный срок службы и 3 уровня износа: новая, немного изношенная, сильно повреждённая. Каждый раз, ремонтируя или переименовывая что-либо, вы имеете 12-процентный шанс повредить наковальню. Наковальни также могут повреждаться, когда они падают с высоте более 1 блока. Если повреждённая наковальня повреждается снова, то она уничтожается. +Slightly Damaged Anvil=Немного изношенная наковальня +Very Damaged Anvil=Сильно повреждённая наковальня +Repair and rename items=Ремонтирует и переименовывает предметы diff --git a/mods/ITEMS/mcl_smithing_table/locale/template.txt b/mods/ITEMS/mcl_smithing_table/locale/template.txt new file mode 100644 index 000000000..ebc741c00 --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/locale/template.txt @@ -0,0 +1,16 @@ +# textdomain: mcl_anvils +Set Name= +Repair and Name= +Inventory= +Anvil= +The anvil allows you to repair tools and armor, and to give names to items. It has a limited durability, however. Don't let it fall on your head, it could be quite painful!= +To use an anvil, rightclick it. An anvil has 2 input slots (on the left) and one output slot.= +To rename items, put an item stack in one of the item slots while keeping the other input slot empty. Type in a name, hit enter or “Set Name”, then take the renamed item from the output slot.= +There are two possibilities to repair tools (and armor):= +• Tool + Tool: Place two tools of the same type in the input slots. The “health” of the repaired tool is the sum of the “health” of both input tools, plus a 12% bonus.= +• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.= +Armor counts as a tool. It is possible to repair and rename a tool in a single step.= +The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.= +Slightly Damaged Anvil= +Very Damaged Anvil= +Repair and rename items= diff --git a/mods/ITEMS/mcl_smithing_table/mod.conf b/mods/ITEMS/mcl_smithing_table/mod.conf new file mode 100644 index 000000000..aee93fa65 --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/mod.conf @@ -0,0 +1,2 @@ +name = mcl_smithing_table +depends = mcl_colors, mcl_formspec diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_bottom.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_bottom.png new file mode 100644 index 000000000..66a1a9a7a Binary files /dev/null and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_bottom.png differ diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_front.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_front.png new file mode 100644 index 000000000..15c0a943f Binary files /dev/null and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_front.png differ diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_inventory.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_inventory.png new file mode 100644 index 000000000..fdbb706d1 Binary files /dev/null and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_inventory.png differ diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_side.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_side.png new file mode 100644 index 000000000..37458771d Binary files /dev/null and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_side.png differ diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_top.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_top.png new file mode 100644 index 000000000..2ec0468c7 Binary files /dev/null and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_top.png differ diff --git a/mods/ITEMS/mcl_smoker/init.lua b/mods/ITEMS/mcl_smoker/init.lua index e45a2712c..696df4917 100644 --- a/mods/ITEMS/mcl_smoker/init.lua +++ b/mods/ITEMS/mcl_smoker/init.lua @@ -288,7 +288,8 @@ local function smoker_node_timer(pos, elapsed) -- Cooking -- - local el = elapsed_game_time + -- Run the smoker at twice the speed of a furnace. + local el = elapsed_game_time * 2 -- Check if we have cookable content: cookable local aftercooked @@ -329,13 +330,12 @@ local function smoker_node_timer(pos, elapsed) elseif active then el = math.min(el, fuel_totaltime - fuel_time) -- The furnace is currently active and has enough fuel - fuel_time = ( fuel_time + el ) * 2 + fuel_time = fuel_time + el end -- If there is a cookable item then check if it is ready yet if cookable and active then - -- In the src_time variable, the *2 is the multiplication that makes the smoker work faster than a normal furnace. - src_time = (src_time + el)*2 + src_time = src_time + el -- Place result in dst list if done if src_time >= cooked.time then inv:add_item("dst", cooked.item) diff --git a/mods/ITEMS/mcl_spyglass/init.lua b/mods/ITEMS/mcl_spyglass/init.lua new file mode 100644 index 000000000..fa1a82339 --- /dev/null +++ b/mods/ITEMS/mcl_spyglass/init.lua @@ -0,0 +1,73 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +minetest.register_tool("mcl_spyglass:spyglass",{ + description = S("Spyglass"), + _doc_items_longdesc = S("A spyglass is an item that can be used for zooming in on specific locations."), + inventory_image = "mcl_spyglass.png", + stack_max = 1, + _mcl_toollike_wield = true, +}) + +minetest.register_craft({ + output = "mcl_spyglass:spyglass", + recipe = { + {"mcl_amethyst:amethyst_shard"}, + {"mcl_copper:copper_ingot"}, + {"mcl_copper:copper_ingot"}, + } +}) + +local spyglass_scope = {} + +local function add_scope(player) + local wielditem = player:get_wielded_item() + if wielditem:get_name() == "mcl_spyglass:spyglass" then + spyglass_scope[player] = player:hud_add({ + hud_elem_type = "image", + position = {x = 0.5, y = 0.5}, + scale = {x = -100, y = -100}, + text = "mcl_spyglass_scope.png", + }) + player:hud_set_flags({wielditem = false}) + end +end + +local function remove_scope(player) + if spyglass_scope[player] then + player:hud_remove(spyglass_scope[player]) + spyglass_scope[player] = nil + player:hud_set_flags({wielditem = true}) + player:set_fov(86.1) + end +end + +controls.register_on_press(function(player, key) + if key ~= "RMB" then return end + add_scope(player) +end) + +controls.register_on_release(function(player, key, time) + if key ~= "RMB" then return end + remove_scope(player) +end) + +controls.register_on_hold(function(player, key, time) + if key ~= "RMB" then return end + local wielditem = player:get_wielded_item() + if wielditem:get_name() == "mcl_spyglass:spyglass" then + player:set_fov(8, false, 0.1) + if spyglass_scope[player] == nil then + add_scope(player) + end + else + remove_scope(player) + end +end) + +minetest.register_on_dieplayer(function(player) + remove_scope(player) +end) + +minetest.register_on_leaveplayer(function(player) + spyglass_scope[player] = nil +end) diff --git a/mods/ITEMS/mcl_spyglass/locale/mcl_spyglass.ru.tr b/mods/ITEMS/mcl_spyglass/locale/mcl_spyglass.ru.tr new file mode 100644 index 000000000..32b7fa96a --- /dev/null +++ b/mods/ITEMS/mcl_spyglass/locale/mcl_spyglass.ru.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_spyglass +Spyglass=Подзорная труба +A spyglass is an item that can be used for zooming in on specific locations.=Подзорная труба это предмет который позволяет смотреть вдаль. \ No newline at end of file diff --git a/mods/ITEMS/mcl_spyglass/locale/template.txt b/mods/ITEMS/mcl_spyglass/locale/template.txt new file mode 100644 index 000000000..606b46455 --- /dev/null +++ b/mods/ITEMS/mcl_spyglass/locale/template.txt @@ -0,0 +1,3 @@ +# textdomain: mcl_spyglass +Spyglass= +A spyglass is an item that can be used for zooming in on specific locations.= diff --git a/mods/ITEMS/mcl_spyglass/mod.conf b/mods/ITEMS/mcl_spyglass/mod.conf new file mode 100644 index 000000000..c13b281e1 --- /dev/null +++ b/mods/ITEMS/mcl_spyglass/mod.conf @@ -0,0 +1,4 @@ +name = mcl_spyglass +author = NO11 +description = This mod adds a spyglass, which is an item that can be used for zooming in on specific locations. +depends = mcl_core, controls diff --git a/mods/ITEMS/mcl_spyglass/textures/mcl_spyglass.png b/mods/ITEMS/mcl_spyglass/textures/mcl_spyglass.png new file mode 100644 index 000000000..cc5eb4d96 Binary files /dev/null and b/mods/ITEMS/mcl_spyglass/textures/mcl_spyglass.png differ diff --git a/mods/ITEMS/mcl_spyglass/textures/mcl_spyglass_scope.png b/mods/ITEMS/mcl_spyglass/textures/mcl_spyglass_scope.png new file mode 100644 index 000000000..041a88feb Binary files /dev/null and b/mods/ITEMS/mcl_spyglass/textures/mcl_spyglass_scope.png differ diff --git a/mods/ITEMS/mcl_stairs/mod.conf b/mods/ITEMS/mcl_stairs/mod.conf index a357c2c79..2fb3180b2 100644 --- a/mods/ITEMS/mcl_stairs/mod.conf +++ b/mods/ITEMS/mcl_stairs/mod.conf @@ -1,2 +1,2 @@ name = mcl_stairs -depends = mcl_core, mcl_sounds, mcl_nether, mcl_end, mcl_ocean +depends = mcl_core, mcl_sounds, mcl_nether, mcl_end, mcl_ocean, mcl_mud diff --git a/mods/ITEMS/mcl_stairs/register.lua b/mods/ITEMS/mcl_stairs/register.lua index 5de380585..eee4c5dc2 100644 --- a/mods/ITEMS/mcl_stairs/register.lua +++ b/mods/ITEMS/mcl_stairs/register.lua @@ -138,6 +138,8 @@ mcl_stairs.register_slab("purpur_block", "group:purpur_block", mcl_stairs.register_stair_and_slab_simple("prismarine", "mcl_ocean:prismarine", S("Prismarine Stairs"), S("Prismarine Slab"), S("Double Prismarine Slab")) +mcl_stairs.register_stair_and_slab_simple("mud_brick", "mcl_mud:mud_bricks", S("Mud Brick Stair"), S("Mud Brick Slab"), S("Double Mud Brick Slab")) + mcl_stairs.register_stair_and_slab_simple("prismarine_brick", "mcl_ocean:prismarine_brick", S("Prismarine Brick Stairs"), S("Prismarine Brick Slab"), S("Double Prismarine Brick Slab")) mcl_stairs.register_stair_and_slab_simple("prismarine_dark", "mcl_ocean:prismarine_dark", S("Dark Prismarine Stairs"), S("Dark Prismarine Slab"), S("Double Dark Prismarine Slab")) diff --git a/mods/ITEMS/mcl_stonecutter/README.md b/mods/ITEMS/mcl_stonecutter/README.md new file mode 100644 index 000000000..c6316a5a2 --- /dev/null +++ b/mods/ITEMS/mcl_stonecutter/README.md @@ -0,0 +1,17 @@ +mcl_stonecutter +=============== +Adds the stonecutter block. Used to cut stone like materials into stairs, slabs, etc. Also used as the Stone Mason Villager's jobsite. + +License of code +--------------- +See the main MineClone 2 README.md file. +Author: PrairieWind + +License of media +---------------- +mcl_stonecutter_bottom.png +mcl_stonecutter_side.png +mcl_stonecutter_top.png +mcl_stonecutter_saw.png +License: CC0 1.0 Universal (CC0 1.0) +Author: RandomLegoBrick diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua new file mode 100644 index 000000000..145bc7703 --- /dev/null +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -0,0 +1,57 @@ +--||||||||||||||||||||||| +--||||| STONECUTTER ||||| +--||||||||||||||||||||||| + +-- TO-DO: +-- * Add GUI + +local S = minetest.get_translator(minetest.get_current_modname()) + +minetest.register_node("mcl_stonecutter:stonecutter", { + description = S("Stone Cutter"), + _tt_help = S("Used to cut stone like materials."), + _doc_items_longdesc = S("Stonecutters are used to create stairs and slabs from stone like materials. It is also the jobsite for the Stone Mason Villager."), + tiles = { + "mcl_stonecutter_top.png", + "mcl_stonecutter_bottom.png", + "mcl_stonecutter_side.png", + "mcl_stonecutter_side.png", + {name="mcl_stonecutter_saw.png", + animation={ + type="vertical_frames", + aspect_w=16, + aspect_h=16, + length=1 + }}, + {name="mcl_stonecutter_saw.png", + animation={ + type="vertical_frames", + aspect_w=16, + aspect_h=16, + length=1 + }} + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = { pickaxey=1, material_stone=1 }, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5}, -- NodeBox1 + {-0.4375, 0.0625, 0, 0.4375, 0.5, 0}, -- NodeBox2 + } + }, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + sounds = mcl_sounds.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "mcl_stonecutter:stonecutter", + recipe = { + { "", "", "" }, + { "", "mcl_core:iron_ingot", "" }, + { "mcl_core:stone", "mcl_core:stone", "mcl_core:stone" }, + } +}) diff --git a/mods/ITEMS/mcl_stonecutter/locale/template.txt b/mods/ITEMS/mcl_stonecutter/locale/template.txt new file mode 100644 index 000000000..840503ec4 --- /dev/null +++ b/mods/ITEMS/mcl_stonecutter/locale/template.txt @@ -0,0 +1,3 @@ +Stone Cutter= +Used to cut stone like materials.= +Stonecutters are used to create stairs and slabs from stone like materials. It is also the jobsite for the Stone Mason Villager.= diff --git a/mods/ITEMS/mcl_stonecutter/mod.conf b/mods/ITEMS/mcl_stonecutter/mod.conf new file mode 100644 index 000000000..d9781e474 --- /dev/null +++ b/mods/ITEMS/mcl_stonecutter/mod.conf @@ -0,0 +1,4 @@ +name = mcl_stonecutter +author = PrairieWind +description = This mod adds a stonecutter, which is used to cut stone like materials, and used as the jobsite for the Stone Mason Villager. +depends = mcl_sounds diff --git a/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_bottom.png b/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_bottom.png new file mode 100644 index 000000000..7467d42be Binary files /dev/null and b/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_bottom.png differ diff --git a/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_saw.png b/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_saw.png new file mode 100644 index 000000000..0f2bc3dfc Binary files /dev/null and b/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_saw.png differ diff --git a/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_side.png b/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_side.png new file mode 100644 index 000000000..d97f84bae Binary files /dev/null and b/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_side.png differ diff --git a/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_top.png b/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_top.png new file mode 100644 index 000000000..0b63cb112 Binary files /dev/null and b/mods/ITEMS/mcl_stonecutter/textures/mcl_stonecutter_top.png differ diff --git a/mods/ITEMS/mcl_sus_stew/LICENSE b/mods/ITEMS/mcl_sus_stew/LICENSE new file mode 100644 index 000000000..d41c0bd98 --- /dev/null +++ b/mods/ITEMS/mcl_sus_stew/LICENSE @@ -0,0 +1,232 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff --git a/mods/ITEMS/mcl_sus_stew/Note b/mods/ITEMS/mcl_sus_stew/Note new file mode 100644 index 000000000..cbf07b1f8 --- /dev/null +++ b/mods/ITEMS/mcl_sus_stew/Note @@ -0,0 +1 @@ +The texture for the suspicious stew is from the Minecraft resourcepack "Pixel Perfection Legacy" (https://www.curseforge.com/minecraft/texture-packs/pixel-perfection-legacy), wich is licensed under CC BY-SA 4.0 (Creative Commons license)! \ No newline at end of file diff --git a/mods/ITEMS/mcl_sus_stew/README.md b/mods/ITEMS/mcl_sus_stew/README.md new file mode 100644 index 000000000..374d80b92 --- /dev/null +++ b/mods/ITEMS/mcl_sus_stew/README.md @@ -0,0 +1,3 @@ +# mcl_sus_stew + +This Mod adds Suspicious Stews for Mineclone \ No newline at end of file diff --git a/mods/ITEMS/mcl_sus_stew/init.lua b/mods/ITEMS/mcl_sus_stew/init.lua new file mode 100644 index 000000000..37fb5265f --- /dev/null +++ b/mods/ITEMS/mcl_sus_stew/init.lua @@ -0,0 +1,130 @@ + +-- ____________________________ +--_________________________________________/ Variables & Functions \_________ + +local eat = minetest.item_eat(6, "mcl_core:bowl") --6 hunger points, player receives mcl_core:bowl after eating + +local flower_effect = { + [ "mcl_flowers:tulip_white" ] = "poison", + [ "mcl_flowers:blue_orchid" ] = "hunger", + [ "mcl_flowers:dandelion" ] = "hunger", + [ "mcl_flowers:peony" ] = "jump", + [ "mcl_flowers:oxeye_daisy" ] = "regeneration", + [ "mcl_flowers:poppy" ] = "night_vision" +} + +local effects = { + [ "poison" ] = function(itemstack, placer, pointed_thing) + mcl_potions.poison_func(placer, 1, 12) + return eat(itemstack, placer, pointed_thing) + end, + + [ "hunger" ] = function(itemstack, placer, pointed_thing, player) + mcl_hunger.item_eat(6, "mcl_core:bowl", 3.5, 0, 100) + return eat(itemstack, placer, pointed_thing) + end, + + ["jump"] = function(itemstack, placer, pointed_thing) + mcl_potions.leaping_func(placer, 1, 6) + return eat(itemstack, placer, pointed_thing) + end, + + ["regeneration"] = function(itemstack, placer, pointed_thing) + mcl_potions.regeneration_func(placer, 1, 8) + return eat(itemstack, placer, pointed_thing) + end, + + ["night_vision"] = function(itemstack, placer, pointed_thing) + mcl_potions.night_vision_func(placer, 1, 5) + return eat(itemstack, placer, pointed_thing) + end, +} +local function get_random_effect() + local keys = {} + for k in pairs(effects) do + table.insert(keys, k) + end + return effects[keys[math.random(#keys)]] +end + +local function eat_stew(itemstack, placer, pointed_thing) + local e = itemstack:get_meta():get_string("effect") + local f = effects[e] + if not f then + f = get_random_effect() + end + if f(itemstack,placer,pointed_thing) then + return "mcl_core:bowl" + end +end + +minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) + if itemstack:get_name() ~= "mcl_sus_stew:stew" then return end + for f,e in pairs(flower_effect) do + for _,it in pairs(old_craft_grid) do + if it:get_name() == f then + itemstack:get_meta():set_string("effect",e) + return itemstack + end + end + end +end) + +-- ________________________ +--_________________________________________/ Item Regestration \_________________ +minetest.register_craftitem("mcl_sus_stew:stew",{ + description = "Suspicious Stew", + inventory_image = "sus_stew.png", + stack_max = 1, + on_place = eat_stew, + groups = { food = 2, eatable = 4, can_eat_when_full = 1, not_in_creative_inventory=1,}, + _mcl_saturation = 7.2, +}) + +mcl_hunger.register_food("mcl_sus_stew:stew",6, "mcl_core:bowl") + +--compat with old (mcl5) sus_stew +minetest.register_alias("mcl_sus_stew:poison_stew", "mcl_sus_stew:stew") +minetest.register_alias("mcl_sus_stew:hunger_stew", "mcl_sus_stew:stew") +minetest.register_alias("mcl_sus_stew:jump_boost_stew", "mcl_sus_stew:stew") +minetest.register_alias("mcl_sus_stew:regneration_stew", "mcl_sus_stew:stew") +minetest.register_alias("mcl_sus_stew:night_vision_stew", "mcl_sus_stew:stew") + +-- ______________ +--_________________________________________/ Crafts \________________________________ + +minetest.register_craft({ + type = "shapeless", + output = "mcl_sus_stew:stew", + recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:tulip_white"}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "mcl_sus_stew:stew", + recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:blue_orchid"}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "mcl_sus_stew:stew", + recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:dandelion"} , +}) + +minetest.register_craft({ + type = "shapeless", + output = "mcl_sus_stew:stew", + recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:peony"}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "mcl_sus_stew:stew", + recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:oxeye_daisy"}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "mcl_sus_stew:stew", + recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:poppy"}, +}) diff --git a/mods/ITEMS/mcl_sus_stew/mod.conf b/mods/ITEMS/mcl_sus_stew/mod.conf new file mode 100644 index 000000000..9e28bd300 --- /dev/null +++ b/mods/ITEMS/mcl_sus_stew/mod.conf @@ -0,0 +1,3 @@ +name = mcl_sus_stew +author = chmodsayshello +depends = mcl_core, mcl_mushrooms, mcl_flowers, mcl_potions, mcl_hunger diff --git a/mods/ITEMS/mcl_sus_stew/textures/sus_stew.png b/mods/ITEMS/mcl_sus_stew/textures/sus_stew.png new file mode 100644 index 000000000..3580c35aa Binary files /dev/null and b/mods/ITEMS/mcl_sus_stew/textures/sus_stew.png differ diff --git a/mods/ITEMS/mcl_throwing/register.lua b/mods/ITEMS/mcl_throwing/register.lua index 413bc9d5f..53af28652 100644 --- a/mods/ITEMS/mcl_throwing/register.lua +++ b/mods/ITEMS/mcl_throwing/register.lua @@ -61,11 +61,9 @@ local function check_object_hit(self, pos, dmg) and entity.name ~= self.object:get_luaentity().name then if object:is_player() and self._thrower ~= object:get_player_name() then - -- TODO: Deal knockback self.object:remove() return true elseif (entity.is_mob == true or entity._hittable_by_projectile) and (self._thrower ~= object) then - -- FIXME: Knockback is broken object:punch(self.object, 1.0, { full_punch_interval = 1.0, damage_groups = dmg, @@ -185,7 +183,7 @@ local function egg_on_step(self, dtime) end -- Destroy when hitting a mob or player (no chick spawning) - if check_object_hit(self, pos) then + if check_object_hit(self, pos, 0) then minetest.sound_play("mcl_throwing_egg_impact", { pos = self.object:get_pos(), max_hear_distance=10, gain=0.5 }, true) self.object:remove() return diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index cbee8e3d0..c2192c968 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -175,9 +175,32 @@ minetest.register_tool("mcl_tools:pick_diamond", { _mcl_diggroups = { pickaxey = { speed = 8, level = 5, uses = 1562 } }, + _mcl_upgradable = true, + _mcl_upgrade_item = "mcl_tools:pick_netherite" }) -local function make_grass_path(itemstack, placer, pointed_thing) +minetest.register_tool("mcl_tools:pick_netherite", { + description = S("Netherite Pickaxe"), + _doc_items_longdesc = pickaxe_longdesc, + inventory_image = "default_tool_netheritepick.png", + wield_scale = wield_scale, + groups = { tool=1, pickaxe=1, dig_speed_class=6, enchantability=10 }, + tool_capabilities = { + -- 1/1.2 + full_punch_interval = 0.83333333, + max_drop_level=5, + damage_groups = {fleshy=6}, + punch_attack_uses = 1016, + }, + sound = { breaks = "default_tool_breaks" }, + _repair_material = "mcl_nether:netherite_ingot", + _mcl_toollike_wield = true, + _mcl_diggroups = { + pickaxey = { speed = 9.5, level = 6, uses = 2031 } + }, +}) + +local make_grass_path = function(itemstack, placer, pointed_thing) -- Use pointed node's on_rightclick function first, if present local node = minetest.get_node(pointed_thing.under) if placer and not placer:get_player_control().sneak then @@ -351,6 +374,30 @@ minetest.register_tool("mcl_tools:shovel_diamond", { _mcl_diggroups = { shovely = { speed = 8, level = 5, uses = 1562 } }, + _mcl_upgradable = true, + _mcl_upgrade_item = "mcl_tools:shovel_netherite" +}) + +minetest.register_tool("mcl_tools:shovel_netherite", { + description = S("Netherite Shovel"), + _doc_items_longdesc = shovel_longdesc, + _doc_items_usagehelp = shovel_use, + inventory_image = "default_tool_netheriteshovel.png", + wield_scale = wield_scale, + groups = { tool=1, shovel=1, dig_speed_class=6, enchantability=10 }, + tool_capabilities = { + full_punch_interval = 1, + max_drop_level=5, + damage_groups = {fleshy=5}, + punch_attack_uses = 1016, + }, + on_place = make_grass_path, + sound = { breaks = "default_tool_breaks" }, + _repair_material = "mcl_nether:netherite_ingot", + _mcl_toollike_wield = true, + _mcl_diggroups = { + shovely = { speed = 9, level = 6, uses = 2031 } + }, }) -- Axes @@ -483,6 +530,29 @@ minetest.register_tool("mcl_tools:axe_diamond", { _mcl_diggroups = { axey = { speed = 8, level = 5, uses = 1562 } }, + _mcl_upgradable = true, + _mcl_upgrade_item = "mcl_tools:axe_netherite" +}) + +minetest.register_tool("mcl_tools:axe_netherite", { + description = S("Netherite Axe"), + _doc_items_longdesc = axe_longdesc, + inventory_image = "default_tool_netheriteaxe.png", + wield_scale = wield_scale, + groups = { tool=1, axe=1, dig_speed_class=6, enchantability=10 }, + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=5, + damage_groups = {fleshy=10}, + punch_attack_uses = 1016, + }, + on_place = make_stripped_trunk, + sound = { breaks = "default_tool_breaks" }, + _repair_material = "mcl_nether:netherite_ingot", + _mcl_toollike_wield = true, + _mcl_diggroups = { + axey = { speed = 9, level = 6, uses = 2031 } + }, }) -- Swords @@ -586,6 +656,28 @@ minetest.register_tool("mcl_tools:sword_diamond", { swordy = { speed = 8, level = 5, uses = 1562 }, swordy_cobweb = { speed = 8, level = 5, uses = 1562 } }, + _mcl_upgradable = true, + _mcl_upgrade_item = "mcl_tools:sword_netherite" +}) +minetest.register_tool("mcl_tools:sword_netherite", { + description = S("Netherite Sword"), + _doc_items_longdesc = sword_longdesc, + inventory_image = "default_tool_netheritesword.png", + wield_scale = wield_scale, + groups = { weapon=1, sword=1, dig_speed_class=5, enchantability=10 }, + tool_capabilities = { + full_punch_interval = 0.625, + max_drop_level=5, + damage_groups = {fleshy=9}, + punch_attack_uses = 2031, + }, + sound = { breaks = "default_tool_breaks" }, + _repair_material = "mcl_nether:netherite_ingot", + _mcl_toollike_wield = true, + _mcl_diggroups = { + swordy = { speed = 8, level = 5, uses = 2031 }, + swordy_cobweb = { speed = 8, level = 5, uses = 2031 } + }, }) --Shears diff --git a/mods/ITEMS/mcl_tools/textures/default_tool_netheriteaxe.png b/mods/ITEMS/mcl_tools/textures/default_tool_netheriteaxe.png new file mode 100644 index 000000000..d9657367b Binary files /dev/null and b/mods/ITEMS/mcl_tools/textures/default_tool_netheriteaxe.png differ diff --git a/mods/ITEMS/mcl_tools/textures/default_tool_netheritepick.png b/mods/ITEMS/mcl_tools/textures/default_tool_netheritepick.png new file mode 100644 index 000000000..e4140dde7 Binary files /dev/null and b/mods/ITEMS/mcl_tools/textures/default_tool_netheritepick.png differ diff --git a/mods/ITEMS/mcl_tools/textures/default_tool_netheriteshovel.png b/mods/ITEMS/mcl_tools/textures/default_tool_netheriteshovel.png new file mode 100644 index 000000000..9ae8654ff Binary files /dev/null and b/mods/ITEMS/mcl_tools/textures/default_tool_netheriteshovel.png differ diff --git a/mods/ITEMS/mcl_tools/textures/default_tool_netheritesword.png b/mods/ITEMS/mcl_tools/textures/default_tool_netheritesword.png new file mode 100644 index 000000000..589637a62 Binary files /dev/null and b/mods/ITEMS/mcl_tools/textures/default_tool_netheritesword.png differ diff --git a/mods/ITEMS/mcl_totems/init.lua b/mods/ITEMS/mcl_totems/init.lua index 8e529c5d5..26874b50b 100644 --- a/mods/ITEMS/mcl_totems/init.lua +++ b/mods/ITEMS/mcl_totems/init.lua @@ -51,7 +51,8 @@ mcl_damage.register_modifier(function(obj, damage, reason) obj:set_wielded_item(wield) end end - + awards.unlock(obj:get_player_name(), "mcl:postMortal") + -- Effects minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true) diff --git a/mods/ITEMS/mcl_walls/mod.conf b/mods/ITEMS/mcl_walls/mod.conf index 8839312de..b6b221007 100644 --- a/mods/ITEMS/mcl_walls/mod.conf +++ b/mods/ITEMS/mcl_walls/mod.conf @@ -1,3 +1,3 @@ name = mcl_walls -depends = mcl_core, mcl_end, mcl_ocean, mcl_nether, mcl_sounds +depends = mcl_core, mcl_end, mcl_ocean, mcl_nether, mcl_sounds, mcl_mud optional_depends = doc diff --git a/mods/ITEMS/mcl_walls/register.lua b/mods/ITEMS/mcl_walls/register.lua index 483af493e..96a1b9b9f 100644 --- a/mods/ITEMS/mcl_walls/register.lua +++ b/mods/ITEMS/mcl_walls/register.lua @@ -14,3 +14,4 @@ mcl_walls.register_wall("mcl_walls:prismarine", S("Prismarine Wall"), "mcl_ocean mcl_walls.register_wall("mcl_walls:endbricks", S("End Stone Brick Wall"), "mcl_end:end_bricks") mcl_walls.register_wall("mcl_walls:netherbrick", S("Nether Brick Wall"), "mcl_nether:nether_brick") mcl_walls.register_wall("mcl_walls:rednetherbrick", S("Red Nether Brick Wall"), "mcl_nether:red_nether_brick") +mcl_walls.register_wall("mcl_walls:mudbrick", S("Mud Brick Wall"), "mcl_mud:mud_bricks") \ No newline at end of file diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index f198e09fa..f766b0692 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -9,6 +9,8 @@ local generate_fallen_logs = minetest.settings:get_bool("mcl_generate_fallen_log local mod_mcl_structures = minetest.get_modpath("mcl_structures") local mod_mcl_core = minetest.get_modpath("mcl_core") local mod_mcl_mushrooms = minetest.get_modpath("mcl_mushrooms") +local mod_mcl_crimson = minetest.get_modpath("mcl_crimson") +local mod_mcl_blackstone = minetest.get_modpath("mcl_blackstone") -- Jungle bush schematic. In PC/Java Edition it's Jungle Wood + Oak Leaves local jungle_bush_schematic = mod_mcl_core.."/schematics/mcl_core_jungle_bush_oak_leaves.mts" @@ -1490,8 +1492,7 @@ local function register_dimension_biomes() node_river_water = "air", node_cave_liquid = "air", y_min = mcl_vars.mg_nether_min, - -- FIXME: For some reason the Nether stops generating early if this constant is not added. - -- Figure out why. + y_max = mcl_vars.mg_nether_max + 80, heat_point = 100, humidity_point = 0, @@ -1499,6 +1500,175 @@ local function register_dimension_biomes() _mcl_palette_index = 17, }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "Nether" }, + y_min = -31000, + y_max = mcl_vars.mg_nether_max, + decoration = "mcl_nether:netherrack", + flags = "all_floors", + param2 = 0, + }) + + minetest.register_biome({ + name = "SoulsandValley", + node_filler = "mcl_nether:netherrack", + node_stone = "mcl_nether:netherrack", + node_top = "mcl_blackstone:soul_soil", + node_water = "air", + node_river_water = "air", + node_cave_liquid = "air", + y_min = mcl_vars.mg_nether_min, + + y_max = mcl_vars.mg_nether_max + 80, + heat_point = 77, + humidity_point = 33, + _mcl_biome_type = "hot", + _mcl_palette_index = 17, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "SoulsandValley" }, + y_min = -31000, + y_max = mcl_vars.mg_nether_max, + decoration = "mcl_blackstone:soul_soil", + flags = "all_floors, all_ceilings", + param2 = 0, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "mcl_nether:soul_sand", + wherein = { "mcl_nether:netherrack", "mcl_blackstone:soul_soil" }, + clust_scarcity = 100, + clust_num_ores = 225, + clust_size = 15, + biomes = { "SoulsandValley" }, + y_min = mcl_vars.mg_nether_min, + y_max = mcl_vars.mg_nether_max + 80, + noise_params = { + offset = 0, + scale = 1, + spread = { x = 250, y = 250, z = 250 }, + seed = 12345, + octaves = 3, + persist = 0.6, + lacunarity = 2, + flags = "defaults", + } + }) + minetest.register_biome({ + name = "CrimsonForest", + node_filler = "mcl_nether:netherrack", + node_stone = "mcl_nether:netherrack", + node_top = "mcl_crimson:crimson_nylium", + node_water = "air", + node_river_water = "air", + node_cave_liquid = "air", + y_min = mcl_vars.mg_nether_min, + + y_max = mcl_vars.mg_nether_max + 80, + heat_point = 60, + humidity_point = 47, + _mcl_biome_type = "hot", + _mcl_palette_index = 17, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "CrimsonForest" }, + y_min = -31000, + y_max = mcl_vars.mg_nether_max, + decoration = "mcl_crimson:crimson_nylium", + flags = "all_floors", + param2 = 0, + }) + minetest.register_biome({ + name = "WarpedForest", + node_filler = "mcl_nether:netherrack", + node_stone = "mcl_nether:netherrack", + node_top = "mcl_crimson:warped_nylium", + node_water = "air", + node_river_water = "air", + node_cave_liquid = "air", + y_min = mcl_vars.mg_nether_min, + y_max = mcl_vars.mg_nether_max + 80, + heat_point = 37, + humidity_point = 70, + _mcl_biome_type = "hot", + _mcl_palette_index = 17, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "WarpedForest" }, + y_min = -31000, + y_max = mcl_vars.mg_nether_max, + decoration = "mcl_crimson:warped_nylium", + flags = "all_floors", + param2 = 0, + }) + minetest.register_biome({ + name = "BasaltDelta", + node_filler = "mcl_nether:netherrack", + node_stone = "mcl_nether:netherrack", + node_top = "mcl_blackstone:basalt", + node_water = "air", + node_river_water = "air", + node_cave_liquid = "air", + y_min = mcl_vars.mg_nether_min, + y_max = mcl_vars.mg_nether_max + 80, + heat_point = 27, + humidity_point = 80, + _mcl_biome_type = "hot", + _mcl_palette_index = 17, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "mcl_blackstone:blackstone", + wherein = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_core:gravel","mcl_nether:soul_sand"}, + clust_scarcity = 100, + clust_num_ores = 400, + clust_size = 20, + biomes = { "BasaltDelta" }, + y_min = mcl_vars.mg_nether_min, + y_max = mcl_vars.mg_nether_max + 80, + noise_params = { + offset = 0, + scale = 1, + spread = { x = 250, y = 250, z = 250 }, + seed = 12345, + octaves = 3, + persist = 0.6, + lacunarity = 2, + flags = "defaults", + } + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand","mcl_blackstone:blackstone"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "BasaltDelta" }, + y_min = -31000, + y_max = mcl_vars.mg_nether_max, + decoration = "mcl_blackstone:basalt", + flags = "all_floors", + param2 = 0, + }) + --[[ THE END ]] minetest.register_biome({ name = "End", @@ -1581,6 +1751,39 @@ local function register_biome_ores() "MesaPlateauFM", "MesaPlateauFM_sandlevel", "MesaPlateauFM_ocean", }, }) end + --nether gold + if mg_name ~= "v6" then + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_blackstone:blackstone_gilded", + wherein = "mcl_blackstone:blackstone", + clust_scarcity = 4775, + clust_num_ores = 2, + clust_size = 2, + y_min = mcl_vars.mg_nether_min, + y_max = mcl_vars.mg_nether_max, + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_blackstone:nether_gold", + wherein = "mcl_nether:netherrack", + clust_scarcity = 830, + clust_num_ores = 5, + clust_size = 3, + y_min = mcl_vars.mg_nether_min, + y_max = mcl_vars.mg_nether_max, + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_blackstone:nether_gold", + wherein = "mcl_nether:netherrack", + clust_scarcity = 1660, + clust_num_ores = 4, + clust_size = 2, + y_min = mcl_vars.mg_nether_min, + y_max = mcl_vars.mg_nether_max, + }) + end end -- Register “fake” ores directly related to the biomes. These are mostly low-level landscape alternations @@ -2292,9 +2495,198 @@ local function register_seagrass_decoration(grasstype, offset, scale, biomes) end end +local coral_min = OCEAN_MIN +local coral_max = -10 +local warm_oceans = { + "JungleEdgeM_ocean", + "Jungle_deep_ocean", + "Savanna_ocean", + "MesaPlateauF_ocean", + "Swampland_ocean", + "Mesa_ocean", + "Plains_ocean", + "MesaPlateauFM_ocean", + "MushroomIsland_ocean", + "SavannaM_ocean", + "JungleEdge_ocean", + "MesaBryce_ocean", + "Jungle_ocean", + "Desert_ocean", + "JungleM_ocean", +} +local corals = { + "brain", + "horn", + "bubble", + "tube", + "fire" +} +local function register_coral_decos(ck) + local c = corals[ck] + local noise = { + offset = -0.0085, + scale = 0.002, + spread = {x = 25, y = 120, z = 25}, + seed = 235, + octaves = 5, + persist = 1.8, + lacunarity = 3.5, + flags = "absvalue" + } + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"group:sand","mcl_core:gravel"}, + sidelen = 80, + noise_params = noise, + biomes = warm_oceans, + y_min = coral_min, + y_max = coral_max, + schematic = mod_mcl_structures.."/schematics/mcl_structures_coral_"..c.."_1.mts", + rotation = "random", + flags = "all_floors,force_placement", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"group:sand","mcl_core:gravel"}, + noise_params = noise, + sidelen = 80, + biomes = warm_oceans, + y_min = coral_min, + y_max = coral_max, + schematic = mod_mcl_structures.."/schematics/mcl_structures_coral_"..c.."_2.mts", + rotation = "random", + flags = "all_floors,force_placement", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_ocean:"..c.."_coral_block"}, + sidelen = 16, + fill_ratio = 3, + y_min = coral_min, + y_max = coral_max, + decoration = "mcl_ocean:"..c.."_coral", + biomes = warm_oceans, + flags = "force_placement, all_floors", + height = 1, + height_max = 1, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_ocean:horn_coral_block"}, + sidelen = 16, + fill_ratio = 7, + y_min = coral_min, + y_max = coral_max, + decoration = "mcl_ocean:"..c.."_coral_fan", + biomes = warm_oceans, + flags = "force_placement, all_floors", + height = 1, + height_max = 1, + }) +end local function register_decorations() + -- Coral Reefs + for k,_ in pairs(corals) do + register_coral_decos(k) + end + minetest.register_decoration({ + deco_type = "simple", + place_on = {"group:sand","mcl_core:gravel"}, + sidelen = 16, + noise_params = { + offset = -0.0085, + scale = 0.002, + spread = {x = 25, y = 120, z = 25}, + seed = 235, + octaves = 5, + persist = 1.8, + lacunarity = 3.5, + flags = "absvalue" + }, + y_min = coral_min, + y_max = coral_max, + decoration = "mcl_ocean:dead_brain_coral_block", + biomes = warm_oceans, + flags = "force_placement", + height = 1, + height_max = 1, + place_offset_y = -1, + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_ocean:dead_brain_coral_block"}, + sidelen = 16, + fill_ratio = 3, + y_min = coral_min, + y_max = coral_max, + decoration = "mcl_ocean:sea_pickle_1_dead_brain_coral_block", + biomes = warm_oceans, + flags = "force_placement, all_floors", + height = 1, + height_max = 1, + place_offset_y = -1, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_ocean:dead_brain_coral_block"}, + sidelen = 16, + fill_ratio = 3, + y_min = coral_min, + y_max = coral_max, + decoration = "mcl_ocean:sea_pickle_2_dead_brain_coral_block", + biomes = warm_oceans, + flags = "force_placement, all_floors", + height = 1, + height_max = 1, + place_offset_y = -1, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_ocean:dead_brain_coral_block"}, + sidelen = 16, + fill_ratio = 2, + y_min = coral_min, + y_max = coral_max, + decoration = "mcl_ocean:sea_pickle_3_dead_brain_coral_block", + biomes = warm_oceans, + flags = "force_placement, all_floors", + height = 1, + height_max = 1, + place_offset_y = -1, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_ocean:dead_brain_coral_block"}, + sidelen = 16, + fill_ratio = 2, + y_min = coral_min, + y_max = coral_max, + decoration = "mcl_ocean:sea_pickle_4_dead_brain_coral_block", + biomes = warm_oceans, + flags = "force_placement, all_floors", + height = 1, + height_max = 1, + place_offset_y = -1, + }) + --rare CORAl + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"group:sand","mcl_core:gravel"}, + fill_ratio = 0.0001, + sidelen = 80, + biomes = warm_oceans, + y_min = coral_min, + y_max = coral_max, + schematic = mod_mcl_structures.."/schematics/coral_cora.mts", + rotation = "random", + flags = "place_center_x,place_center_z, force_placement", + }) + + -- Large ice spike minetest.register_decoration({ deco_type = "schematic", @@ -2975,6 +3367,29 @@ local function register_decorations() rotation = "0", }) + --Mushrooms in caves + minetest.register_decoration({ + deco_type = "simple", + place_on = {"group:material_stone"}, + sidelen = 80, + fill_ratio = 0.009, + noise_threshold = 2.0, + flags = "all_floors", + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_vars.mg_overworld_max, + decoration = "mcl_mushrooms:mushroom_red", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"group:material_stone"}, + sidelen = 80, + fill_ratio = 0.009, + noise_threshold = 2.0, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_vars.mg_overworld_max, + decoration = "mcl_mushrooms:mushroom_brown", + }) + -- Mossy cobblestone boulder (3×3) minetest.register_decoration({ deco_type = "schematic", @@ -2993,6 +3408,7 @@ local function register_decorations() y_max = mcl_vars.mg_overworld_max, schematic = mod_mcl_structures.."/schematics/mcl_structures_boulder.mts", flags = "place_center_x, place_center_z", + rotation = "random", }) -- Small mossy cobblestone boulder (2×2) @@ -3013,6 +3429,7 @@ local function register_decorations() y_max = mcl_vars.mg_overworld_max, schematic = mod_mcl_structures.."/schematics/mcl_structures_boulder_small.mts", flags = "place_center_x, place_center_z", + rotation = "random", }) -- Cacti @@ -3911,7 +4328,331 @@ end -- Decorations in non-Overworld dimensions local function register_dimension_decorations() --[[ NETHER ]] - -- TODO: Nether + --NETHER WASTES (Nether) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:magma"}, + sidelen = 16, + fill_ratio = 0.04, + biomes = {"Nether"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 1, + flags = "all_floors", + decoration = "mcl_fire:eternal_fire", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack"}, + sidelen = 16, + fill_ratio = 0.013, + biomes = {"Nether"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 1, + flags = "all_floors", + decoration = "mcl_mushrooms:mushroom_brown", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack"}, + sidelen = 16, + fill_ratio = 0.012, + biomes = {"Nether"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 1, + flags = "all_floors", + decoration = "mcl_mushrooms:mushroom_red", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 0.0032, + biomes = {"Nether","SoulsandValley"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 1, + flags = "all_floors", + decoration = "mcl_nether:nether_wart", + }) + + -- WARPED FOREST + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_crimson:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.02, + biomes = {"WarpedForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 10, + flags = "all_floors", + decoration = "mcl_crimson:warped_fungus", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:warped_tree1", + place_on = {"mcl_crimson:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.007, + biomes = {"WarpedForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 15, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_crimson.."/schematics/warped_fungus_1.mts", + size = {x = 5, y = 11, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:warped_tree2", + place_on = {"mcl_crimson:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.005, + biomes = {"WarpedForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 10, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_crimson.."/schematics/warped_fungus_2.mts", + size = {x = 5, y = 6, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:warped_tree3", + place_on = {"mcl_crimson:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.003, + biomes = {"WarpedForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 14, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_crimson.."/schematics/warped_fungus_3.mts", + size = {x = 5, y = 12, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_crimson:warped_nylium","mcl_crimson:twisting_vines"}, + sidelen = 16, + fill_ratio = 0.012, + biomes = {"WarpedForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors", + height = 2, + height_max = 8, + decoration = "mcl_crimson:twisting_vines", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_crimson:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.0812, + biomes = {"WarpedForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors", + max_height = 5, + decoration = "mcl_crimson:warped_roots", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_crimson:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.052, + biomes = {"WarpedForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors", + decoration = "mcl_crimson:nether_sprouts", + }) + -- CRIMSON FOREST + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_crimson:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.02, + biomes = {"CrimsonForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_lava_nether_max - 10, + flags = "all_floors", + decoration = "mcl_crimson:crimson_fungus", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:crimson_tree", + place_on = {"mcl_crimson:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.008, + biomes = {"CrimsonForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 10, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_crimson.."/schematics/crimson_fungus_1.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:crimson_tree2", + place_on = {"mcl_crimson:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.006, + biomes = {"CrimsonForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 15, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_crimson.."/schematics/crimson_fungus_2.mts", + size = {x = 5, y = 12, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:crimson_tree3", + place_on = {"mcl_crimson:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.004, + biomes = {"CrimsonForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 20, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_crimson.."/schematics/crimson_fungus_3.mts", + size = {x = 7, y = 13, z = 7}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_crimson:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.082, + biomes = {"CrimsonForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors", + max_height = 5, + decoration = "mcl_crimson:crimson_roots", + }) + + --SOULSAND VALLEY + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 0.062, + biomes = {"SoulsandValley"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors", + max_height = 5, + decoration = "mcl_blackstone:soul_fire", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"}, + sidelen = 16, + fill_ratio = 0.000212, + biomes = {"SoulsandValley"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_1.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"}, + sidelen = 16, + fill_ratio = 0.0002233, + biomes = {"SoulsandValley"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_2.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"}, + sidelen = 16, + fill_ratio = 0.000225, + biomes = {"SoulsandValley"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_3.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"}, + sidelen = 16, + fill_ratio = 0.00022323, + biomes = {"SoulsandValley"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_4.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + --BASALT DELTA + minetest.register_decoration({ + deco_type = "simple", + decoration = "mcl_blackstone:basalt", + place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"}, + sidelen = 80, + height_max = 55, + noise_params={ + offset = -0.0085, + scale = 0.002, + spread = {x = 25, y = 120, z = 25}, + seed = 2325, + octaves = 5, + persist = 2, + lacunarity = 3.5, + flags = "absvalue" + }, + biomes = {"BasaltDelta"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors, all ceilings", + }) + minetest.register_decoration({ + deco_type = "simple", + decoration = "mcl_blackstone:basalt", + place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"}, + sidelen = 80, + height_max = 15, + noise_params={ + offset = -0.0085, + scale = 0.004, + spread = {x = 25, y = 120, z = 25}, + seed = 235, + octaves = 5, + persist = 2.5, + lacunarity = 3.5, + flags = "absvalue" + }, + biomes = {"BasaltDelta"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors, all ceilings", + }) + minetest.register_decoration({ + deco_type = "simple", + decoration = "mcl_nether:magma", + place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"}, + sidelen = 80, + fill_ratio = 0.082323, + biomes = {"BasaltDelta"}, + place_offset_y = -1, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_floors, all ceilings", + }) + minetest.register_decoration({ + deco_type = "simple", + decoration = "mcl_nether:nether_lava_source", + place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"}, + spawn_by = {"mcl_blackstone:basalt","mcl_blackstone:blackstone"}, + num_spawn_by = 14, + sidelen = 80, + fill_ratio = 4, + biomes = {"BasaltDelta"}, + place_offset_y = -1, + y_min = mcl_vars.mg_lava_nether_max + 1, + y_max = mcl_vars.mg_nether_max - 5, + flags = "all_floors, force_placement", + }) --[[ THE END ]] @@ -3975,10 +4716,21 @@ if mg_name ~= "singlenode" then -- Overworld decorations for v6 are handled in mcl_mapgen_core - if deco_id_chorus_plant then + local deco_ids_fungus ={ + minetest.get_decoration_id("mcl_biomes:crimson_tree1"), + minetest.get_decoration_id("mcl_biomes:crimson_tree2"), + minetest.get_decoration_id("mcl_biomes:crimson_tree3"), + minetest.get_decoration_id("mcl_biomes:warped_tree1"), + minetest.get_decoration_id("mcl_biomes:warped_tree2"), + minetest.get_decoration_id("mcl_biomes:warped_tree3") + } + for _,f in pairs(deco_ids_fungus) do + minetest.set_gen_notify({decoration=true}, { f }) + end + if deco_id_chorus_plant or deco_id_crimson_tree or deco_id_warped_tree then mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed) + if minp.y > -26900 then return end local gennotify = minetest.get_mapgen_object("gennotify") - --local poslist = {} local pr = PseudoRandom(blockseed + 14) for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do local x, y, z = pos.x, pos.y, pos.z @@ -3990,8 +4742,13 @@ if mg_name ~= "singlenode" then end end end + if minp.y > mcl_vars.mg_nether_max then return end + for _,f in pairs(deco_ids_fungus) do + for _, pos in ipairs(gennotify["decoration#"..f] or {}) do + minetest.fix_light(vector.offset(pos,-8,-8,-8),vector.offset(pos,8,8,8)) + end + end end) end end - diff --git a/mods/MAPGEN/mcl_biomes/mod.conf b/mods/MAPGEN/mcl_biomes/mod.conf index 0c6095f3d..b02d78e05 100644 --- a/mods/MAPGEN/mcl_biomes/mod.conf +++ b/mods/MAPGEN/mcl_biomes/mod.conf @@ -1,4 +1,4 @@ name = mcl_biomes author = maikerumine description = Adds the various biomes and biome-related things for non-v6 map generators. -depends = mcl_init, mcl_mapgen_core, mcl_core, mcl_worlds, mcl_farming, mcl_flowers, mcl_end, mcl_ocean +depends = mcl_init, mcl_mapgen_core, mcl_core, mcl_worlds, mcl_farming, mcl_flowers, mcl_end, mcl_ocean, mcl_crimson, mcl_blackstone diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index d9494d18b..a59dfc935 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -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 -- @@ -1262,12 +1302,10 @@ end -- TODO: Try to use more efficient structure generating code local function generate_structures(minp, maxp, blockseed, biomemap) - local chunk_has_desert_well = false - local chunk_has_desert_temple = false local chunk_has_igloo = false local struct_min, struct_max = -3, 111 --64 - - if maxp.y >= struct_min and minp.y <= struct_max then + --except end exit portall all v6 + if mg_name == "v6" and maxp.y >= struct_min and minp.y <= struct_max then -- Generate structures local pr = PcgRandom(blockseed) perlin_structures = perlin_structures or minetest.get_perlin(329, 3, 0.6, 100) @@ -1301,32 +1339,8 @@ local function generate_structures(minp, maxp, blockseed, biomemap) local nn0 = minetest.get_node(p).name -- Check if the node can be replaced if minetest.registered_nodes[nn0] and minetest.registered_nodes[nn0].buildable_to then - -- Desert temples and desert wells - if nn == "mcl_core:sand" or (nn == "mcl_core:sandstone") then - if not chunk_has_desert_temple and not chunk_has_desert_well and ground_y > 3 then - -- Spawn desert temple - -- TODO: Check surface - if pr:next(1,12000) == 1 then - mcl_structures.call_struct(p, "desert_temple", nil, pr) - chunk_has_desert_temple = true - end - end - if not chunk_has_desert_temple and not chunk_has_desert_well and ground_y > 3 then - local desert_well_prob = minecraft_chunk_probability(1000, minp, maxp) - - -- Spawn desert well - if pr:next(1, desert_well_prob) == 1 then - -- Check surface - local surface = minetest.find_nodes_in_area({x=p.x,y=p.y-1,z=p.z}, {x=p.x+5, y=p.y-1, z=p.z+5}, "mcl_core:sand") - if #surface >= 25 then - mcl_structures.call_struct(p, "desert_well", nil, pr) - chunk_has_desert_well = true - end - end - end - -- Igloos - elseif not chunk_has_igloo and (nn == "mcl_core:snowblock" or nn == "mcl_core:snow" or (minetest.get_item_group(nn, "grass_block_snow") == 1)) then + if not chunk_has_igloo and (nn == "mcl_core:snowblock" or nn == "mcl_core:snow" or (minetest.get_item_group(nn, "grass_block_snow") == 1)) then if pr:next(1, 4400) == 1 then -- Check surface local floor = {x=p.x+9, y=p.y-1, z=p.z+9} @@ -1357,7 +1371,7 @@ local function generate_structures(minp, maxp, blockseed, biomemap) end end - -- Witch hut + -- Witch hut (v6) if ground_y <= 0 and nn == "mcl_core:dirt" then local prob = minecraft_chunk_probability(48, minp, maxp) if pr:next(1, prob) == 1 then @@ -1365,23 +1379,14 @@ local function generate_structures(minp, maxp, blockseed, biomemap) local swampland = minetest.get_biome_id("Swampland") local swampland_shore = minetest.get_biome_id("Swampland_shore") - -- Where do witches live? - - local here_be_witches = false - if mg_name == "v6" then - -- v6: In Normal biome - if biomeinfo.get_v6_biome(p) == "Normal" then - here_be_witches = true - end - else - -- Other mapgens: In swampland biome - local bi = xz_to_biomemap_index(p.x, p.z, minp, maxp) - if biomemap[bi] == swampland or biomemap[bi] == swampland_shore then - here_be_witches = true - end + -- Where do witches live? + -- v6: In Normal biome + if biomeinfo.get_v6_biome(p) == "Normal" then + here_be_witches = true end - + local here_be_witches = false if here_be_witches then + local r = tostring(pr:next(0, 3) * 90) -- "0", "90", "180" or 270" local p1 = {x=p.x-1, y=WITCH_HUT_HEIGHT+2, z=p.z-1} local size @@ -1401,9 +1406,7 @@ local function generate_structures(minp, maxp, blockseed, biomemap) -- FIXME: For some mysterious reason (black magic?) this -- function does sometimes NOT spawn the witch hut. One can only see the -- oak wood nodes in the water, but no hut. :-/ - mcl_structures.call_struct(place, "witch_hut", r, pr) - - -- TODO: Spawn witch in or around hut when the mob sucks less. + mcl_structures.place_structure(place,mcl_structures.registered_structures["witch_hut"],pr) local function place_tree_if_free(pos, prev_result) local nn = minetest.get_node(pos).name @@ -1462,7 +1465,7 @@ local function generate_structures(minp, maxp, blockseed, biomemap) -- Ice spikes in v6 -- In other mapgens, ice spikes are generated as decorations. - if mg_name == "v6" and not chunk_has_igloo and nn == "mcl_core:snowblock" then + if nn == "mcl_core:snowblock" then local spike = pr:next(1,58000) if spike < 3 then -- Check surface @@ -1472,7 +1475,7 @@ local function generate_structures(minp, maxp, blockseed, biomemap) local spruce_collisions = minetest.find_nodes_in_area({x=p.x+1,y=p.y+2,z=p.z+1}, {x=p.x+4, y=p.y+6, z=p.z+4}, {"mcl_core:sprucetree", "mcl_core:spruceleaves"}) if #surface >= 9 and #spruce_collisions == 0 then - mcl_structures.call_struct(p, "ice_spike_large", nil, pr) + mcl_structures.place_structure(p,mcl_structures.registered_structures["ice_spike_large"],pr) end elseif spike < 100 then -- Check surface @@ -1483,7 +1486,7 @@ local function generate_structures(minp, maxp, blockseed, biomemap) local spruce_collisions = minetest.find_nodes_in_area({x=p.x+1,y=p.y+1,z=p.z+1}, {x=p.x+6, y=p.y+6, z=p.z+6}, {"mcl_core:sprucetree", "mcl_core:spruceleaves"}) if #surface >= 25 and #spruce_collisions == 0 then - mcl_structures.call_struct(p, "ice_spike_small", nil, pr) + mcl_structures.place_structure(p,mcl_structures.registered_structures["ice_spike_small"],pr) end end end @@ -1720,7 +1723,7 @@ local function generate_tree_decorations(minp, maxp, seed, data, param2_data, ar end -- Generate mushrooms in caves manually. --- Minetest's API does not support decorations in caves yet. :-( +-- only v6. minetest supports cave decos via "all_floors" flag now local function generate_underground_mushrooms(minp, maxp, seed) local pr_shroom = PseudoRandom(seed-24359) -- Generate rare underground mushrooms @@ -1747,14 +1750,9 @@ local function generate_underground_mushrooms(minp, maxp, seed) end end -local nether_wart_chance -if mg_name == "v6" then - nether_wart_chance = 85 -else - nether_wart_chance = 170 -end -- Generate Nether decorations manually: Eternal fire, mushrooms, nether wart --- Minetest's API does not support decorations in caves yet. :-( +-- (only v6) +local nether_wart_chance = 85 local function generate_nether_decorations(minp, maxp, seed) local pr_nether = PseudoRandom(seed+667) @@ -1778,9 +1776,7 @@ local function generate_nether_decorations(minp, maxp, seed) spawn_func(bpos) end - end - -- Eternal fire on netherrack special_deco(rack, function(bpos) -- Eternal fire on netherrack @@ -1817,7 +1813,6 @@ local function generate_nether_decorations(minp, maxp, seed) minetest.set_node(bpos, {name = "mcl_nether:nether_wart"}) end end) - end minetest.register_on_generated(function(minp, maxp, blockseed) @@ -2201,10 +2196,33 @@ end local function basic_node(minp, maxp, blockseed) if mg_name ~= "singlenode" then -- Generate special decorations - generate_underground_mushrooms(minp, maxp, blockseed) - generate_nether_decorations(minp, maxp, blockseed) + if mg_name == "v6" then + generate_underground_mushrooms(minp, maxp, blockseed) + generate_nether_decorations(minp, maxp, blockseed) + end generate_structures(minp, maxp, blockseed, minetest.get_mapgen_object("biomemap")) end end mcl_mapgen_core.register_generator("main", basic, basic_node, 1, true) + +mcl_mapgen_core.register_generator("structures",nil, function(minp, maxp, blockseed) + local gennotify = minetest.get_mapgen_object("gennotify") + local has_struct = {} + local poshash = minetest.hash_node_position(minp) + for _,struct in pairs(mcl_structures.registered_structures) do + if struct.deco_id then + local pr = PseudoRandom(blockseed + 42) + local has = false + if has_struct[struct.name] == nil then has_struct[struct.name] = {} end + for _, pos in pairs(gennotify["decoration#"..struct.deco_id] or {}) do + local realpos = vector.offset(pos,0,1,0) + minetest.remove_node(realpos) + if struct.chunk_probability == nil or (not has and pr:next(1,struct.chunk_probability) == 1 ) then + mcl_structures.place_structure(realpos,struct,pr,blockseed) + has=true + end + end + end + end +end, 100, true) diff --git a/mods/MAPGEN/mcl_nether_fortresses/init.lua b/mods/MAPGEN/mcl_nether_fortresses/init.lua new file mode 100644 index 000000000..8a5d97244 --- /dev/null +++ b/mods/MAPGEN/mcl_nether_fortresses/init.lua @@ -0,0 +1,29 @@ +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) + +mcl_structures.register_structure("nether_outpost",{ + place_on = {"mcl_nether:netherrack","mcl_crimson:crimson_nylium","mcl_crimson:warped_nylium","mcl_blackstone:basalt","mcl_blackstone:soul_soil"}, + noise_params = { + offset = 0, + scale = 0.00022, + spread = {x = 250, y = 250, z = 250}, + seed = 333, + octaves = 1, + persist = 0.0001, + flags = "absvalue", + }, + flags = "all_floors", + biomes = {"Nether","SoulsandValley","WarpedForest","CrimsonForest","BasaltDelta"}, + sidelen = 15, + solid_ground = true, + make_foundation = true, + y_min = mcl_vars.mg_lava_nether_max - 1, + y_max = mcl_vars.mg_nether_max - 30, + filenames = { modpath.."/schematics/nether_outpost.mts" }, + y_offset = 0, + after_place = function(pos) + local sp = minetest.find_nodes_in_area(pos,vector.offset(pos,0,20,0),{"mcl_mobspawners:spawner"}) + if not sp[1] then return end + mcl_mobspawners.setup_spawner(sp[1], "mobs_mc:blaze", 0, minetest.LIGHT_MAX+1, 10, 3, -1) + end +}) diff --git a/mods/MAPGEN/mcl_nether_fortresses/mod.conf b/mods/MAPGEN/mcl_nether_fortresses/mod.conf new file mode 100644 index 000000000..7d1565ff3 --- /dev/null +++ b/mods/MAPGEN/mcl_nether_fortresses/mod.conf @@ -0,0 +1,3 @@ +name = mcl_nether_fortresses +author = cora +depends = mcl_init, mcl_structures, mcl_mobspawners diff --git a/mods/MAPGEN/mcl_nether_fortresses/schematics/nether_outpost.mts b/mods/MAPGEN/mcl_nether_fortresses/schematics/nether_outpost.mts new file mode 100644 index 000000000..7fba741bf Binary files /dev/null and b/mods/MAPGEN/mcl_nether_fortresses/schematics/nether_outpost.mts differ diff --git a/mods/MAPGEN/mcl_strongholds/init.lua b/mods/MAPGEN/mcl_strongholds/init.lua index 083172a3c..2a362cc40 100644 --- a/mods/MAPGEN/mcl_strongholds/init.lua +++ b/mods/MAPGEN/mcl_strongholds/init.lua @@ -61,7 +61,7 @@ local function init_strongholds() end end - mcl_structures.register_structures("stronghold", table.copy(strongholds)) + mcl_structures.register_structure_data("stronghold", table.copy(strongholds)) strongholds_inited = true end diff --git a/mods/MAPGEN/mcl_structures/API.md b/mods/MAPGEN/mcl_structures/API.md new file mode 100644 index 000000000..074810186 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/API.md @@ -0,0 +1,38 @@ +# mcl_structures +Structure placement API for MCL2. + +## mcl_structures.register_structure(name,structure definition,nospawn) +If nospawn is truthy the structure will not be placed by mapgen and the decoration parameters can be omitted. This is intended for secondary structures the placement of which gets triggered by the placement of other structures. It can also be used to register testing structures so they can be used with /spawnstruct. + +### structure definition +{ + fill_ratio = OR noise = {}, + biomes = {}, + y_min =, + y_max =, + place_on = {}, + spawn_by = {}, + num_spawn_by =, + flags = (default: "place_center_x, place_center_z, force_placement") + (same as decoration def) + y_offset =, --can be a number or a function returning a number + filenames = {} OR place_func = function(pos,def,pr) + -- filenames can be a list of any schematics accepted by mcl_structures.place_schematic / minetest.place_schematic + on_place = function(pos,def,pr) end, + -- called before placement. denies placement when returning falsy. + after_place = function(pos,def,pr) + -- executed after successful placement + sidelen = int, --length of one side of the structure. used for foundations. + solid_ground = bool, -- structure requires solid ground + make_foundation = bool, -- a foundation is automatically built for the structure. needs the sidelen param + loot = , + --a table of loot tables for mcl_loot indexed by node names + -- e.g. { ["mcl_chests:chest_small"] = {loot},... } +} +## mcl_structures.registered_structures +Table of the registered structure defintions indexed by name. + +## mcl_structures.place_structure(pos, def, pr) +Places a structure using the mapgen placement function + +## mcl_structures.place_schematic(pos, schematic, rotation, replacements, force_placement, flags, after_placement_callback, pr, callback_param) diff --git a/mods/MAPGEN/mcl_structures/api.lua b/mods/MAPGEN/mcl_structures/api.lua new file mode 100644 index 000000000..a4a3e59cf --- /dev/null +++ b/mods/MAPGEN/mcl_structures/api.lua @@ -0,0 +1,171 @@ +mcl_structures.registered_structures = {} + + +function mcl_structures.fill_chests(p1,p2,loot,pr) + for it,lt in pairs(loot) do + local nodes = minetest.find_nodes_in_area(p1, p2, it) + for _,p in pairs(nodes) do + local lootitems = mcl_loot.get_multi_loot(lt, pr) + mcl_structures.init_node_construct(p) + local meta = minetest.get_meta(p) + local inv = meta:get_inventory() + mcl_loot.fill_inventory(inv, "main", lootitems, pr) + end + end +end + +local function generate_loot(pos, def, pr) + local hl = def.sidelen / 2 + local p1 = vector.offset(pos,-hl,-hl,-hl) + local p2 = vector.offset(pos,hl,hl,hl) + if def.loot then mcl_structures.fill_chests(p1,p2,def.loot,pr) end +end + + +function mcl_structures.find_lowest_y(pp) + local y = 31000 + for _,p in pairs(pp) do + if p.y < y then y = p.y end + end + return y +end + +function mcl_structures.find_highest_y(pp) + local y = -31000 + for _,p in pairs(pp) do + if p.y > y then y = p.y end + end + return y +end + +function mcl_structures.place_structure(pos, def, pr, blockseed) + if not def then return end + local logging = not def.terrain_feature + local y_offset = 0 + if type(def.y_offset) == "function" then + y_offset = def.y_offset(pr) + elseif def.y_offset then + y_offset = def.y_offset + end + local pp = vector.offset(pos,0,y_offset,0) + if def.solid_ground and def.sidelen then + local ground_p1 = vector.offset(pos,-def.sidelen/2,-1,-def.sidelen/2) + local ground_p2 = vector.offset(pos,def.sidelen/2,-1,def.sidelen/2) + + local solid = minetest.find_nodes_in_area(ground_p1,ground_p2,{"group:solid"}) + if #solid < ( def.sidelen * def.sidelen ) then + if def.make_foundation then + local node_stone = "mcl_core:stone" + local node_filler = "mcl_core:dirt" + local node_top = "mcl_core:dirt_with_grass" or minetest.get_node(ground_p1).name + local node_dust = nil + + if minetest.get_mapgen_setting("mg_name") ~= "v6" then + local b = minetest.registered_biomes[minetest.get_biome_name(minetest.get_biome_data(pos).biome)] + --minetest.log(dump(b.node_top)) + if b.node_top then node_top = b.node_top end + if b.node_filler then node_filler = b.node_filler end + if b.node_stone then node_stone = b.node_stone end + if b.node_dust then node_dust = b.node_dust end + end + local replace = {"air","group:liquid","mcl_core:snow","group:tree","group:leaves"} + minetest.bulk_set_node(minetest.find_nodes_in_area(ground_p1,ground_p2,replace),{name=node_top}) + if node_dust then + minetest.bulk_set_node(minetest.find_nodes_in_area(vector.offset(ground_p1,0,1,0),vector.offset(ground_p2,0,1,0),{"air"}),{name=node_dust}) + end + minetest.bulk_set_node(minetest.find_nodes_in_area(vector.offset(ground_p1,0,-1,0),vector.offset(ground_p2,0,-4,0),replace),{name=node_filler}) + minetest.bulk_set_node(minetest.find_nodes_in_area(vector.offset(ground_p1,0,-5,0),vector.offset(ground_p2,0,-30,0),replace),{name=node_stone}) + else + if logging then + minetest.log("warning","[mcl_structures] "..def.name.." at "..minetest.pos_to_string(pp).." not placed. No solid ground.") + end + return false + end + end + end + if def.on_place and not def.on_place(pos,def,pr,blockseed) then + if logging then + minetest.log("warning","[mcl_structures] "..def.name.." at "..minetest.pos_to_string(pp).." not placed. Conditions not satisfied.") + end + return false + end + if def.filenames then + if #def.filenames <= 0 then return false end + local r = pr:next(1,#def.filenames) + local file = def.filenames[r] + if file then + local ap = function(pos,def,pr,blockseed) end + if def.after_place then ap = def.after_place end + + mcl_structures.place_schematic(pp, file, "random", nil, true, "place_center_x,place_center_z",function(p) + if def.loot then generate_loot(pos,def,pr,blockseed) end + return ap(pos,def,pr,blockseed) + end,pr) + if logging then + minetest.log("action","[mcl_structures] "..def.name.." placed at "..minetest.pos_to_string(pp)) + end + return true + end + elseif def.place_func and def.place_func(pos,def,pr,blockseed) then + if not def.after_place or ( def.after_place and def.after_place(pos,def,pr,blockseed) ) then + if logging then + minetest.log("action","[mcl_structures] "..def.name.." placed at "..minetest.pos_to_string(pp)) + end + return true + end + end + if logging then + minetest.log("warning","[mcl_structures] placing "..def.name.." failed at "..minetest.pos_to_string(pos)) + end +end + +function mcl_structures.register_structure(name,def,nospawn) --nospawn means it will be placed by another (non-nospawn) structure that contains it's structblock i.e. it will not be placed by mapgen directly + local structblock = "mcl_structures:structblock_"..name + local flags = "place_center_x, place_center_z, force_placement" + local y_offset = 0 + local sbgroups = { structblock = 1, not_in_creative_inventory=1 } + if def.flags then flags = def.flags end + def.name = name + if nospawn then + sbgroups.structblock = nil + sbgroups.structblock_lbm = 1 + else + minetest.register_on_mods_loaded(function() --make sure all previous decorations and biomes have been registered + def.deco = minetest.register_decoration({ + name = "mcl_structures:deco_"..name, + decoration = structblock, + deco_type = "simple", + place_on = def.place_on, + spawn_by = def.spawn_by, + num_spawn_by = def.num_spawn_by, + sidelen = 80, + fill_ratio = def.fill_ratio, + noise_params = def.noise_params, + flags = flags, + biomes = def.biomes, + y_max = def.y_max, + y_min = def.y_min + }) + minetest.register_node(":"..structblock, {drawtype="airlike", walkable = false, pointable = false,groups = sbgroups}) + def.structblock = structblock + def.deco_id = minetest.get_decoration_id("mcl_structures:deco_"..name) + minetest.set_gen_notify({decoration=true}, { def.deco_id }) + --catching of gennotify happens in mcl_mapgen_core + end) + end + mcl_structures.registered_structures[name] = def +end + +--lbm for secondary structures (structblock included in base structure) +minetest.register_lbm({ + name = "mcl_structures:struct_lbm", + run_at_every_load = true, + nodenames = {"group:structblock_lbm"}, + action = function(pos, node) + minetest.remove_node(pos) + local name = node.name:gsub("mcl_structures:structblock_","") + local def = mcl_structures.registered_structures[name] + if not def then return end + mcl_structures.place_structure(pos) + end +}) diff --git a/mods/MAPGEN/mcl_structures/desert_temple.lua b/mods/MAPGEN/mcl_structures/desert_temple.lua new file mode 100644 index 000000000..75c170ab1 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/desert_temple.lua @@ -0,0 +1,86 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) + +local function temple_placement_callback(pos,def, pr) + local hl = def.sidelen / 2 + local p1 = vector.offset(pos,-hl,-hl,-hl) + local p2 = vector.offset(pos,hl,hl,hl) + -- Delete cacti leftovers: + local cactus_nodes = minetest.find_nodes_in_area_under_air(p1, p2, "mcl_core:cactus") + if cactus_nodes and #cactus_nodes > 0 then + for _, pos in pairs(cactus_nodes) do + local node_below = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) + if node_below and node_below.name == "mcl_core:sandstone" then + minetest.swap_node(pos, {name="air"}) + end + end + end + + -- Initialize pressure plates and randomly remove up to 5 plates + local pplates = minetest.find_nodes_in_area(p1, p2, "mesecons_pressureplates:pressure_plate_stone_off") + local pplates_remove = 5 + for p=1, #pplates do + if pplates_remove > 0 and pr:next(1, 100) >= 50 then + -- Remove plate + minetest.remove_node(pplates[p]) + pplates_remove = pplates_remove - 1 + else + -- Initialize plate + minetest.registered_nodes["mesecons_pressureplates:pressure_plate_stone_off"].on_construct(pplates[p]) + end + end +end + +mcl_structures.register_structure("desert_temple",{ + place_on = {"group:sand"}, + fill_ratio = 0.01, + flags = "place_center_x, place_center_z", + solid_ground = true, + make_foundation = true, + sidelen = 18, + y_offset = -12, + chunk_probability = 300, + y_max = mcl_vars.mg_overworld_max, + y_min = 1, + biomes = { "Desert" }, + filenames = { modpath.."/schematics/mcl_structures_desert_temple.mts" }, + after_place = temple_placement_callback, + loot = { + ["mcl_chests:chest" ] ={ + { + stacks_min = 2, + stacks_max = 4, + items = { + { itemstring = "mcl_mobitems:bone", weight = 25, amount_min = 4, amount_max=6 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 25, amount_min = 3, amount_max=7 }, + { itemstring = "mcl_mobitems:spider_eye", weight = 25, amount_min = 1, amount_max=3 }, + { itemstring = "mcl_books:book", weight = 20, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) + end }, + { itemstring = "mcl_mobitems:saddle", weight = 20, }, + { itemstring = "mcl_core:apple_gold", weight = 20, }, + { itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 }, + { itemstring = "mcl_core:iron_ingot", weight = 15, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_core:emerald", weight = 15, amount_min = 1, amount_max = 3 }, + { itemstring = "", weight = 15, }, + { itemstring = "mcl_mobitems:iron_horse_armor", weight = 15, }, + { itemstring = "mcl_mobitems:gold_horse_armor", weight = 10, }, + { itemstring = "mcl_mobitems:diamond_horse_armor", weight = 5, }, + { itemstring = "mcl_core:diamond", weight = 5, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_core:apple_gold_enchanted", weight = 2, }, + } + }, + { + stacks_min = 4, + stacks_max = 4, + items = { + { itemstring = "mcl_mobitems:bone", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_mobitems:gunpowder", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_core:sand", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_mobitems:string", weight = 10, amount_min = 1, amount_max = 8 }, + } + }} + } +}) diff --git a/mods/MAPGEN/mcl_structures/geode.lua b/mods/MAPGEN/mcl_structures/geode.lua new file mode 100644 index 000000000..95f9b0e81 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/geode.lua @@ -0,0 +1,88 @@ +local adjacents = { + vector.new(1,0,0), + vector.new(-1,0,0), + vector.new(0,0,1), + vector.new(0,0,-1), + vector.new(0,1,0), + vector.new(0,-1,0) +} + +local function set_node_no_bedrock(pos,node) + local n = minetest.get_node(pos) + if n.name == "mcl_core:bedrock" then return end + return minetest.set_node(pos,node) +end + +local function makegeode(pos,def,pr) + local size = pr:next(5,7) + local p1 = vector.offset(pos,-size,-size,-size) + local p2 = vector.offset(pos,size,size,size) + minetest.emerge_area(p1, p2, function(blockpos, action, calls_remaining, param) + if calls_remaining ~= 0 then return end + local calcite = {} + local nn = minetest.find_nodes_in_area(p1,p2,{"group:material_stone","group:dirt","mcl_core:gravel"}) + table.sort(nn,function(a, b) + return vector.distance(pos, a) < vector.distance(pos, b) + end) + if not nn[1] then return end + + for i=1,pr:next(1,math.max(2,#nn - math.ceil(#nn/5) )) do + set_node_no_bedrock(nn[i],{name="mcl_amethyst:amethyst_block"}) + end + + for k,v in pairs(minetest.find_nodes_in_area(p1,p2,{"mcl_amethyst:amethyst_block"})) do + local all_amethyst = true + for kk,vv in pairs(adjacents) do + local pp = vector.add(v,vv) + local an = minetest.get_node(pp) + if an.name ~= "mcl_amethyst:amethyst_block" then + if minetest.get_item_group(an.name,"material_stone") > 0 then + set_node_no_bedrock(pp,{name="mcl_amethyst:calcite"}) + table.insert(calcite,pp) + if pr:next(1,5) == 1 then + set_node_no_bedrock(v,{name="mcl_amethyst:budding_amethyst_block"}) + end + all_amethyst = false + elseif an.name ~= "mcl_amethyst:amethyst_block" and an.name ~= "air" and an.name ~= "mcl_amethyst:budding_amethyst_block" then + all_amethyst = false + end + end + end + if all_amethyst then set_node_no_bedrock(v,{name="air"}) end + end + + for _,v in pairs(calcite) do + for _,vv in pairs(minetest.find_nodes_in_area(vector.offset(v,-1,-1,-1),vector.offset(v,1,1,1),{"group:material_stone"})) do + set_node_no_bedrock(vv,{name="mcl_blackstone:basalt_smooth"}) + end + end + + for k,v in pairs(minetest.find_nodes_in_area_under_air(p1,p2,{"mcl_amethyst:amethyst_block","mcl_amethyst:budding_amethyst_block"})) do + local r = pr:next(1,50) + if r < 10 then + set_node_no_bedrock(vector.offset(v,0,1,0),{name="mcl_amethyst:amethyst_cluster",param2=1}) + end + end + return true + end) + return true +end + +mcl_structures.register_structure("geode",{ + place_on = {"group:material_stone"}, + noise_params = { + offset = 0, + scale = 0.00022, + spread = {x = 250, y = 250, z = 250}, + seed = 7894353, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, + flags = "force_placement", + terrain_feature = true, + y_max = -24, + y_min = mcl_vars.mg_overworld_min, + y_offset = function(pr) return pr:next(-4,-2) end, + place_func = makegeode, +}) diff --git a/mods/MAPGEN/mcl_structures/igloo.lua b/mods/MAPGEN/mcl_structures/igloo.lua new file mode 100644 index 000000000..49e3c879a --- /dev/null +++ b/mods/MAPGEN/mcl_structures/igloo.lua @@ -0,0 +1,163 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) + +function mcl_structures.generate_igloo_top(pos, pr) + -- FIXME: This spawns bookshelf instead of furnace. Fix this! + -- Furnace does ot work atm because apparently meta is not set. :-( + local newpos = {x=pos.x,y=pos.y-2,z=pos.z} + local path = modpath.."/schematics/mcl_structures_igloo_top.mts" + local rotation = tostring(pr:next(0,3)*90) + return mcl_structures.place_schematic(newpos, path, rotation, nil, true), rotation +end + +function mcl_structures.generate_igloo_basement(pos, orientation, loot, pr) + -- TODO: Add brewing stand + -- TODO: Add monster eggs + local path = modpath.."/schematics/mcl_structures_igloo_basement.mts" + mcl_structures.place_schematic(pos, path, orientation, nil, true, nil, function() + local p1 = vector.offset(pos,-5,-5,-5) + local p2 = vector.offset(pos,5,5,5) + mcl_structures.fill_chests(p1,p2,loot,pr) + local mc = minetest.find_nodes_in_area_under_air(p1,p2,{"mcl_core:stonebrickmossy"}) + if #mc == 2 then + table.shuffle(mc) + minetest.add_entity(vector.offset(mc[1],0,1,0),"mobs_mc:villager") + minetest.add_entity(vector.offset(mc[2],0,1,0),"mobs_mc:villager_zombie") + end + end, pr) +end + +function mcl_structures.generate_igloo(pos, def, pr) + -- Place igloo + local success, rotation = mcl_structures.generate_igloo_top(pos, pr) + -- Place igloo basement with 50% chance + local r = pr:next(1,2) + if r == 1 then + -- Select basement depth + local dim = mcl_worlds.pos_to_dimension(pos) + --local buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) + local buffer + if dim == "nether" then + buffer = pos.y - (mcl_vars.mg_lava_nether_max + 10) + elseif dim == "end" then + buffer = pos.y - (mcl_vars.mg_end_min + 1) + elseif dim == "overworld" then + buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) + else + return success + end + if buffer <= 19 then + return success + end + local depth = pr:next(19, buffer) + local bpos = {x=pos.x, y=pos.y-depth, z=pos.z} + -- trapdoor position + local tpos + local dir, tdir + if rotation == "0" then + dir = {x=-1, y=0, z=0} + tdir = {x=1, y=0, z=0} + tpos = {x=pos.x+7, y=pos.y-1, z=pos.z+3} + elseif rotation == "90" then + dir = {x=0, y=0, z=-1} + tdir = {x=0, y=0, z=-1} + tpos = {x=pos.x+3, y=pos.y-1, z=pos.z+1} + elseif rotation == "180" then + dir = {x=1, y=0, z=0} + tdir = {x=-1, y=0, z=0} + tpos = {x=pos.x+1, y=pos.y-1, z=pos.z+3} + elseif rotation == "270" then + dir = {x=0, y=0, z=1} + tdir = {x=0, y=0, z=1} + tpos = {x=pos.x+3, y=pos.y-1, z=pos.z+7} + else + return success + end + local function set_brick(pos) + local c = pr:next(1, 3) -- cracked chance + local m = pr:next(1, 10) -- chance for monster egg + local brick + if m == 1 then + if c == 1 then + brick = "mcl_monster_eggs:monster_egg_stonebrickcracked" + else + brick = "mcl_monster_eggs:monster_egg_stonebrick" + end + else + if c == 1 then + brick = "mcl_core:stonebrickcracked" + else + brick = "mcl_core:stonebrick" + end + end + minetest.set_node(pos, {name=brick}) + end + local ladder_param2 = minetest.dir_to_wallmounted(tdir) + local real_depth = 0 + -- Check how deep we can actuall dig + for y=1, depth-5 do + real_depth = real_depth + 1 + local node = minetest.get_node({x=tpos.x,y=tpos.y-y,z=tpos.z}) + local def = minetest.registered_nodes[node.name] + if not (def and def.walkable and def.liquidtype == "none" and def.is_ground_content) then + bpos.y = tpos.y-y+1 + break + end + end + if real_depth <= 6 then + return success + end + -- Generate ladder to basement + for y=1, real_depth-1 do + set_brick({x=tpos.x-1,y=tpos.y-y,z=tpos.z }) + set_brick({x=tpos.x+1,y=tpos.y-y,z=tpos.z }) + set_brick({x=tpos.x ,y=tpos.y-y,z=tpos.z-1}) + set_brick({x=tpos.x ,y=tpos.y-y,z=tpos.z+1}) + minetest.set_node({x=tpos.x,y=tpos.y-y,z=tpos.z}, {name="mcl_core:ladder", param2=ladder_param2}) + end + -- Place basement + mcl_structures.generate_igloo_basement(bpos, rotation, def.loot, pr) + -- Place hidden trapdoor + minetest.after(5, function(tpos, dir) + minetest.set_node(tpos, {name="mcl_doors:trapdoor", param2=20+minetest.dir_to_facedir(dir)}) -- TODO: more reliable param2 + end, tpos, dir) + end + return success +end + +mcl_structures.register_structure("igloo",{ + place_on = {"mcl_core:snowblock","mcl_core:snow","group:grass_block_snow"}, + fill_ratio = 0.01, + sidelen = 16, + chunk_probability = 250, + solid_ground = true, + make_foundation = true, + y_max = mcl_vars.mg_overworld_max, + y_min = 0, + y_offset = 0, + biomes = { "ColdTaiga", "IcePlainsSpikes", "IcePlains" }, + place_func = mcl_structures.generate_igloo, + loot = { + ["mcl_chests:chest"] = {{ + stacks_min = 1, + stacks_max = 1, + items = { + { itemstring = "mcl_core:apple_gold", weight = 1 }, + } + }, + { + stacks_min = 2, + stacks_max = 8, + items = { + { itemstring = "mcl_core:coal_lump", weight = 15, amount_min = 1, amount_max = 4 }, + { itemstring = "mcl_core:apple", weight = 15, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_farming:wheat_item", weight = 10, amount_min = 2, amount_max = 3 }, + { itemstring = "mcl_core:gold_nugget", weight = 10, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 10 }, + { itemstring = "mcl_tools:axe_stone", weight = 2 }, + { itemstring = "mcl_core:emerald", weight = 1 }, + } + }}, + } +}) diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index 5d3ecac6c..44d21cd96 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -11,6 +11,11 @@ local rotations = { "270" } +local replacement = { + ["mcl_farming:pumpkintige_linked_t"] = "mcl_farming:pumpkintige_unconnect", + ["mcl_farming:melontige_linked_t"] = "mcl_farming:melontige_unconnect" +} + local function ecb_place(blockpos, action, calls_remaining, param) if calls_remaining >= 1 then return end minetest.place_schematic(param.pos, param.schematic, param.rotation, param.replacements, param.force_placement, param.flags) @@ -37,8 +42,9 @@ function mcl_structures.place_schematic(pos, schematic, rotation, replacements, local p1 = {x=pos.x , y=pos.y , z=pos.z } local p2 = {x=pos.x+x-1, y=pos.y+s.size.y-1, z=pos.z+z-1} minetest.log("verbose", "[mcl_structures] size=" ..minetest.pos_to_string(s.size) .. ", rotation=" .. tostring(rotation) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2)) - local param = {pos=vector.new(pos), schematic=s, rotation=rotation, replacements=replacements, force_placement=force_placement, flags=flags, p1=p1, p2=p2, after_placement_callback = after_placement_callback, size=vector.new(s.size), pr=pr, callback_param=callback_param} + local param = {pos=vector.new(pos), schematic=s, rotation=rotation, replacements=replacement, force_placement=force_placement, flags=flags, p1=p1, p2=p2, after_placement_callback = after_placement_callback, size=vector.new(s.size), pr=pr, callback_param=callback_param} minetest.emerge_area(p1, p2, ecb_place, param) + return true end end @@ -67,6 +73,7 @@ local function init_node_construct(pos) end return false end +mcl_structures.init_node_construct = init_node_construct -- The call of Struct function mcl_structures.call_struct(pos, struct_style, rotation, pr) @@ -74,23 +81,7 @@ function mcl_structures.call_struct(pos, struct_style, rotation, pr) if not rotation then rotation = "random" end - if struct_style == "desert_temple" then - return mcl_structures.generate_desert_temple(pos, rotation, pr) - elseif struct_style == "desert_well" then - return mcl_structures.generate_desert_well(pos, rotation) - elseif struct_style == "igloo" then - return mcl_structures.generate_igloo(pos, rotation, pr) - elseif struct_style == "witch_hut" then - return mcl_structures.generate_witch_hut(pos, rotation) - elseif struct_style == "ice_spike_small" then - return mcl_structures.generate_ice_spike_small(pos, rotation) - elseif struct_style == "ice_spike_large" then - return mcl_structures.generate_ice_spike_large(pos, rotation) - elseif struct_style == "boulder" then - return mcl_structures.generate_boulder(pos, rotation, pr) - elseif struct_style == "fossil" then - return mcl_structures.generate_fossil(pos, rotation, pr) - elseif struct_style == "end_exit_portal" then + if struct_style == "end_exit_portal" then return mcl_structures.generate_end_exit_portal(pos, rotation) elseif struct_style == "end_exit_portal_open" then return mcl_structures.generate_end_exit_portal_open(pos, rotation) @@ -101,245 +92,6 @@ function mcl_structures.call_struct(pos, struct_style, rotation, pr) end end -function mcl_structures.generate_desert_well(pos, rot) - local newpos = {x=pos.x,y=pos.y-2,z=pos.z} - local path = modpath.."/schematics/mcl_structures_desert_well.mts" - return mcl_structures.place_schematic(newpos, path, rot or "0", nil, true) -end - -function mcl_structures.generate_igloo(pos, rotation, pr) - -- Place igloo - local success, rotation = mcl_structures.generate_igloo_top(pos, pr) - -- Place igloo basement with 50% chance - local r = pr:next(1,2) - if r == 1 then - -- Select basement depth - local dim = mcl_worlds.pos_to_dimension(pos) - --local buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) - local buffer - if dim == "nether" then - buffer = pos.y - (mcl_vars.mg_lava_nether_max + 10) - elseif dim == "end" then - buffer = pos.y - (mcl_vars.mg_end_min + 1) - elseif dim == "overworld" then - buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) - else - return success - end - if buffer <= 19 then - return success - end - local depth = pr:next(19, buffer) - local bpos = {x=pos.x, y=pos.y-depth, z=pos.z} - -- trapdoor position - local tpos - local dir, tdir - if rotation == "0" then - dir = {x=-1, y=0, z=0} - tdir = {x=1, y=0, z=0} - tpos = {x=pos.x+7, y=pos.y-1, z=pos.z+3} - elseif rotation == "90" then - dir = {x=0, y=0, z=-1} - tdir = {x=0, y=0, z=-1} - tpos = {x=pos.x+3, y=pos.y-1, z=pos.z+1} - elseif rotation == "180" then - dir = {x=1, y=0, z=0} - tdir = {x=-1, y=0, z=0} - tpos = {x=pos.x+1, y=pos.y-1, z=pos.z+3} - elseif rotation == "270" then - dir = {x=0, y=0, z=1} - tdir = {x=0, y=0, z=1} - tpos = {x=pos.x+3, y=pos.y-1, z=pos.z+7} - else - return success - end - local function set_brick(pos) - local c = pr:next(1, 3) -- cracked chance - local m = pr:next(1, 10) -- chance for monster egg - local brick - if m == 1 then - if c == 1 then - brick = "mcl_monster_eggs:monster_egg_stonebrickcracked" - else - brick = "mcl_monster_eggs:monster_egg_stonebrick" - end - else - if c == 1 then - brick = "mcl_core:stonebrickcracked" - else - brick = "mcl_core:stonebrick" - end - end - minetest.set_node(pos, {name=brick}) - end - local ladder_param2 = minetest.dir_to_wallmounted(tdir) - local real_depth = 0 - -- Check how deep we can actuall dig - for y=1, depth-5 do - real_depth = real_depth + 1 - local node = minetest.get_node({x=tpos.x,y=tpos.y-y,z=tpos.z}) - local def = minetest.registered_nodes[node.name] - if not (def and def.walkable and def.liquidtype == "none" and def.is_ground_content) then - bpos.y = tpos.y-y+1 - break - end - end - if real_depth <= 6 then - return success - end - -- Generate ladder to basement - for y=1, real_depth-1 do - set_brick({x=tpos.x-1,y=tpos.y-y,z=tpos.z }) - set_brick({x=tpos.x+1,y=tpos.y-y,z=tpos.z }) - set_brick({x=tpos.x ,y=tpos.y-y,z=tpos.z-1}) - set_brick({x=tpos.x ,y=tpos.y-y,z=tpos.z+1}) - minetest.set_node({x=tpos.x,y=tpos.y-y,z=tpos.z}, {name="mcl_core:ladder", param2=ladder_param2}) - end - -- Place basement - mcl_structures.generate_igloo_basement(bpos, rotation, pr) - -- Place hidden trapdoor - minetest.after(5, function(tpos, dir) - minetest.set_node(tpos, {name="mcl_doors:trapdoor", param2=20+minetest.dir_to_facedir(dir)}) -- TODO: more reliable param2 - end, tpos, dir) - end - return success -end - -function mcl_structures.generate_igloo_top(pos, pr) - -- FIXME: This spawns bookshelf instead of furnace. Fix this! - -- Furnace does ot work atm because apparently meta is not set. :-( - local newpos = {x=pos.x,y=pos.y-1,z=pos.z} - local path = modpath.."/schematics/mcl_structures_igloo_top.mts" - local rotation = tostring(pr:next(0,3)*90) - return mcl_structures.place_schematic(newpos, path, rotation, nil, true), rotation -end - -local function igloo_placement_callback(p1, p2, size, orientation, pr) - local chest_offset - if orientation == "0" then - chest_offset = {x=5, y=1, z=5} - elseif orientation == "90" then - chest_offset = {x=5, y=1, z=3} - elseif orientation == "180" then - chest_offset = {x=3, y=1, z=1} - elseif orientation == "270" then - chest_offset = {x=1, y=1, z=5} - else - return - end - --local size = {x=9,y=5,z=7} - local lootitems = mcl_loot.get_multi_loot({ - { - stacks_min = 1, - stacks_max = 1, - items = { - { itemstring = "mcl_core:apple_gold", weight = 1 }, - } - }, - { - stacks_min = 2, - stacks_max = 8, - items = { - { itemstring = "mcl_core:coal_lump", weight = 15, amount_min = 1, amount_max = 4 }, - { itemstring = "mcl_core:apple", weight = 15, amount_min = 1, amount_max = 3 }, - { itemstring = "mcl_farming:wheat_item", weight = 10, amount_min = 2, amount_max = 3 }, - { itemstring = "mcl_core:gold_nugget", weight = 10, amount_min = 1, amount_max = 3 }, - { itemstring = "mcl_mobitems:rotten_flesh", weight = 10 }, - { itemstring = "mcl_tools:axe_stone", weight = 2 }, - { itemstring = "mcl_core:emerald", weight = 1 }, - } - }}, pr) - - local chest_pos = vector.add(p1, chest_offset) - init_node_construct(chest_pos) - local meta = minetest.get_meta(chest_pos) - local inv = meta:get_inventory() - mcl_loot.fill_inventory(inv, "main", lootitems, pr) -end - -function mcl_structures.generate_igloo_basement(pos, orientation, pr) - -- TODO: Add brewing stand - -- TODO: Add monster eggs - -- TODO: Spawn villager and zombie villager - local path = modpath.."/schematics/mcl_structures_igloo_basement.mts" - mcl_structures.place_schematic(pos, path, orientation, nil, true, nil, igloo_placement_callback, pr) -end - -function mcl_structures.generate_boulder(pos, rotation, pr) - -- Choose between 2 boulder sizes (2×2×2 or 3×3×3) - local r = pr:next(1, 10) - local path - if r <= 3 then - path = modpath.."/schematics/mcl_structures_boulder_small.mts" - else - path = modpath.."/schematics/mcl_structures_boulder.mts" - end - - local newpos = {x=pos.x,y=pos.y-1,z=pos.z} - - return minetest.place_schematic(newpos, path, rotation) -- don't serialize schematics for registered biome decorations, for MT 5.4.0, https://github.com/minetest/minetest/issues/10995 -end - -local function spawn_witch(p1,p2) - local c = minetest.find_node_near(p1,15,{"mcl_cauldrons:cauldron"}) - if c then - local nn = minetest.find_nodes_in_area_under_air(vector.new(p1.x,c.y-1,p1.z),vector.new(p2.x,c.y-1,p2.z),{"mcl_core:sprucewood"}) - local witch = minetest.add_entity(vector.offset(nn[math.random(#nn)],0,1,0),"mobs_mc:witch"):get_luaentity() - local cat = minetest.add_entity(vector.offset(nn[math.random(#nn)],0,1,0),"mobs_mc:cat"):get_luaentity() - witch._home = c - witch.can_despawn = false - cat.object:set_properties({textures = {"mobs_mc_cat_black.png"}}) - cat.owner = "!witch!" --so it's not claimable by player - cat._home = c - cat.can_despawn = false - return - end -end - -local function hut_placement_callback(p1, p2, size, orientation, pr) - if not p1 or not p2 then return end - local legs = minetest.find_nodes_in_area(p1, p2, "mcl_core:tree") - for i = 1, #legs do - while minetest.get_item_group(mcl_vars.get_node({x=legs[i].x, y=legs[i].y-1, z=legs[i].z}, true, 333333).name, "water") ~= 0 do - legs[i].y = legs[i].y - 1 - minetest.swap_node(legs[i], {name = "mcl_core:tree", param2 = 2}) - end - end - spawn_witch(p1,p2) -end - -function mcl_structures.generate_witch_hut(pos, rotation, pr) - local path = modpath.."/schematics/mcl_structures_witch_hut.mts" - mcl_structures.place_schematic(pos, path, rotation, nil, true, nil, hut_placement_callback, pr) -end - -function mcl_structures.generate_ice_spike_small(pos, rotation) - local path = modpath.."/schematics/mcl_structures_ice_spike_small.mts" - return minetest.place_schematic(pos, path, rotation or "random", nil, false) -- don't serialize schematics for registered biome decorations, for MT 5.4.0 -end - -function mcl_structures.generate_ice_spike_large(pos, rotation) - local path = modpath.."/schematics/mcl_structures_ice_spike_large.mts" - return minetest.place_schematic(pos, path, rotation or "random", nil, false) -- don't serialize schematics for registered biome decorations, for MT 5.4.0 -end - -function mcl_structures.generate_fossil(pos, rotation, pr) - -- Generates one out of 8 possible fossil pieces - local newpos = {x=pos.x,y=pos.y-1,z=pos.z} - local fossils = { - "mcl_structures_fossil_skull_1.mts", -- 4×5×5 - "mcl_structures_fossil_skull_2.mts", -- 5×5×5 - "mcl_structures_fossil_skull_3.mts", -- 5×5×7 - "mcl_structures_fossil_skull_4.mts", -- 7×5×5 - "mcl_structures_fossil_spine_1.mts", -- 3×3×13 - "mcl_structures_fossil_spine_2.mts", -- 5×4×13 - "mcl_structures_fossil_spine_3.mts", -- 7×4×13 - "mcl_structures_fossil_spine_4.mts", -- 8×5×13 - } - local r = pr:next(1, #fossils) - local path = modpath.."/schematics/"..fossils[r] - return mcl_structures.place_schematic(newpos, path, rotation or "random", nil, true) -end function mcl_structures.generate_end_exit_portal(pos, rot) local path = modpath.."/schematics/mcl_structures_end_exit_portal.mts" @@ -443,94 +195,7 @@ function mcl_structures.generate_end_portal_shrine(pos, rotation, pr) mcl_structures.place_schematic(newpos, path, rotation or "0", nil, true, nil, shrine_placement_callback, pr) end -local function temple_placement_callback(p1, p2, size, rotation, pr) - - -- Delete cacti leftovers: - local cactus_nodes = minetest.find_nodes_in_area_under_air(p1, p2, "mcl_core:cactus") - if cactus_nodes and #cactus_nodes > 0 then - for _, pos in pairs(cactus_nodes) do - local node_below = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if node_below and node_below.name == "mcl_core:sandstone" then - minetest.swap_node(pos, {name="air"}) - end - end - end - - -- Find chests. - -- FIXME: Searching this large area just for the chets is not efficient. Need a better way to find the chests; - -- probably let's just infer it from newpos because the schematic always the same. - local chests = minetest.find_nodes_in_area(p1, p2, "mcl_chests:chest") - - -- Add desert temple loot into chests - for c=1, #chests do - local lootitems = mcl_loot.get_multi_loot({ - { - stacks_min = 2, - stacks_max = 4, - items = { - { itemstring = "mcl_mobitems:bone", weight = 25, amount_min = 4, amount_max=6 }, - { itemstring = "mcl_mobitems:rotten_flesh", weight = 25, amount_min = 3, amount_max=7 }, - { itemstring = "mcl_mobitems:spider_eye", weight = 25, amount_min = 1, amount_max=3 }, - { itemstring = "mcl_books:book", weight = 20, func = function(stack, pr) - mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) - end }, - { itemstring = "mcl_mobitems:saddle", weight = 20, }, - { itemstring = "mcl_core:apple_gold", weight = 20, }, - { itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 }, - { itemstring = "mcl_core:iron_ingot", weight = 15, amount_min = 1, amount_max = 5 }, - { itemstring = "mcl_core:emerald", weight = 15, amount_min = 1, amount_max = 3 }, - { itemstring = "", weight = 15, }, - { itemstring = "mcl_mobitems:iron_horse_armor", weight = 15, }, - { itemstring = "mcl_mobitems:gold_horse_armor", weight = 10, }, - { itemstring = "mcl_mobitems:diamond_horse_armor", weight = 5, }, - { itemstring = "mcl_core:diamond", weight = 5, amount_min = 1, amount_max = 3 }, - { itemstring = "mcl_core:apple_gold_enchanted", weight = 2, }, - } - }, - { - stacks_min = 4, - stacks_max = 4, - items = { - { itemstring = "mcl_mobitems:bone", weight = 10, amount_min = 1, amount_max = 8 }, - { itemstring = "mcl_mobitems:rotten_flesh", weight = 10, amount_min = 1, amount_max = 8 }, - { itemstring = "mcl_mobitems:gunpowder", weight = 10, amount_min = 1, amount_max = 8 }, - { itemstring = "mcl_core:sand", weight = 10, amount_min = 1, amount_max = 8 }, - { itemstring = "mcl_mobitems:string", weight = 10, amount_min = 1, amount_max = 8 }, - } - }}, pr) - init_node_construct(chests[c]) - local meta = minetest.get_meta(chests[c]) - local inv = meta:get_inventory() - mcl_loot.fill_inventory(inv, "main", lootitems, pr) - end - - -- Initialize pressure plates and randomly remove up to 5 plates - local pplates = minetest.find_nodes_in_area(p1, p2, "mesecons_pressureplates:pressure_plate_stone_off") - local pplates_remove = 5 - for p=1, #pplates do - if pplates_remove > 0 and pr:next(1, 100) >= 50 then - -- Remove plate - minetest.remove_node(pplates[p]) - pplates_remove = pplates_remove - 1 - else - -- Initialize plate - minetest.registered_nodes["mesecons_pressureplates:pressure_plate_stone_off"].on_construct(pplates[p]) - end - end -end - -function mcl_structures.generate_desert_temple(pos, rotation, pr) - -- No Generating for the temple ... Why using it ? No Change - local path = modpath.."/schematics/mcl_structures_desert_temple.mts" - local newpos = {x=pos.x,y=pos.y-12,z=pos.z} - --local size = {x=22, y=24, z=22} - if newpos == nil then - return - end - mcl_structures.place_schematic(newpos, path, rotation or "random", nil, true, nil, temple_placement_callback, pr) -end - -local registered_structures = {} +local structure_data = {} --[[ Returns a table of structure of the specified type. Currently the only valid parameter is "stronghold". @@ -543,18 +208,18 @@ Format of return value: TODO: Implement this function for all other structure types as well. ]] -function mcl_structures.get_registered_structures(structure_type) - if registered_structures[structure_type] then - return table.copy(registered_structures[structure_type]) +function mcl_structures.get_structure_data(structure_type) + if structure_data[structure_type] then + return table.copy(structure_data[structure_type]) else return {} end end -- Register a structures table for the given type. The table format is the same as for --- mcl_structures.get_registered_structures. -function mcl_structures.register_structures(structure_type, structures) - registered_structures[structure_type] = structures +-- mcl_structures.get_structure_data. +function mcl_structures.register_structure_data(structure_type, structures) + structure_data[structure_type] = structures end local function dir_to_rotation(dir) @@ -571,9 +236,81 @@ local function dir_to_rotation(dir) return "0" end +dofile(modpath.."/api.lua") +dofile(modpath.."/shipwrecks.lua") +dofile(modpath.."/desert_temple.lua") +dofile(modpath.."/jungle_temple.lua") +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") + + + +mcl_structures.register_structure("desert_well",{ + place_on = {"group:sand"}, + fill_ratio = 0.01, + flags = "place_center_x, place_center_z", + not_near = { "desert_temple_new" }, + solid_ground = true, + sidelen = 4, + chunk_probability = 600, + y_max = mcl_vars.mg_overworld_max, + y_min = 1, + y_offset = -2, + biomes = { "Desert" }, + filenames = { modpath.."/schematics/mcl_structures_desert_well.mts" }, +}) + +mcl_structures.register_structure("fossil",{ + place_on = {"group:material_stone","group:sand"}, + fill_ratio = 0.01, + flags = "place_center_x, place_center_z", + solid_ground = true, + sidelen = 13, + chunk_probability = 1000, + y_offset = function(pr) return ( pr:next(1,16) * -1 ) -16 end, + y_max = 15, + y_min = mcl_vars.mg_overworld_min + 35, + biomes = { "Desert" }, + filenames = { + modpath.."/schematics/mcl_structures_fossil_skull_1.mts", -- 4×5×5 + modpath.."/schematics/mcl_structures_fossil_skull_2.mts", -- 5×5×5 + modpath.."/schematics/mcl_structures_fossil_skull_3.mts", -- 5×5×7 + modpath.."/schematics/mcl_structures_fossil_skull_4.mts", -- 7×5×5 + modpath.."/schematics/mcl_structures_fossil_spine_1.mts", -- 3×3×13 + modpath.."/schematics/mcl_structures_fossil_spine_2.mts", -- 5×4×13 + modpath.."/schematics/mcl_structures_fossil_spine_3.mts", -- 7×4×13 + modpath.."/schematics/mcl_structures_fossil_spine_4.mts", -- 8×5×13 + }, +}) + +mcl_structures.register_structure("boulder",{ + filenames = { + modpath.."/schematics/mcl_structures_boulder_small.mts", + modpath.."/schematics/mcl_structures_boulder_small.mts", + modpath.."/schematics/mcl_structures_boulder_small.mts", + modpath.."/schematics/mcl_structures_boulder.mts", + -- small boulder 3x as likely + }, +},true) --is spawned as a normal decoration. this is just for /spawnstruct +mcl_structures.register_structure("ice_spike_small",{ + filenames = { + modpath.."/schematics/mcl_structures_ice_spike_small.mts" + }, +},true) --is spawned as a normal decoration. this is just for /spawnstruct +mcl_structures.register_structure("ice_spike_large",{ + sidelen = 6, + filenames = { + modpath.."/schematics/mcl_structures_ice_spike_large.mts" + }, +},true) --is spawned as a normal decoration. this is just for /spawnstruct + -- Debug command minetest.register_chatcommand("spawnstruct", { - params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_exit_portal_open | end_gateway_portal | end_portal_shrine | nether_portal | dungeon", + params = "end_exit_portal | end_exit_portal_open | end_gateway_portal | end_portal_shrine | nether_portal | dungeon", description = S("Generate a pre-defined structure near your position."), privs = {debug = true}, func = function(name, param) @@ -587,23 +324,7 @@ minetest.register_chatcommand("spawnstruct", { local pr = PseudoRandom(pos.x+pos.y+pos.z) local errord = false local message = S("Structure placed.") - if param == "desert_temple" then - mcl_structures.generate_desert_temple(pos, rot, pr) - elseif param == "desert_well" then - mcl_structures.generate_desert_well(pos, rot) - elseif param == "igloo" then - mcl_structures.generate_igloo(pos, rot, pr) - elseif param == "witch_hut" then - mcl_structures.generate_witch_hut(pos, rot, pr) - elseif param == "boulder" then - mcl_structures.generate_boulder(pos, rot, pr) - elseif param == "fossil" then - mcl_structures.generate_fossil(pos, rot, pr) - elseif param == "ice_spike_small" then - mcl_structures.generate_ice_spike_small(pos, rot, pr) - elseif param == "ice_spike_large" then - mcl_structures.generate_ice_spike_large(pos, rot, pr) - elseif param == "end_exit_portal" then + if param == "end_exit_portal" then mcl_structures.generate_end_exit_portal(pos, rot, pr) elseif param == "end_exit_portal_open" then mcl_structures.generate_end_exit_portal_open(pos, rot, pr) @@ -619,6 +340,12 @@ minetest.register_chatcommand("spawnstruct", { message = S("Error: No structure type given. Please use “/spawnstruct ”.") errord = true else + for n,d in pairs(mcl_structures.registered_structures) do + if n == param then + mcl_structures.place_structure(pos,d,pr,math.random()) + return true,message + end + end message = S("Error: Unknown structure type. Please use “/spawnstruct ”.") errord = true end @@ -628,3 +355,10 @@ minetest.register_chatcommand("spawnstruct", { end end }) +minetest.register_on_mods_loaded(function() + local p = "" + for n,_ in pairs(mcl_structures.registered_structures) do + p = p .. " | "..n + end + minetest.registered_chatcommands["spawnstruct"].params = minetest.registered_chatcommands["spawnstruct"].params .. p +end) diff --git a/mods/MAPGEN/mcl_structures/jungle_temple.lua b/mods/MAPGEN/mcl_structures/jungle_temple.lua new file mode 100644 index 000000000..843dec04d --- /dev/null +++ b/mods/MAPGEN/mcl_structures/jungle_temple.lua @@ -0,0 +1,44 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) + +mcl_structures.register_structure("jungle_temple",{ + place_on = {"group:grass_block","group:dirt","mcl_core:dirt_with_grass"}, + fill_ratio = 0.01, + flags = "place_center_x, place_center_z", + solid_ground = true, + make_foundation = true, + y_offset = function(pr) return pr:next(-3,0) -5 end, + chunk_probability = 200, + y_max = mcl_vars.mg_overworld_max, + y_min = 1, + biomes = { "Jungle" }, + sidelen = 18, + filenames = { + modpath.."/schematics/mcl_structures_jungle_temple.mts", + modpath.."/schematics/mcl_structures_jungle_temple_nice.mts", + }, + loot = { + ["mcl_chests:trapped_chest_small" ] ={{ + stacks_min = 2, + stacks_max = 6, + items = { + { itemstring = "mcl_mobitems:bone", weight = 20, amount_min = 4, amount_max=6 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 16, amount_min = 3, amount_max=7 }, + { itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 }, + --{ itemstring = "mcl_bamboo:bamboo", weight = 15, amount_min = 1, amount_max=3 }, --FIXME BAMBOO + { itemstring = "mcl_core:iron_ingot", weight = 15, amount_min = 1, amount_max = 5 }, + { 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_books:book", weight = 1, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) + end }, + { 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_enchanted", weight = 2, }, + } + }} + } +}) diff --git a/mods/MAPGEN/mcl_structures/mod.conf b/mods/MAPGEN/mcl_structures/mod.conf index 3150c7cec..823714aad 100644 --- a/mods/MAPGEN/mcl_structures/mod.conf +++ b/mods/MAPGEN/mcl_structures/mod.conf @@ -1,4 +1,4 @@ name = mcl_structures -author = Wuzzy -description = Structures for MCL2 -depends = mcl_loot +author = Wuzzy, cora +description = Structure placement for MCL2 +depends = mcl_init, mcl_loot diff --git a/mods/MAPGEN/mcl_structures/ocean_ruins.lua b/mods/MAPGEN/mcl_structures/ocean_ruins.lua new file mode 100644 index 000000000..0b609aee7 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/ocean_ruins.lua @@ -0,0 +1,132 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) + +local cold_oceans = { + "RoofedForest_ocean", + "BirchForestM_ocean", + "BirchForest_ocean", + "IcePlains_deep_ocean", + "ExtremeHillsM_deep_ocean", + "SunflowerPlains_ocean", + "MegaSpruceTaiga_deep_ocean", + "ExtremeHillsM_ocean", + "SunflowerPlains_deep_ocean", + "BirchForest_deep_ocean", + "IcePlainsSpikes_ocean", + "StoneBeach_ocean", + "ColdTaiga_deep_ocean", + "Forest_deep_ocean", + "FlowerForest_deep_ocean", + "MegaTaiga_ocean", + "StoneBeach_deep_ocean", + "IcePlainsSpikes_deep_ocean", + "ColdTaiga_ocean", + "ExtremeHills+_deep_ocean", + "ExtremeHills_ocean", + "Forest_ocean", + "MegaTaiga_deep_ocean", + "MegaSpruceTaiga_ocean", + "ExtremeHills+_ocean", + "RoofedForest_deep_ocean", + "IcePlains_ocean", + "FlowerForest_ocean", + "ExtremeHills_deep_ocean", + "Taiga_ocean", + "BirchForestM_deep_ocean", + "Taiga_deep_ocean", +} + +local warm_oceans = { + "JungleEdgeM_ocean", + "Jungle_deep_ocean", + "Savanna_ocean", + "MesaPlateauF_ocean", + "Swampland_ocean", + "Mesa_ocean", + "Plains_ocean", + "MesaPlateauFM_ocean", + "MushroomIsland_ocean", + "SavannaM_ocean", + "JungleEdge_ocean", + "MesaBryce_ocean", + "Jungle_ocean", + "Desert_ocean", + "JungleM_ocean", + "JungleEdgeM_deep_ocean", + "Jungle_deep_ocean", + "Savanna_deep_ocean", + "MesaPlateauF_deep_ocean", + "Swampland_deep_ocean", + "Mesa_deep_ocean", + "Plains_deep_ocean", + "MesaPlateauFM_deep_ocean", + "MushroomIsland_deep_ocean", + "SavannaM_deep_ocean", + "JungleEdge_deep_ocean", + "MesaBryce_deep_ocean", + "Jungle_deep_ocean", + "Desert_deep_ocean", + "JungleM_deep_ocean", +} + +local cold = { + place_on = {"group:sand","mcl_core:gravel","mcl_core:dirt","mcl_core:clay","group:material_stone"}, + spawn_by = {"mcl_core:water_source"}, + num_spawn_by = 2, + fill_ratio = 0.01, + flags = "place_center_x, place_center_z, force_placement", + solid_ground = true, + make_foundation = true, + y_offset = -1, + y_min = mcl_vars.mg_overworld_min, + y_max = -2, + biomes = cold_oceans, + chunk_probability = 400, + sidelen = 20, + filenames = { + modpath.."/schematics/mcl_structures_ocean_ruins_cold_1.mts", + modpath.."/schematics/mcl_structures_ocean_ruins_cold_2.mts", + modpath.."/schematics/mcl_structures_ocean_ruins_cold_3.mts", + }, + loot = { + ["mcl_chests:chest_small" ] = { + { + stacks_min = 2, + stacks_max = 4, + items = { + { itemstring = "mcl_core:coal_lump", weight = 25, amount_min = 1, amount_max=4 }, + { itemstring = "mcl_farming:wheat_item", weight = 25, amount_min = 2, amount_max=3 }, + { itemstring = "mcl_core:gold_nugget", weight = 25, amount_min = 1, amount_max=3 }, + --{ itemstring = "mcl_maps:treasure_map", weight = 20, }, --FIXME Treasure map + + { itemstring = "mcl_books:book", weight = 10, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) + end }, + { itemstring = "mcl_fishing:fishing_rod_enchanted", weight = 20, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) + end }, + { itemstring = "mcl_core:emerald", weight = 15, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_armor:chestplate_leather", weight = 15, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_core:apple_gold", weight = 20, }, + { itemstring = "mcl_armor:helmet_gold", weight = 15, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 }, + { itemstring = "mcl_core:iron_ingot", weight = 15, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_core:apple_gold_enchanted", weight = 2, }, + } + } + } + }, +} + +local warm = table.copy(cold) +warm.biomes = warm_oceans +warm.filenames = { + modpath.."/schematics/mcl_structures_ocean_ruins_warm_1.mts", + modpath.."/schematics/mcl_structures_ocean_ruins_warm_2.mts", + modpath.."/schematics/mcl_structures_ocean_ruins_warm_3.mts", + modpath.."/schematics/mcl_structures_ocean_ruins_warm_4.mts", +} + +mcl_structures.register_structure("cold_ocean_ruins",cold) +mcl_structures.register_structure("warm_ocean_ruins",warm) diff --git a/mods/MAPGEN/mcl_structures/ruined_portal.lua b/mods/MAPGEN/mcl_structures/ruined_portal.lua new file mode 100644 index 000000000..002195f76 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/ruined_portal.lua @@ -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) diff --git a/mods/MAPGEN/mcl_structures/schematics/coral_cora.mts b/mods/MAPGEN/mcl_structures/schematics/coral_cora.mts new file mode 100644 index 000000000..8ee971820 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/coral_cora.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_brain_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_brain_1.mts new file mode 100644 index 000000000..03e1ddfb6 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_brain_1.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_brain_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_brain_2.mts new file mode 100644 index 000000000..f40af2ec3 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_brain_2.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_bubble_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_bubble_1.mts new file mode 100644 index 000000000..1111368e8 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_bubble_1.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_bubble_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_bubble_2.mts new file mode 100644 index 000000000..c3cf1012e Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_bubble_2.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_fire_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_fire_1.mts new file mode 100644 index 000000000..fffbfb26f Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_fire_1.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_fire_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_fire_2.mts new file mode 100644 index 000000000..a55b3995f Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_fire_2.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_horn_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_horn_1.mts new file mode 100644 index 000000000..03c8f0e85 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_horn_1.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_horn_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_horn_2.mts new file mode 100644 index 000000000..8d2ec7f2b Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_horn_2.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_tube_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_tube_1.mts new file mode 100644 index 000000000..89d08e9ea Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_tube_1.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_tube_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_tube_2.mts new file mode 100644 index 000000000..cd4372f95 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_coral_tube_2.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple.mts new file mode 100644 index 000000000..ec98a83ea Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple_nice.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple_nice.mts new file mode 100644 index 000000000..8a9babb9b Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple_nice.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_1.mts new file mode 100644 index 000000000..1b2c8d1f3 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_1.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_2.mts new file mode 100644 index 000000000..d7437d7ce Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_2.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_3.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_3.mts new file mode 100644 index 000000000..67cb5c9ac Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_cold_3.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_1.mts new file mode 100644 index 000000000..072931b13 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_1.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_2.mts new file mode 100644 index 000000000..9834226fa Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_2.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_3.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_3.mts new file mode 100644 index 000000000..eb43cdf1c Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_3.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_4.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_4.mts new file mode 100644 index 000000000..0eb5bacf0 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ocean_ruins_warm_4.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_1.mts new file mode 100644 index 000000000..ae37576dc Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_1.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_2.mts new file mode 100644 index 000000000..fd17f1365 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_2.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_3.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_3.mts new file mode 100644 index 000000000..88c0acb28 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_3.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_4.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_4.mts new file mode 100644 index 000000000..404256ed9 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_4.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_5.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_5.mts new file mode 100644 index 000000000..f14105154 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_5.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_99.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_99.mts new file mode 100644 index 000000000..0834d8923 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_99.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_back_damaged.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_back_damaged.mts new file mode 100644 index 000000000..12f3c9b13 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_back_damaged.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_damaged.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_damaged.mts new file mode 100644 index 000000000..5c8a3e105 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_damaged.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_normal.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_normal.mts new file mode 100644 index 000000000..3d997c83b Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_full_normal.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_half_back.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_half_back.mts new file mode 100644 index 000000000..f58376f30 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_half_back.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_half_front.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_half_front.mts new file mode 100644 index 000000000..41efb386b Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_shipwreck_half_front.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_woodland_cabin.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_woodland_cabin.mts new file mode 100644 index 000000000..f654da926 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_woodland_cabin.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_woodland_outpost.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_woodland_outpost.mts new file mode 100644 index 000000000..dac927b66 Binary files /dev/null and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_woodland_outpost.mts differ diff --git a/mods/MAPGEN/mcl_structures/shipwrecks.lua b/mods/MAPGEN/mcl_structures/shipwrecks.lua new file mode 100644 index 000000000..72823d811 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/shipwrecks.lua @@ -0,0 +1,161 @@ +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) +--local S = minetest.get_translator(modname) + +local seed = minetest.get_mapgen_setting("seed") +local water_level = minetest.get_mapgen_setting("water_level") +local pr = PseudoRandom(seed) + +--schematics by chmodsayshello +local schems = { + modpath.."/schematics/mcl_structures_shipwreck_full_damaged.mts", + modpath.."/schematics/mcl_structures_shipwreck_full_normal.mts", + modpath.."/schematics/mcl_structures_shipwreck_full_back_damaged.mts", + modpath.."/schematics/mcl_structures_shipwreck_half_front.mts", + modpath.."/schematics/mcl_structures_shipwreck_half_back.mts", +} + +local ocean_biomes = { + "RoofedForest_ocean", + "JungleEdgeM_ocean", + "BirchForestM_ocean", + "BirchForest_ocean", + "IcePlains_deep_ocean", + "Jungle_deep_ocean", + "Savanna_ocean", + "MesaPlateauF_ocean", + "ExtremeHillsM_deep_ocean", + "Savanna_deep_ocean", + "SunflowerPlains_ocean", + "Swampland_deep_ocean", + "Swampland_ocean", + "MegaSpruceTaiga_deep_ocean", + "ExtremeHillsM_ocean", + "JungleEdgeM_deep_ocean", + "SunflowerPlains_deep_ocean", + "BirchForest_deep_ocean", + "IcePlainsSpikes_ocean", + "Mesa_ocean", + "StoneBeach_ocean", + "Plains_deep_ocean", + "JungleEdge_deep_ocean", + "SavannaM_deep_ocean", + "Desert_deep_ocean", + "Mesa_deep_ocean", + "ColdTaiga_deep_ocean", + "Plains_ocean", + "MesaPlateauFM_ocean", + "Forest_deep_ocean", + "JungleM_deep_ocean", + "FlowerForest_deep_ocean", + "MushroomIsland_ocean", + "MegaTaiga_ocean", + "StoneBeach_deep_ocean", + "IcePlainsSpikes_deep_ocean", + "ColdTaiga_ocean", + "SavannaM_ocean", + "MesaPlateauF_deep_ocean", + "MesaBryce_deep_ocean", + "ExtremeHills+_deep_ocean", + "ExtremeHills_ocean", + "MushroomIsland_deep_ocean", + "Forest_ocean", + "MegaTaiga_deep_ocean", + "JungleEdge_ocean", + "MesaBryce_ocean", + "MegaSpruceTaiga_ocean", + "ExtremeHills+_ocean", + "Jungle_ocean", + "RoofedForest_deep_ocean", + "IcePlains_ocean", + "FlowerForest_ocean", + "ExtremeHills_deep_ocean", + "MesaPlateauFM_deep_ocean", + "Desert_ocean", + "Taiga_ocean", + "BirchForestM_deep_ocean", + "Taiga_deep_ocean", + "JungleM_ocean" +} + +local beach_biomes = { + "FlowerForest_beach", + "Forest_beach", + "StoneBeach", + "ColdTaiga_beach_water", + "Taiga_beach", + "Savanna_beach", + "Plains_beach", + "ExtremeHills_beach", + "ColdTaiga_beach", + "Swampland_shore", + "MushroomIslandShore", + "JungleM_shore", + "Jungle_shore" +} + +mcl_structures.register_structure("shipwreck",{ + place_on = {"group:sand","mcl_core:gravel"}, + spawn_by = {"group:water"}, + num_spawn_by = 4, + noise_params = { + offset = 0, + scale = 0.000022, + spread = {x = 250, y = 250, z = 250}, + seed = 3, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, + sidelen = 16, + flags = "force_placement", + biomes = ocean_biomes, + y_max = water_level-4, + y_min = mcl_vars.mg_overworld_min, + filenames = schems, + y_offset = function(pr) return pr:next(-4,-2) end, + loot = { + ["mcl_chests:chest_small"] = { + stacks_min = 3, + stacks_max = 10, + items = { + { itemstring = "mcl_sus_stew:stew", weight = 10, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_core:paper", weight = 8, amount_min = 1, amount_max = 12 }, + { itemstring = "mcl_farming:wheat_item", weight = 7, amount_min = 8, amount_max = 21 }, + { itemstring = "mcl_farming:carrot_item", weight = 7, amount_min = 4, amount_max = 8 }, + { itemstring = "mcl_farming:potato_item_poison", weight = 7, amount_min = 2, amount_max = 6 }, + { itemstring = "mcl_farming:potato_item", weight = 7, amount_min = 2, amount_max = 6 }, + --{ itemstring = "TODO:moss_block", weight = 7, amount_min = 1, amount_max = 4 }, + { itemstring = "mcl_core:coal_lump", weight = 6, amount_min = 2, amount_max = 8 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 5, amount_min = 5, amount_max = 24 }, + { itemstring = "mcl_farming:potato_item", weight = 3, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_armor:helmet_leather_enchanted", weight = 3, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}) end }, + { itemstring = "mcl_armor:chestplate_leather_enchanted", weight = 3, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}) end }, + { itemstring = "mcl_armor:leggings_leather_enchanted", weight = 3, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}) end }, + { itemstring = "mcl_armor:boots_leather_enchanted", weight = 3, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}) end }, + --{ itemstring = "TODO:bamboo", weight = 2, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_farming:pumpkin", weight = 2, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_tnt:tnt", weight = 1, amount_min = 1, amount_max = 2 }, + + }, + { + stacks_min = 3, + stacks_max = 10, + items = { + { itemstring = "mcl_core:iron_ingot", weight = 8, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_core:iron_nugget", weight = 8, amount_min = 1, amount_max = 10 }, + { itemstring = "mcl_core:emerald", weight = 8, amount_min = 1, amount_max = 12 }, + { itemstring = "mcl_dye:blue", weight = 8, amount_min = 1, amount_max = 12 }, + { itemstring = "mcl_core:gold_ingot", weight = 8, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_core:gold_nugget", weight = 8, amount_min = 1, amount_max = 10 }, + { itemstring = "mcl_experience:bottle", weight = 8, amount_min = 1, amount_max = 10 }, + { itemstring = "mcl_core:diamond", weight = 8, amount_min = 1, amount_max = 10 }, + } + } + } + } +}) diff --git a/mods/MAPGEN/mcl_structures/witch_hut.lua b/mods/MAPGEN/mcl_structures/witch_hut.lua new file mode 100644 index 000000000..039c46332 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/witch_hut.lua @@ -0,0 +1,49 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) + +local function spawn_witch(p1,p2) + local c = minetest.find_node_near(p1,15,{"mcl_cauldrons:cauldron"}) + if c then + local nn = minetest.find_nodes_in_area_under_air(vector.new(p1.x,c.y-1,p1.z),vector.new(p2.x,c.y-1,p2.z),{"mcl_core:sprucewood"}) + local witch = minetest.add_entity(vector.offset(nn[math.random(#nn)],0,1,0),"mobs_mc:witch"):get_luaentity() + local cat = minetest.add_entity(vector.offset(nn[math.random(#nn)],0,1,0),"mobs_mc:cat"):get_luaentity() + witch._home = c + witch.can_despawn = false + cat.object:set_properties({textures = {"mobs_mc_cat_black.png"}}) + cat.owner = "!witch!" --so it's not claimable by player + cat._home = c + cat.can_despawn = false + return + end +end + +local function hut_placement_callback(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 legs = minetest.find_nodes_in_area(vector.offset(pos,-hl,0,-hl),vector.offset(pos,hl,0,hl), "mcl_core:tree") + local tree = {} + for _,leg in pairs(legs) do + while minetest.get_item_group(mcl_vars.get_node(vector.offset(leg,0,-1,0), true, 333333).name, "water") ~= 0 do + leg = vector.offset(leg,0,-1,0) + table.insert(tree,leg) + end + end + minetest.bulk_set_node(tree, {name = "mcl_core:tree", param2 = 2}) + spawn_witch(p1,p2) +end + +mcl_structures.register_structure("witch_hut",{ + place_on = {"group:sand","group:grass_block","mcl_core:water_source","group:dirt"}, + fill_ratio = 0.01, + flags = "place_center_x, place_center_z, liquid_surface, force_placement", + sidelen = 8, + chunk_probability = 300, + y_max = mcl_vars.mg_overworld_max, + y_min = -4, + y_offset = 0, + biomes = { "Swampland", "Swampland_ocean", "Swampland_shore" }, + filenames = { modpath.."/schematics/mcl_structures_witch_hut.mts" }, + after_place = hut_placement_callback, +}) diff --git a/mods/MAPGEN/mcl_structures/woodland_mansion.lua b/mods/MAPGEN/mcl_structures/woodland_mansion.lua new file mode 100644 index 000000000..6a4cfebe0 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/woodland_mansion.lua @@ -0,0 +1,80 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) + +mcl_structures.register_structure("woodland_cabin",{ + place_on = {"group:grass_block","group:dirt","mcl_core:dirt_with_grass"}, + fill_ratio = 0.01, + flags = "place_center_x, place_center_z", + solid_ground = true, + make_foundation = true, + chunk_probability = 800, + y_max = mcl_vars.mg_overworld_max, + y_min = 1, + biomes = { "RoofedForest" }, + sidelen = 32, + filenames = { + modpath.."/schematics/mcl_structures_woodland_cabin.mts", + modpath.."/schematics/mcl_structures_woodland_outpost.mts", + }, + after_place = function(p,def,pr) + local spawnon = {"mcl_deepslate:deepslate","mcl_core:birchwood","mcl_wool:red_carpet","mcl_wool:brown_carpet"} + local p1=vector.offset(p,-def.sidelen,-1,-def.sidelen) + local p2=vector.offset(p,def.sidelen,def.sidelen,def.sidelen) + local sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon) + if sp and #sp > 0 then + for i=1,5 do + local pos = sp[pr:next(1,#sp)] + if pos then + minetest.add_entity(pos,"mobs_mc:vindicator") + end + end + local pos = sp[pr:next(1,#sp)] + if pos then + minetest.add_entity(pos,"mobs_mc:evoker") + end + end + local parrot = minetest.find_node_near(p,25,{"mcl_heads:wither_skeleton"}) + if parrot then + minetest.add_entity(parrot,"mobs_mc:parrot") + end + end, + loot = { + ["mcl_chests:chest_small" ] ={{ + stacks_min = 3, + stacks_max = 3, + items = { + { itemstring = "mcl_mobitems:bone", weight = 10, amount_min = 1, amount_max=8 }, + { itemstring = "mcl_mobitems:gunpowder", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 10, amount_min = 1, amount_max=8 }, + { itemstring = "mcl_mobitems:string", weight = 10, amount_min = 1, amount_max=8 }, + + { itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 }, + }},{ + stacks_min = 1, + stacks_max = 4, + items = { + { itemstring = "mcl_farming:wheat_item", weight = 20, amount_min = 1, amount_max = 4 }, + { itemstring = "mcl_farming:bread", weight = 20, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_core:coal_lump", weight = 15, amount_min = 1, amount_max = 4 }, + { itemstring = "mesecons:mesecon", weight = 15, amount_min = 1, amount_max = 4 }, + { itemstring = "mcl_farming:beetroot_seeds", weight = 10, amount_min = 2, amount_max = 4 }, + { itemstring = "mcl_farming:melon_seeds", weight = 10, amount_min = 2, amount_max = 4 }, + { itemstring = "mcl_farming:pumpkin_seeds", weight = 10, amount_min = 2, amount_max = 4 }, + { itemstring = "mcl_core:iron_ingot", weight = 10, amount_min = 1, amount_max = 4 }, + { itemstring = "mcl_buckets:bucket_empty", weight = 10, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_core:gold_ingot", weight = 5, amount_min = 1, amount_max = 4 }, + }},{ + stacks_min = 1, + stacks_max = 4, + items = { + --{ itemstring = "FIXME:lead", weight = 20, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_mobs:nametag", weight = 2, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_books:book", weight = 1, func = function(stack, pr)mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) end }, + { itemstring = "mcl_armor:chestplate_chain", weight = 1, }, + { itemstring = "mcl_armor:chestplate_diamond", weight = 1, }, + { itemstring = "mcl_core:apple_gold_enchanted", weight = 2, }, + } + }} + } +}) diff --git a/mods/MAPGEN/mcl_terrain_features/init.lua b/mods/MAPGEN/mcl_terrain_features/init.lua new file mode 100644 index 000000000..18f242e36 --- /dev/null +++ b/mods/MAPGEN/mcl_terrain_features/init.lua @@ -0,0 +1,353 @@ +local adjacents = { + vector.new(1,0,0), + vector.new(1,0,1), + vector.new(1,0,-1), + vector.new(-1,0,0), + vector.new(-1,0,1), + vector.new(-1,0,-1), + vector.new(0,0,1), + vector.new(0,0,-1), + vector.new(0,-1,0) +} + +local plane_adjacents = { + vector.new(1,0,0), + vector.new(-1,0,0), + vector.new(0,0,1), + vector.new(0,0,-1), +} + +local function set_node_no_bedrock(pos,node) + local n = minetest.get_node(pos) + if n.name == "mcl_core:bedrock" then return end + return minetest.set_node(pos,node) +end + +local function airtower(pos,tbl,h) + for i=1,h do + table.insert(tbl,vector.offset(pos,0,i,0)) + end +end + +local function makelake(pos,size,liquid,placein,border,pr) + local node_under = minetest.get_node(vector.offset(pos,0,-1,0)) + local p1 = vector.offset(pos,-size,-1,-size) + local p2 = vector.offset(pos,size,-1,size) + minetest.emerge_area(p1, p2, function(blockpos, action, calls_remaining, param) + if calls_remaining ~= 0 then return end + local nn = minetest.find_nodes_in_area(p1,p2,placein) + table.sort(nn,function(a, b) + return vector.distance(vector.new(pos.x,0,pos.z), a) < vector.distance(vector.new(pos.x,0,pos.z), b) + end) + if not nn[1] then return end + local y = pos.y - pr:next(1,2) + local lq = {} + local air = {} + local r = pr:next(1,#nn) + if r > #nn then return end + for i=1,r do + if nn[i].y == y then + airtower(nn[i],air,55) + table.insert(lq,nn[i]) + end + end + minetest.bulk_set_node(lq,{name=liquid}) + minetest.bulk_set_node(air,{name="air"}) + air = {} + local br = {} + for k,v in pairs(lq) do + for kk,vv in pairs(adjacents) do + local pp = vector.add(v,vv) + local an = minetest.get_node(pp) + local un = minetest.get_node(vector.offset(pp,0,1,0)) + if not border then + if minetest.get_item_group(an.name,"solid") > 0 then + border = an.name + elseif minetest.get_item_group(minetest.get_node(nn[1]).name,"solid") > 0 then + border = minetest.get_node_or_nil(nn[1]).name + else + border = "mcl_core:stone" + end + if border == nil or border == "mcl_core:dirt" then border = "mcl_core:dirt_with_grass" end + end + if an.name ~= liquid then + table.insert(br,pp) + if un.name ~= liquid then + airtower(pp,air,55) + end + end + end + end + minetest.bulk_set_node(br,{name=border}) + minetest.bulk_set_node(air,{name="air"}) + return true + end) + return true +end + +local mushrooms = {"mcl_mushrooms:mushroom_brown","mcl_mushrooms:mushroom_red"} + +local function get_fallen_tree_schematic(pos,pr) + local tree = minetest.find_node_near(pos,15,{"group:tree"}) + if not tree then return end + tree = minetest.get_node(tree).name + local maxlen = 8 + local minlen = 2 + local vprob = 120 + local mprob = 160 + local len = pr:next(minlen,maxlen) + local schem = { + size = {x = len + 2, y = 2, z = 3}, + data = { + {name = "air", prob=0}, + {name = "air", prob=0}, + } + } + for i = 1,len do + table.insert(schem.data,{name = "mcl_core:vine",param2=4, prob=vprob}) + end + table.insert(schem.data,{name = "air", prob=0}) + table.insert(schem.data,{name = "air", prob=0}) + for i = 1,len do + table.insert(schem.data,{name = "air", prob=0}) + end + + table.insert(schem.data,{name = tree, param2 = 0}) + table.insert(schem.data,{name = "air", prob=0}) + for i = 1,len do + table.insert(schem.data,{name = tree, param2 = 12}) + end + table.insert(schem.data,{name = "air", prob=0}) + table.insert(schem.data,{name = "air", prob=0}) + for i = 1,len do + table.insert(schem.data,{name = mushrooms[pr:next(1,#mushrooms)], param2 = 12, prob=mprob}) + end + + table.insert(schem.data,{name = "air", prob=0}) + table.insert(schem.data,{name = "air", prob=0}) + for i = 1,len do + table.insert(schem.data,{name = "mcl_core:vine",param2=5, prob=vprob}) + end + table.insert(schem.data,{name = "air", prob=0}) + table.insert(schem.data,{name = "air", prob=0}) + for i = 1,len do + table.insert(schem.data,{name = "air", prob=0}) + end + + return schem +end + +mcl_structures.register_structure("fallen_tree",{ + place_on = {"group:grass_block"}, + terrain_feature = true, + noise_params = { + offset = 0.00018, + scale = 0.01011, + spread = {x = 250, y = 250, z = 250}, + seed = 24533, + octaves = 3, + persist = 0.66 + }, + flags = "place_center_x, place_center_z", + sidelen = 18, + solid_ground = true, + y_max = mcl_vars.mg_overworld_max, + y_min = minetest.get_mapgen_setting("water_level"), + on_place = function(pos,def,pr) + local air_p1 = vector.offset(pos,-def.sidelen/2,1,-def.sidelen/2) + local air_p2 = vector.offset(pos,def.sidelen/2,1,def.sidelen/2) + local air = minetest.find_nodes_in_area(air_p1,air_p2,{"air"}) + if #air < ( def.sidelen * def.sidelen ) / 2 then + return false + end + return true + end, + place_func = function(pos,def,pr) + local schem=get_fallen_tree_schematic(pos,pr) + if not schem then return end + return minetest.place_schematic(pos,schem,"random") + end +}) + +mcl_structures.register_structure("lavapool",{ + place_on = {"group:sand", "group:dirt", "group:stone"}, + terrain_feature = true, + noise_params = { + offset = 0, + scale = 0.0000022, + spread = {x = 250, y = 250, z = 250}, + seed = 78375213, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, + flags = "place_center_x, place_center_z, force_placement", + y_max = mcl_vars.mg_overworld_max, + y_min = minetest.get_mapgen_setting("water_level"), + place_func = function(pos,def,pr) + return makelake(pos,5,"mcl_core:lava_source",{"group:material_stone", "group:sand", "group:dirt"},"mcl_core:stone",pr) + end +}) + +mcl_structures.register_structure("water_lake",{ + place_on = {"group:dirt","group:stone"}, + terrain_feature = true, + noise_params = { + offset = 0, + scale = 0.000032, + spread = {x = 250, y = 250, z = 250}, + seed = 756641353, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, + flags = "place_center_x, place_center_z, force_placement", + y_max = mcl_vars.mg_overworld_max, + y_min = minetest.get_mapgen_setting("water_level"), + place_func = function(pos,def,pr) + return makelake(pos,5,"mcl_core:water_source",{"group:material_stone", "group:sand", "group:dirt","group:grass_block"},nil,pr) + end +}) + +local pool_adjacents = { + vector.new(1,0,0), + vector.new(-1,0,0), + vector.new(0,-1,0), + vector.new(0,0,1), + vector.new(0,0,-1), +} + +mcl_structures.register_structure("basalt_column",{ + place_on = {"mcl_blackstone:blackstone","mcl_blackstone:basalt"}, + terrain_feature = true, + spawn_by = {"air"}, + num_spawn_by = 2, + noise_params = { + offset = 0, + scale = 0.003, + spread = {x = 250, y = 250, z = 250}, + seed = 72235213, + octaves = 5, + persist = 0.3, + flags = "absvalue", + }, + flags = "all_floors", + y_max = mcl_vars.mg_nether_max - 20, + y_min = mcl_vars.mg_lava_nether_max + 1, + biomes = { "BasaltDelta" }, + place_func = function(pos,def,pr) + local nn = minetest.find_nodes_in_area(vector.offset(pos,-5,-1,-5),vector.offset(pos,5,-1,5),{"air","mcl_blackstone:basalt","mcl_blackstone:blackstone"}) + table.sort(nn,function(a, b) + return vector.distance(vector.new(pos.x,0,pos.z), a) < vector.distance(vector.new(pos.x,0,pos.z), b) + end) + if #nn < 1 then return false end + local basalt = {} + local magma = {} + for i=1,pr:next(1,#nn) do + if minetest.get_node(vector.offset(nn[i],0,-1,0)).name ~= "air" then + local dst=vector.distance(pos,nn[i]) + local r = pr:next(1,14)-dst + for ii=0,r do + if pr:next(1,25) == 1 then + table.insert(magma,vector.new(nn[i].x,nn[i].y + ii,nn[i].z)) + else + table.insert(basalt,vector.new(nn[i].x,nn[i].y + ii,nn[i].z)) + end + end + end + end + minetest.bulk_set_node(magma,{name="mcl_nether:magma"}) + minetest.bulk_set_node(basalt,{name="mcl_blackstone:basalt"}) + return true + end +}) +mcl_structures.register_structure("basalt_pillar",{ + place_on = {"mcl_blackstone:blackstone","mcl_blackstone:basalt"}, + terrain_feature = true, + noise_params = { + offset = 0, + scale = 0.001, + spread = {x = 250, y = 250, z = 250}, + seed = 7113, + octaves = 5, + persist = 0.1, + flags = "absvalue", + }, + flags = "all_floors", + y_max = mcl_vars.mg_nether_max-40, + y_min = mcl_vars.mg_lava_nether_max + 1, + biomes = { "BasaltDelta" }, + place_func = function(pos,def,pr) + local nn = minetest.find_nodes_in_area(vector.offset(pos,-2,-1,-2),vector.offset(pos,2,-1,2),{"air","mcl_blackstone:basalt","mcl_blackstone:blackstone"}) + table.sort(nn,function(a, b) + return vector.distance(vector.new(pos.x,0,pos.z), a) < vector.distance(vector.new(pos.x,0,pos.z), b) + end) + if #nn < 1 then return false end + local basalt = {} + local magma = {} + for i=1,pr:next(1,#nn) do + if minetest.get_node(vector.offset(nn[i],0,-1,0)).name ~= "air" then + local dst=vector.distance(pos,nn[i]) + for ii=0,pr:next(19,35)-dst do + if pr:next(1,20) == 1 then + table.insert(magma,vector.new(nn[i].x,nn[i].y + ii,nn[i].z)) + else + table.insert(basalt,vector.new(nn[i].x,nn[i].y + ii,nn[i].z)) + end + end + end + end + minetest.bulk_set_node(basalt,{name="mcl_blackstone:basalt"}) + minetest.bulk_set_node(magma,{name="mcl_nether:magma"}) + return true + end +}) + +mcl_structures.register_structure("lavadelta",{ + place_on = {"mcl_blackstone:blackstone","mcl_blackstone:basalt"}, + spawn_by = {"mcl_blackstone:basalt","mcl_blackstone:blackstone"}, + num_spawn_by = 2, + terrain_feature = true, + noise_params = { + offset = 0, + scale = 0.005, + spread = {x = 250, y = 250, z = 250}, + seed = 78375213, + octaves = 5, + persist = 0.1, + flags = "absvalue", + }, + flags = "all_floors", + y_max = mcl_vars.mg_nether_max, + y_min = mcl_vars.mg_lava_nether_max + 1, + biomes = { "BasaltDelta" }, + place_func = function(pos,def,pr) + local nn = minetest.find_nodes_in_area_under_air(vector.offset(pos,-10,-1,-10),vector.offset(pos,10,-2,10),{"mcl_blackstone:basalt","mcl_blackstone:blackstone","mcl_nether:netherrack"}) + table.sort(nn,function(a, b) + return vector.distance(vector.new(pos.x,0,pos.z), a) < vector.distance(vector.new(pos.x,0,pos.z), b) + end) + if #nn < 1 then return false end + local lava = {} + for i=1,pr:next(1,#nn) do + table.insert(lava,nn[i]) + end + minetest.bulk_set_node(lava,{name="mcl_nether:nether_lava_source"}) + local basalt = {} + local magma = {} + for _,v in pairs(lava) do + for _,vv in pairs(adjacents) do + local p = vector.add(v,vv) + if minetest.get_node(p).name ~= "mcl_nether:nether_lava_source" then + table.insert(basalt,p) + + end + end + if math.random(3) == 1 then + table.insert(magma,v) + end + end + minetest.bulk_set_node(basalt,{name="mcl_blackstone:basalt"}) + minetest.bulk_set_node(magma,{name="mcl_nether:magma"}) + return true + end +}) diff --git a/mods/MAPGEN/mcl_terrain_features/mod.conf b/mods/MAPGEN/mcl_terrain_features/mod.conf new file mode 100644 index 000000000..008e370cc --- /dev/null +++ b/mods/MAPGEN/mcl_terrain_features/mod.conf @@ -0,0 +1,3 @@ +name = mcl_terrain_features +author = cora +depends = mcl_init, mcl_structures diff --git a/mods/MAPGEN/tsm_railcorridors/gameconfig.lua b/mods/MAPGEN/tsm_railcorridors/gameconfig.lua index de4b18119..3ada3052f 100644 --- a/mods/MAPGEN/tsm_railcorridors/gameconfig.lua +++ b/mods/MAPGEN/tsm_railcorridors/gameconfig.lua @@ -42,6 +42,14 @@ tsm_railcorridors.carts = { "mcl_minecarts:minecart" } function tsm_railcorridors.on_construct_cart(pos, cart) -- TODO: Fill cart with treasures + + -- This is it? There's this giant hack announced in + -- the other file and I grep for the function and it's + -- a stub? :) + + -- The path here using some minetest.after hackery was + -- deactivated in init.lua - reactivate when this does + -- something the function is called RecheckCartHack. end -- Fallback function. Returns a random treasure. This function is called for chests diff --git a/mods/MAPGEN/tsm_railcorridors/init.lua b/mods/MAPGEN/tsm_railcorridors/init.lua index 451406167..d68c58aa3 100644 --- a/mods/MAPGEN/tsm_railcorridors/init.lua +++ b/mods/MAPGEN/tsm_railcorridors/init.lua @@ -364,18 +364,24 @@ local function Platform(p, radius, node, node2) if not node2 then node2 = { name = tsm_railcorridors.nodes.dirt } end + local n1 = {} + local n2 = {} for zi = p.z-radius, p.z+radius do for xi = p.x-radius, p.x+radius do local np, np2 = NeedsPlatform({x=xi,y=p.y,z=zi}) if np then if np2 then - minetest.set_node({x=xi,y=p.y-1,z=zi}, node2) + --minetest.set_node({x=xi,y=p.y-1,z=zi}, node2) + table.insert(n1,{x=xi,y=p.y-1,z=zi}) else - minetest.set_node({x=xi,y=p.y-1,z=zi}, node) + --minetest.set_node({x=xi,y=p.y-1,z=zi}, node) + table.insert(n2,{x=xi,y=p.y-1,z=zi}) end end end end + minetest.bulk_set_node(n1,node) + minetest.bulk_set_node(n2,node2) end -- Chests @@ -388,11 +394,16 @@ local function PlaceChest(pos, param2) end end + -- This function checks if a cart has ACTUALLY been spawned. -- To be calld by minetest.after. -- This is a workaround thanks to the fact that minetest.add_entity is unreliable as fuck -- See: https://github.com/minetest/minetest/issues/4759 -- FIXME: Kill this horrible hack with fire as soon you can. + +-- Why did anyone activate it in the first place? It doesn't +-- have a function seeing as there are no chest minecarts yet. +--[[ local function RecheckCartHack(params) local pos = params[1] local cart_id = params[2] @@ -408,6 +419,8 @@ local function RecheckCartHack(params) end minetest.log("info", "[tsm_railcorridors] Cart spawn FAILED: "..minetest.pos_to_string(pos)) end +--]] + -- Try to place a cobweb. -- pos: Position of cobweb @@ -937,7 +950,10 @@ local function spawn_carts() -- Note that the callback function is also called there. -- TODO: Move callback function to this position when the -- minetest.add_entity bug has been fixed. - minetest.after(3, RecheckCartHack, {cpos, cart_id}) + + -- minetest.after(3, RecheckCartHack, {cpos, cart_id}) + -- This whole recheck logic leads to a stub right now + -- it can be reenabled when chest carts are a thing. end end carts_table = {} @@ -1092,6 +1108,28 @@ local function create_corridor_system(main_cave_coords) return true end +mcl_structures.register_structure("mineshaft",{ + place_on = {"group:sand","group:grass_block","mcl_core:water_source","group:dirt","mcl_core:dirt_with_grass","mcl_core:gravel","group:material_stone","mcl_core:snow"}, + fill_ratio = 0.0001, + flags = "place_center_x, place_center_z, force_placement, all_floors", + sidelen = 32, + y_max = 40, + y_min = mcl_vars.mg_overworld_min, + place_func = function(pos,def,pr,blockseed) + local r = pr:next(-50,-10) + local p = vector.offset(pos,0,r,0) + if p.y < mcl_vars.mg_overworld_min + 5 then + p.y = mcl_vars.mg_overworld_min + 5 + end + if p.y > -10 then return true end + InitRandomizer(blockseed) + create_corridor_system(p, pr) + return true + end, + +}) + +--[[ Old Generation code this is VERY slow -- The rail corridor algorithm starts here mcl_mapgen_core.register_generator("railcorridors", nil, function(minp, maxp, blockseed, _pr) -- We re-init the randomizer for every mapchunk as we start generating in the middle of each mapchunk. @@ -1120,3 +1158,4 @@ mcl_mapgen_core.register_generator("railcorridors", nil, function(minp, maxp, bl end end end, 10) +--]] diff --git a/mods/MAPGEN/tsm_railcorridors/mod.conf b/mods/MAPGEN/tsm_railcorridors/mod.conf index c846cff19..d1a9ada4a 100644 --- a/mods/MAPGEN/tsm_railcorridors/mod.conf +++ b/mods/MAPGEN/tsm_railcorridors/mod.conf @@ -1,4 +1,4 @@ name = tsm_railcorridors author = UgnilJoZ description = Adds simple underground mines with railways and occasional treasure chests. -depends = mcl_init, mcl_worlds, mcl_core, mcl_mapgen_core, mcl_loot, mcl_tnt, mcl_farming, mcl_mobspawners, mcl_minecarts +depends = mcl_init, mcl_worlds, mcl_core, mcl_mapgen_core, mcl_loot, mcl_tnt, mcl_farming, mcl_mobspawners, mcl_minecarts, mcl_structures diff --git a/mods/PLAYER/mcl_hunger/api.lua b/mods/PLAYER/mcl_hunger/api.lua index 20937023a..3c9cd97e9 100644 --- a/mods/PLAYER/mcl_hunger/api.lua +++ b/mods/PLAYER/mcl_hunger/api.lua @@ -67,7 +67,7 @@ if mcl_hunger.active then local satuchanged = false local s = mcl_hunger.get_saturation(player) if s > 0 then - mcl_hunger.set_saturation(player, math.max(s - 1.0, 0)) + mcl_hunger.set_saturation(player, math.max(s - 1.5, 0)) satuchanged = true elseif s <= 0.0001 then h = mcl_hunger.get_hunger(player) diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index 21c1e0860..0cae89a7d 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -28,6 +28,7 @@ mcl_hunger.EXHAUST_SWIM = 10 -- player movement in water mcl_hunger.EXHAUST_SPRINT = 100 -- sprint (per node) mcl_hunger.EXHAUST_DAMAGE = 100 -- taking damage (protected by armor) mcl_hunger.EXHAUST_REGEN = 6000 -- Regenerate 1 HP +mcl_hunger.EXHAUST_HUNGER = 5 -- Hunger status effect at base level. mcl_hunger.EXHAUST_LVL = 4000 -- at what exhaustion player saturation gets lowered mcl_hunger.SATURATION_INIT = 5 -- Initial saturation for new/respawning players @@ -147,7 +148,13 @@ minetest.register_globalstep(function(dtime) if food_tick_timer > 4.0 then food_tick_timer = 0 - if food_level >= 18 then -- slow regenration + -- let hunger work always + if player_health > 0 and player_health <= 20 then + --mcl_hunger.exhaust(player_name, mcl_hunger.EXHAUST_HUNGER) -- later for hunger status effect + mcl_hunger.update_exhaustion_hud(player, mcl_hunger.get_exhaustion(player)) + end + + if food_level >= 18 then -- slow regeneration if player_health > 0 and player_health < 20 then player:set_hp(player_health+1) mcl_hunger.exhaust(player_name, mcl_hunger.EXHAUST_REGEN) @@ -164,7 +171,7 @@ minetest.register_globalstep(function(dtime) end end - elseif food_tick_timer > 0.5 and food_level == 20 and food_saturation_level >= 6 then -- fast regeneration + elseif food_tick_timer > 0.5 and food_level == 20 and food_saturation_level > 0 then -- fast regeneration if player_health > 0 and player_health < 20 then food_tick_timer = 0 player:set_hp(player_health+1) diff --git a/mods/PLAYER/mcl_playerinfo/init.lua b/mods/PLAYER/mcl_playerinfo/init.lua index 9c5d1433f..1f1b84749 100644 --- a/mods/PLAYER/mcl_playerinfo/init.lua +++ b/mods/PLAYER/mcl_playerinfo/init.lua @@ -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) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 924b60c97..c3876269c 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -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") diff --git a/screenshot.png b/screenshot.png index a92bd53e5..12cc5db22 100644 Binary files a/screenshot.png and b/screenshot.png differ diff --git a/settingtypes.txt b/settingtypes.txt index 8a0ebcce8..35db8bde7 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -20,6 +20,18 @@ enable_fire (Destructive and spreading fire) bool true # If enabled, the weather will change naturally over time. mcl_doWeatherCycle (Change weather) bool true +# Amount of rain particles. You can reduce this to get better FPS (default: 500) +mcl_weather_rain_particles (Rain particles) int 500 0 + +# Amount of thunderstorm rain particles. You can reduce this to get better FPS (default: 900) +mcl_weather_thunder_particles (Thunderstorm rain particles) int 900 0 + +# Amount of snow particles. You can reduce this to get better FPS (default: 100) +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_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. mcl_doTileDrops (Blocks have drops) bool true diff --git a/tools/Texture_Converter.py b/tools/Texture_Converter.py index bdf249113..67800ccfc 100755 --- a/tools/Texture_Converter.py +++ b/tools/Texture_Converter.py @@ -196,7 +196,8 @@ def convert_textures(): [ tex_dir + "/models/armor/chainmail_layer_1.png", tex_dir + "/models/armor/chainmail_layer_2.png", target_dir("/mods/ITEMS/mcl_armor/textures"), "mcl_armor_helmet_chain.png", "mcl_armor_chestplate_chain.png", "mcl_armor_leggings_chain.png", "mcl_armor_boots_chain.png" ], [ tex_dir + "/models/armor/gold_layer_1.png", tex_dir + "/models/armor/gold_layer_2.png", target_dir("/mods/ITEMS/mcl_armor/textures"), "mcl_armor_helmet_gold.png", "mcl_armor_chestplate_gold.png", "mcl_armor_leggings_gold.png", "mcl_armor_boots_gold.png" ], [ tex_dir + "/models/armor/iron_layer_1.png", tex_dir + "/models/armor/iron_layer_2.png", target_dir("/mods/ITEMS/mcl_armor/textures"), "mcl_armor_helmet_iron.png", "mcl_armor_chestplate_iron.png", "mcl_armor_leggings_iron.png", "mcl_armor_boots_iron.png" ], - [ tex_dir + "/models/armor/diamond_layer_1.png", tex_dir + "/models/armor/diamond_layer_2.png", target_dir("/mods/ITEMS/mcl_armor/textures"), "mcl_armor_helmet_diamond.png", "mcl_armor_chestplate_diamond.png", "mcl_armor_leggings_diamond.png", "mcl_armor_boots_diamond.png" ] + [ tex_dir + "/models/armor/diamond_layer_1.png", tex_dir + "/models/armor/diamond_layer_2.png", target_dir("/mods/ITEMS/mcl_armor/textures"), "mcl_armor_helmet_diamond.png", "mcl_armor_chestplate_diamond.png", "mcl_armor_leggings_diamond.png", "mcl_armor_boots_diamond.png" ], + [ tex_dir + "/models/armor/netherite_layer_1.png", tex_dir + "/models/armor/netherite_layer_2.png", target_dir("/mods/ITEMS/mcl_armor/textures"), "mcl_armor_helmet_netherite.png", "mcl_armor_chestplate_netherite.png", "mcl_armor_leggings_netherite.png", "mcl_armor_boots_netherite.png" ] ] for a in armor_files: APXSIZE = 16 # for some reason MineClone2 requires this diff --git a/tools/create_luacheck.py b/tools/create_luacheck.py index 8b55c1376..d3ee5d038 100755 --- a/tools/create_luacheck.py +++ b/tools/create_luacheck.py @@ -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]))